Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: generated/googleapis/lib/reseller/v1.dart

Issue 559053002: Generate 0.1.0 version of googleapis/googleapis_beta (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library googleapis.reseller.v1;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async;
6 import "dart:convert" as convert;
7
8 import "package:crypto/crypto.dart" as crypto;
9 import 'package:http/http.dart' as http;
10 import '../src/common_internal.dart' as common_internal;
11 import '../common/common.dart' as common;
12
13 export '../common/common.dart' show ApiRequestError;
14 export '../common/common.dart' show DetailedApiRequestError;
15
16 /** Lets you create and manage your customers and their subscriptions. */
17 class ResellerApi {
18 /** Manage users on your domain */
19 static const AppsOrderScope = "https://www.googleapis.com/auth/apps.order";
20
21 /** Manage users on your domain */
22 static const AppsOrderReadonlyScope = "https://www.googleapis.com/auth/apps.or der.readonly";
23
24
25 final common_internal.ApiRequester _requester;
26
27 CustomersResourceApi get customers => new CustomersResourceApi(_requester);
28 SubscriptionsResourceApi get subscriptions => new SubscriptionsResourceApi(_re quester);
29
30 ResellerApi(http.Client client) :
31 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/apps/reseller/v1/");
32 }
33
34
35 /** Not documented yet. */
36 class CustomersResourceApi {
37 final common_internal.ApiRequester _requester;
38
39 CustomersResourceApi(common_internal.ApiRequester client) :
40 _requester = client;
41
42 /**
43 * Gets a customer resource if one exists and is owned by the reseller.
44 *
45 * Request parameters:
46 *
47 * [customerId] - Id of the Customer
48 *
49 * Completes with a [Customer].
50 *
51 * Completes with a [common.ApiRequestError] if the API endpoint returned an
52 * error.
53 *
54 * If the used [http.Client] completes with an error when making a REST call,
55 * this method will complete with the same error.
56 */
57 async.Future<Customer> get(core.String customerId) {
58 var _url = null;
59 var _queryParams = new core.Map();
60 var _uploadMedia = null;
61 var _uploadOptions = null;
62 var _downloadOptions = common.DownloadOptions.Metadata;
63 var _body = null;
64
65 if (customerId == null) {
66 throw new core.ArgumentError("Parameter customerId is required.");
67 }
68
69
70 _url = 'customers/' + common_internal.Escaper.ecapeVariable('$customerId');
71
72 var _response = _requester.request(_url,
73 "GET",
74 body: _body,
75 queryParams: _queryParams,
76 uploadOptions: _uploadOptions,
77 uploadMedia: _uploadMedia,
78 downloadOptions: _downloadOptions);
79 return _response.then((data) => new Customer.fromJson(data));
80 }
81
82 /**
83 * Creates a customer resource if one does not already exist.
84 *
85 * [request] - The metadata request object.
86 *
87 * Request parameters:
88 *
89 * [customerAuthToken] - An auth token needed for inserting a customer for
90 * which domain already exists. Can be generated at
91 * https://www.google.com/a/cpanel//TransferToken. Optional.
92 *
93 * Completes with a [Customer].
94 *
95 * Completes with a [common.ApiRequestError] if the API endpoint returned an
96 * error.
97 *
98 * If the used [http.Client] completes with an error when making a REST call,
99 * this method will complete with the same error.
100 */
101 async.Future<Customer> insert(Customer request, {core.String customerAuthToken }) {
102 var _url = null;
103 var _queryParams = new core.Map();
104 var _uploadMedia = null;
105 var _uploadOptions = null;
106 var _downloadOptions = common.DownloadOptions.Metadata;
107 var _body = null;
108
109 if (request != null) {
110 _body = convert.JSON.encode((request).toJson());
111 }
112 if (customerAuthToken != null) {
113 _queryParams["customerAuthToken"] = [customerAuthToken];
114 }
115
116
117 _url = 'customers';
118
119 var _response = _requester.request(_url,
120 "POST",
121 body: _body,
122 queryParams: _queryParams,
123 uploadOptions: _uploadOptions,
124 uploadMedia: _uploadMedia,
125 downloadOptions: _downloadOptions);
126 return _response.then((data) => new Customer.fromJson(data));
127 }
128
129 /**
130 * Update a customer resource if one it exists and is owned by the reseller.
131 * This method supports patch semantics.
132 *
133 * [request] - The metadata request object.
134 *
135 * Request parameters:
136 *
137 * [customerId] - Id of the Customer
138 *
139 * Completes with a [Customer].
140 *
141 * Completes with a [common.ApiRequestError] if the API endpoint returned an
142 * error.
143 *
144 * If the used [http.Client] completes with an error when making a REST call,
145 * this method will complete with the same error.
146 */
147 async.Future<Customer> patch(Customer request, core.String customerId) {
148 var _url = null;
149 var _queryParams = new core.Map();
150 var _uploadMedia = null;
151 var _uploadOptions = null;
152 var _downloadOptions = common.DownloadOptions.Metadata;
153 var _body = null;
154
155 if (request != null) {
156 _body = convert.JSON.encode((request).toJson());
157 }
158 if (customerId == null) {
159 throw new core.ArgumentError("Parameter customerId is required.");
160 }
161
162
163 _url = 'customers/' + common_internal.Escaper.ecapeVariable('$customerId');
164
165 var _response = _requester.request(_url,
166 "PATCH",
167 body: _body,
168 queryParams: _queryParams,
169 uploadOptions: _uploadOptions,
170 uploadMedia: _uploadMedia,
171 downloadOptions: _downloadOptions);
172 return _response.then((data) => new Customer.fromJson(data));
173 }
174
175 /**
176 * Update a customer resource if one it exists and is owned by the reseller.
177 *
178 * [request] - The metadata request object.
179 *
180 * Request parameters:
181 *
182 * [customerId] - Id of the Customer
183 *
184 * Completes with a [Customer].
185 *
186 * Completes with a [common.ApiRequestError] if the API endpoint returned an
187 * error.
188 *
189 * If the used [http.Client] completes with an error when making a REST call,
190 * this method will complete with the same error.
191 */
192 async.Future<Customer> update(Customer request, core.String customerId) {
193 var _url = null;
194 var _queryParams = new core.Map();
195 var _uploadMedia = null;
196 var _uploadOptions = null;
197 var _downloadOptions = common.DownloadOptions.Metadata;
198 var _body = null;
199
200 if (request != null) {
201 _body = convert.JSON.encode((request).toJson());
202 }
203 if (customerId == null) {
204 throw new core.ArgumentError("Parameter customerId is required.");
205 }
206
207
208 _url = 'customers/' + common_internal.Escaper.ecapeVariable('$customerId');
209
210 var _response = _requester.request(_url,
211 "PUT",
212 body: _body,
213 queryParams: _queryParams,
214 uploadOptions: _uploadOptions,
215 uploadMedia: _uploadMedia,
216 downloadOptions: _downloadOptions);
217 return _response.then((data) => new Customer.fromJson(data));
218 }
219
220 }
221
222
223 /** Not documented yet. */
224 class SubscriptionsResourceApi {
225 final common_internal.ApiRequester _requester;
226
227 SubscriptionsResourceApi(common_internal.ApiRequester client) :
228 _requester = client;
229
230 /**
231 * Changes the plan of a subscription
232 *
233 * [request] - The metadata request object.
234 *
235 * Request parameters:
236 *
237 * [customerId] - Id of the Customer
238 *
239 * [subscriptionId] - Id of the subscription, which is unique for a customer
240 *
241 * Completes with a [Subscription].
242 *
243 * Completes with a [common.ApiRequestError] if the API endpoint returned an
244 * error.
245 *
246 * If the used [http.Client] completes with an error when making a REST call,
247 * this method will complete with the same error.
248 */
249 async.Future<Subscription> changePlan(ChangePlanRequest request, core.String c ustomerId, core.String subscriptionId) {
250 var _url = null;
251 var _queryParams = new core.Map();
252 var _uploadMedia = null;
253 var _uploadOptions = null;
254 var _downloadOptions = common.DownloadOptions.Metadata;
255 var _body = null;
256
257 if (request != null) {
258 _body = convert.JSON.encode((request).toJson());
259 }
260 if (customerId == null) {
261 throw new core.ArgumentError("Parameter customerId is required.");
262 }
263 if (subscriptionId == null) {
264 throw new core.ArgumentError("Parameter subscriptionId is required.");
265 }
266
267
268 _url = 'customers/' + common_internal.Escaper.ecapeVariable('$customerId') + '/subscriptions/' + common_internal.Escaper.ecapeVariable('$subscriptionId') + '/changePlan';
269
270 var _response = _requester.request(_url,
271 "POST",
272 body: _body,
273 queryParams: _queryParams,
274 uploadOptions: _uploadOptions,
275 uploadMedia: _uploadMedia,
276 downloadOptions: _downloadOptions);
277 return _response.then((data) => new Subscription.fromJson(data));
278 }
279
280 /**
281 * Changes the renewal settings of a subscription
282 *
283 * [request] - The metadata request object.
284 *
285 * Request parameters:
286 *
287 * [customerId] - Id of the Customer
288 *
289 * [subscriptionId] - Id of the subscription, which is unique for a customer
290 *
291 * Completes with a [Subscription].
292 *
293 * Completes with a [common.ApiRequestError] if the API endpoint returned an
294 * error.
295 *
296 * If the used [http.Client] completes with an error when making a REST call,
297 * this method will complete with the same error.
298 */
299 async.Future<Subscription> changeRenewalSettings(RenewalSettings request, core .String customerId, core.String subscriptionId) {
300 var _url = null;
301 var _queryParams = new core.Map();
302 var _uploadMedia = null;
303 var _uploadOptions = null;
304 var _downloadOptions = common.DownloadOptions.Metadata;
305 var _body = null;
306
307 if (request != null) {
308 _body = convert.JSON.encode((request).toJson());
309 }
310 if (customerId == null) {
311 throw new core.ArgumentError("Parameter customerId is required.");
312 }
313 if (subscriptionId == null) {
314 throw new core.ArgumentError("Parameter subscriptionId is required.");
315 }
316
317
318 _url = 'customers/' + common_internal.Escaper.ecapeVariable('$customerId') + '/subscriptions/' + common_internal.Escaper.ecapeVariable('$subscriptionId') + '/changeRenewalSettings';
319
320 var _response = _requester.request(_url,
321 "POST",
322 body: _body,
323 queryParams: _queryParams,
324 uploadOptions: _uploadOptions,
325 uploadMedia: _uploadMedia,
326 downloadOptions: _downloadOptions);
327 return _response.then((data) => new Subscription.fromJson(data));
328 }
329
330 /**
331 * Changes the seats configuration of a subscription
332 *
333 * [request] - The metadata request object.
334 *
335 * Request parameters:
336 *
337 * [customerId] - Id of the Customer
338 *
339 * [subscriptionId] - Id of the subscription, which is unique for a customer
340 *
341 * Completes with a [Subscription].
342 *
343 * Completes with a [common.ApiRequestError] if the API endpoint returned an
344 * error.
345 *
346 * If the used [http.Client] completes with an error when making a REST call,
347 * this method will complete with the same error.
348 */
349 async.Future<Subscription> changeSeats(Seats request, core.String customerId, core.String subscriptionId) {
350 var _url = null;
351 var _queryParams = new core.Map();
352 var _uploadMedia = null;
353 var _uploadOptions = null;
354 var _downloadOptions = common.DownloadOptions.Metadata;
355 var _body = null;
356
357 if (request != null) {
358 _body = convert.JSON.encode((request).toJson());
359 }
360 if (customerId == null) {
361 throw new core.ArgumentError("Parameter customerId is required.");
362 }
363 if (subscriptionId == null) {
364 throw new core.ArgumentError("Parameter subscriptionId is required.");
365 }
366
367
368 _url = 'customers/' + common_internal.Escaper.ecapeVariable('$customerId') + '/subscriptions/' + common_internal.Escaper.ecapeVariable('$subscriptionId') + '/changeSeats';
369
370 var _response = _requester.request(_url,
371 "POST",
372 body: _body,
373 queryParams: _queryParams,
374 uploadOptions: _uploadOptions,
375 uploadMedia: _uploadMedia,
376 downloadOptions: _downloadOptions);
377 return _response.then((data) => new Subscription.fromJson(data));
378 }
379
380 /**
381 * Cancels/Downgrades a subscription.
382 *
383 * Request parameters:
384 *
385 * [customerId] - Id of the Customer
386 *
387 * [subscriptionId] - Id of the subscription, which is unique for a customer
388 *
389 * [deletionType] - Whether the subscription is to be fully cancelled or
390 * downgraded
391 * Possible string values are:
392 * - "cancel" : Cancels the subscription immediately
393 * - "downgrade" : Downgrades a Google Apps for Business subscription to
394 * Google Apps
395 * - "suspend" : Suspends the subscriptions for 4 days before cancelling it
396 *
397 * Completes with a [common.ApiRequestError] if the API endpoint returned an
398 * error.
399 *
400 * If the used [http.Client] completes with an error when making a REST call,
401 * this method will complete with the same error.
402 */
403 async.Future delete(core.String customerId, core.String subscriptionId, core.S tring deletionType) {
404 var _url = null;
405 var _queryParams = new core.Map();
406 var _uploadMedia = null;
407 var _uploadOptions = null;
408 var _downloadOptions = common.DownloadOptions.Metadata;
409 var _body = null;
410
411 if (customerId == null) {
412 throw new core.ArgumentError("Parameter customerId is required.");
413 }
414 if (subscriptionId == null) {
415 throw new core.ArgumentError("Parameter subscriptionId is required.");
416 }
417 if (deletionType == null) {
418 throw new core.ArgumentError("Parameter deletionType is required.");
419 }
420 _queryParams["deletionType"] = [deletionType];
421
422 _downloadOptions = null;
423
424 _url = 'customers/' + common_internal.Escaper.ecapeVariable('$customerId') + '/subscriptions/' + common_internal.Escaper.ecapeVariable('$subscriptionId');
425
426 var _response = _requester.request(_url,
427 "DELETE",
428 body: _body,
429 queryParams: _queryParams,
430 uploadOptions: _uploadOptions,
431 uploadMedia: _uploadMedia,
432 downloadOptions: _downloadOptions);
433 return _response.then((data) => null);
434 }
435
436 /**
437 * Gets a subscription of the customer.
438 *
439 * Request parameters:
440 *
441 * [customerId] - Id of the Customer
442 *
443 * [subscriptionId] - Id of the subscription, which is unique for a customer
444 *
445 * Completes with a [Subscription].
446 *
447 * Completes with a [common.ApiRequestError] if the API endpoint returned an
448 * error.
449 *
450 * If the used [http.Client] completes with an error when making a REST call,
451 * this method will complete with the same error.
452 */
453 async.Future<Subscription> get(core.String customerId, core.String subscriptio nId) {
454 var _url = null;
455 var _queryParams = new core.Map();
456 var _uploadMedia = null;
457 var _uploadOptions = null;
458 var _downloadOptions = common.DownloadOptions.Metadata;
459 var _body = null;
460
461 if (customerId == null) {
462 throw new core.ArgumentError("Parameter customerId is required.");
463 }
464 if (subscriptionId == null) {
465 throw new core.ArgumentError("Parameter subscriptionId is required.");
466 }
467
468
469 _url = 'customers/' + common_internal.Escaper.ecapeVariable('$customerId') + '/subscriptions/' + common_internal.Escaper.ecapeVariable('$subscriptionId');
470
471 var _response = _requester.request(_url,
472 "GET",
473 body: _body,
474 queryParams: _queryParams,
475 uploadOptions: _uploadOptions,
476 uploadMedia: _uploadMedia,
477 downloadOptions: _downloadOptions);
478 return _response.then((data) => new Subscription.fromJson(data));
479 }
480
481 /**
482 * Creates/Transfers a subscription for the customer.
483 *
484 * [request] - The metadata request object.
485 *
486 * Request parameters:
487 *
488 * [customerId] - Id of the Customer
489 *
490 * [customerAuthToken] - An auth token needed for transferring a subscription.
491 * Can be generated at
492 * https://www.google.com/a/cpanel/customer-domain/TransferToken. Optional.
493 *
494 * Completes with a [Subscription].
495 *
496 * Completes with a [common.ApiRequestError] if the API endpoint returned an
497 * error.
498 *
499 * If the used [http.Client] completes with an error when making a REST call,
500 * this method will complete with the same error.
501 */
502 async.Future<Subscription> insert(Subscription request, core.String customerId , {core.String customerAuthToken}) {
503 var _url = null;
504 var _queryParams = new core.Map();
505 var _uploadMedia = null;
506 var _uploadOptions = null;
507 var _downloadOptions = common.DownloadOptions.Metadata;
508 var _body = null;
509
510 if (request != null) {
511 _body = convert.JSON.encode((request).toJson());
512 }
513 if (customerId == null) {
514 throw new core.ArgumentError("Parameter customerId is required.");
515 }
516 if (customerAuthToken != null) {
517 _queryParams["customerAuthToken"] = [customerAuthToken];
518 }
519
520
521 _url = 'customers/' + common_internal.Escaper.ecapeVariable('$customerId') + '/subscriptions';
522
523 var _response = _requester.request(_url,
524 "POST",
525 body: _body,
526 queryParams: _queryParams,
527 uploadOptions: _uploadOptions,
528 uploadMedia: _uploadMedia,
529 downloadOptions: _downloadOptions);
530 return _response.then((data) => new Subscription.fromJson(data));
531 }
532
533 /**
534 * Lists subscriptions of a reseller, optionally filtered by a customer name
535 * prefix.
536 *
537 * Request parameters:
538 *
539 * [customerAuthToken] - An auth token needed if the customer is not a resold
540 * customer of this reseller. Can be generated at
541 * https://www.google.com/a/cpanel/customer-domain/TransferToken.Optional.
542 *
543 * [customerId] - Id of the Customer
544 *
545 * [customerNamePrefix] - Prefix of the customer's domain name by which the
546 * subscriptions should be filtered. Optional
547 *
548 * [maxResults] - Maximum number of results to return
549 * Value must be between "1" and "100".
550 *
551 * [pageToken] - Token to specify next page in the list
552 *
553 * Completes with a [Subscriptions].
554 *
555 * Completes with a [common.ApiRequestError] if the API endpoint returned an
556 * error.
557 *
558 * If the used [http.Client] completes with an error when making a REST call,
559 * this method will complete with the same error.
560 */
561 async.Future<Subscriptions> list({core.String customerAuthToken, core.String c ustomerId, core.String customerNamePrefix, core.int maxResults, core.String page Token}) {
562 var _url = null;
563 var _queryParams = new core.Map();
564 var _uploadMedia = null;
565 var _uploadOptions = null;
566 var _downloadOptions = common.DownloadOptions.Metadata;
567 var _body = null;
568
569 if (customerAuthToken != null) {
570 _queryParams["customerAuthToken"] = [customerAuthToken];
571 }
572 if (customerId != null) {
573 _queryParams["customerId"] = [customerId];
574 }
575 if (customerNamePrefix != null) {
576 _queryParams["customerNamePrefix"] = [customerNamePrefix];
577 }
578 if (maxResults != null) {
579 _queryParams["maxResults"] = ["${maxResults}"];
580 }
581 if (pageToken != null) {
582 _queryParams["pageToken"] = [pageToken];
583 }
584
585
586 _url = 'subscriptions';
587
588 var _response = _requester.request(_url,
589 "GET",
590 body: _body,
591 queryParams: _queryParams,
592 uploadOptions: _uploadOptions,
593 uploadMedia: _uploadMedia,
594 downloadOptions: _downloadOptions);
595 return _response.then((data) => new Subscriptions.fromJson(data));
596 }
597
598 /**
599 * Starts paid service of a trial subscription
600 *
601 * Request parameters:
602 *
603 * [customerId] - Id of the Customer
604 *
605 * [subscriptionId] - Id of the subscription, which is unique for a customer
606 *
607 * Completes with a [Subscription].
608 *
609 * Completes with a [common.ApiRequestError] if the API endpoint returned an
610 * error.
611 *
612 * If the used [http.Client] completes with an error when making a REST call,
613 * this method will complete with the same error.
614 */
615 async.Future<Subscription> startPaidService(core.String customerId, core.Strin g subscriptionId) {
616 var _url = null;
617 var _queryParams = new core.Map();
618 var _uploadMedia = null;
619 var _uploadOptions = null;
620 var _downloadOptions = common.DownloadOptions.Metadata;
621 var _body = null;
622
623 if (customerId == null) {
624 throw new core.ArgumentError("Parameter customerId is required.");
625 }
626 if (subscriptionId == null) {
627 throw new core.ArgumentError("Parameter subscriptionId is required.");
628 }
629
630
631 _url = 'customers/' + common_internal.Escaper.ecapeVariable('$customerId') + '/subscriptions/' + common_internal.Escaper.ecapeVariable('$subscriptionId') + '/startPaidService';
632
633 var _response = _requester.request(_url,
634 "POST",
635 body: _body,
636 queryParams: _queryParams,
637 uploadOptions: _uploadOptions,
638 uploadMedia: _uploadMedia,
639 downloadOptions: _downloadOptions);
640 return _response.then((data) => new Subscription.fromJson(data));
641 }
642
643 }
644
645
646
647 /** JSON template for address of a customer. */
648 class Address {
649 /** Address line 1 of the address. */
650 core.String addressLine1;
651
652 /** Address line 2 of the address. */
653 core.String addressLine2;
654
655 /** Address line 3 of the address. */
656 core.String addressLine3;
657
658 /** Name of the contact person. */
659 core.String contactName;
660
661 /** ISO 3166 country code. */
662 core.String countryCode;
663
664 /** Identifies the resource as a customer address. */
665 core.String kind;
666
667 /**
668 * Name of the locality. This is in accordance with -
669 * http://portablecontacts.net/draft-spec.html#address_element.
670 */
671 core.String locality;
672
673 /** Name of the organization. */
674 core.String organizationName;
675
676 /**
677 * The postal code. This is in accordance with -
678 * http://portablecontacts.net/draft-spec.html#address_element.
679 */
680 core.String postalCode;
681
682 /**
683 * Name of the region. This is in accordance with -
684 * http://portablecontacts.net/draft-spec.html#address_element.
685 */
686 core.String region;
687
688
689 Address();
690
691 Address.fromJson(core.Map _json) {
692 if (_json.containsKey("addressLine1")) {
693 addressLine1 = _json["addressLine1"];
694 }
695 if (_json.containsKey("addressLine2")) {
696 addressLine2 = _json["addressLine2"];
697 }
698 if (_json.containsKey("addressLine3")) {
699 addressLine3 = _json["addressLine3"];
700 }
701 if (_json.containsKey("contactName")) {
702 contactName = _json["contactName"];
703 }
704 if (_json.containsKey("countryCode")) {
705 countryCode = _json["countryCode"];
706 }
707 if (_json.containsKey("kind")) {
708 kind = _json["kind"];
709 }
710 if (_json.containsKey("locality")) {
711 locality = _json["locality"];
712 }
713 if (_json.containsKey("organizationName")) {
714 organizationName = _json["organizationName"];
715 }
716 if (_json.containsKey("postalCode")) {
717 postalCode = _json["postalCode"];
718 }
719 if (_json.containsKey("region")) {
720 region = _json["region"];
721 }
722 }
723
724 core.Map toJson() {
725 var _json = new core.Map();
726 if (addressLine1 != null) {
727 _json["addressLine1"] = addressLine1;
728 }
729 if (addressLine2 != null) {
730 _json["addressLine2"] = addressLine2;
731 }
732 if (addressLine3 != null) {
733 _json["addressLine3"] = addressLine3;
734 }
735 if (contactName != null) {
736 _json["contactName"] = contactName;
737 }
738 if (countryCode != null) {
739 _json["countryCode"] = countryCode;
740 }
741 if (kind != null) {
742 _json["kind"] = kind;
743 }
744 if (locality != null) {
745 _json["locality"] = locality;
746 }
747 if (organizationName != null) {
748 _json["organizationName"] = organizationName;
749 }
750 if (postalCode != null) {
751 _json["postalCode"] = postalCode;
752 }
753 if (region != null) {
754 _json["region"] = region;
755 }
756 return _json;
757 }
758 }
759
760
761 /** JSON template for the ChangePlan rpc request. */
762 class ChangePlanRequest {
763 /** Identifies the resource as a subscription change plan request. */
764 core.String kind;
765
766 /** Name of the plan to change to. */
767 core.String planName;
768
769 /** Purchase order id for your order tracking purposes. */
770 core.String purchaseOrderId;
771
772 /** Number/Limit of seats in the new plan. */
773 Seats seats;
774
775
776 ChangePlanRequest();
777
778 ChangePlanRequest.fromJson(core.Map _json) {
779 if (_json.containsKey("kind")) {
780 kind = _json["kind"];
781 }
782 if (_json.containsKey("planName")) {
783 planName = _json["planName"];
784 }
785 if (_json.containsKey("purchaseOrderId")) {
786 purchaseOrderId = _json["purchaseOrderId"];
787 }
788 if (_json.containsKey("seats")) {
789 seats = new Seats.fromJson(_json["seats"]);
790 }
791 }
792
793 core.Map toJson() {
794 var _json = new core.Map();
795 if (kind != null) {
796 _json["kind"] = kind;
797 }
798 if (planName != null) {
799 _json["planName"] = planName;
800 }
801 if (purchaseOrderId != null) {
802 _json["purchaseOrderId"] = purchaseOrderId;
803 }
804 if (seats != null) {
805 _json["seats"] = (seats).toJson();
806 }
807 return _json;
808 }
809 }
810
811
812 /** JSON template for a customer. */
813 class Customer {
814 /** The alternate email of the customer. */
815 core.String alternateEmail;
816
817 /** The domain name of the customer. */
818 core.String customerDomain;
819
820 /** The id of the customer. */
821 core.String customerId;
822
823 /** Identifies the resource as a customer. */
824 core.String kind;
825
826 /** The phone number of the customer. */
827 core.String phoneNumber;
828
829 /** The postal address of the customer. */
830 Address postalAddress;
831
832 /** Ui url for customer resource. */
833 core.String resourceUiUrl;
834
835
836 Customer();
837
838 Customer.fromJson(core.Map _json) {
839 if (_json.containsKey("alternateEmail")) {
840 alternateEmail = _json["alternateEmail"];
841 }
842 if (_json.containsKey("customerDomain")) {
843 customerDomain = _json["customerDomain"];
844 }
845 if (_json.containsKey("customerId")) {
846 customerId = _json["customerId"];
847 }
848 if (_json.containsKey("kind")) {
849 kind = _json["kind"];
850 }
851 if (_json.containsKey("phoneNumber")) {
852 phoneNumber = _json["phoneNumber"];
853 }
854 if (_json.containsKey("postalAddress")) {
855 postalAddress = new Address.fromJson(_json["postalAddress"]);
856 }
857 if (_json.containsKey("resourceUiUrl")) {
858 resourceUiUrl = _json["resourceUiUrl"];
859 }
860 }
861
862 core.Map toJson() {
863 var _json = new core.Map();
864 if (alternateEmail != null) {
865 _json["alternateEmail"] = alternateEmail;
866 }
867 if (customerDomain != null) {
868 _json["customerDomain"] = customerDomain;
869 }
870 if (customerId != null) {
871 _json["customerId"] = customerId;
872 }
873 if (kind != null) {
874 _json["kind"] = kind;
875 }
876 if (phoneNumber != null) {
877 _json["phoneNumber"] = phoneNumber;
878 }
879 if (postalAddress != null) {
880 _json["postalAddress"] = (postalAddress).toJson();
881 }
882 if (resourceUiUrl != null) {
883 _json["resourceUiUrl"] = resourceUiUrl;
884 }
885 return _json;
886 }
887 }
888
889
890 /** JSON template for a subscription renewal settings. */
891 class RenewalSettings {
892 /** Identifies the resource as a subscription renewal setting. */
893 core.String kind;
894
895 /** Subscription renewal type. */
896 core.String renewalType;
897
898
899 RenewalSettings();
900
901 RenewalSettings.fromJson(core.Map _json) {
902 if (_json.containsKey("kind")) {
903 kind = _json["kind"];
904 }
905 if (_json.containsKey("renewalType")) {
906 renewalType = _json["renewalType"];
907 }
908 }
909
910 core.Map toJson() {
911 var _json = new core.Map();
912 if (kind != null) {
913 _json["kind"] = kind;
914 }
915 if (renewalType != null) {
916 _json["renewalType"] = renewalType;
917 }
918 return _json;
919 }
920 }
921
922
923 /** JSON template for subscription seats. */
924 class Seats {
925 /** Identifies the resource as a subscription change plan request. */
926 core.String kind;
927
928 /**
929 * Maximum number of seats that can be purchased. This needs to be provided
930 * only for a non-commitment plan. For a commitment plan it is decided by the
931 * contract.
932 */
933 core.int maximumNumberOfSeats;
934
935 /**
936 * Number of seats to purchase. This is applicable only for a commitment plan.
937 */
938 core.int numberOfSeats;
939
940
941 Seats();
942
943 Seats.fromJson(core.Map _json) {
944 if (_json.containsKey("kind")) {
945 kind = _json["kind"];
946 }
947 if (_json.containsKey("maximumNumberOfSeats")) {
948 maximumNumberOfSeats = _json["maximumNumberOfSeats"];
949 }
950 if (_json.containsKey("numberOfSeats")) {
951 numberOfSeats = _json["numberOfSeats"];
952 }
953 }
954
955 core.Map toJson() {
956 var _json = new core.Map();
957 if (kind != null) {
958 _json["kind"] = kind;
959 }
960 if (maximumNumberOfSeats != null) {
961 _json["maximumNumberOfSeats"] = maximumNumberOfSeats;
962 }
963 if (numberOfSeats != null) {
964 _json["numberOfSeats"] = numberOfSeats;
965 }
966 return _json;
967 }
968 }
969
970
971 /** Interval of the commitment if it is a commitment plan. */
972 class SubscriptionPlanCommitmentInterval {
973 /** End time of the commitment interval in milliseconds since Unix epoch. */
974 core.String endTime;
975
976 /**
977 * Start time of the commitment interval in milliseconds since Unix epoch.
978 */
979 core.String startTime;
980
981
982 SubscriptionPlanCommitmentInterval();
983
984 SubscriptionPlanCommitmentInterval.fromJson(core.Map _json) {
985 if (_json.containsKey("endTime")) {
986 endTime = _json["endTime"];
987 }
988 if (_json.containsKey("startTime")) {
989 startTime = _json["startTime"];
990 }
991 }
992
993 core.Map toJson() {
994 var _json = new core.Map();
995 if (endTime != null) {
996 _json["endTime"] = endTime;
997 }
998 if (startTime != null) {
999 _json["startTime"] = startTime;
1000 }
1001 return _json;
1002 }
1003 }
1004
1005
1006 /** Plan details of the subscription */
1007 class SubscriptionPlan {
1008 /** Interval of the commitment if it is a commitment plan. */
1009 SubscriptionPlanCommitmentInterval commitmentInterval;
1010
1011 /** Whether the plan is a commitment plan or not. */
1012 core.bool isCommitmentPlan;
1013
1014 /** The plan name of this subscription's plan. */
1015 core.String planName;
1016
1017
1018 SubscriptionPlan();
1019
1020 SubscriptionPlan.fromJson(core.Map _json) {
1021 if (_json.containsKey("commitmentInterval")) {
1022 commitmentInterval = new SubscriptionPlanCommitmentInterval.fromJson(_json ["commitmentInterval"]);
1023 }
1024 if (_json.containsKey("isCommitmentPlan")) {
1025 isCommitmentPlan = _json["isCommitmentPlan"];
1026 }
1027 if (_json.containsKey("planName")) {
1028 planName = _json["planName"];
1029 }
1030 }
1031
1032 core.Map toJson() {
1033 var _json = new core.Map();
1034 if (commitmentInterval != null) {
1035 _json["commitmentInterval"] = (commitmentInterval).toJson();
1036 }
1037 if (isCommitmentPlan != null) {
1038 _json["isCommitmentPlan"] = isCommitmentPlan;
1039 }
1040 if (planName != null) {
1041 _json["planName"] = planName;
1042 }
1043 return _json;
1044 }
1045 }
1046
1047
1048 /** Transfer related information for the subscription. */
1049 class SubscriptionTransferInfo {
1050 /** Not documented yet. */
1051 core.int minimumTransferableSeats;
1052
1053 /** Time when transfer token or intent to transfer will expire. */
1054 core.String transferabilityExpirationTime;
1055
1056
1057 SubscriptionTransferInfo();
1058
1059 SubscriptionTransferInfo.fromJson(core.Map _json) {
1060 if (_json.containsKey("minimumTransferableSeats")) {
1061 minimumTransferableSeats = _json["minimumTransferableSeats"];
1062 }
1063 if (_json.containsKey("transferabilityExpirationTime")) {
1064 transferabilityExpirationTime = _json["transferabilityExpirationTime"];
1065 }
1066 }
1067
1068 core.Map toJson() {
1069 var _json = new core.Map();
1070 if (minimumTransferableSeats != null) {
1071 _json["minimumTransferableSeats"] = minimumTransferableSeats;
1072 }
1073 if (transferabilityExpirationTime != null) {
1074 _json["transferabilityExpirationTime"] = transferabilityExpirationTime;
1075 }
1076 return _json;
1077 }
1078 }
1079
1080
1081 /** Trial Settings of the subscription. */
1082 class SubscriptionTrialSettings {
1083 /** Whether the subscription is in trial. */
1084 core.bool isInTrial;
1085
1086 /** End time of the trial in milliseconds since Unix epoch. */
1087 core.String trialEndTime;
1088
1089
1090 SubscriptionTrialSettings();
1091
1092 SubscriptionTrialSettings.fromJson(core.Map _json) {
1093 if (_json.containsKey("isInTrial")) {
1094 isInTrial = _json["isInTrial"];
1095 }
1096 if (_json.containsKey("trialEndTime")) {
1097 trialEndTime = _json["trialEndTime"];
1098 }
1099 }
1100
1101 core.Map toJson() {
1102 var _json = new core.Map();
1103 if (isInTrial != null) {
1104 _json["isInTrial"] = isInTrial;
1105 }
1106 if (trialEndTime != null) {
1107 _json["trialEndTime"] = trialEndTime;
1108 }
1109 return _json;
1110 }
1111 }
1112
1113
1114 /** JSON template for a subscription. */
1115 class Subscription {
1116 /** Creation time of this subscription in milliseconds since Unix epoch. */
1117 core.String creationTime;
1118
1119 /** The id of the customer to whom the subscription belongs. */
1120 core.String customerId;
1121
1122 /** Identifies the resource as a Subscription. */
1123 core.String kind;
1124
1125 /** Plan details of the subscription */
1126 SubscriptionPlan plan;
1127
1128 /** Purchase order id for your order tracking purposes. */
1129 core.String purchaseOrderId;
1130
1131 /** Renewal settings of the subscription. */
1132 RenewalSettings renewalSettings;
1133
1134 /** Ui url for subscription resource. */
1135 core.String resourceUiUrl;
1136
1137 /** Number/Limit of seats in the new plan. */
1138 Seats seats;
1139
1140 /** Name of the sku for which this subscription is purchased. */
1141 core.String skuId;
1142
1143 /** Status of the subscription. */
1144 core.String status;
1145
1146 /** The id of the subscription. */
1147 core.String subscriptionId;
1148
1149 /** Transfer related information for the subscription. */
1150 SubscriptionTransferInfo transferInfo;
1151
1152 /** Trial Settings of the subscription. */
1153 SubscriptionTrialSettings trialSettings;
1154
1155
1156 Subscription();
1157
1158 Subscription.fromJson(core.Map _json) {
1159 if (_json.containsKey("creationTime")) {
1160 creationTime = _json["creationTime"];
1161 }
1162 if (_json.containsKey("customerId")) {
1163 customerId = _json["customerId"];
1164 }
1165 if (_json.containsKey("kind")) {
1166 kind = _json["kind"];
1167 }
1168 if (_json.containsKey("plan")) {
1169 plan = new SubscriptionPlan.fromJson(_json["plan"]);
1170 }
1171 if (_json.containsKey("purchaseOrderId")) {
1172 purchaseOrderId = _json["purchaseOrderId"];
1173 }
1174 if (_json.containsKey("renewalSettings")) {
1175 renewalSettings = new RenewalSettings.fromJson(_json["renewalSettings"]);
1176 }
1177 if (_json.containsKey("resourceUiUrl")) {
1178 resourceUiUrl = _json["resourceUiUrl"];
1179 }
1180 if (_json.containsKey("seats")) {
1181 seats = new Seats.fromJson(_json["seats"]);
1182 }
1183 if (_json.containsKey("skuId")) {
1184 skuId = _json["skuId"];
1185 }
1186 if (_json.containsKey("status")) {
1187 status = _json["status"];
1188 }
1189 if (_json.containsKey("subscriptionId")) {
1190 subscriptionId = _json["subscriptionId"];
1191 }
1192 if (_json.containsKey("transferInfo")) {
1193 transferInfo = new SubscriptionTransferInfo.fromJson(_json["transferInfo"] );
1194 }
1195 if (_json.containsKey("trialSettings")) {
1196 trialSettings = new SubscriptionTrialSettings.fromJson(_json["trialSetting s"]);
1197 }
1198 }
1199
1200 core.Map toJson() {
1201 var _json = new core.Map();
1202 if (creationTime != null) {
1203 _json["creationTime"] = creationTime;
1204 }
1205 if (customerId != null) {
1206 _json["customerId"] = customerId;
1207 }
1208 if (kind != null) {
1209 _json["kind"] = kind;
1210 }
1211 if (plan != null) {
1212 _json["plan"] = (plan).toJson();
1213 }
1214 if (purchaseOrderId != null) {
1215 _json["purchaseOrderId"] = purchaseOrderId;
1216 }
1217 if (renewalSettings != null) {
1218 _json["renewalSettings"] = (renewalSettings).toJson();
1219 }
1220 if (resourceUiUrl != null) {
1221 _json["resourceUiUrl"] = resourceUiUrl;
1222 }
1223 if (seats != null) {
1224 _json["seats"] = (seats).toJson();
1225 }
1226 if (skuId != null) {
1227 _json["skuId"] = skuId;
1228 }
1229 if (status != null) {
1230 _json["status"] = status;
1231 }
1232 if (subscriptionId != null) {
1233 _json["subscriptionId"] = subscriptionId;
1234 }
1235 if (transferInfo != null) {
1236 _json["transferInfo"] = (transferInfo).toJson();
1237 }
1238 if (trialSettings != null) {
1239 _json["trialSettings"] = (trialSettings).toJson();
1240 }
1241 return _json;
1242 }
1243 }
1244
1245
1246 /** JSON template for a subscription list. */
1247 class Subscriptions {
1248 /** Identifies the resource as a collection of subscriptions. */
1249 core.String kind;
1250
1251 /**
1252 * The continuation token, used to page through large result sets. Provide
1253 * this value in a subsequent request to return the next page of results.
1254 */
1255 core.String nextPageToken;
1256
1257 /** The subscriptions in this page of results. */
1258 core.List<Subscription> subscriptions;
1259
1260
1261 Subscriptions();
1262
1263 Subscriptions.fromJson(core.Map _json) {
1264 if (_json.containsKey("kind")) {
1265 kind = _json["kind"];
1266 }
1267 if (_json.containsKey("nextPageToken")) {
1268 nextPageToken = _json["nextPageToken"];
1269 }
1270 if (_json.containsKey("subscriptions")) {
1271 subscriptions = _json["subscriptions"].map((value) => new Subscription.fro mJson(value)).toList();
1272 }
1273 }
1274
1275 core.Map toJson() {
1276 var _json = new core.Map();
1277 if (kind != null) {
1278 _json["kind"] = kind;
1279 }
1280 if (nextPageToken != null) {
1281 _json["nextPageToken"] = nextPageToken;
1282 }
1283 if (subscriptions != null) {
1284 _json["subscriptions"] = subscriptions.map((value) => (value).toJson()).to List();
1285 }
1286 return _json;
1287 }
1288 }
1289
1290
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698