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\Directory\Resource;
19
20use Google\Service\Directory\Customer as CustomerModel;
21
22/**
23 * The "customers" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $adminService = new Google\Service\Directory(...);
27 *   $customers = $adminService->customers;
28 *  </code>
29 */
30class Customers extends \Google\Service\Resource
31{
32  /**
33   * Retrieves a customer. (customers.get)
34   *
35   * @param string $customerKey Id of the customer to be retrieved
36   * @param array $optParams Optional parameters.
37   * @return Customer
38   */
39  public function get($customerKey, $optParams = [])
40  {
41    $params = ['customerKey' => $customerKey];
42    $params = array_merge($params, $optParams);
43    return $this->call('get', [$params], CustomerModel::class);
44  }
45  /**
46   * Patches a customer. (customers.patch)
47   *
48   * @param string $customerKey Id of the customer to be updated
49   * @param CustomerModel $postBody
50   * @param array $optParams Optional parameters.
51   * @return CustomerModel
52   */
53  public function patch($customerKey, CustomerModel $postBody, $optParams = [])
54  {
55    $params = ['customerKey' => $customerKey, 'postBody' => $postBody];
56    $params = array_merge($params, $optParams);
57    return $this->call('patch', [$params], CustomerModel::class);
58  }
59  /**
60   * Updates a customer. (customers.update)
61   *
62   * @param string $customerKey Id of the customer to be updated
63   * @param CustomerModel $postBody
64   * @param array $optParams Optional parameters.
65   * @return CustomerModel
66   */
67  public function update($customerKey, CustomerModel $postBody, $optParams = [])
68  {
69    $params = ['customerKey' => $customerKey, 'postBody' => $postBody];
70    $params = array_merge($params, $optParams);
71    return $this->call('update', [$params], CustomerModel::class);
72  }
73}
74
75// Adding a class alias for backwards compatibility with the previous class name.
76class_alias(Customers::class, 'Google_Service_Directory_Resource_Customers');
77