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\Feature;
21use Google\Service\Directory\FeatureRename;
22use Google\Service\Directory\Features;
23
24/**
25 * The "features" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $adminService = new Google\Service\Directory(...);
29 *   $features = $adminService->features;
30 *  </code>
31 */
32class ResourcesFeatures extends \Google\Service\Resource
33{
34  /**
35   * Deletes a feature. (features.delete)
36   *
37   * @param string $customer The unique ID for the customer's Google Workspace
38   * account. As an account administrator, you can also use the `my_customer`
39   * alias to represent your account's customer ID.
40   * @param string $featureKey The unique ID of the feature to delete.
41   * @param array $optParams Optional parameters.
42   */
43  public function delete($customer, $featureKey, $optParams = [])
44  {
45    $params = ['customer' => $customer, 'featureKey' => $featureKey];
46    $params = array_merge($params, $optParams);
47    return $this->call('delete', [$params]);
48  }
49  /**
50   * Retrieves a feature. (features.get)
51   *
52   * @param string $customer The unique ID for the customer's Google Workspace
53   * account. As an account administrator, you can also use the `my_customer`
54   * alias to represent your account's customer ID.
55   * @param string $featureKey The unique ID of the feature to retrieve.
56   * @param array $optParams Optional parameters.
57   * @return Feature
58   */
59  public function get($customer, $featureKey, $optParams = [])
60  {
61    $params = ['customer' => $customer, 'featureKey' => $featureKey];
62    $params = array_merge($params, $optParams);
63    return $this->call('get', [$params], Feature::class);
64  }
65  /**
66   * Inserts a feature. (features.insert)
67   *
68   * @param string $customer The unique ID for the customer's Google Workspace
69   * account. As an account administrator, you can also use the `my_customer`
70   * alias to represent your account's customer ID.
71   * @param Feature $postBody
72   * @param array $optParams Optional parameters.
73   * @return Feature
74   */
75  public function insert($customer, Feature $postBody, $optParams = [])
76  {
77    $params = ['customer' => $customer, 'postBody' => $postBody];
78    $params = array_merge($params, $optParams);
79    return $this->call('insert', [$params], Feature::class);
80  }
81  /**
82   * Retrieves a list of features for an account. (features.listResourcesFeatures)
83   *
84   * @param string $customer The unique ID for the customer's Google Workspace
85   * account. As an account administrator, you can also use the `my_customer`
86   * alias to represent your account's customer ID.
87   * @param array $optParams Optional parameters.
88   *
89   * @opt_param int maxResults Maximum number of results to return.
90   * @opt_param string pageToken Token to specify the next page in the list.
91   * @return Features
92   */
93  public function listResourcesFeatures($customer, $optParams = [])
94  {
95    $params = ['customer' => $customer];
96    $params = array_merge($params, $optParams);
97    return $this->call('list', [$params], Features::class);
98  }
99  /**
100   * Patches a feature. (features.patch)
101   *
102   * @param string $customer The unique ID for the customer's Google Workspace
103   * account. As an account administrator, you can also use the `my_customer`
104   * alias to represent your account's customer ID.
105   * @param string $featureKey The unique ID of the feature to update.
106   * @param Feature $postBody
107   * @param array $optParams Optional parameters.
108   * @return Feature
109   */
110  public function patch($customer, $featureKey, Feature $postBody, $optParams = [])
111  {
112    $params = ['customer' => $customer, 'featureKey' => $featureKey, 'postBody' => $postBody];
113    $params = array_merge($params, $optParams);
114    return $this->call('patch', [$params], Feature::class);
115  }
116  /**
117   * Renames a feature. (features.rename)
118   *
119   * @param string $customer The unique ID for the customer's Google Workspace
120   * account. As an account administrator, you can also use the `my_customer`
121   * alias to represent your account's customer ID.
122   * @param string $oldName The unique ID of the feature to rename.
123   * @param FeatureRename $postBody
124   * @param array $optParams Optional parameters.
125   */
126  public function rename($customer, $oldName, FeatureRename $postBody, $optParams = [])
127  {
128    $params = ['customer' => $customer, 'oldName' => $oldName, 'postBody' => $postBody];
129    $params = array_merge($params, $optParams);
130    return $this->call('rename', [$params]);
131  }
132  /**
133   * Updates a feature. (features.update)
134   *
135   * @param string $customer The unique ID for the customer's Google Workspace
136   * account. As an account administrator, you can also use the `my_customer`
137   * alias to represent your account's customer ID.
138   * @param string $featureKey The unique ID of the feature to update.
139   * @param Feature $postBody
140   * @param array $optParams Optional parameters.
141   * @return Feature
142   */
143  public function update($customer, $featureKey, Feature $postBody, $optParams = [])
144  {
145    $params = ['customer' => $customer, 'featureKey' => $featureKey, 'postBody' => $postBody];
146    $params = array_merge($params, $optParams);
147    return $this->call('update', [$params], Feature::class);
148  }
149}
150
151// Adding a class alias for backwards compatibility with the previous class name.
152class_alias(ResourcesFeatures::class, 'Google_Service_Directory_Resource_ResourcesFeatures');
153