OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
1 library googleapis.groupsmigration.v1; | 3 library googleapis.groupsmigration.v1; |
2 | 4 |
3 import "dart:core" as core; | 5 import 'dart:core' as core; |
4 import "dart:collection" as collection; | 6 import 'dart:collection' as collection; |
5 import "dart:async" as async; | 7 import 'dart:async' as async; |
6 import "dart:convert" as convert; | 8 import 'dart:convert' as convert; |
7 | 9 |
8 import "package:crypto/crypto.dart" as crypto; | 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 11 import 'package:crypto/crypto.dart' as crypto; |
9 import 'package:http/http.dart' as http; | 12 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 |
13 export '../common/common.dart' show ApiRequestError; | 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
14 export '../common/common.dart' show DetailedApiRequestError; | 15 ApiRequestError, DetailedApiRequestError, Media, UploadOptions, |
| 16 ResumableUploadOptions, DownloadOptions, PartialDownloadOptions, |
| 17 ByteRange; |
| 18 |
| 19 const core.String USER_AGENT = 'dart-api-client groupsmigration/v1'; |
15 | 20 |
16 /** Groups Migration Api. */ | 21 /** Groups Migration Api. */ |
17 class GroupsmigrationApi { | 22 class GroupsmigrationApi { |
| 23 /** Manage messages in groups on your domain */ |
| 24 static const AppsGroupsMigrationScope = "https://www.googleapis.com/auth/apps.
groups.migration"; |
18 | 25 |
19 final common_internal.ApiRequester _requester; | 26 |
| 27 final commons.ApiRequester _requester; |
20 | 28 |
21 ArchiveResourceApi get archive => new ArchiveResourceApi(_requester); | 29 ArchiveResourceApi get archive => new ArchiveResourceApi(_requester); |
22 | 30 |
23 GroupsmigrationApi(http.Client client, {core.String rootUrl: "https://www.goog
leapis.com/", core.String servicePath: "groups/v1/groups/"}) : | 31 GroupsmigrationApi(http.Client client, {core.String rootUrl: "https://www.goog
leapis.com/", core.String servicePath: "groups/v1/groups/"}) : |
24 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 32 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
25 } | 33 } |
26 | 34 |
27 | 35 |
28 /** Not documented yet. */ | |
29 class ArchiveResourceApi { | 36 class ArchiveResourceApi { |
30 final common_internal.ApiRequester _requester; | 37 final commons.ApiRequester _requester; |
31 | 38 |
32 ArchiveResourceApi(common_internal.ApiRequester client) : | 39 ArchiveResourceApi(commons.ApiRequester client) : |
33 _requester = client; | 40 _requester = client; |
34 | 41 |
35 /** | 42 /** |
36 * Inserts a new mail into the archive of the Google group. | 43 * Inserts a new mail into the archive of the Google group. |
37 * | 44 * |
38 * Request parameters: | 45 * Request parameters: |
39 * | 46 * |
40 * [groupId] - The group ID | 47 * [groupId] - The group ID |
41 * | 48 * |
42 * [uploadMedia] - The media to upload. | 49 * [uploadMedia] - The media to upload. |
43 * | 50 * |
44 * [uploadOptions] - Options for the media upload. Streaming Media without the | 51 * [uploadOptions] - Options for the media upload. Streaming Media without the |
45 * length being known ahead of time is only supported via resumable uploads. | 52 * length being known ahead of time is only supported via resumable uploads. |
46 * | 53 * |
47 * Completes with a [Groups]. | 54 * Completes with a [Groups]. |
48 * | 55 * |
49 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 56 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
50 * error. | 57 * error. |
51 * | 58 * |
52 * If the used [http.Client] completes with an error when making a REST call, | 59 * If the used [http.Client] completes with an error when making a REST call, |
53 * this method will complete with the same error. | 60 * this method will complete with the same error. |
54 */ | 61 */ |
55 async.Future<Groups> insert(core.String groupId, {common.UploadOptions uploadO
ptions : common.UploadOptions.Default, common.Media uploadMedia}) { | 62 async.Future<Groups> insert(core.String groupId, {commons.UploadOptions upload
Options : commons.UploadOptions.Default, commons.Media uploadMedia}) { |
56 var _url = null; | 63 var _url = null; |
57 var _queryParams = new core.Map(); | 64 var _queryParams = new core.Map(); |
58 var _uploadMedia = null; | 65 var _uploadMedia = null; |
59 var _uploadOptions = null; | 66 var _uploadOptions = null; |
60 var _downloadOptions = common.DownloadOptions.Metadata; | 67 var _downloadOptions = commons.DownloadOptions.Metadata; |
61 var _body = null; | 68 var _body = null; |
62 | 69 |
63 if (groupId == null) { | 70 if (groupId == null) { |
64 throw new core.ArgumentError("Parameter groupId is required."); | 71 throw new core.ArgumentError("Parameter groupId is required."); |
65 } | 72 } |
66 | 73 |
67 _uploadMedia = uploadMedia; | 74 _uploadMedia = uploadMedia; |
68 _uploadOptions = uploadOptions; | 75 _uploadOptions = uploadOptions; |
69 | 76 |
70 if (_uploadMedia == null) { | 77 if (_uploadMedia == null) { |
71 _url = common_internal.Escaper.ecapeVariable('$groupId') + '/archive'; | 78 _url = commons.Escaper.ecapeVariable('$groupId') + '/archive'; |
72 } else if (_uploadOptions is common.ResumableUploadOptions) { | 79 } else if (_uploadOptions is commons.ResumableUploadOptions) { |
73 _url = '/resumable/upload/groups/v1/groups/' + common_internal.Escaper.eca
peVariable('$groupId') + '/archive'; | 80 _url = '/resumable/upload/groups/v1/groups/' + commons.Escaper.ecapeVariab
le('$groupId') + '/archive'; |
74 } else { | 81 } else { |
75 _url = '/upload/groups/v1/groups/' + common_internal.Escaper.ecapeVariable
('$groupId') + '/archive'; | 82 _url = '/upload/groups/v1/groups/' + commons.Escaper.ecapeVariable('$group
Id') + '/archive'; |
76 } | 83 } |
77 | 84 |
78 | 85 |
79 var _response = _requester.request(_url, | 86 var _response = _requester.request(_url, |
80 "POST", | 87 "POST", |
81 body: _body, | 88 body: _body, |
82 queryParams: _queryParams, | 89 queryParams: _queryParams, |
83 uploadOptions: _uploadOptions, | 90 uploadOptions: _uploadOptions, |
84 uploadMedia: _uploadMedia, | 91 uploadMedia: _uploadMedia, |
85 downloadOptions: _downloadOptions); | 92 downloadOptions: _downloadOptions); |
(...skipping 28 matching lines...) Expand all Loading... |
114 var _json = new core.Map(); | 121 var _json = new core.Map(); |
115 if (kind != null) { | 122 if (kind != null) { |
116 _json["kind"] = kind; | 123 _json["kind"] = kind; |
117 } | 124 } |
118 if (responseCode != null) { | 125 if (responseCode != null) { |
119 _json["responseCode"] = responseCode; | 126 _json["responseCode"] = responseCode; |
120 } | 127 } |
121 return _json; | 128 return _json; |
122 } | 129 } |
123 } | 130 } |
124 | |
125 | |
OLD | NEW |