Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

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