[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\Reseller\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Reseller\Customer;
|
---|
| 21 |
|
---|
| 22 | /**
|
---|
| 23 | * The "customers" collection of methods.
|
---|
| 24 | * Typical usage is:
|
---|
| 25 | * <code>
|
---|
| 26 | * $resellerService = new Google\Service\Reseller(...);
|
---|
| 27 | * $customers = $resellerService->customers;
|
---|
| 28 | * </code>
|
---|
| 29 | */
|
---|
| 30 | class Customers extends \Google\Service\Resource
|
---|
| 31 | {
|
---|
| 32 | /**
|
---|
| 33 | * Gets a customer account. Use this operation to see a customer account already
|
---|
| 34 | * in your reseller management, or to see the minimal account information for an
|
---|
| 35 | * existing customer that you do not manage. For more information about the API
|
---|
| 36 | * response for existing customers, see [retrieving a customer account](/admin-
|
---|
| 37 | * sdk/reseller/v1/how-tos/manage_customers#get_customer). (customers.get)
|
---|
| 38 | *
|
---|
| 39 | * @param string $customerId This can be either the customer's primary domain
|
---|
| 40 | * name or the customer's unique identifier. If the domain name for a customer
|
---|
| 41 | * changes, the old domain name cannot be used to access the customer, but the
|
---|
| 42 | * customer's unique identifier (as returned by the API) can always be used. We
|
---|
| 43 | * recommend storing the unique identifier in your systems where applicable.
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | * @return Customer
|
---|
| 46 | * @throws \Google\Service\Exception
|
---|
| 47 | */
|
---|
| 48 | public function get($customerId, $optParams = [])
|
---|
| 49 | {
|
---|
| 50 | $params = ['customerId' => $customerId];
|
---|
| 51 | $params = array_merge($params, $optParams);
|
---|
| 52 | return $this->call('get', [$params], Customer::class);
|
---|
| 53 | }
|
---|
| 54 | /**
|
---|
| 55 | * Orders a new customer's account. Before ordering a new customer account,
|
---|
| 56 | * establish whether the customer account already exists using the
|
---|
| 57 | * [`customers.get`](/admin-sdk/reseller/v1/reference/customers/get) If the
|
---|
| 58 | * customer account exists as a direct Google account or as a resold customer
|
---|
| 59 | * account from another reseller, use the `customerAuthToken\` as described in
|
---|
| 60 | * [order a resold account for an existing customer](/admin-sdk/reseller/v1/how-
|
---|
| 61 | * tos/manage_customers#create_existing_customer). For more information about
|
---|
| 62 | * ordering a new customer account, see [order a new customer account](/admin-
|
---|
| 63 | * sdk/reseller/v1/how-tos/manage_customers#create_customer). After creating a
|
---|
| 64 | * new customer account, you must provision a user as an administrator. The
|
---|
| 65 | * customer's administrator is required to sign in to the Admin console and sign
|
---|
| 66 | * the G Suite via Reseller agreement to activate the account. Resellers are
|
---|
| 67 | * prohibited from signing the G Suite via Reseller agreement on the customer's
|
---|
| 68 | * behalf. For more information, see [order a new customer account](/admin-
|
---|
| 69 | * sdk/reseller/v1/how-tos/manage_customers#tos). (customers.insert)
|
---|
| 70 | *
|
---|
| 71 | * @param Customer $postBody
|
---|
| 72 | * @param array $optParams Optional parameters.
|
---|
| 73 | *
|
---|
| 74 | * @opt_param string customerAuthToken The `customerAuthToken` query string is
|
---|
| 75 | * required when creating a resold account that transfers a direct customer's
|
---|
| 76 | * subscription or transfers another reseller customer's subscription to your
|
---|
| 77 | * reseller management. This is a hexadecimal authentication token needed to
|
---|
| 78 | * complete the subscription transfer. For more information, see the
|
---|
| 79 | * administrator help center.
|
---|
| 80 | * @return Customer
|
---|
| 81 | * @throws \Google\Service\Exception
|
---|
| 82 | */
|
---|
| 83 | public function insert(Customer $postBody, $optParams = [])
|
---|
| 84 | {
|
---|
| 85 | $params = ['postBody' => $postBody];
|
---|
| 86 | $params = array_merge($params, $optParams);
|
---|
| 87 | return $this->call('insert', [$params], Customer::class);
|
---|
| 88 | }
|
---|
| 89 | /**
|
---|
| 90 | * Updates a customer account's settings. This method supports patch semantics.
|
---|
| 91 | * You cannot update `customerType` via the Reseller API, but a `"team"`
|
---|
| 92 | * customer can verify their domain and become `customerType = "domain"`. For
|
---|
| 93 | * more information, see [Verify your domain to unlock Essentials
|
---|
| 94 | * features](https://support.google.com/a/answer/9122284). (customers.patch)
|
---|
| 95 | *
|
---|
| 96 | * @param string $customerId This can be either the customer's primary domain
|
---|
| 97 | * name or the customer's unique identifier. If the domain name for a customer
|
---|
| 98 | * changes, the old domain name cannot be used to access the customer, but the
|
---|
| 99 | * customer's unique identifier (as returned by the API) can always be used. We
|
---|
| 100 | * recommend storing the unique identifier in your systems where applicable.
|
---|
| 101 | * @param Customer $postBody
|
---|
| 102 | * @param array $optParams Optional parameters.
|
---|
| 103 | * @return Customer
|
---|
| 104 | * @throws \Google\Service\Exception
|
---|
| 105 | */
|
---|
| 106 | public function patch($customerId, Customer $postBody, $optParams = [])
|
---|
| 107 | {
|
---|
| 108 | $params = ['customerId' => $customerId, 'postBody' => $postBody];
|
---|
| 109 | $params = array_merge($params, $optParams);
|
---|
| 110 | return $this->call('patch', [$params], Customer::class);
|
---|
| 111 | }
|
---|
| 112 | /**
|
---|
| 113 | * Updates a customer account's settings. You cannot update `customerType` via
|
---|
| 114 | * the Reseller API, but a `"team"` customer can verify their domain and become
|
---|
| 115 | * `customerType = "domain"`. For more information, see [update a customer's
|
---|
| 116 | * settings](/admin-sdk/reseller/v1/how-tos/manage_customers#update_customer).
|
---|
| 117 | * (customers.update)
|
---|
| 118 | *
|
---|
| 119 | * @param string $customerId This can be either the customer's primary domain
|
---|
| 120 | * name or the customer's unique identifier. If the domain name for a customer
|
---|
| 121 | * changes, the old domain name cannot be used to access the customer, but the
|
---|
| 122 | * customer's unique identifier (as returned by the API) can always be used. We
|
---|
| 123 | * recommend storing the unique identifier in your systems where applicable.
|
---|
| 124 | * @param Customer $postBody
|
---|
| 125 | * @param array $optParams Optional parameters.
|
---|
| 126 | * @return Customer
|
---|
| 127 | * @throws \Google\Service\Exception
|
---|
| 128 | */
|
---|
| 129 | public function update($customerId, Customer $postBody, $optParams = [])
|
---|
| 130 | {
|
---|
| 131 | $params = ['customerId' => $customerId, 'postBody' => $postBody];
|
---|
| 132 | $params = array_merge($params, $optParams);
|
---|
| 133 | return $this->call('update', [$params], Customer::class);
|
---|
| 134 | }
|
---|
| 135 | }
|
---|
| 136 |
|
---|
| 137 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 138 | class_alias(Customers::class, 'Google_Service_Reseller_Resource_Customers');
|
---|