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;
19
20use Google\Client;
21
22/**
23 * Service definition for Reseller (v1).
24 *
25 * <p>
26 * Perform common functions that are available on the Channel Services console
27 * at scale, like placing orders and viewing customer information</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://developers.google.com/google-apps/reseller/" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class Reseller extends \Google\Service
37{
38  /** Manage users on your domain. */
39  const APPS_ORDER =
40      "https://www.googleapis.com/auth/apps.order";
41  /** Manage users on your domain. */
42  const APPS_ORDER_READONLY =
43      "https://www.googleapis.com/auth/apps.order.readonly";
44
45  public $customers;
46  public $resellernotify;
47  public $subscriptions;
48
49  /**
50   * Constructs the internal representation of the Reseller service.
51   *
52   * @param Client|array $clientOrConfig The client used to deliver requests, or a
53   *                                     config array to pass to a new Client instance.
54   * @param string $rootUrl The root URL used for requests to the service.
55   */
56  public function __construct($clientOrConfig = [], $rootUrl = null)
57  {
58    parent::__construct($clientOrConfig);
59    $this->rootUrl = $rootUrl ?: 'https://reseller.googleapis.com/';
60    $this->servicePath = '';
61    $this->batchPath = 'batch';
62    $this->version = 'v1';
63    $this->serviceName = 'reseller';
64
65    $this->customers = new Reseller\Resource\Customers(
66        $this,
67        $this->serviceName,
68        'customers',
69        [
70          'methods' => [
71            'get' => [
72              'path' => 'apps/reseller/v1/customers/{customerId}',
73              'httpMethod' => 'GET',
74              'parameters' => [
75                'customerId' => [
76                  'location' => 'path',
77                  'type' => 'string',
78                  'required' => true,
79                ],
80              ],
81            ],'insert' => [
82              'path' => 'apps/reseller/v1/customers',
83              'httpMethod' => 'POST',
84              'parameters' => [
85                'customerAuthToken' => [
86                  'location' => 'query',
87                  'type' => 'string',
88                ],
89              ],
90            ],'patch' => [
91              'path' => 'apps/reseller/v1/customers/{customerId}',
92              'httpMethod' => 'PATCH',
93              'parameters' => [
94                'customerId' => [
95                  'location' => 'path',
96                  'type' => 'string',
97                  'required' => true,
98                ],
99              ],
100            ],'update' => [
101              'path' => 'apps/reseller/v1/customers/{customerId}',
102              'httpMethod' => 'PUT',
103              'parameters' => [
104                'customerId' => [
105                  'location' => 'path',
106                  'type' => 'string',
107                  'required' => true,
108                ],
109              ],
110            ],
111          ]
112        ]
113    );
114    $this->resellernotify = new Reseller\Resource\Resellernotify(
115        $this,
116        $this->serviceName,
117        'resellernotify',
118        [
119          'methods' => [
120            'getwatchdetails' => [
121              'path' => 'apps/reseller/v1/resellernotify/getwatchdetails',
122              'httpMethod' => 'GET',
123              'parameters' => [],
124            ],'register' => [
125              'path' => 'apps/reseller/v1/resellernotify/register',
126              'httpMethod' => 'POST',
127              'parameters' => [
128                'serviceAccountEmailAddress' => [
129                  'location' => 'query',
130                  'type' => 'string',
131                ],
132              ],
133            ],'unregister' => [
134              'path' => 'apps/reseller/v1/resellernotify/unregister',
135              'httpMethod' => 'POST',
136              'parameters' => [
137                'serviceAccountEmailAddress' => [
138                  'location' => 'query',
139                  'type' => 'string',
140                ],
141              ],
142            ],
143          ]
144        ]
145    );
146    $this->subscriptions = new Reseller\Resource\Subscriptions(
147        $this,
148        $this->serviceName,
149        'subscriptions',
150        [
151          'methods' => [
152            'activate' => [
153              'path' => 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/activate',
154              'httpMethod' => 'POST',
155              'parameters' => [
156                'customerId' => [
157                  'location' => 'path',
158                  'type' => 'string',
159                  'required' => true,
160                ],
161                'subscriptionId' => [
162                  'location' => 'path',
163                  'type' => 'string',
164                  'required' => true,
165                ],
166              ],
167            ],'changePlan' => [
168              'path' => 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changePlan',
169              'httpMethod' => 'POST',
170              'parameters' => [
171                'customerId' => [
172                  'location' => 'path',
173                  'type' => 'string',
174                  'required' => true,
175                ],
176                'subscriptionId' => [
177                  'location' => 'path',
178                  'type' => 'string',
179                  'required' => true,
180                ],
181              ],
182            ],'changeRenewalSettings' => [
183              'path' => 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings',
184              'httpMethod' => 'POST',
185              'parameters' => [
186                'customerId' => [
187                  'location' => 'path',
188                  'type' => 'string',
189                  'required' => true,
190                ],
191                'subscriptionId' => [
192                  'location' => 'path',
193                  'type' => 'string',
194                  'required' => true,
195                ],
196              ],
197            ],'changeSeats' => [
198              'path' => 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changeSeats',
199              'httpMethod' => 'POST',
200              'parameters' => [
201                'customerId' => [
202                  'location' => 'path',
203                  'type' => 'string',
204                  'required' => true,
205                ],
206                'subscriptionId' => [
207                  'location' => 'path',
208                  'type' => 'string',
209                  'required' => true,
210                ],
211              ],
212            ],'delete' => [
213              'path' => 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}',
214              'httpMethod' => 'DELETE',
215              'parameters' => [
216                'customerId' => [
217                  'location' => 'path',
218                  'type' => 'string',
219                  'required' => true,
220                ],
221                'subscriptionId' => [
222                  'location' => 'path',
223                  'type' => 'string',
224                  'required' => true,
225                ],
226                'deletionType' => [
227                  'location' => 'query',
228                  'type' => 'string',
229                  'required' => true,
230                ],
231              ],
232            ],'get' => [
233              'path' => 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}',
234              'httpMethod' => 'GET',
235              'parameters' => [
236                'customerId' => [
237                  'location' => 'path',
238                  'type' => 'string',
239                  'required' => true,
240                ],
241                'subscriptionId' => [
242                  'location' => 'path',
243                  'type' => 'string',
244                  'required' => true,
245                ],
246              ],
247            ],'insert' => [
248              'path' => 'apps/reseller/v1/customers/{customerId}/subscriptions',
249              'httpMethod' => 'POST',
250              'parameters' => [
251                'customerId' => [
252                  'location' => 'path',
253                  'type' => 'string',
254                  'required' => true,
255                ],
256                'customerAuthToken' => [
257                  'location' => 'query',
258                  'type' => 'string',
259                ],
260              ],
261            ],'list' => [
262              'path' => 'apps/reseller/v1/subscriptions',
263              'httpMethod' => 'GET',
264              'parameters' => [
265                'customerAuthToken' => [
266                  'location' => 'query',
267                  'type' => 'string',
268                ],
269                'customerId' => [
270                  'location' => 'query',
271                  'type' => 'string',
272                ],
273                'customerNamePrefix' => [
274                  'location' => 'query',
275                  'type' => 'string',
276                ],
277                'maxResults' => [
278                  'location' => 'query',
279                  'type' => 'integer',
280                ],
281                'pageToken' => [
282                  'location' => 'query',
283                  'type' => 'string',
284                ],
285              ],
286            ],'startPaidService' => [
287              'path' => 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/startPaidService',
288              'httpMethod' => 'POST',
289              'parameters' => [
290                'customerId' => [
291                  'location' => 'path',
292                  'type' => 'string',
293                  'required' => true,
294                ],
295                'subscriptionId' => [
296                  'location' => 'path',
297                  'type' => 'string',
298                  'required' => true,
299                ],
300              ],
301            ],'suspend' => [
302              'path' => 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/suspend',
303              'httpMethod' => 'POST',
304              'parameters' => [
305                'customerId' => [
306                  'location' => 'path',
307                  'type' => 'string',
308                  'required' => true,
309                ],
310                'subscriptionId' => [
311                  'location' => 'path',
312                  'type' => 'string',
313                  'required' => true,
314                ],
315              ],
316            ],
317          ]
318        ]
319    );
320  }
321}
322
323// Adding a class alias for backwards compatibility with the previous class name.
324class_alias(Reseller::class, 'Google_Service_Reseller');
325