[e3d4e0a] | 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\CloudIdentity\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\CloudIdentity\CancelUserInvitationRequest;
|
---|
| 21 | use Google\Service\CloudIdentity\IsInvitableUserResponse;
|
---|
| 22 | use Google\Service\CloudIdentity\ListUserInvitationsResponse;
|
---|
| 23 | use Google\Service\CloudIdentity\Operation;
|
---|
| 24 | use Google\Service\CloudIdentity\SendUserInvitationRequest;
|
---|
| 25 | use Google\Service\CloudIdentity\UserInvitation;
|
---|
| 26 |
|
---|
| 27 | /**
|
---|
| 28 | * The "userinvitations" collection of methods.
|
---|
| 29 | * Typical usage is:
|
---|
| 30 | * <code>
|
---|
| 31 | * $cloudidentityService = new Google\Service\CloudIdentity(...);
|
---|
| 32 | * $userinvitations = $cloudidentityService->customers_userinvitations;
|
---|
| 33 | * </code>
|
---|
| 34 | */
|
---|
| 35 | class CustomersUserinvitations extends \Google\Service\Resource
|
---|
| 36 | {
|
---|
| 37 | /**
|
---|
| 38 | * Cancels a UserInvitation that was already sent. (userinvitations.cancel)
|
---|
| 39 | *
|
---|
| 40 | * @param string $name Required. `UserInvitation` name in the format
|
---|
| 41 | * `customers/{customer}/userinvitations/{user_email_address}`
|
---|
| 42 | * @param CancelUserInvitationRequest $postBody
|
---|
| 43 | * @param array $optParams Optional parameters.
|
---|
| 44 | * @return Operation
|
---|
| 45 | * @throws \Google\Service\Exception
|
---|
| 46 | */
|
---|
| 47 | public function cancel($name, CancelUserInvitationRequest $postBody, $optParams = [])
|
---|
| 48 | {
|
---|
| 49 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 50 | $params = array_merge($params, $optParams);
|
---|
| 51 | return $this->call('cancel', [$params], Operation::class);
|
---|
| 52 | }
|
---|
| 53 | /**
|
---|
| 54 | * Retrieves a UserInvitation resource. **Note:** New consumer accounts with the
|
---|
| 55 | * customer's verified domain created within the previous 48 hours will not
|
---|
| 56 | * appear in the result. This delay also applies to newly-verified domains.
|
---|
| 57 | * (userinvitations.get)
|
---|
| 58 | *
|
---|
| 59 | * @param string $name Required. `UserInvitation` name in the format
|
---|
| 60 | * `customers/{customer}/userinvitations/{user_email_address}`
|
---|
| 61 | * @param array $optParams Optional parameters.
|
---|
| 62 | * @return UserInvitation
|
---|
| 63 | * @throws \Google\Service\Exception
|
---|
| 64 | */
|
---|
| 65 | public function get($name, $optParams = [])
|
---|
| 66 | {
|
---|
| 67 | $params = ['name' => $name];
|
---|
| 68 | $params = array_merge($params, $optParams);
|
---|
| 69 | return $this->call('get', [$params], UserInvitation::class);
|
---|
| 70 | }
|
---|
| 71 | /**
|
---|
| 72 | * Verifies whether a user account is eligible to receive a UserInvitation (is
|
---|
| 73 | * an unmanaged account). Eligibility is based on the following criteria: * the
|
---|
| 74 | * email address is a consumer account and it's the primary email address of the
|
---|
| 75 | * account, and * the domain of the email address matches an existing verified
|
---|
| 76 | * Google Workspace or Cloud Identity domain If both conditions are met, the
|
---|
| 77 | * user is eligible. **Note:** This method is not supported for Workspace
|
---|
| 78 | * Essentials customers. (userinvitations.isInvitableUser)
|
---|
| 79 | *
|
---|
| 80 | * @param string $name Required. `UserInvitation` name in the format
|
---|
| 81 | * `customers/{customer}/userinvitations/{user_email_address}`
|
---|
| 82 | * @param array $optParams Optional parameters.
|
---|
| 83 | * @return IsInvitableUserResponse
|
---|
| 84 | * @throws \Google\Service\Exception
|
---|
| 85 | */
|
---|
| 86 | public function isInvitableUser($name, $optParams = [])
|
---|
| 87 | {
|
---|
| 88 | $params = ['name' => $name];
|
---|
| 89 | $params = array_merge($params, $optParams);
|
---|
| 90 | return $this->call('isInvitableUser', [$params], IsInvitableUserResponse::class);
|
---|
| 91 | }
|
---|
| 92 | /**
|
---|
| 93 | * Retrieves a list of UserInvitation resources. **Note:** New consumer accounts
|
---|
| 94 | * with the customer's verified domain created within the previous 48 hours will
|
---|
| 95 | * not appear in the result. This delay also applies to newly-verified domains.
|
---|
| 96 | * (userinvitations.listCustomersUserinvitations)
|
---|
| 97 | *
|
---|
| 98 | * @param string $parent Required. The customer ID of the Google Workspace or
|
---|
| 99 | * Cloud Identity account the UserInvitation resources are associated with.
|
---|
| 100 | * @param array $optParams Optional parameters.
|
---|
| 101 | *
|
---|
| 102 | * @opt_param string filter Optional. A query string for filtering
|
---|
| 103 | * `UserInvitation` results by their current state, in the format:
|
---|
| 104 | * `"state=='invited'"`.
|
---|
| 105 | * @opt_param string orderBy Optional. The sort order of the list results. You
|
---|
| 106 | * can sort the results in descending order based on either email or last update
|
---|
| 107 | * timestamp but not both, using `order_by="email desc"`. Currently, sorting is
|
---|
| 108 | * supported for `update_time asc`, `update_time desc`, `email asc`, and `email
|
---|
| 109 | * desc`. If not specified, results will be returned based on `email asc` order.
|
---|
| 110 | * @opt_param int pageSize Optional. The maximum number of UserInvitation
|
---|
| 111 | * resources to return. If unspecified, at most 100 resources will be returned.
|
---|
| 112 | * The maximum value is 200; values above 200 will be set to 200.
|
---|
| 113 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
| 114 | * `ListUserInvitations` call. Provide this to retrieve the subsequent page.
|
---|
| 115 | * When paginating, all other parameters provided to `ListBooks` must match the
|
---|
| 116 | * call that provided the page token.
|
---|
| 117 | * @return ListUserInvitationsResponse
|
---|
| 118 | * @throws \Google\Service\Exception
|
---|
| 119 | */
|
---|
| 120 | public function listCustomersUserinvitations($parent, $optParams = [])
|
---|
| 121 | {
|
---|
| 122 | $params = ['parent' => $parent];
|
---|
| 123 | $params = array_merge($params, $optParams);
|
---|
| 124 | return $this->call('list', [$params], ListUserInvitationsResponse::class);
|
---|
| 125 | }
|
---|
| 126 | /**
|
---|
| 127 | * Sends a UserInvitation to email. If the `UserInvitation` does not exist for
|
---|
| 128 | * this request and it is a valid request, the request creates a
|
---|
| 129 | * `UserInvitation`. **Note:** The `get` and `list` methods have a 48-hour delay
|
---|
| 130 | * where newly-created consumer accounts will not appear in the results. You can
|
---|
| 131 | * still send a `UserInvitation` to those accounts if you know the unmanaged
|
---|
| 132 | * email address and IsInvitableUser==True. (userinvitations.send)
|
---|
| 133 | *
|
---|
| 134 | * @param string $name Required. `UserInvitation` name in the format
|
---|
| 135 | * `customers/{customer}/userinvitations/{user_email_address}`
|
---|
| 136 | * @param SendUserInvitationRequest $postBody
|
---|
| 137 | * @param array $optParams Optional parameters.
|
---|
| 138 | * @return Operation
|
---|
| 139 | * @throws \Google\Service\Exception
|
---|
| 140 | */
|
---|
| 141 | public function send($name, SendUserInvitationRequest $postBody, $optParams = [])
|
---|
| 142 | {
|
---|
| 143 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 144 | $params = array_merge($params, $optParams);
|
---|
| 145 | return $this->call('send', [$params], Operation::class);
|
---|
| 146 | }
|
---|
| 147 | }
|
---|
| 148 |
|
---|
| 149 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 150 | class_alias(CustomersUserinvitations::class, 'Google_Service_CloudIdentity_Resource_CustomersUserinvitations');
|
---|