1<?php
2/*
3 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 * use this file except in compliance with the License. You may obtain a copy of
5 * the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 * License for the specific language governing permissions and limitations under
13 * the License.
14 */
15
16
17  /**
18   * The "licenseAssignments" collection of methods.
19   * Typical usage is:
20   *  <code>
21   *   $licensingService = new Google_LicensingService(...);
22   *   $licenseAssignments = $licensingService->licenseAssignments;
23   *  </code>
24   */
25  class Google_LicenseAssignmentsServiceResource extends Google_ServiceResource {
26
27    /**
28     * Revoke License. (licenseAssignments.delete)
29     *
30     * @param string $productId Name for product
31     * @param string $skuId Name for sku
32     * @param string $userId email id or unique Id of the user
33     * @param array $optParams Optional parameters.
34     */
35    public function delete($productId, $skuId, $userId, $optParams = array()) {
36      $params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId);
37      $params = array_merge($params, $optParams);
38      $data = $this->__call('delete', array($params));
39      return $data;
40    }
41    /**
42     * Get license assignment of a particular product and sku for a user (licenseAssignments.get)
43     *
44     * @param string $productId Name for product
45     * @param string $skuId Name for sku
46     * @param string $userId email id or unique Id of the user
47     * @param array $optParams Optional parameters.
48     * @return Google_LicenseAssignment
49     */
50    public function get($productId, $skuId, $userId, $optParams = array()) {
51      $params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId);
52      $params = array_merge($params, $optParams);
53      $data = $this->__call('get', array($params));
54      if ($this->useObjects()) {
55        return new Google_LicenseAssignment($data);
56      } else {
57        return $data;
58      }
59    }
60    /**
61     * Assign License. (licenseAssignments.insert)
62     *
63     * @param string $productId Name for product
64     * @param string $skuId Name for sku
65     * @param Google_LicenseAssignmentInsert $postBody
66     * @param array $optParams Optional parameters.
67     * @return Google_LicenseAssignment
68     */
69    public function insert($productId, $skuId, Google_LicenseAssignmentInsert $postBody, $optParams = array()) {
70      $params = array('productId' => $productId, 'skuId' => $skuId, 'postBody' => $postBody);
71      $params = array_merge($params, $optParams);
72      $data = $this->__call('insert', array($params));
73      if ($this->useObjects()) {
74        return new Google_LicenseAssignment($data);
75      } else {
76        return $data;
77      }
78    }
79    /**
80     * List license assignments for given product of the customer. (licenseAssignments.listForProduct)
81     *
82     * @param string $productId Name for product
83     * @param string $customerId CustomerId represents the customer for whom licenseassignments are queried
84     * @param array $optParams Optional parameters.
85     *
86     * @opt_param string maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.
87     * @opt_param string pageToken Token to fetch the next page.Optional. By default server will return first page
88     * @return Google_LicenseAssignmentList
89     */
90    public function listForProduct($productId, $customerId, $optParams = array()) {
91      $params = array('productId' => $productId, 'customerId' => $customerId);
92      $params = array_merge($params, $optParams);
93      $data = $this->__call('listForProduct', array($params));
94      if ($this->useObjects()) {
95        return new Google_LicenseAssignmentList($data);
96      } else {
97        return $data;
98      }
99    }
100    /**
101     * List license assignments for given product and sku of the customer.
102     * (licenseAssignments.listForProductAndSku)
103     *
104     * @param string $productId Name for product
105     * @param string $skuId Name for sku
106     * @param string $customerId CustomerId represents the customer for whom licenseassignments are queried
107     * @param array $optParams Optional parameters.
108     *
109     * @opt_param string maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.
110     * @opt_param string pageToken Token to fetch the next page.Optional. By default server will return first page
111     * @return Google_LicenseAssignmentList
112     */
113    public function listForProductAndSku($productId, $skuId, $customerId, $optParams = array()) {
114      $params = array('productId' => $productId, 'skuId' => $skuId, 'customerId' => $customerId);
115      $params = array_merge($params, $optParams);
116      $data = $this->__call('listForProductAndSku', array($params));
117      if ($this->useObjects()) {
118        return new Google_LicenseAssignmentList($data);
119      } else {
120        return $data;
121      }
122    }
123    /**
124     * Assign License. This method supports patch semantics. (licenseAssignments.patch)
125     *
126     * @param string $productId Name for product
127     * @param string $skuId Name for sku for which license would be revoked
128     * @param string $userId email id or unique Id of the user
129     * @param Google_LicenseAssignment $postBody
130     * @param array $optParams Optional parameters.
131     * @return Google_LicenseAssignment
132     */
133    public function patch($productId, $skuId, $userId, Google_LicenseAssignment $postBody, $optParams = array()) {
134      $params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId, 'postBody' => $postBody);
135      $params = array_merge($params, $optParams);
136      $data = $this->__call('patch', array($params));
137      if ($this->useObjects()) {
138        return new Google_LicenseAssignment($data);
139      } else {
140        return $data;
141      }
142    }
143    /**
144     * Assign License. (licenseAssignments.update)
145     *
146     * @param string $productId Name for product
147     * @param string $skuId Name for sku for which license would be revoked
148     * @param string $userId email id or unique Id of the user
149     * @param Google_LicenseAssignment $postBody
150     * @param array $optParams Optional parameters.
151     * @return Google_LicenseAssignment
152     */
153    public function update($productId, $skuId, $userId, Google_LicenseAssignment $postBody, $optParams = array()) {
154      $params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId, 'postBody' => $postBody);
155      $params = array_merge($params, $optParams);
156      $data = $this->__call('update', array($params));
157      if ($this->useObjects()) {
158        return new Google_LicenseAssignment($data);
159      } else {
160        return $data;
161      }
162    }
163  }
164
165/**
166 * Service definition for Google_Licensing (v1).
167 *
168 * <p>
169 * Licensing API to view and manage license for your domain.
170 * </p>
171 *
172 * <p>
173 * For more information about this service, see the
174 * <a href="https://developers.google.com/google-apps/licensing/" target="_blank">API Documentation</a>
175 * </p>
176 *
177 * @author Google, Inc.
178 */
179class Google_LicensingService extends Google_Service {
180  public $licenseAssignments;
181  /**
182   * Constructs the internal representation of the Licensing service.
183   *
184   * @param Google_Client $client
185   */
186  public function __construct(Google_Client $client) {
187    $this->servicePath = 'apps/licensing/v1/product/';
188    $this->version = 'v1';
189    $this->serviceName = 'licensing';
190
191    $client->addService($this->serviceName, $this->version);
192    $this->licenseAssignments = new Google_LicenseAssignmentsServiceResource($this, $this->serviceName, 'licenseAssignments', json_decode('{"methods": {"delete": {"id": "licensing.licenseAssignments.delete", "path": "{productId}/sku/{skuId}/user/{userId}", "httpMethod": "DELETE", "parameters": {"productId": {"type": "string", "required": true, "location": "path"}, "skuId": {"type": "string", "required": true, "location": "path"}, "userId": {"type": "string", "required": true, "location": "path"}}}, "get": {"id": "licensing.licenseAssignments.get", "path": "{productId}/sku/{skuId}/user/{userId}", "httpMethod": "GET", "parameters": {"productId": {"type": "string", "required": true, "location": "path"}, "skuId": {"type": "string", "required": true, "location": "path"}, "userId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "LicenseAssignment"}}, "insert": {"id": "licensing.licenseAssignments.insert", "path": "{productId}/sku/{skuId}/user", "httpMethod": "POST", "parameters": {"productId": {"type": "string", "required": true, "location": "path"}, "skuId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "LicenseAssignmentInsert"}, "response": {"$ref": "LicenseAssignment"}}, "listForProduct": {"id": "licensing.licenseAssignments.listForProduct", "path": "{productId}/users", "httpMethod": "GET", "parameters": {"customerId": {"type": "string", "required": true, "location": "query"}, "maxResults": {"type": "integer", "default": "100", "format": "uint32", "minimum": "1", "maximum": "1000", "location": "query"}, "pageToken": {"type": "string", "default": "", "location": "query"}, "productId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "LicenseAssignmentList"}}, "listForProductAndSku": {"id": "licensing.licenseAssignments.listForProductAndSku", "path": "{productId}/sku/{skuId}/users", "httpMethod": "GET", "parameters": {"customerId": {"type": "string", "required": true, "location": "query"}, "maxResults": {"type": "integer", "default": "100", "format": "uint32", "minimum": "1", "maximum": "1000", "location": "query"}, "pageToken": {"type": "string", "default": "", "location": "query"}, "productId": {"type": "string", "required": true, "location": "path"}, "skuId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "LicenseAssignmentList"}}, "patch": {"id": "licensing.licenseAssignments.patch", "path": "{productId}/sku/{skuId}/user/{userId}", "httpMethod": "PATCH", "parameters": {"productId": {"type": "string", "required": true, "location": "path"}, "skuId": {"type": "string", "required": true, "location": "path"}, "userId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "LicenseAssignment"}, "response": {"$ref": "LicenseAssignment"}}, "update": {"id": "licensing.licenseAssignments.update", "path": "{productId}/sku/{skuId}/user/{userId}", "httpMethod": "PUT", "parameters": {"productId": {"type": "string", "required": true, "location": "path"}, "skuId": {"type": "string", "required": true, "location": "path"}, "userId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "LicenseAssignment"}, "response": {"$ref": "LicenseAssignment"}}}}', true));
193
194  }
195}
196
197
198
199class Google_LicenseAssignment extends Google_Model {
200  public $etags;
201  public $kind;
202  public $productId;
203  public $selfLink;
204  public $skuId;
205  public $userId;
206  public function setEtags( $etags) {
207    $this->etags = $etags;
208  }
209  public function getEtags() {
210    return $this->etags;
211  }
212  public function setKind( $kind) {
213    $this->kind = $kind;
214  }
215  public function getKind() {
216    return $this->kind;
217  }
218  public function setProductId( $productId) {
219    $this->productId = $productId;
220  }
221  public function getProductId() {
222    return $this->productId;
223  }
224  public function setSelfLink( $selfLink) {
225    $this->selfLink = $selfLink;
226  }
227  public function getSelfLink() {
228    return $this->selfLink;
229  }
230  public function setSkuId( $skuId) {
231    $this->skuId = $skuId;
232  }
233  public function getSkuId() {
234    return $this->skuId;
235  }
236  public function setUserId( $userId) {
237    $this->userId = $userId;
238  }
239  public function getUserId() {
240    return $this->userId;
241  }
242}
243
244class Google_LicenseAssignmentInsert extends Google_Model {
245  public $userId;
246  public function setUserId( $userId) {
247    $this->userId = $userId;
248  }
249  public function getUserId() {
250    return $this->userId;
251  }
252}
253
254class Google_LicenseAssignmentList extends Google_Model {
255  public $etag;
256  protected $__itemsType = 'Google_LicenseAssignment';
257  protected $__itemsDataType = 'array';
258  public $items;
259  public $kind;
260  public $nextPageToken;
261  public function setEtag( $etag) {
262    $this->etag = $etag;
263  }
264  public function getEtag() {
265    return $this->etag;
266  }
267  public function setItems(/* array(Google_LicenseAssignment) */ $items) {
268    $this->assertIsArray($items, 'Google_LicenseAssignment', __METHOD__);
269    $this->items = $items;
270  }
271  public function getItems() {
272    return $this->items;
273  }
274  public function setKind( $kind) {
275    $this->kind = $kind;
276  }
277  public function getKind() {
278    return $this->kind;
279  }
280  public function setNextPageToken( $nextPageToken) {
281    $this->nextPageToken = $nextPageToken;
282  }
283  public function getNextPageToken() {
284    return $this->nextPageToken;
285  }
286}
287