OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.licensing.v1; | 3 library googleapis.licensing.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client licensing/v1'; | 15 const core.String USER_AGENT = 'dart-api-client licensing/v1'; |
16 | 16 |
17 /** Views and manages licenses for your domain. */ | 17 /// Views and manages licenses for your domain. |
18 class LicensingApi { | 18 class LicensingApi { |
19 /** View and manage G Suite licenses for your domain */ | 19 /// View and manage G Suite licenses for your domain |
20 static const AppsLicensingScope = "https://www.googleapis.com/auth/apps.licens
ing"; | 20 static const AppsLicensingScope = |
21 | 21 "https://www.googleapis.com/auth/apps.licensing"; |
22 | 22 |
23 final commons.ApiRequester _requester; | 23 final commons.ApiRequester _requester; |
24 | 24 |
25 LicenseAssignmentsResourceApi get licenseAssignments => new LicenseAssignments
ResourceApi(_requester); | 25 LicenseAssignmentsResourceApi get licenseAssignments => |
| 26 new LicenseAssignmentsResourceApi(_requester); |
26 | 27 |
27 LicensingApi(http.Client client, {core.String rootUrl: "https://www.googleapis
.com/", core.String servicePath: "apps/licensing/v1/product/"}) : | 28 LicensingApi(http.Client client, |
28 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 29 {core.String rootUrl: "https://www.googleapis.com/", |
| 30 core.String servicePath: "apps/licensing/v1/product/"}) |
| 31 : _requester = |
| 32 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
29 } | 33 } |
30 | 34 |
31 | |
32 class LicenseAssignmentsResourceApi { | 35 class LicenseAssignmentsResourceApi { |
33 final commons.ApiRequester _requester; | 36 final commons.ApiRequester _requester; |
34 | 37 |
35 LicenseAssignmentsResourceApi(commons.ApiRequester client) : | 38 LicenseAssignmentsResourceApi(commons.ApiRequester client) |
36 _requester = client; | 39 : _requester = client; |
37 | 40 |
38 /** | 41 /// Revoke License. |
39 * Revoke License. | 42 /// |
40 * | 43 /// Request parameters: |
41 * Request parameters: | 44 /// |
42 * | 45 /// [productId] - Name for product |
43 * [productId] - Name for product | 46 /// |
44 * | 47 /// [skuId] - Name for sku |
45 * [skuId] - Name for sku | 48 /// |
46 * | 49 /// [userId] - email id or unique Id of the user |
47 * [userId] - email id or unique Id of the user | 50 /// |
48 * | 51 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
49 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 52 /// an error. |
50 * error. | 53 /// |
51 * | 54 /// If the used [http.Client] completes with an error when making a REST |
52 * If the used [http.Client] completes with an error when making a REST call, | 55 /// call, this method will complete with the same error. |
53 * this method will complete with the same error. | 56 async.Future delete( |
54 */ | 57 core.String productId, core.String skuId, core.String userId) { |
55 async.Future delete(core.String productId, core.String skuId, core.String user
Id) { | |
56 var _url = null; | 58 var _url = null; |
57 var _queryParams = new core.Map(); | 59 var _queryParams = new core.Map(); |
58 var _uploadMedia = null; | 60 var _uploadMedia = null; |
59 var _uploadOptions = null; | 61 var _uploadOptions = null; |
60 var _downloadOptions = commons.DownloadOptions.Metadata; | 62 var _downloadOptions = commons.DownloadOptions.Metadata; |
61 var _body = null; | 63 var _body = null; |
62 | 64 |
63 if (productId == null) { | 65 if (productId == null) { |
64 throw new core.ArgumentError("Parameter productId is required."); | 66 throw new core.ArgumentError("Parameter productId is required."); |
65 } | 67 } |
66 if (skuId == null) { | 68 if (skuId == null) { |
67 throw new core.ArgumentError("Parameter skuId is required."); | 69 throw new core.ArgumentError("Parameter skuId is required."); |
68 } | 70 } |
69 if (userId == null) { | 71 if (userId == null) { |
70 throw new core.ArgumentError("Parameter userId is required."); | 72 throw new core.ArgumentError("Parameter userId is required."); |
71 } | 73 } |
72 | 74 |
73 _downloadOptions = null; | 75 _downloadOptions = null; |
74 | 76 |
75 _url = commons.Escaper.ecapeVariable('$productId') + '/sku/' + commons.Escap
er.ecapeVariable('$skuId') + '/user/' + commons.Escaper.ecapeVariable('$userId')
; | 77 _url = commons.Escaper.ecapeVariable('$productId') + |
| 78 '/sku/' + |
| 79 commons.Escaper.ecapeVariable('$skuId') + |
| 80 '/user/' + |
| 81 commons.Escaper.ecapeVariable('$userId'); |
76 | 82 |
77 var _response = _requester.request(_url, | 83 var _response = _requester.request(_url, "DELETE", |
78 "DELETE", | 84 body: _body, |
79 body: _body, | 85 queryParams: _queryParams, |
80 queryParams: _queryParams, | 86 uploadOptions: _uploadOptions, |
81 uploadOptions: _uploadOptions, | 87 uploadMedia: _uploadMedia, |
82 uploadMedia: _uploadMedia, | 88 downloadOptions: _downloadOptions); |
83 downloadOptions: _downloadOptions); | |
84 return _response.then((data) => null); | 89 return _response.then((data) => null); |
85 } | 90 } |
86 | 91 |
87 /** | 92 /// Get license assignment of a particular product and sku for a user |
88 * Get license assignment of a particular product and sku for a user | 93 /// |
89 * | 94 /// Request parameters: |
90 * Request parameters: | 95 /// |
91 * | 96 /// [productId] - Name for product |
92 * [productId] - Name for product | 97 /// |
93 * | 98 /// [skuId] - Name for sku |
94 * [skuId] - Name for sku | 99 /// |
95 * | 100 /// [userId] - email id or unique Id of the user |
96 * [userId] - email id or unique Id of the user | 101 /// |
97 * | 102 /// Completes with a [LicenseAssignment]. |
98 * Completes with a [LicenseAssignment]. | 103 /// |
99 * | 104 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
100 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 105 /// an error. |
101 * error. | 106 /// |
102 * | 107 /// If the used [http.Client] completes with an error when making a REST |
103 * If the used [http.Client] completes with an error when making a REST call, | 108 /// call, this method will complete with the same error. |
104 * this method will complete with the same error. | 109 async.Future<LicenseAssignment> get( |
105 */ | 110 core.String productId, core.String skuId, core.String userId) { |
106 async.Future<LicenseAssignment> get(core.String productId, core.String skuId,
core.String userId) { | |
107 var _url = null; | 111 var _url = null; |
108 var _queryParams = new core.Map(); | 112 var _queryParams = new core.Map(); |
109 var _uploadMedia = null; | 113 var _uploadMedia = null; |
110 var _uploadOptions = null; | 114 var _uploadOptions = null; |
111 var _downloadOptions = commons.DownloadOptions.Metadata; | 115 var _downloadOptions = commons.DownloadOptions.Metadata; |
112 var _body = null; | 116 var _body = null; |
113 | 117 |
114 if (productId == null) { | 118 if (productId == null) { |
115 throw new core.ArgumentError("Parameter productId is required."); | 119 throw new core.ArgumentError("Parameter productId is required."); |
116 } | 120 } |
117 if (skuId == null) { | 121 if (skuId == null) { |
118 throw new core.ArgumentError("Parameter skuId is required."); | 122 throw new core.ArgumentError("Parameter skuId is required."); |
119 } | 123 } |
120 if (userId == null) { | 124 if (userId == null) { |
121 throw new core.ArgumentError("Parameter userId is required."); | 125 throw new core.ArgumentError("Parameter userId is required."); |
122 } | 126 } |
123 | 127 |
124 _url = commons.Escaper.ecapeVariable('$productId') + '/sku/' + commons.Escap
er.ecapeVariable('$skuId') + '/user/' + commons.Escaper.ecapeVariable('$userId')
; | 128 _url = commons.Escaper.ecapeVariable('$productId') + |
| 129 '/sku/' + |
| 130 commons.Escaper.ecapeVariable('$skuId') + |
| 131 '/user/' + |
| 132 commons.Escaper.ecapeVariable('$userId'); |
125 | 133 |
126 var _response = _requester.request(_url, | 134 var _response = _requester.request(_url, "GET", |
127 "GET", | 135 body: _body, |
128 body: _body, | 136 queryParams: _queryParams, |
129 queryParams: _queryParams, | 137 uploadOptions: _uploadOptions, |
130 uploadOptions: _uploadOptions, | 138 uploadMedia: _uploadMedia, |
131 uploadMedia: _uploadMedia, | 139 downloadOptions: _downloadOptions); |
132 downloadOptions: _downloadOptions); | |
133 return _response.then((data) => new LicenseAssignment.fromJson(data)); | 140 return _response.then((data) => new LicenseAssignment.fromJson(data)); |
134 } | 141 } |
135 | 142 |
136 /** | 143 /// Assign License. |
137 * Assign License. | 144 /// |
138 * | 145 /// [request] - The metadata request object. |
139 * [request] - The metadata request object. | 146 /// |
140 * | 147 /// Request parameters: |
141 * Request parameters: | 148 /// |
142 * | 149 /// [productId] - Name for product |
143 * [productId] - Name for product | 150 /// |
144 * | 151 /// [skuId] - Name for sku |
145 * [skuId] - Name for sku | 152 /// |
146 * | 153 /// Completes with a [LicenseAssignment]. |
147 * Completes with a [LicenseAssignment]. | 154 /// |
148 * | 155 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
149 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 156 /// an error. |
150 * error. | 157 /// |
151 * | 158 /// If the used [http.Client] completes with an error when making a REST |
152 * If the used [http.Client] completes with an error when making a REST call, | 159 /// call, this method will complete with the same error. |
153 * this method will complete with the same error. | 160 async.Future<LicenseAssignment> insert(LicenseAssignmentInsert request, |
154 */ | 161 core.String productId, core.String skuId) { |
155 async.Future<LicenseAssignment> insert(LicenseAssignmentInsert request, core.S
tring productId, core.String skuId) { | |
156 var _url = null; | 162 var _url = null; |
157 var _queryParams = new core.Map(); | 163 var _queryParams = new core.Map(); |
158 var _uploadMedia = null; | 164 var _uploadMedia = null; |
159 var _uploadOptions = null; | 165 var _uploadOptions = null; |
160 var _downloadOptions = commons.DownloadOptions.Metadata; | 166 var _downloadOptions = commons.DownloadOptions.Metadata; |
161 var _body = null; | 167 var _body = null; |
162 | 168 |
163 if (request != null) { | 169 if (request != null) { |
164 _body = convert.JSON.encode((request).toJson()); | 170 _body = convert.JSON.encode((request).toJson()); |
165 } | 171 } |
166 if (productId == null) { | 172 if (productId == null) { |
167 throw new core.ArgumentError("Parameter productId is required."); | 173 throw new core.ArgumentError("Parameter productId is required."); |
168 } | 174 } |
169 if (skuId == null) { | 175 if (skuId == null) { |
170 throw new core.ArgumentError("Parameter skuId is required."); | 176 throw new core.ArgumentError("Parameter skuId is required."); |
171 } | 177 } |
172 | 178 |
173 _url = commons.Escaper.ecapeVariable('$productId') + '/sku/' + commons.Escap
er.ecapeVariable('$skuId') + '/user'; | 179 _url = commons.Escaper.ecapeVariable('$productId') + |
| 180 '/sku/' + |
| 181 commons.Escaper.ecapeVariable('$skuId') + |
| 182 '/user'; |
174 | 183 |
175 var _response = _requester.request(_url, | 184 var _response = _requester.request(_url, "POST", |
176 "POST", | 185 body: _body, |
177 body: _body, | 186 queryParams: _queryParams, |
178 queryParams: _queryParams, | 187 uploadOptions: _uploadOptions, |
179 uploadOptions: _uploadOptions, | 188 uploadMedia: _uploadMedia, |
180 uploadMedia: _uploadMedia, | 189 downloadOptions: _downloadOptions); |
181 downloadOptions: _downloadOptions); | |
182 return _response.then((data) => new LicenseAssignment.fromJson(data)); | 190 return _response.then((data) => new LicenseAssignment.fromJson(data)); |
183 } | 191 } |
184 | 192 |
185 /** | 193 /// List license assignments for given product of the customer. |
186 * List license assignments for given product of the customer. | 194 /// |
187 * | 195 /// Request parameters: |
188 * Request parameters: | 196 /// |
189 * | 197 /// [productId] - Name for product |
190 * [productId] - Name for product | 198 /// |
191 * | 199 /// [customerId] - CustomerId represents the customer for whom |
192 * [customerId] - CustomerId represents the customer for whom | 200 /// licenseassignments are queried |
193 * licenseassignments are queried | 201 /// |
194 * | 202 /// [maxResults] - Maximum number of campaigns to return at one time. Must be |
195 * [maxResults] - Maximum number of campaigns to return at one time. Must be | 203 /// positive. Optional. Default value is 100. |
196 * positive. Optional. Default value is 100. | 204 /// Value must be between "1" and "1000". |
197 * Value must be between "1" and "1000". | 205 /// |
198 * | 206 /// [pageToken] - Token to fetch the next page.Optional. By default server |
199 * [pageToken] - Token to fetch the next page.Optional. By default server will | 207 /// will return first page |
200 * return first page | 208 /// |
201 * | 209 /// Completes with a [LicenseAssignmentList]. |
202 * Completes with a [LicenseAssignmentList]. | 210 /// |
203 * | 211 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
204 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 212 /// an error. |
205 * error. | 213 /// |
206 * | 214 /// If the used [http.Client] completes with an error when making a REST |
207 * If the used [http.Client] completes with an error when making a REST call, | 215 /// call, this method will complete with the same error. |
208 * this method will complete with the same error. | 216 async.Future<LicenseAssignmentList> listForProduct( |
209 */ | 217 core.String productId, core.String customerId, |
210 async.Future<LicenseAssignmentList> listForProduct(core.String productId, core
.String customerId, {core.int maxResults, core.String pageToken}) { | 218 {core.int maxResults, core.String pageToken}) { |
211 var _url = null; | 219 var _url = null; |
212 var _queryParams = new core.Map(); | 220 var _queryParams = new core.Map(); |
213 var _uploadMedia = null; | 221 var _uploadMedia = null; |
214 var _uploadOptions = null; | 222 var _uploadOptions = null; |
215 var _downloadOptions = commons.DownloadOptions.Metadata; | 223 var _downloadOptions = commons.DownloadOptions.Metadata; |
216 var _body = null; | 224 var _body = null; |
217 | 225 |
218 if (productId == null) { | 226 if (productId == null) { |
219 throw new core.ArgumentError("Parameter productId is required."); | 227 throw new core.ArgumentError("Parameter productId is required."); |
220 } | 228 } |
221 if (customerId == null) { | 229 if (customerId == null) { |
222 throw new core.ArgumentError("Parameter customerId is required."); | 230 throw new core.ArgumentError("Parameter customerId is required."); |
223 } | 231 } |
224 _queryParams["customerId"] = [customerId]; | 232 _queryParams["customerId"] = [customerId]; |
225 if (maxResults != null) { | 233 if (maxResults != null) { |
226 _queryParams["maxResults"] = ["${maxResults}"]; | 234 _queryParams["maxResults"] = ["${maxResults}"]; |
227 } | 235 } |
228 if (pageToken != null) { | 236 if (pageToken != null) { |
229 _queryParams["pageToken"] = [pageToken]; | 237 _queryParams["pageToken"] = [pageToken]; |
230 } | 238 } |
231 | 239 |
232 _url = commons.Escaper.ecapeVariable('$productId') + '/users'; | 240 _url = commons.Escaper.ecapeVariable('$productId') + '/users'; |
233 | 241 |
234 var _response = _requester.request(_url, | 242 var _response = _requester.request(_url, "GET", |
235 "GET", | 243 body: _body, |
236 body: _body, | 244 queryParams: _queryParams, |
237 queryParams: _queryParams, | 245 uploadOptions: _uploadOptions, |
238 uploadOptions: _uploadOptions, | 246 uploadMedia: _uploadMedia, |
239 uploadMedia: _uploadMedia, | 247 downloadOptions: _downloadOptions); |
240 downloadOptions: _downloadOptions); | |
241 return _response.then((data) => new LicenseAssignmentList.fromJson(data)); | 248 return _response.then((data) => new LicenseAssignmentList.fromJson(data)); |
242 } | 249 } |
243 | 250 |
244 /** | 251 /// List license assignments for given product and sku of the customer. |
245 * List license assignments for given product and sku of the customer. | 252 /// |
246 * | 253 /// Request parameters: |
247 * Request parameters: | 254 /// |
248 * | 255 /// [productId] - Name for product |
249 * [productId] - Name for product | 256 /// |
250 * | 257 /// [skuId] - Name for sku |
251 * [skuId] - Name for sku | 258 /// |
252 * | 259 /// [customerId] - CustomerId represents the customer for whom |
253 * [customerId] - CustomerId represents the customer for whom | 260 /// licenseassignments are queried |
254 * licenseassignments are queried | 261 /// |
255 * | 262 /// [maxResults] - Maximum number of campaigns to return at one time. Must be |
256 * [maxResults] - Maximum number of campaigns to return at one time. Must be | 263 /// positive. Optional. Default value is 100. |
257 * positive. Optional. Default value is 100. | 264 /// Value must be between "1" and "1000". |
258 * Value must be between "1" and "1000". | 265 /// |
259 * | 266 /// [pageToken] - Token to fetch the next page.Optional. By default server |
260 * [pageToken] - Token to fetch the next page.Optional. By default server will | 267 /// will return first page |
261 * return first page | 268 /// |
262 * | 269 /// Completes with a [LicenseAssignmentList]. |
263 * Completes with a [LicenseAssignmentList]. | 270 /// |
264 * | 271 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
265 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 272 /// an error. |
266 * error. | 273 /// |
267 * | 274 /// If the used [http.Client] completes with an error when making a REST |
268 * If the used [http.Client] completes with an error when making a REST call, | 275 /// call, this method will complete with the same error. |
269 * this method will complete with the same error. | 276 async.Future<LicenseAssignmentList> listForProductAndSku( |
270 */ | 277 core.String productId, core.String skuId, core.String customerId, |
271 async.Future<LicenseAssignmentList> listForProductAndSku(core.String productId
, core.String skuId, core.String customerId, {core.int maxResults, core.String p
ageToken}) { | 278 {core.int maxResults, core.String pageToken}) { |
272 var _url = null; | 279 var _url = null; |
273 var _queryParams = new core.Map(); | 280 var _queryParams = new core.Map(); |
274 var _uploadMedia = null; | 281 var _uploadMedia = null; |
275 var _uploadOptions = null; | 282 var _uploadOptions = null; |
276 var _downloadOptions = commons.DownloadOptions.Metadata; | 283 var _downloadOptions = commons.DownloadOptions.Metadata; |
277 var _body = null; | 284 var _body = null; |
278 | 285 |
279 if (productId == null) { | 286 if (productId == null) { |
280 throw new core.ArgumentError("Parameter productId is required."); | 287 throw new core.ArgumentError("Parameter productId is required."); |
281 } | 288 } |
282 if (skuId == null) { | 289 if (skuId == null) { |
283 throw new core.ArgumentError("Parameter skuId is required."); | 290 throw new core.ArgumentError("Parameter skuId is required."); |
284 } | 291 } |
285 if (customerId == null) { | 292 if (customerId == null) { |
286 throw new core.ArgumentError("Parameter customerId is required."); | 293 throw new core.ArgumentError("Parameter customerId is required."); |
287 } | 294 } |
288 _queryParams["customerId"] = [customerId]; | 295 _queryParams["customerId"] = [customerId]; |
289 if (maxResults != null) { | 296 if (maxResults != null) { |
290 _queryParams["maxResults"] = ["${maxResults}"]; | 297 _queryParams["maxResults"] = ["${maxResults}"]; |
291 } | 298 } |
292 if (pageToken != null) { | 299 if (pageToken != null) { |
293 _queryParams["pageToken"] = [pageToken]; | 300 _queryParams["pageToken"] = [pageToken]; |
294 } | 301 } |
295 | 302 |
296 _url = commons.Escaper.ecapeVariable('$productId') + '/sku/' + commons.Escap
er.ecapeVariable('$skuId') + '/users'; | 303 _url = commons.Escaper.ecapeVariable('$productId') + |
| 304 '/sku/' + |
| 305 commons.Escaper.ecapeVariable('$skuId') + |
| 306 '/users'; |
297 | 307 |
298 var _response = _requester.request(_url, | 308 var _response = _requester.request(_url, "GET", |
299 "GET", | 309 body: _body, |
300 body: _body, | 310 queryParams: _queryParams, |
301 queryParams: _queryParams, | 311 uploadOptions: _uploadOptions, |
302 uploadOptions: _uploadOptions, | 312 uploadMedia: _uploadMedia, |
303 uploadMedia: _uploadMedia, | 313 downloadOptions: _downloadOptions); |
304 downloadOptions: _downloadOptions); | |
305 return _response.then((data) => new LicenseAssignmentList.fromJson(data)); | 314 return _response.then((data) => new LicenseAssignmentList.fromJson(data)); |
306 } | 315 } |
307 | 316 |
308 /** | 317 /// Assign License. This method supports patch semantics. |
309 * Assign License. This method supports patch semantics. | 318 /// |
310 * | 319 /// [request] - The metadata request object. |
311 * [request] - The metadata request object. | 320 /// |
312 * | 321 /// Request parameters: |
313 * Request parameters: | 322 /// |
314 * | 323 /// [productId] - Name for product |
315 * [productId] - Name for product | 324 /// |
316 * | 325 /// [skuId] - Name for sku for which license would be revoked |
317 * [skuId] - Name for sku for which license would be revoked | 326 /// |
318 * | 327 /// [userId] - email id or unique Id of the user |
319 * [userId] - email id or unique Id of the user | 328 /// |
320 * | 329 /// Completes with a [LicenseAssignment]. |
321 * Completes with a [LicenseAssignment]. | 330 /// |
322 * | 331 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
323 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 332 /// an error. |
324 * error. | 333 /// |
325 * | 334 /// If the used [http.Client] completes with an error when making a REST |
326 * If the used [http.Client] completes with an error when making a REST call, | 335 /// call, this method will complete with the same error. |
327 * this method will complete with the same error. | 336 async.Future<LicenseAssignment> patch(LicenseAssignment request, |
328 */ | 337 core.String productId, core.String skuId, core.String userId) { |
329 async.Future<LicenseAssignment> patch(LicenseAssignment request, core.String p
roductId, core.String skuId, core.String userId) { | |
330 var _url = null; | 338 var _url = null; |
331 var _queryParams = new core.Map(); | 339 var _queryParams = new core.Map(); |
332 var _uploadMedia = null; | 340 var _uploadMedia = null; |
333 var _uploadOptions = null; | 341 var _uploadOptions = null; |
334 var _downloadOptions = commons.DownloadOptions.Metadata; | 342 var _downloadOptions = commons.DownloadOptions.Metadata; |
335 var _body = null; | 343 var _body = null; |
336 | 344 |
337 if (request != null) { | 345 if (request != null) { |
338 _body = convert.JSON.encode((request).toJson()); | 346 _body = convert.JSON.encode((request).toJson()); |
339 } | 347 } |
340 if (productId == null) { | 348 if (productId == null) { |
341 throw new core.ArgumentError("Parameter productId is required."); | 349 throw new core.ArgumentError("Parameter productId is required."); |
342 } | 350 } |
343 if (skuId == null) { | 351 if (skuId == null) { |
344 throw new core.ArgumentError("Parameter skuId is required."); | 352 throw new core.ArgumentError("Parameter skuId is required."); |
345 } | 353 } |
346 if (userId == null) { | 354 if (userId == null) { |
347 throw new core.ArgumentError("Parameter userId is required."); | 355 throw new core.ArgumentError("Parameter userId is required."); |
348 } | 356 } |
349 | 357 |
350 _url = commons.Escaper.ecapeVariable('$productId') + '/sku/' + commons.Escap
er.ecapeVariable('$skuId') + '/user/' + commons.Escaper.ecapeVariable('$userId')
; | 358 _url = commons.Escaper.ecapeVariable('$productId') + |
| 359 '/sku/' + |
| 360 commons.Escaper.ecapeVariable('$skuId') + |
| 361 '/user/' + |
| 362 commons.Escaper.ecapeVariable('$userId'); |
351 | 363 |
352 var _response = _requester.request(_url, | 364 var _response = _requester.request(_url, "PATCH", |
353 "PATCH", | 365 body: _body, |
354 body: _body, | 366 queryParams: _queryParams, |
355 queryParams: _queryParams, | 367 uploadOptions: _uploadOptions, |
356 uploadOptions: _uploadOptions, | 368 uploadMedia: _uploadMedia, |
357 uploadMedia: _uploadMedia, | 369 downloadOptions: _downloadOptions); |
358 downloadOptions: _downloadOptions); | |
359 return _response.then((data) => new LicenseAssignment.fromJson(data)); | 370 return _response.then((data) => new LicenseAssignment.fromJson(data)); |
360 } | 371 } |
361 | 372 |
362 /** | 373 /// Assign License. |
363 * Assign License. | 374 /// |
364 * | 375 /// [request] - The metadata request object. |
365 * [request] - The metadata request object. | 376 /// |
366 * | 377 /// Request parameters: |
367 * Request parameters: | 378 /// |
368 * | 379 /// [productId] - Name for product |
369 * [productId] - Name for product | 380 /// |
370 * | 381 /// [skuId] - Name for sku for which license would be revoked |
371 * [skuId] - Name for sku for which license would be revoked | 382 /// |
372 * | 383 /// [userId] - email id or unique Id of the user |
373 * [userId] - email id or unique Id of the user | 384 /// |
374 * | 385 /// Completes with a [LicenseAssignment]. |
375 * Completes with a [LicenseAssignment]. | 386 /// |
376 * | 387 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
377 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 388 /// an error. |
378 * error. | 389 /// |
379 * | 390 /// If the used [http.Client] completes with an error when making a REST |
380 * If the used [http.Client] completes with an error when making a REST call, | 391 /// call, this method will complete with the same error. |
381 * this method will complete with the same error. | 392 async.Future<LicenseAssignment> update(LicenseAssignment request, |
382 */ | 393 core.String productId, core.String skuId, core.String userId) { |
383 async.Future<LicenseAssignment> update(LicenseAssignment request, core.String
productId, core.String skuId, core.String userId) { | |
384 var _url = null; | 394 var _url = null; |
385 var _queryParams = new core.Map(); | 395 var _queryParams = new core.Map(); |
386 var _uploadMedia = null; | 396 var _uploadMedia = null; |
387 var _uploadOptions = null; | 397 var _uploadOptions = null; |
388 var _downloadOptions = commons.DownloadOptions.Metadata; | 398 var _downloadOptions = commons.DownloadOptions.Metadata; |
389 var _body = null; | 399 var _body = null; |
390 | 400 |
391 if (request != null) { | 401 if (request != null) { |
392 _body = convert.JSON.encode((request).toJson()); | 402 _body = convert.JSON.encode((request).toJson()); |
393 } | 403 } |
394 if (productId == null) { | 404 if (productId == null) { |
395 throw new core.ArgumentError("Parameter productId is required."); | 405 throw new core.ArgumentError("Parameter productId is required."); |
396 } | 406 } |
397 if (skuId == null) { | 407 if (skuId == null) { |
398 throw new core.ArgumentError("Parameter skuId is required."); | 408 throw new core.ArgumentError("Parameter skuId is required."); |
399 } | 409 } |
400 if (userId == null) { | 410 if (userId == null) { |
401 throw new core.ArgumentError("Parameter userId is required."); | 411 throw new core.ArgumentError("Parameter userId is required."); |
402 } | 412 } |
403 | 413 |
404 _url = commons.Escaper.ecapeVariable('$productId') + '/sku/' + commons.Escap
er.ecapeVariable('$skuId') + '/user/' + commons.Escaper.ecapeVariable('$userId')
; | 414 _url = commons.Escaper.ecapeVariable('$productId') + |
| 415 '/sku/' + |
| 416 commons.Escaper.ecapeVariable('$skuId') + |
| 417 '/user/' + |
| 418 commons.Escaper.ecapeVariable('$userId'); |
405 | 419 |
406 var _response = _requester.request(_url, | 420 var _response = _requester.request(_url, "PUT", |
407 "PUT", | 421 body: _body, |
408 body: _body, | 422 queryParams: _queryParams, |
409 queryParams: _queryParams, | 423 uploadOptions: _uploadOptions, |
410 uploadOptions: _uploadOptions, | 424 uploadMedia: _uploadMedia, |
411 uploadMedia: _uploadMedia, | 425 downloadOptions: _downloadOptions); |
412 downloadOptions: _downloadOptions); | |
413 return _response.then((data) => new LicenseAssignment.fromJson(data)); | 426 return _response.then((data) => new LicenseAssignment.fromJson(data)); |
414 } | 427 } |
415 | |
416 } | 428 } |
417 | 429 |
| 430 /// Template for LiscenseAssignment Resource |
| 431 class LicenseAssignment { |
| 432 /// ETag of the resource. |
| 433 core.String etags; |
418 | 434 |
| 435 /// Identifies the resource as a LicenseAssignment. |
| 436 core.String kind; |
419 | 437 |
420 /** Template for LiscenseAssignment Resource */ | 438 /// Id of the product. |
421 class LicenseAssignment { | |
422 /** ETag of the resource. */ | |
423 core.String etags; | |
424 /** Identifies the resource as a LicenseAssignment. */ | |
425 core.String kind; | |
426 /** Id of the product. */ | |
427 core.String productId; | 439 core.String productId; |
428 /** Display Name of the product. */ | 440 |
| 441 /// Display Name of the product. |
429 core.String productName; | 442 core.String productName; |
430 /** Link to this page. */ | 443 |
| 444 /// Link to this page. |
431 core.String selfLink; | 445 core.String selfLink; |
432 /** Id of the sku of the product. */ | 446 |
| 447 /// Id of the sku of the product. |
433 core.String skuId; | 448 core.String skuId; |
434 /** Display Name of the sku of the product. */ | 449 |
| 450 /// Display Name of the sku of the product. |
435 core.String skuName; | 451 core.String skuName; |
436 /** Email id of the user. */ | 452 |
| 453 /// Email id of the user. |
437 core.String userId; | 454 core.String userId; |
438 | 455 |
439 LicenseAssignment(); | 456 LicenseAssignment(); |
440 | 457 |
441 LicenseAssignment.fromJson(core.Map _json) { | 458 LicenseAssignment.fromJson(core.Map _json) { |
442 if (_json.containsKey("etags")) { | 459 if (_json.containsKey("etags")) { |
443 etags = _json["etags"]; | 460 etags = _json["etags"]; |
444 } | 461 } |
445 if (_json.containsKey("kind")) { | 462 if (_json.containsKey("kind")) { |
446 kind = _json["kind"]; | 463 kind = _json["kind"]; |
(...skipping 12 matching lines...) Expand all Loading... |
459 } | 476 } |
460 if (_json.containsKey("skuName")) { | 477 if (_json.containsKey("skuName")) { |
461 skuName = _json["skuName"]; | 478 skuName = _json["skuName"]; |
462 } | 479 } |
463 if (_json.containsKey("userId")) { | 480 if (_json.containsKey("userId")) { |
464 userId = _json["userId"]; | 481 userId = _json["userId"]; |
465 } | 482 } |
466 } | 483 } |
467 | 484 |
468 core.Map<core.String, core.Object> toJson() { | 485 core.Map<core.String, core.Object> toJson() { |
469 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 486 final core.Map<core.String, core.Object> _json = |
| 487 new core.Map<core.String, core.Object>(); |
470 if (etags != null) { | 488 if (etags != null) { |
471 _json["etags"] = etags; | 489 _json["etags"] = etags; |
472 } | 490 } |
473 if (kind != null) { | 491 if (kind != null) { |
474 _json["kind"] = kind; | 492 _json["kind"] = kind; |
475 } | 493 } |
476 if (productId != null) { | 494 if (productId != null) { |
477 _json["productId"] = productId; | 495 _json["productId"] = productId; |
478 } | 496 } |
479 if (productName != null) { | 497 if (productName != null) { |
480 _json["productName"] = productName; | 498 _json["productName"] = productName; |
481 } | 499 } |
482 if (selfLink != null) { | 500 if (selfLink != null) { |
483 _json["selfLink"] = selfLink; | 501 _json["selfLink"] = selfLink; |
484 } | 502 } |
485 if (skuId != null) { | 503 if (skuId != null) { |
486 _json["skuId"] = skuId; | 504 _json["skuId"] = skuId; |
487 } | 505 } |
488 if (skuName != null) { | 506 if (skuName != null) { |
489 _json["skuName"] = skuName; | 507 _json["skuName"] = skuName; |
490 } | 508 } |
491 if (userId != null) { | 509 if (userId != null) { |
492 _json["userId"] = userId; | 510 _json["userId"] = userId; |
493 } | 511 } |
494 return _json; | 512 return _json; |
495 } | 513 } |
496 } | 514 } |
497 | 515 |
498 /** Template for LicenseAssignment Insert request */ | 516 /// Template for LicenseAssignment Insert request |
499 class LicenseAssignmentInsert { | 517 class LicenseAssignmentInsert { |
500 /** Email id of the user */ | 518 /// Email id of the user |
501 core.String userId; | 519 core.String userId; |
502 | 520 |
503 LicenseAssignmentInsert(); | 521 LicenseAssignmentInsert(); |
504 | 522 |
505 LicenseAssignmentInsert.fromJson(core.Map _json) { | 523 LicenseAssignmentInsert.fromJson(core.Map _json) { |
506 if (_json.containsKey("userId")) { | 524 if (_json.containsKey("userId")) { |
507 userId = _json["userId"]; | 525 userId = _json["userId"]; |
508 } | 526 } |
509 } | 527 } |
510 | 528 |
511 core.Map<core.String, core.Object> toJson() { | 529 core.Map<core.String, core.Object> toJson() { |
512 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 530 final core.Map<core.String, core.Object> _json = |
| 531 new core.Map<core.String, core.Object>(); |
513 if (userId != null) { | 532 if (userId != null) { |
514 _json["userId"] = userId; | 533 _json["userId"] = userId; |
515 } | 534 } |
516 return _json; | 535 return _json; |
517 } | 536 } |
518 } | 537 } |
519 | 538 |
520 /** LicesnseAssignment List for a given product/sku for a customer. */ | 539 /// LicesnseAssignment List for a given product/sku for a customer. |
521 class LicenseAssignmentList { | 540 class LicenseAssignmentList { |
522 /** ETag of the resource. */ | 541 /// ETag of the resource. |
523 core.String etag; | 542 core.String etag; |
524 /** The LicenseAssignments in this page of results. */ | 543 |
| 544 /// The LicenseAssignments in this page of results. |
525 core.List<LicenseAssignment> items; | 545 core.List<LicenseAssignment> items; |
526 /** Identifies the resource as a collection of LicenseAssignments. */ | 546 |
| 547 /// Identifies the resource as a collection of LicenseAssignments. |
527 core.String kind; | 548 core.String kind; |
528 /** | 549 |
529 * The continuation token, used to page through large result sets. Provide | 550 /// The continuation token, used to page through large result sets. Provide |
530 * this value in a subsequent request to return the next page of results. | 551 /// this value in a subsequent request to return the next page of results. |
531 */ | |
532 core.String nextPageToken; | 552 core.String nextPageToken; |
533 | 553 |
534 LicenseAssignmentList(); | 554 LicenseAssignmentList(); |
535 | 555 |
536 LicenseAssignmentList.fromJson(core.Map _json) { | 556 LicenseAssignmentList.fromJson(core.Map _json) { |
537 if (_json.containsKey("etag")) { | 557 if (_json.containsKey("etag")) { |
538 etag = _json["etag"]; | 558 etag = _json["etag"]; |
539 } | 559 } |
540 if (_json.containsKey("items")) { | 560 if (_json.containsKey("items")) { |
541 items = _json["items"].map((value) => new LicenseAssignment.fromJson(value
)).toList(); | 561 items = _json["items"] |
| 562 .map((value) => new LicenseAssignment.fromJson(value)) |
| 563 .toList(); |
542 } | 564 } |
543 if (_json.containsKey("kind")) { | 565 if (_json.containsKey("kind")) { |
544 kind = _json["kind"]; | 566 kind = _json["kind"]; |
545 } | 567 } |
546 if (_json.containsKey("nextPageToken")) { | 568 if (_json.containsKey("nextPageToken")) { |
547 nextPageToken = _json["nextPageToken"]; | 569 nextPageToken = _json["nextPageToken"]; |
548 } | 570 } |
549 } | 571 } |
550 | 572 |
551 core.Map<core.String, core.Object> toJson() { | 573 core.Map<core.String, core.Object> toJson() { |
552 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 574 final core.Map<core.String, core.Object> _json = |
| 575 new core.Map<core.String, core.Object>(); |
553 if (etag != null) { | 576 if (etag != null) { |
554 _json["etag"] = etag; | 577 _json["etag"] = etag; |
555 } | 578 } |
556 if (items != null) { | 579 if (items != null) { |
557 _json["items"] = items.map((value) => (value).toJson()).toList(); | 580 _json["items"] = items.map((value) => (value).toJson()).toList(); |
558 } | 581 } |
559 if (kind != null) { | 582 if (kind != null) { |
560 _json["kind"] = kind; | 583 _json["kind"] = kind; |
561 } | 584 } |
562 if (nextPageToken != null) { | 585 if (nextPageToken != null) { |
563 _json["nextPageToken"] = nextPageToken; | 586 _json["nextPageToken"] = nextPageToken; |
564 } | 587 } |
565 return _json; | 588 return _json; |
566 } | 589 } |
567 } | 590 } |
OLD | NEW |