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 18namespace Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Resource; 19 20use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\AttachTrustRequest; 21use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\DetachTrustRequest; 22use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Domain; 23use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\LDAPSSettings; 24use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\ListDomainsResponse; 25use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Operation; 26use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Policy; 27use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\ReconfigureTrustRequest; 28use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\ResetAdminPasswordRequest; 29use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\ResetAdminPasswordResponse; 30use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\RestoreDomainRequest; 31use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\SetIamPolicyRequest; 32use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\TestIamPermissionsRequest; 33use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\TestIamPermissionsResponse; 34use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\ValidateTrustRequest; 35 36/** 37 * The "domains" collection of methods. 38 * Typical usage is: 39 * <code> 40 * $managedidentitiesService = new Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI(...); 41 * $domains = $managedidentitiesService->domains; 42 * </code> 43 */ 44class ProjectsLocationsManagedidentitiesGlobalDomains extends \Google\Service\Resource 45{ 46 /** 47 * Adds an AD trust to a domain. (domains.attachTrust) 48 * 49 * @param string $name Required. The resource domain name, project name and 50 * location using the form: 51 * `projects/{project_id}/locations/global/domains/{domain_name}` 52 * @param AttachTrustRequest $postBody 53 * @param array $optParams Optional parameters. 54 * @return Operation 55 */ 56 public function attachTrust($name, AttachTrustRequest $postBody, $optParams = []) 57 { 58 $params = ['name' => $name, 'postBody' => $postBody]; 59 $params = array_merge($params, $optParams); 60 return $this->call('attachTrust', [$params], Operation::class); 61 } 62 /** 63 * Creates a Microsoft AD domain. (domains.create) 64 * 65 * @param string $parent Required. The resource project name and location using 66 * the form: `projects/{project_id}/locations/global` 67 * @param Domain $postBody 68 * @param array $optParams Optional parameters. 69 * 70 * @opt_param string domainName Required. The fully qualified domain name. e.g. 71 * mydomain.myorganization.com, with the following restrictions: * Must contain 72 * only lowercase letters, numbers, periods and hyphens. * Must start with a 73 * letter. * Must contain between 2-64 characters. * Must end with a number or a 74 * letter. * Must not start with period. * First segment length (mydomain for 75 * example above) shouldn't exceed 15 chars. * The last segment cannot be fully 76 * numeric. * Must be unique within the customer project. 77 * @return Operation 78 */ 79 public function create($parent, Domain $postBody, $optParams = []) 80 { 81 $params = ['parent' => $parent, 'postBody' => $postBody]; 82 $params = array_merge($params, $optParams); 83 return $this->call('create', [$params], Operation::class); 84 } 85 /** 86 * Deletes a domain. (domains.delete) 87 * 88 * @param string $name Required. The domain resource name using the form: 89 * `projects/{project_id}/locations/global/domains/{domain_name}` 90 * @param array $optParams Optional parameters. 91 * @return Operation 92 */ 93 public function delete($name, $optParams = []) 94 { 95 $params = ['name' => $name]; 96 $params = array_merge($params, $optParams); 97 return $this->call('delete', [$params], Operation::class); 98 } 99 /** 100 * Removes an AD trust. (domains.detachTrust) 101 * 102 * @param string $name Required. The resource domain name, project name, and 103 * location using the form: 104 * `projects/{project_id}/locations/global/domains/{domain_name}` 105 * @param DetachTrustRequest $postBody 106 * @param array $optParams Optional parameters. 107 * @return Operation 108 */ 109 public function detachTrust($name, DetachTrustRequest $postBody, $optParams = []) 110 { 111 $params = ['name' => $name, 'postBody' => $postBody]; 112 $params = array_merge($params, $optParams); 113 return $this->call('detachTrust', [$params], Operation::class); 114 } 115 /** 116 * Gets information about a domain. (domains.get) 117 * 118 * @param string $name Required. The domain resource name using the form: 119 * `projects/{project_id}/locations/global/domains/{domain_name}` 120 * @param array $optParams Optional parameters. 121 * @return Domain 122 */ 123 public function get($name, $optParams = []) 124 { 125 $params = ['name' => $name]; 126 $params = array_merge($params, $optParams); 127 return $this->call('get', [$params], Domain::class); 128 } 129 /** 130 * Gets the access control policy for a resource. Returns an empty policy if the 131 * resource exists and does not have a policy set. (domains.getIamPolicy) 132 * 133 * @param string $resource REQUIRED: The resource for which the policy is being 134 * requested. See the operation documentation for the appropriate value for this 135 * field. 136 * @param array $optParams Optional parameters. 137 * 138 * @opt_param int options.requestedPolicyVersion Optional. The maximum policy 139 * version that will be used to format the policy. Valid values are 0, 1, and 3. 140 * Requests specifying an invalid value will be rejected. Requests for policies 141 * with any conditional role bindings must specify version 3. Policies with no 142 * conditional role bindings may specify any valid value or leave the field 143 * unset. The policy in the response might use the policy version that you 144 * specified, or it might use a lower policy version. For example, if you 145 * specify version 3, but the policy has no conditional role bindings, the 146 * response uses version 1. To learn which resources support conditions in their 147 * IAM policies, see the [IAM 148 * documentation](https://cloud.google.com/iam/help/conditions/resource- 149 * policies). 150 * @return Policy 151 */ 152 public function getIamPolicy($resource, $optParams = []) 153 { 154 $params = ['resource' => $resource]; 155 $params = array_merge($params, $optParams); 156 return $this->call('getIamPolicy', [$params], Policy::class); 157 } 158 /** 159 * Gets the domain ldaps settings. (domains.getLdapssettings) 160 * 161 * @param string $name Required. The domain resource name using the form: 162 * `projects/{project_id}/locations/global/domains/{domain_name}` 163 * @param array $optParams Optional parameters. 164 * @return LDAPSSettings 165 */ 166 public function getLdapssettings($name, $optParams = []) 167 { 168 $params = ['name' => $name]; 169 $params = array_merge($params, $optParams); 170 return $this->call('getLdapssettings', [$params], LDAPSSettings::class); 171 } 172 /** 173 * Lists domains in a project. 174 * (domains.listProjectsLocationsManagedidentitiesGlobalDomains) 175 * 176 * @param string $parent Required. The resource name of the domain location 177 * using the form: `projects/{project_id}/locations/global` 178 * @param array $optParams Optional parameters. 179 * 180 * @opt_param string filter Optional. A filter specifying constraints of a list 181 * operation. For example, `Domain.fqdn="mydomain.myorginization"`. 182 * @opt_param string orderBy Optional. Specifies the ordering of results. See 183 * [Sorting 184 * order](https://cloud.google.com/apis/design/design_patterns#sorting_order) 185 * for more information. 186 * @opt_param int pageSize Optional. The maximum number of items to return. If 187 * not specified, a default value of 1000 will be used. Regardless of the 188 * page_size value, the response may include a partial list. Callers should rely 189 * on a response's next_page_token to determine if there are additional results 190 * to list. 191 * @opt_param string pageToken Optional. The `next_page_token` value returned 192 * from a previous ListDomainsRequest request, if any. 193 * @return ListDomainsResponse 194 */ 195 public function listProjectsLocationsManagedidentitiesGlobalDomains($parent, $optParams = []) 196 { 197 $params = ['parent' => $parent]; 198 $params = array_merge($params, $optParams); 199 return $this->call('list', [$params], ListDomainsResponse::class); 200 } 201 /** 202 * Updates the metadata and configuration of a domain. (domains.patch) 203 * 204 * @param string $name Required. The unique name of the domain using the form: 205 * `projects/{project_id}/locations/global/domains/{domain_name}`. 206 * @param Domain $postBody 207 * @param array $optParams Optional parameters. 208 * 209 * @opt_param string updateMask Required. Mask of fields to update. At least one 210 * path must be supplied in this field. The elements of the repeated paths field 211 * may only include fields from Domain: * `labels` * `locations` * 212 * `authorized_networks` * `audit_logs_enabled` 213 * @return Operation 214 */ 215 public function patch($name, Domain $postBody, $optParams = []) 216 { 217 $params = ['name' => $name, 'postBody' => $postBody]; 218 $params = array_merge($params, $optParams); 219 return $this->call('patch', [$params], Operation::class); 220 } 221 /** 222 * Updates the DNS conditional forwarder. (domains.reconfigureTrust) 223 * 224 * @param string $name Required. The resource domain name, project name and 225 * location using the form: 226 * `projects/{project_id}/locations/global/domains/{domain_name}` 227 * @param ReconfigureTrustRequest $postBody 228 * @param array $optParams Optional parameters. 229 * @return Operation 230 */ 231 public function reconfigureTrust($name, ReconfigureTrustRequest $postBody, $optParams = []) 232 { 233 $params = ['name' => $name, 'postBody' => $postBody]; 234 $params = array_merge($params, $optParams); 235 return $this->call('reconfigureTrust', [$params], Operation::class); 236 } 237 /** 238 * Resets a domain's administrator password. (domains.resetAdminPassword) 239 * 240 * @param string $name Required. The domain resource name using the form: 241 * `projects/{project_id}/locations/global/domains/{domain_name}` 242 * @param ResetAdminPasswordRequest $postBody 243 * @param array $optParams Optional parameters. 244 * @return ResetAdminPasswordResponse 245 */ 246 public function resetAdminPassword($name, ResetAdminPasswordRequest $postBody, $optParams = []) 247 { 248 $params = ['name' => $name, 'postBody' => $postBody]; 249 $params = array_merge($params, $optParams); 250 return $this->call('resetAdminPassword', [$params], ResetAdminPasswordResponse::class); 251 } 252 /** 253 * RestoreDomain restores domain backup mentioned in the RestoreDomainRequest 254 * (domains.restore) 255 * 256 * @param string $name Required. Resource name for the domain to which the 257 * backup belongs 258 * @param RestoreDomainRequest $postBody 259 * @param array $optParams Optional parameters. 260 * @return Operation 261 */ 262 public function restore($name, RestoreDomainRequest $postBody, $optParams = []) 263 { 264 $params = ['name' => $name, 'postBody' => $postBody]; 265 $params = array_merge($params, $optParams); 266 return $this->call('restore', [$params], Operation::class); 267 } 268 /** 269 * Sets the access control policy on the specified resource. Replaces any 270 * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and 271 * `PERMISSION_DENIED` errors. (domains.setIamPolicy) 272 * 273 * @param string $resource REQUIRED: The resource for which the policy is being 274 * specified. See the operation documentation for the appropriate value for this 275 * field. 276 * @param SetIamPolicyRequest $postBody 277 * @param array $optParams Optional parameters. 278 * @return Policy 279 */ 280 public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = []) 281 { 282 $params = ['resource' => $resource, 'postBody' => $postBody]; 283 $params = array_merge($params, $optParams); 284 return $this->call('setIamPolicy', [$params], Policy::class); 285 } 286 /** 287 * Returns permissions that a caller has on the specified resource. If the 288 * resource does not exist, this will return an empty set of permissions, not a 289 * `NOT_FOUND` error. Note: This operation is designed to be used for building 290 * permission-aware UIs and command-line tools, not for authorization checking. 291 * This operation may "fail open" without warning. (domains.testIamPermissions) 292 * 293 * @param string $resource REQUIRED: The resource for which the policy detail is 294 * being requested. See the operation documentation for the appropriate value 295 * for this field. 296 * @param TestIamPermissionsRequest $postBody 297 * @param array $optParams Optional parameters. 298 * @return TestIamPermissionsResponse 299 */ 300 public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = []) 301 { 302 $params = ['resource' => $resource, 'postBody' => $postBody]; 303 $params = array_merge($params, $optParams); 304 return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class); 305 } 306 /** 307 * Patches a single ldaps settings. (domains.updateLdapssettings) 308 * 309 * @param string $name The resource name of the LDAPS settings. Uses the form: 310 * `projects/{project}/locations/{location}/domains/{domain}`. 311 * @param LDAPSSettings $postBody 312 * @param array $optParams Optional parameters. 313 * 314 * @opt_param string updateMask Required. Mask of fields to update. At least one 315 * path must be supplied in this field. For the `FieldMask` definition, see 316 * https://developers.google.com/protocol- 317 * buffers/docs/reference/google.protobuf#fieldmask 318 * @return Operation 319 */ 320 public function updateLdapssettings($name, LDAPSSettings $postBody, $optParams = []) 321 { 322 $params = ['name' => $name, 'postBody' => $postBody]; 323 $params = array_merge($params, $optParams); 324 return $this->call('updateLdapssettings', [$params], Operation::class); 325 } 326 /** 327 * Validates a trust state, that the target domain is reachable, and that the 328 * target domain is able to accept incoming trust requests. 329 * (domains.validateTrust) 330 * 331 * @param string $name Required. The resource domain name, project name, and 332 * location using the form: 333 * `projects/{project_id}/locations/global/domains/{domain_name}` 334 * @param ValidateTrustRequest $postBody 335 * @param array $optParams Optional parameters. 336 * @return Operation 337 */ 338 public function validateTrust($name, ValidateTrustRequest $postBody, $optParams = []) 339 { 340 $params = ['name' => $name, 'postBody' => $postBody]; 341 $params = array_merge($params, $optParams); 342 return $this->call('validateTrust', [$params], Operation::class); 343 } 344} 345 346// Adding a class alias for backwards compatibility with the previous class name. 347class_alias(ProjectsLocationsManagedidentitiesGlobalDomains::class, 'Google_Service_ManagedServiceforMicrosoftActiveDirectoryConsumerAPI_Resource_ProjectsLocationsManagedidentitiesGlobalDomains'); 348