organizations.proto 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.resourcemanager.v3;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/iam/v1/iam_policy.proto";
  21. import "google/iam/v1/policy.proto";
  22. import "google/longrunning/operations.proto";
  23. import "google/protobuf/timestamp.proto";
  24. option csharp_namespace = "Google.Cloud.ResourceManager.V3";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "OrganizationsProto";
  28. option java_package = "com.google.cloud.resourcemanager.v3";
  29. option php_namespace = "Google\\Cloud\\ResourceManager\\V3";
  30. option ruby_package = "Google::Cloud::ResourceManager::V3";
  31. // Allows users to manage their organization resources.
  32. service Organizations {
  33. option (google.api.default_host) = "cloudresourcemanager.googleapis.com";
  34. option (google.api.oauth_scopes) =
  35. "https://www.googleapis.com/auth/cloud-platform,"
  36. "https://www.googleapis.com/auth/cloud-platform.read-only";
  37. // Fetches an organization resource identified by the specified resource name.
  38. rpc GetOrganization(GetOrganizationRequest) returns (Organization) {
  39. option (google.api.http) = {
  40. get: "/v3/{name=organizations/*}"
  41. };
  42. option (google.api.method_signature) = "name";
  43. }
  44. // Searches organization resources that are visible to the user and satisfy
  45. // the specified filter. This method returns organizations in an unspecified
  46. // order. New organizations do not necessarily appear at the end of the
  47. // results, and may take a small amount of time to appear.
  48. //
  49. // Search will only return organizations on which the user has the permission
  50. // `resourcemanager.organizations.get`
  51. rpc SearchOrganizations(SearchOrganizationsRequest) returns (SearchOrganizationsResponse) {
  52. option (google.api.http) = {
  53. get: "/v3/organizations:search"
  54. };
  55. option (google.api.method_signature) = "query";
  56. }
  57. // Gets the access control policy for an organization resource. The policy may
  58. // be empty if no such policy or resource exists. The `resource` field should
  59. // be the organization's resource name, for example: "organizations/123".
  60. //
  61. // Authorization requires the IAM permission
  62. // `resourcemanager.organizations.getIamPolicy` on the specified organization.
  63. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
  64. option (google.api.http) = {
  65. post: "/v3/{resource=organizations/*}:getIamPolicy"
  66. body: "*"
  67. };
  68. option (google.api.method_signature) = "resource";
  69. }
  70. // Sets the access control policy on an organization resource. Replaces any
  71. // existing policy. The `resource` field should be the organization's resource
  72. // name, for example: "organizations/123".
  73. //
  74. // Authorization requires the IAM permission
  75. // `resourcemanager.organizations.setIamPolicy` on the specified organization.
  76. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
  77. option (google.api.http) = {
  78. post: "/v3/{resource=organizations/*}:setIamPolicy"
  79. body: "*"
  80. };
  81. option (google.api.method_signature) = "resource";
  82. }
  83. // Returns the permissions that a caller has on the specified organization.
  84. // The `resource` field should be the organization's resource name,
  85. // for example: "organizations/123".
  86. //
  87. // There are no permissions required for making this API call.
  88. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
  89. option (google.api.http) = {
  90. post: "/v3/{resource=organizations/*}:testIamPermissions"
  91. body: "*"
  92. };
  93. option (google.api.method_signature) = "resource,permissions";
  94. }
  95. }
  96. // The root node in the resource hierarchy to which a particular entity's
  97. // (a company, for example) resources belong.
  98. message Organization {
  99. option (google.api.resource) = {
  100. type: "cloudresourcemanager.googleapis.com/Organization"
  101. pattern: "organizations/{organization}"
  102. style: DECLARATIVE_FRIENDLY
  103. };
  104. // Organization lifecycle states.
  105. enum State {
  106. // Unspecified state. This is only useful for distinguishing unset values.
  107. STATE_UNSPECIFIED = 0;
  108. // The normal and active state.
  109. ACTIVE = 1;
  110. // The organization has been marked for deletion by the user.
  111. DELETE_REQUESTED = 2;
  112. }
  113. // Output only. The resource name of the organization. This is the
  114. // organization's relative path in the API. Its format is
  115. // "organizations/[organization_id]". For example, "organizations/1234".
  116. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  117. // Output only. A human-readable string that refers to the organization in the
  118. // Google Cloud Console. This string is set by the server and cannot be
  119. // changed. The string will be set to the primary domain (for example,
  120. // "google.com") of the Google Workspace customer that owns the organization.
  121. string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  122. // The owner of this organization. The owner should be specified on
  123. // creation. Once set, it cannot be changed.
  124. //
  125. // The lifetime of the organization and all of its descendants are bound to
  126. // the owner. If the owner is deleted, the organization and all its
  127. // descendants will be deleted.
  128. oneof owner {
  129. // Immutable. The G Suite / Workspace customer id used in the Directory API.
  130. string directory_customer_id = 3 [(google.api.field_behavior) = IMMUTABLE];
  131. }
  132. // Output only. The organization's current lifecycle state.
  133. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  134. // Output only. Timestamp when the Organization was created.
  135. google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  136. // Output only. Timestamp when the Organization was last modified.
  137. google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  138. // Output only. Timestamp when the Organization was requested for deletion.
  139. google.protobuf.Timestamp delete_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  140. // Output only. A checksum computed by the server based on the current value of the
  141. // Organization resource. This may be sent on update and delete requests to
  142. // ensure the client has an up-to-date value before proceeding.
  143. string etag = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  144. }
  145. // The request sent to the `GetOrganization` method. The `name` field is
  146. // required. `organization_id` is no longer accepted.
  147. message GetOrganizationRequest {
  148. // Required. The resource name of the Organization to fetch. This is the organization's
  149. // relative path in the API, formatted as "organizations/[organizationId]".
  150. // For example, "organizations/1234".
  151. string name = 1 [
  152. (google.api.field_behavior) = REQUIRED,
  153. (google.api.resource_reference) = {
  154. type: "cloudresourcemanager.googleapis.com/Organization"
  155. }
  156. ];
  157. }
  158. // The request sent to the `SearchOrganizations` method.
  159. message SearchOrganizationsRequest {
  160. // Optional. The maximum number of organizations to return in the response.
  161. // If unspecified, server picks an appropriate default.
  162. int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
  163. // Optional. A pagination token returned from a previous call to `SearchOrganizations`
  164. // that indicates from where listing should continue.
  165. string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
  166. // Optional. An optional query string used to filter the Organizations to return in
  167. // the response. Query rules are case-insensitive.
  168. //
  169. //
  170. // | Field | Description |
  171. // |------------------|--------------------------------------------|
  172. // | directoryCustomerId, owner.directoryCustomerId | Filters by directory
  173. // customer id. |
  174. // | domain | Filters by domain. |
  175. //
  176. // Organizations may be queried by `directoryCustomerId` or by
  177. // `domain`, where the domain is a G Suite domain, for example:
  178. //
  179. // * Query `directorycustomerid:123456789` returns Organization
  180. // resources with `owner.directory_customer_id` equal to `123456789`.
  181. // * Query `domain:google.com` returns Organization resources corresponding
  182. // to the domain `google.com`.
  183. string query = 3 [(google.api.field_behavior) = OPTIONAL];
  184. }
  185. // The response returned from the `SearchOrganizations` method.
  186. message SearchOrganizationsResponse {
  187. // The list of Organizations that matched the search query, possibly
  188. // paginated.
  189. repeated Organization organizations = 1;
  190. // A pagination token to be used to retrieve the next page of results. If the
  191. // result is too large to fit within the page size specified in the request,
  192. // this field will be set with a token that can be used to fetch the next page
  193. // of results. If this field is empty, it indicates that this response
  194. // contains the last page of results.
  195. string next_page_token = 2;
  196. }
  197. // A status object which is used as the `metadata` field for the operation
  198. // returned by DeleteOrganization.
  199. message DeleteOrganizationMetadata {
  200. }
  201. // A status object which is used as the `metadata` field for the Operation
  202. // returned by UndeleteOrganization.
  203. message UndeleteOrganizationMetadata {
  204. }