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