organizations.proto 9.7 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/protobuf/timestamp.proto";
  23. option csharp_namespace = "Google.Cloud.ResourceManager.V3";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "OrganizationsProto";
  27. option java_package = "com.google.cloud.resourcemanager.v3";
  28. option php_namespace = "Google\\Cloud\\ResourceManager\\V3";
  29. option ruby_package = "Google::Cloud::ResourceManager::V3";
  30. // Allows users to manage their organization resources.
  31. service Organizations {
  32. option (google.api.default_host) = "cloudresourcemanager.googleapis.com";
  33. option (google.api.oauth_scopes) =
  34. "https://www.googleapis.com/auth/cloud-platform,"
  35. "https://www.googleapis.com/auth/cloud-platform.read-only";
  36. // Fetches an organization resource identified by the specified resource name.
  37. rpc GetOrganization(GetOrganizationRequest) returns (Organization) {
  38. option (google.api.http) = {
  39. get: "/v3/{name=organizations/*}"
  40. };
  41. option (google.api.method_signature) = "name";
  42. }
  43. // Searches organization resources that are visible to the user and satisfy
  44. // the specified filter. This method returns organizations in an unspecified
  45. // order. New organizations do not necessarily appear at the end of the
  46. // results, and may take a small amount of time to appear.
  47. //
  48. // Search will only return organizations on which the user has the permission
  49. // `resourcemanager.organizations.get`
  50. rpc SearchOrganizations(SearchOrganizationsRequest) returns (SearchOrganizationsResponse) {
  51. option (google.api.http) = {
  52. get: "/v3/organizations:search"
  53. };
  54. option (google.api.method_signature) = "query";
  55. }
  56. // Gets the access control policy for an organization resource. The policy may
  57. // be empty if no such policy or resource exists. The `resource` field should
  58. // be the organization's resource name, for example: "organizations/123".
  59. //
  60. // Authorization requires the IAM permission
  61. // `resourcemanager.organizations.getIamPolicy` on the specified organization.
  62. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
  63. option (google.api.http) = {
  64. post: "/v3/{resource=organizations/*}:getIamPolicy"
  65. body: "*"
  66. };
  67. option (google.api.method_signature) = "resource";
  68. }
  69. // Sets the access control policy on an organization resource. Replaces any
  70. // existing policy. The `resource` field should be the organization's resource
  71. // name, for example: "organizations/123".
  72. //
  73. // Authorization requires the IAM permission
  74. // `resourcemanager.organizations.setIamPolicy` on the specified organization.
  75. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
  76. option (google.api.http) = {
  77. post: "/v3/{resource=organizations/*}:setIamPolicy"
  78. body: "*"
  79. };
  80. option (google.api.method_signature) = "resource";
  81. }
  82. // Returns the permissions that a caller has on the specified organization.
  83. // The `resource` field should be the organization's resource name,
  84. // for example: "organizations/123".
  85. //
  86. // There are no permissions required for making this API call.
  87. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
  88. option (google.api.http) = {
  89. post: "/v3/{resource=organizations/*}:testIamPermissions"
  90. body: "*"
  91. };
  92. option (google.api.method_signature) = "resource,permissions";
  93. }
  94. }
  95. // The root node in the resource hierarchy to which a particular entity's
  96. // (a company, for example) resources belong.
  97. message Organization {
  98. option (google.api.resource) = {
  99. type: "cloudresourcemanager.googleapis.com/Organization"
  100. pattern: "organizations/{organization}"
  101. style: DECLARATIVE_FRIENDLY
  102. };
  103. // Organization lifecycle states.
  104. enum State {
  105. // Unspecified state. This is only useful for distinguishing unset values.
  106. STATE_UNSPECIFIED = 0;
  107. // The normal and active state.
  108. ACTIVE = 1;
  109. // The organization has been marked for deletion by the user.
  110. DELETE_REQUESTED = 2;
  111. }
  112. // Output only. The resource name of the organization. This is the
  113. // organization's relative path in the API. Its format is
  114. // "organizations/[organization_id]". For example, "organizations/1234".
  115. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  116. // Output only. A human-readable string that refers to the organization in the
  117. // Google Cloud Console. This string is set by the server and cannot be
  118. // changed. The string will be set to the primary domain (for example,
  119. // "google.com") of the Google Workspace customer that owns the organization.
  120. string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  121. // The owner of this organization. The owner should be specified on
  122. // creation. Once set, it cannot be changed.
  123. //
  124. // The lifetime of the organization and all of its descendants are bound to
  125. // the owner. If the owner is deleted, the organization and all its
  126. // descendants will be deleted.
  127. oneof owner {
  128. // Immutable. The G Suite / Workspace customer id used in the Directory API.
  129. string directory_customer_id = 3 [(google.api.field_behavior) = IMMUTABLE];
  130. }
  131. // Output only. The organization's current lifecycle state.
  132. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  133. // Output only. Timestamp when the Organization was created.
  134. google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  135. // Output only. Timestamp when the Organization was last modified.
  136. google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  137. // Output only. Timestamp when the Organization was requested for deletion.
  138. google.protobuf.Timestamp delete_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  139. // Output only. A checksum computed by the server based on the current value of the
  140. // Organization resource. This may be sent on update and delete requests to
  141. // ensure the client has an up-to-date value before proceeding.
  142. string etag = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  143. }
  144. // The request sent to the `GetOrganization` method. The `name` field is
  145. // required. `organization_id` is no longer accepted.
  146. message GetOrganizationRequest {
  147. // Required. The resource name of the Organization to fetch. This is the organization's
  148. // relative path in the API, formatted as "organizations/[organizationId]".
  149. // For example, "organizations/1234".
  150. string name = 1 [
  151. (google.api.field_behavior) = REQUIRED,
  152. (google.api.resource_reference) = {
  153. type: "cloudresourcemanager.googleapis.com/Organization"
  154. }
  155. ];
  156. }
  157. // The request sent to the `SearchOrganizations` method.
  158. message SearchOrganizationsRequest {
  159. // Optional. The maximum number of organizations to return in the response.
  160. // If unspecified, server picks an appropriate default.
  161. int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
  162. // Optional. A pagination token returned from a previous call to `SearchOrganizations`
  163. // that indicates from where listing should continue.
  164. string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
  165. // Optional. An optional query string used to filter the Organizations to return in
  166. // the response. Query rules are case-insensitive.
  167. //
  168. // ```
  169. // | Field | Description |
  170. // |------------------|--------------------------------------------|
  171. // | directoryCustomerId, owner.directoryCustomerId | Filters by directory
  172. // customer id. |
  173. // | domain | Filters by domain. |
  174. // ```
  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. }