1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service\CloudResourceManager\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudResourceManager\GetIamPolicyRequest;
|
---|
21 | use Google\Service\CloudResourceManager\Organization;
|
---|
22 | use Google\Service\CloudResourceManager\Policy;
|
---|
23 | use Google\Service\CloudResourceManager\SearchOrganizationsResponse;
|
---|
24 | use Google\Service\CloudResourceManager\SetIamPolicyRequest;
|
---|
25 | use Google\Service\CloudResourceManager\TestIamPermissionsRequest;
|
---|
26 | use Google\Service\CloudResourceManager\TestIamPermissionsResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "organizations" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $cloudresourcemanagerService = new Google\Service\CloudResourceManager(...);
|
---|
33 | * $organizations = $cloudresourcemanagerService->organizations;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class Organizations extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Fetches an organization resource identified by the specified resource name.
|
---|
40 | * (organizations.get)
|
---|
41 | *
|
---|
42 | * @param string $name Required. The resource name of the Organization to fetch.
|
---|
43 | * This is the organization's relative path in the API, formatted as
|
---|
44 | * "organizations/[organizationId]". For example, "organizations/1234".
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | * @return Organization
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function get($name, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['name' => $name];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('get', [$params], Organization::class);
|
---|
54 | }
|
---|
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 be
|
---|
58 | * the organization's resource name, for example: "organizations/123".
|
---|
59 | * Authorization requires the IAM permission
|
---|
60 | * `resourcemanager.organizations.getIamPolicy` on the specified organization.
|
---|
61 | * (organizations.getIamPolicy)
|
---|
62 | *
|
---|
63 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
64 | * requested. See [Resource
|
---|
65 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
66 | * appropriate value for this field.
|
---|
67 | * @param GetIamPolicyRequest $postBody
|
---|
68 | * @param array $optParams Optional parameters.
|
---|
69 | * @return Policy
|
---|
70 | * @throws \Google\Service\Exception
|
---|
71 | */
|
---|
72 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
73 | {
|
---|
74 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
75 | $params = array_merge($params, $optParams);
|
---|
76 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
77 | }
|
---|
78 | /**
|
---|
79 | * Searches organization resources that are visible to the user and satisfy the
|
---|
80 | * specified filter. This method returns organizations in an unspecified order.
|
---|
81 | * New organizations do not necessarily appear at the end of the results, and
|
---|
82 | * may take a small amount of time to appear. Search will only return
|
---|
83 | * organizations on which the user has the permission
|
---|
84 | * `resourcemanager.organizations.get` or has super admin privileges.
|
---|
85 | * (organizations.search)
|
---|
86 | *
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | *
|
---|
89 | * @opt_param int pageSize Optional. The maximum number of organizations to
|
---|
90 | * return in the response. The server can return fewer organizations than
|
---|
91 | * requested. If unspecified, server picks an appropriate default.
|
---|
92 | * @opt_param string pageToken Optional. A pagination token returned from a
|
---|
93 | * previous call to `SearchOrganizations` that indicates from where listing
|
---|
94 | * should continue.
|
---|
95 | * @opt_param string query Optional. An optional query string used to filter the
|
---|
96 | * Organizations to return in the response. Query rules are case-insensitive.
|
---|
97 | * ``` | Field | Description |
|
---|
98 | * |------------------|--------------------------------------------| |
|
---|
99 | * directoryCustomerId, owner.directoryCustomerId | Filters by directory
|
---|
100 | * customer id. | | domain | Filters by domain. | ``` Organizations may be
|
---|
101 | * queried by `directoryCustomerId` or by `domain`, where the domain is a G
|
---|
102 | * Suite domain, for example: * Query `directorycustomerid:123456789` returns
|
---|
103 | * Organization resources with `owner.directory_customer_id` equal to
|
---|
104 | * `123456789`. * Query `domain:google.com` returns Organization resources
|
---|
105 | * corresponding to the domain `google.com`.
|
---|
106 | * @return SearchOrganizationsResponse
|
---|
107 | * @throws \Google\Service\Exception
|
---|
108 | */
|
---|
109 | public function search($optParams = [])
|
---|
110 | {
|
---|
111 | $params = [];
|
---|
112 | $params = array_merge($params, $optParams);
|
---|
113 | return $this->call('search', [$params], SearchOrganizationsResponse::class);
|
---|
114 | }
|
---|
115 | /**
|
---|
116 | * Sets the access control policy on an organization resource. Replaces any
|
---|
117 | * existing policy. The `resource` field should be the organization's resource
|
---|
118 | * name, for example: "organizations/123". Authorization requires the IAM
|
---|
119 | * permission `resourcemanager.organizations.setIamPolicy` on the specified
|
---|
120 | * organization. (organizations.setIamPolicy)
|
---|
121 | *
|
---|
122 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
123 | * specified. See [Resource
|
---|
124 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
125 | * appropriate value for this field.
|
---|
126 | * @param SetIamPolicyRequest $postBody
|
---|
127 | * @param array $optParams Optional parameters.
|
---|
128 | * @return Policy
|
---|
129 | * @throws \Google\Service\Exception
|
---|
130 | */
|
---|
131 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
132 | {
|
---|
133 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
134 | $params = array_merge($params, $optParams);
|
---|
135 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
136 | }
|
---|
137 | /**
|
---|
138 | * Returns the permissions that a caller has on the specified organization. The
|
---|
139 | * `resource` field should be the organization's resource name, for example:
|
---|
140 | * "organizations/123". There are no permissions required for making this API
|
---|
141 | * call. (organizations.testIamPermissions)
|
---|
142 | *
|
---|
143 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
144 | * being requested. See [Resource
|
---|
145 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
146 | * appropriate value for this field.
|
---|
147 | * @param TestIamPermissionsRequest $postBody
|
---|
148 | * @param array $optParams Optional parameters.
|
---|
149 | * @return TestIamPermissionsResponse
|
---|
150 | * @throws \Google\Service\Exception
|
---|
151 | */
|
---|
152 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
153 | {
|
---|
154 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
155 | $params = array_merge($params, $optParams);
|
---|
156 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
157 | }
|
---|
158 | }
|
---|
159 |
|
---|
160 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
161 | class_alias(Organizations::class, 'Google_Service_CloudResourceManager_Resource_Organizations');
|
---|