OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
1 library googleapis.adsensehost.v4_1; | 3 library googleapis.adsensehost.v4_1; |
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; |
| 16 |
| 17 const core.String USER_AGENT = 'dart-api-client adsensehost/v4.1'; |
15 | 18 |
16 /** | 19 /** |
17 * Gives AdSense Hosts access to report generation, ad code generation, and | 20 * Gives AdSense Hosts access to report generation, ad code generation, and |
18 * publisher management capabilities. | 21 * publisher management capabilities. |
19 */ | 22 */ |
20 class AdsensehostApi { | 23 class AdsensehostApi { |
21 /** View and manage your AdSense host data and associated accounts */ | 24 /** View and manage your AdSense host data and associated accounts */ |
22 static const AdsensehostScope = "https://www.googleapis.com/auth/adsensehost"; | 25 static const AdsensehostScope = "https://www.googleapis.com/auth/adsensehost"; |
23 | 26 |
24 | 27 |
25 final common_internal.ApiRequester _requester; | 28 final commons.ApiRequester _requester; |
26 | 29 |
27 AccountsResourceApi get accounts => new AccountsResourceApi(_requester); | 30 AccountsResourceApi get accounts => new AccountsResourceApi(_requester); |
28 AdclientsResourceApi get adclients => new AdclientsResourceApi(_requester); | 31 AdclientsResourceApi get adclients => new AdclientsResourceApi(_requester); |
29 AssociationsessionsResourceApi get associationsessions => new Associationsessi
onsResourceApi(_requester); | 32 AssociationsessionsResourceApi get associationsessions => new Associationsessi
onsResourceApi(_requester); |
30 CustomchannelsResourceApi get customchannels => new CustomchannelsResourceApi(
_requester); | 33 CustomchannelsResourceApi get customchannels => new CustomchannelsResourceApi(
_requester); |
31 ReportsResourceApi get reports => new ReportsResourceApi(_requester); | 34 ReportsResourceApi get reports => new ReportsResourceApi(_requester); |
32 UrlchannelsResourceApi get urlchannels => new UrlchannelsResourceApi(_requeste
r); | 35 UrlchannelsResourceApi get urlchannels => new UrlchannelsResourceApi(_requeste
r); |
33 | 36 |
34 AdsensehostApi(http.Client client, {core.String rootUrl: "https://www.googleap
is.com/", core.String servicePath: "adsensehost/v4.1/"}) : | 37 AdsensehostApi(http.Client client, {core.String rootUrl: "https://www.googleap
is.com/", core.String servicePath: "adsensehost/v4.1/"}) : |
35 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 38 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
36 } | 39 } |
37 | 40 |
38 | 41 |
39 /** Not documented yet. */ | |
40 class AccountsResourceApi { | 42 class AccountsResourceApi { |
41 final common_internal.ApiRequester _requester; | 43 final commons.ApiRequester _requester; |
42 | 44 |
43 AccountsAdclientsResourceApi get adclients => new AccountsAdclientsResourceApi
(_requester); | 45 AccountsAdclientsResourceApi get adclients => new AccountsAdclientsResourceApi
(_requester); |
44 AccountsAdunitsResourceApi get adunits => new AccountsAdunitsResourceApi(_requ
ester); | 46 AccountsAdunitsResourceApi get adunits => new AccountsAdunitsResourceApi(_requ
ester); |
45 AccountsReportsResourceApi get reports => new AccountsReportsResourceApi(_requ
ester); | 47 AccountsReportsResourceApi get reports => new AccountsReportsResourceApi(_requ
ester); |
46 | 48 |
47 AccountsResourceApi(common_internal.ApiRequester client) : | 49 AccountsResourceApi(commons.ApiRequester client) : |
48 _requester = client; | 50 _requester = client; |
49 | 51 |
50 /** | 52 /** |
51 * Get information about the selected associated AdSense account. | 53 * Get information about the selected associated AdSense account. |
52 * | 54 * |
53 * Request parameters: | 55 * Request parameters: |
54 * | 56 * |
55 * [accountId] - Account to get information about. | 57 * [accountId] - Account to get information about. |
56 * | 58 * |
57 * Completes with a [Account]. | 59 * Completes with a [Account]. |
58 * | 60 * |
59 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 61 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
60 * error. | 62 * error. |
61 * | 63 * |
62 * If the used [http.Client] completes with an error when making a REST call, | 64 * If the used [http.Client] completes with an error when making a REST call, |
63 * this method will complete with the same error. | 65 * this method will complete with the same error. |
64 */ | 66 */ |
65 async.Future<Account> get(core.String accountId) { | 67 async.Future<Account> get(core.String accountId) { |
66 var _url = null; | 68 var _url = null; |
67 var _queryParams = new core.Map(); | 69 var _queryParams = new core.Map(); |
68 var _uploadMedia = null; | 70 var _uploadMedia = null; |
69 var _uploadOptions = null; | 71 var _uploadOptions = null; |
70 var _downloadOptions = common.DownloadOptions.Metadata; | 72 var _downloadOptions = commons.DownloadOptions.Metadata; |
71 var _body = null; | 73 var _body = null; |
72 | 74 |
73 if (accountId == null) { | 75 if (accountId == null) { |
74 throw new core.ArgumentError("Parameter accountId is required."); | 76 throw new core.ArgumentError("Parameter accountId is required."); |
75 } | 77 } |
76 | 78 |
77 | 79 |
78 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId'); | 80 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId'); |
79 | 81 |
80 var _response = _requester.request(_url, | 82 var _response = _requester.request(_url, |
81 "GET", | 83 "GET", |
82 body: _body, | 84 body: _body, |
83 queryParams: _queryParams, | 85 queryParams: _queryParams, |
84 uploadOptions: _uploadOptions, | 86 uploadOptions: _uploadOptions, |
85 uploadMedia: _uploadMedia, | 87 uploadMedia: _uploadMedia, |
86 downloadOptions: _downloadOptions); | 88 downloadOptions: _downloadOptions); |
87 return _response.then((data) => new Account.fromJson(data)); | 89 return _response.then((data) => new Account.fromJson(data)); |
88 } | 90 } |
89 | 91 |
90 /** | 92 /** |
91 * List hosted accounts associated with this AdSense account by ad client id. | 93 * List hosted accounts associated with this AdSense account by ad client id. |
92 * | 94 * |
93 * Request parameters: | 95 * Request parameters: |
94 * | 96 * |
95 * [filterAdClientId] - Ad clients to list accounts for. | 97 * [filterAdClientId] - Ad clients to list accounts for. |
96 * | 98 * |
97 * Completes with a [Accounts]. | 99 * Completes with a [Accounts]. |
98 * | 100 * |
99 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 101 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
100 * error. | 102 * error. |
101 * | 103 * |
102 * If the used [http.Client] completes with an error when making a REST call, | 104 * If the used [http.Client] completes with an error when making a REST call, |
103 * this method will complete with the same error. | 105 * this method will complete with the same error. |
104 */ | 106 */ |
105 async.Future<Accounts> list(core.List<core.String> filterAdClientId) { | 107 async.Future<Accounts> list(core.List<core.String> filterAdClientId) { |
106 var _url = null; | 108 var _url = null; |
107 var _queryParams = new core.Map(); | 109 var _queryParams = new core.Map(); |
108 var _uploadMedia = null; | 110 var _uploadMedia = null; |
109 var _uploadOptions = null; | 111 var _uploadOptions = null; |
110 var _downloadOptions = common.DownloadOptions.Metadata; | 112 var _downloadOptions = commons.DownloadOptions.Metadata; |
111 var _body = null; | 113 var _body = null; |
112 | 114 |
113 if (filterAdClientId == null || filterAdClientId.isEmpty) { | 115 if (filterAdClientId == null || filterAdClientId.isEmpty) { |
114 throw new core.ArgumentError("Parameter filterAdClientId is required."); | 116 throw new core.ArgumentError("Parameter filterAdClientId is required."); |
115 } | 117 } |
116 _queryParams["filterAdClientId"] = filterAdClientId; | 118 _queryParams["filterAdClientId"] = filterAdClientId; |
117 | 119 |
118 | 120 |
119 _url = 'accounts'; | 121 _url = 'accounts'; |
120 | 122 |
121 var _response = _requester.request(_url, | 123 var _response = _requester.request(_url, |
122 "GET", | 124 "GET", |
123 body: _body, | 125 body: _body, |
124 queryParams: _queryParams, | 126 queryParams: _queryParams, |
125 uploadOptions: _uploadOptions, | 127 uploadOptions: _uploadOptions, |
126 uploadMedia: _uploadMedia, | 128 uploadMedia: _uploadMedia, |
127 downloadOptions: _downloadOptions); | 129 downloadOptions: _downloadOptions); |
128 return _response.then((data) => new Accounts.fromJson(data)); | 130 return _response.then((data) => new Accounts.fromJson(data)); |
129 } | 131 } |
130 | 132 |
131 } | 133 } |
132 | 134 |
133 | 135 |
134 /** Not documented yet. */ | |
135 class AccountsAdclientsResourceApi { | 136 class AccountsAdclientsResourceApi { |
136 final common_internal.ApiRequester _requester; | 137 final commons.ApiRequester _requester; |
137 | 138 |
138 AccountsAdclientsResourceApi(common_internal.ApiRequester client) : | 139 AccountsAdclientsResourceApi(commons.ApiRequester client) : |
139 _requester = client; | 140 _requester = client; |
140 | 141 |
141 /** | 142 /** |
142 * Get information about one of the ad clients in the specified publisher's | 143 * Get information about one of the ad clients in the specified publisher's |
143 * AdSense account. | 144 * AdSense account. |
144 * | 145 * |
145 * Request parameters: | 146 * Request parameters: |
146 * | 147 * |
147 * [accountId] - Account which contains the ad client. | 148 * [accountId] - Account which contains the ad client. |
148 * | 149 * |
149 * [adClientId] - Ad client to get. | 150 * [adClientId] - Ad client to get. |
150 * | 151 * |
151 * Completes with a [AdClient]. | 152 * Completes with a [AdClient]. |
152 * | 153 * |
153 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 154 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
154 * error. | 155 * error. |
155 * | 156 * |
156 * If the used [http.Client] completes with an error when making a REST call, | 157 * If the used [http.Client] completes with an error when making a REST call, |
157 * this method will complete with the same error. | 158 * this method will complete with the same error. |
158 */ | 159 */ |
159 async.Future<AdClient> get(core.String accountId, core.String adClientId) { | 160 async.Future<AdClient> get(core.String accountId, core.String adClientId) { |
160 var _url = null; | 161 var _url = null; |
161 var _queryParams = new core.Map(); | 162 var _queryParams = new core.Map(); |
162 var _uploadMedia = null; | 163 var _uploadMedia = null; |
163 var _uploadOptions = null; | 164 var _uploadOptions = null; |
164 var _downloadOptions = common.DownloadOptions.Metadata; | 165 var _downloadOptions = commons.DownloadOptions.Metadata; |
165 var _body = null; | 166 var _body = null; |
166 | 167 |
167 if (accountId == null) { | 168 if (accountId == null) { |
168 throw new core.ArgumentError("Parameter accountId is required."); | 169 throw new core.ArgumentError("Parameter accountId is required."); |
169 } | 170 } |
170 if (adClientId == null) { | 171 if (adClientId == null) { |
171 throw new core.ArgumentError("Parameter adClientId is required."); | 172 throw new core.ArgumentError("Parameter adClientId is required."); |
172 } | 173 } |
173 | 174 |
174 | 175 |
175 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + '
/adclients/' + common_internal.Escaper.ecapeVariable('$adClientId'); | 176 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId') + '/adclien
ts/' + commons.Escaper.ecapeVariable('$adClientId'); |
176 | 177 |
177 var _response = _requester.request(_url, | 178 var _response = _requester.request(_url, |
178 "GET", | 179 "GET", |
179 body: _body, | 180 body: _body, |
180 queryParams: _queryParams, | 181 queryParams: _queryParams, |
181 uploadOptions: _uploadOptions, | 182 uploadOptions: _uploadOptions, |
182 uploadMedia: _uploadMedia, | 183 uploadMedia: _uploadMedia, |
183 downloadOptions: _downloadOptions); | 184 downloadOptions: _downloadOptions); |
184 return _response.then((data) => new AdClient.fromJson(data)); | 185 return _response.then((data) => new AdClient.fromJson(data)); |
185 } | 186 } |
186 | 187 |
187 /** | 188 /** |
188 * List all hosted ad clients in the specified hosted account. | 189 * List all hosted ad clients in the specified hosted account. |
189 * | 190 * |
190 * Request parameters: | 191 * Request parameters: |
191 * | 192 * |
192 * [accountId] - Account for which to list ad clients. | 193 * [accountId] - Account for which to list ad clients. |
193 * | 194 * |
194 * [maxResults] - The maximum number of ad clients to include in the response, | 195 * [maxResults] - The maximum number of ad clients to include in the response, |
195 * used for paging. | 196 * used for paging. |
196 * Value must be between "0" and "10000". | 197 * Value must be between "0" and "10000". |
197 * | 198 * |
198 * [pageToken] - A continuation token, used to page through ad clients. To | 199 * [pageToken] - A continuation token, used to page through ad clients. To |
199 * retrieve the next page, set this parameter to the value of "nextPageToken" | 200 * retrieve the next page, set this parameter to the value of "nextPageToken" |
200 * from the previous response. | 201 * from the previous response. |
201 * | 202 * |
202 * Completes with a [AdClients]. | 203 * Completes with a [AdClients]. |
203 * | 204 * |
204 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 205 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
205 * error. | 206 * error. |
206 * | 207 * |
207 * If the used [http.Client] completes with an error when making a REST call, | 208 * If the used [http.Client] completes with an error when making a REST call, |
208 * this method will complete with the same error. | 209 * this method will complete with the same error. |
209 */ | 210 */ |
210 async.Future<AdClients> list(core.String accountId, {core.int maxResults, core
.String pageToken}) { | 211 async.Future<AdClients> list(core.String accountId, {core.int maxResults, core
.String pageToken}) { |
211 var _url = null; | 212 var _url = null; |
212 var _queryParams = new core.Map(); | 213 var _queryParams = new core.Map(); |
213 var _uploadMedia = null; | 214 var _uploadMedia = null; |
214 var _uploadOptions = null; | 215 var _uploadOptions = null; |
215 var _downloadOptions = common.DownloadOptions.Metadata; | 216 var _downloadOptions = commons.DownloadOptions.Metadata; |
216 var _body = null; | 217 var _body = null; |
217 | 218 |
218 if (accountId == null) { | 219 if (accountId == null) { |
219 throw new core.ArgumentError("Parameter accountId is required."); | 220 throw new core.ArgumentError("Parameter accountId is required."); |
220 } | 221 } |
221 if (maxResults != null) { | 222 if (maxResults != null) { |
222 _queryParams["maxResults"] = ["${maxResults}"]; | 223 _queryParams["maxResults"] = ["${maxResults}"]; |
223 } | 224 } |
224 if (pageToken != null) { | 225 if (pageToken != null) { |
225 _queryParams["pageToken"] = [pageToken]; | 226 _queryParams["pageToken"] = [pageToken]; |
226 } | 227 } |
227 | 228 |
228 | 229 |
229 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + '
/adclients'; | 230 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId') + '/adclien
ts'; |
230 | 231 |
231 var _response = _requester.request(_url, | 232 var _response = _requester.request(_url, |
232 "GET", | 233 "GET", |
233 body: _body, | 234 body: _body, |
234 queryParams: _queryParams, | 235 queryParams: _queryParams, |
235 uploadOptions: _uploadOptions, | 236 uploadOptions: _uploadOptions, |
236 uploadMedia: _uploadMedia, | 237 uploadMedia: _uploadMedia, |
237 downloadOptions: _downloadOptions); | 238 downloadOptions: _downloadOptions); |
238 return _response.then((data) => new AdClients.fromJson(data)); | 239 return _response.then((data) => new AdClients.fromJson(data)); |
239 } | 240 } |
240 | 241 |
241 } | 242 } |
242 | 243 |
243 | 244 |
244 /** Not documented yet. */ | |
245 class AccountsAdunitsResourceApi { | 245 class AccountsAdunitsResourceApi { |
246 final common_internal.ApiRequester _requester; | 246 final commons.ApiRequester _requester; |
247 | 247 |
248 AccountsAdunitsResourceApi(common_internal.ApiRequester client) : | 248 AccountsAdunitsResourceApi(commons.ApiRequester client) : |
249 _requester = client; | 249 _requester = client; |
250 | 250 |
251 /** | 251 /** |
252 * Delete the specified ad unit from the specified publisher AdSense account. | 252 * Delete the specified ad unit from the specified publisher AdSense account. |
253 * | 253 * |
254 * Request parameters: | 254 * Request parameters: |
255 * | 255 * |
256 * [accountId] - Account which contains the ad unit. | 256 * [accountId] - Account which contains the ad unit. |
257 * | 257 * |
258 * [adClientId] - Ad client for which to get ad unit. | 258 * [adClientId] - Ad client for which to get ad unit. |
259 * | 259 * |
260 * [adUnitId] - Ad unit to delete. | 260 * [adUnitId] - Ad unit to delete. |
261 * | 261 * |
262 * Completes with a [AdUnit]. | 262 * Completes with a [AdUnit]. |
263 * | 263 * |
264 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 264 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
265 * error. | 265 * error. |
266 * | 266 * |
267 * If the used [http.Client] completes with an error when making a REST call, | 267 * If the used [http.Client] completes with an error when making a REST call, |
268 * this method will complete with the same error. | 268 * this method will complete with the same error. |
269 */ | 269 */ |
270 async.Future<AdUnit> delete(core.String accountId, core.String adClientId, cor
e.String adUnitId) { | 270 async.Future<AdUnit> delete(core.String accountId, core.String adClientId, cor
e.String adUnitId) { |
271 var _url = null; | 271 var _url = null; |
272 var _queryParams = new core.Map(); | 272 var _queryParams = new core.Map(); |
273 var _uploadMedia = null; | 273 var _uploadMedia = null; |
274 var _uploadOptions = null; | 274 var _uploadOptions = null; |
275 var _downloadOptions = common.DownloadOptions.Metadata; | 275 var _downloadOptions = commons.DownloadOptions.Metadata; |
276 var _body = null; | 276 var _body = null; |
277 | 277 |
278 if (accountId == null) { | 278 if (accountId == null) { |
279 throw new core.ArgumentError("Parameter accountId is required."); | 279 throw new core.ArgumentError("Parameter accountId is required."); |
280 } | 280 } |
281 if (adClientId == null) { | 281 if (adClientId == null) { |
282 throw new core.ArgumentError("Parameter adClientId is required."); | 282 throw new core.ArgumentError("Parameter adClientId is required."); |
283 } | 283 } |
284 if (adUnitId == null) { | 284 if (adUnitId == null) { |
285 throw new core.ArgumentError("Parameter adUnitId is required."); | 285 throw new core.ArgumentError("Parameter adUnitId is required."); |
286 } | 286 } |
287 | 287 |
288 | 288 |
289 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + '
/adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/
' + common_internal.Escaper.ecapeVariable('$adUnitId'); | 289 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId') + '/adclien
ts/' + commons.Escaper.ecapeVariable('$adClientId') + '/adunits/' + commons.Esca
per.ecapeVariable('$adUnitId'); |
290 | 290 |
291 var _response = _requester.request(_url, | 291 var _response = _requester.request(_url, |
292 "DELETE", | 292 "DELETE", |
293 body: _body, | 293 body: _body, |
294 queryParams: _queryParams, | 294 queryParams: _queryParams, |
295 uploadOptions: _uploadOptions, | 295 uploadOptions: _uploadOptions, |
296 uploadMedia: _uploadMedia, | 296 uploadMedia: _uploadMedia, |
297 downloadOptions: _downloadOptions); | 297 downloadOptions: _downloadOptions); |
298 return _response.then((data) => new AdUnit.fromJson(data)); | 298 return _response.then((data) => new AdUnit.fromJson(data)); |
299 } | 299 } |
300 | 300 |
301 /** | 301 /** |
302 * Get the specified host ad unit in this AdSense account. | 302 * Get the specified host ad unit in this AdSense account. |
303 * | 303 * |
304 * Request parameters: | 304 * Request parameters: |
305 * | 305 * |
306 * [accountId] - Account which contains the ad unit. | 306 * [accountId] - Account which contains the ad unit. |
307 * | 307 * |
308 * [adClientId] - Ad client for which to get ad unit. | 308 * [adClientId] - Ad client for which to get ad unit. |
309 * | 309 * |
310 * [adUnitId] - Ad unit to get. | 310 * [adUnitId] - Ad unit to get. |
311 * | 311 * |
312 * Completes with a [AdUnit]. | 312 * Completes with a [AdUnit]. |
313 * | 313 * |
314 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 314 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
315 * error. | 315 * error. |
316 * | 316 * |
317 * If the used [http.Client] completes with an error when making a REST call, | 317 * If the used [http.Client] completes with an error when making a REST call, |
318 * this method will complete with the same error. | 318 * this method will complete with the same error. |
319 */ | 319 */ |
320 async.Future<AdUnit> get(core.String accountId, core.String adClientId, core.S
tring adUnitId) { | 320 async.Future<AdUnit> get(core.String accountId, core.String adClientId, core.S
tring adUnitId) { |
321 var _url = null; | 321 var _url = null; |
322 var _queryParams = new core.Map(); | 322 var _queryParams = new core.Map(); |
323 var _uploadMedia = null; | 323 var _uploadMedia = null; |
324 var _uploadOptions = null; | 324 var _uploadOptions = null; |
325 var _downloadOptions = common.DownloadOptions.Metadata; | 325 var _downloadOptions = commons.DownloadOptions.Metadata; |
326 var _body = null; | 326 var _body = null; |
327 | 327 |
328 if (accountId == null) { | 328 if (accountId == null) { |
329 throw new core.ArgumentError("Parameter accountId is required."); | 329 throw new core.ArgumentError("Parameter accountId is required."); |
330 } | 330 } |
331 if (adClientId == null) { | 331 if (adClientId == null) { |
332 throw new core.ArgumentError("Parameter adClientId is required."); | 332 throw new core.ArgumentError("Parameter adClientId is required."); |
333 } | 333 } |
334 if (adUnitId == null) { | 334 if (adUnitId == null) { |
335 throw new core.ArgumentError("Parameter adUnitId is required."); | 335 throw new core.ArgumentError("Parameter adUnitId is required."); |
336 } | 336 } |
337 | 337 |
338 | 338 |
339 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + '
/adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/
' + common_internal.Escaper.ecapeVariable('$adUnitId'); | 339 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId') + '/adclien
ts/' + commons.Escaper.ecapeVariable('$adClientId') + '/adunits/' + commons.Esca
per.ecapeVariable('$adUnitId'); |
340 | 340 |
341 var _response = _requester.request(_url, | 341 var _response = _requester.request(_url, |
342 "GET", | 342 "GET", |
343 body: _body, | 343 body: _body, |
344 queryParams: _queryParams, | 344 queryParams: _queryParams, |
345 uploadOptions: _uploadOptions, | 345 uploadOptions: _uploadOptions, |
346 uploadMedia: _uploadMedia, | 346 uploadMedia: _uploadMedia, |
347 downloadOptions: _downloadOptions); | 347 downloadOptions: _downloadOptions); |
348 return _response.then((data) => new AdUnit.fromJson(data)); | 348 return _response.then((data) => new AdUnit.fromJson(data)); |
349 } | 349 } |
350 | 350 |
351 /** | 351 /** |
352 * Get ad code for the specified ad unit, attaching the specified host custom | 352 * Get ad code for the specified ad unit, attaching the specified host custom |
353 * channels. | 353 * channels. |
354 * | 354 * |
355 * Request parameters: | 355 * Request parameters: |
356 * | 356 * |
357 * [accountId] - Account which contains the ad client. | 357 * [accountId] - Account which contains the ad client. |
358 * | 358 * |
359 * [adClientId] - Ad client with contains the ad unit. | 359 * [adClientId] - Ad client with contains the ad unit. |
360 * | 360 * |
361 * [adUnitId] - Ad unit to get the code for. | 361 * [adUnitId] - Ad unit to get the code for. |
362 * | 362 * |
363 * [hostCustomChannelId] - Host custom channel to attach to the ad code. | 363 * [hostCustomChannelId] - Host custom channel to attach to the ad code. |
364 * | 364 * |
365 * Completes with a [AdCode]. | 365 * Completes with a [AdCode]. |
366 * | 366 * |
367 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 367 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
368 * error. | 368 * error. |
369 * | 369 * |
370 * If the used [http.Client] completes with an error when making a REST call, | 370 * If the used [http.Client] completes with an error when making a REST call, |
371 * this method will complete with the same error. | 371 * this method will complete with the same error. |
372 */ | 372 */ |
373 async.Future<AdCode> getAdCode(core.String accountId, core.String adClientId,
core.String adUnitId, {core.List<core.String> hostCustomChannelId}) { | 373 async.Future<AdCode> getAdCode(core.String accountId, core.String adClientId,
core.String adUnitId, {core.List<core.String> hostCustomChannelId}) { |
374 var _url = null; | 374 var _url = null; |
375 var _queryParams = new core.Map(); | 375 var _queryParams = new core.Map(); |
376 var _uploadMedia = null; | 376 var _uploadMedia = null; |
377 var _uploadOptions = null; | 377 var _uploadOptions = null; |
378 var _downloadOptions = common.DownloadOptions.Metadata; | 378 var _downloadOptions = commons.DownloadOptions.Metadata; |
379 var _body = null; | 379 var _body = null; |
380 | 380 |
381 if (accountId == null) { | 381 if (accountId == null) { |
382 throw new core.ArgumentError("Parameter accountId is required."); | 382 throw new core.ArgumentError("Parameter accountId is required."); |
383 } | 383 } |
384 if (adClientId == null) { | 384 if (adClientId == null) { |
385 throw new core.ArgumentError("Parameter adClientId is required."); | 385 throw new core.ArgumentError("Parameter adClientId is required."); |
386 } | 386 } |
387 if (adUnitId == null) { | 387 if (adUnitId == null) { |
388 throw new core.ArgumentError("Parameter adUnitId is required."); | 388 throw new core.ArgumentError("Parameter adUnitId is required."); |
389 } | 389 } |
390 if (hostCustomChannelId != null) { | 390 if (hostCustomChannelId != null) { |
391 _queryParams["hostCustomChannelId"] = hostCustomChannelId; | 391 _queryParams["hostCustomChannelId"] = hostCustomChannelId; |
392 } | 392 } |
393 | 393 |
394 | 394 |
395 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + '
/adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits/
' + common_internal.Escaper.ecapeVariable('$adUnitId') + '/adcode'; | 395 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId') + '/adclien
ts/' + commons.Escaper.ecapeVariable('$adClientId') + '/adunits/' + commons.Esca
per.ecapeVariable('$adUnitId') + '/adcode'; |
396 | 396 |
397 var _response = _requester.request(_url, | 397 var _response = _requester.request(_url, |
398 "GET", | 398 "GET", |
399 body: _body, | 399 body: _body, |
400 queryParams: _queryParams, | 400 queryParams: _queryParams, |
401 uploadOptions: _uploadOptions, | 401 uploadOptions: _uploadOptions, |
402 uploadMedia: _uploadMedia, | 402 uploadMedia: _uploadMedia, |
403 downloadOptions: _downloadOptions); | 403 downloadOptions: _downloadOptions); |
404 return _response.then((data) => new AdCode.fromJson(data)); | 404 return _response.then((data) => new AdCode.fromJson(data)); |
405 } | 405 } |
406 | 406 |
407 /** | 407 /** |
408 * Insert the supplied ad unit into the specified publisher AdSense account. | 408 * Insert the supplied ad unit into the specified publisher AdSense account. |
409 * | 409 * |
410 * [request] - The metadata request object. | 410 * [request] - The metadata request object. |
411 * | 411 * |
412 * Request parameters: | 412 * Request parameters: |
413 * | 413 * |
414 * [accountId] - Account which will contain the ad unit. | 414 * [accountId] - Account which will contain the ad unit. |
415 * | 415 * |
416 * [adClientId] - Ad client into which to insert the ad unit. | 416 * [adClientId] - Ad client into which to insert the ad unit. |
417 * | 417 * |
418 * Completes with a [AdUnit]. | 418 * Completes with a [AdUnit]. |
419 * | 419 * |
420 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 420 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
421 * error. | 421 * error. |
422 * | 422 * |
423 * If the used [http.Client] completes with an error when making a REST call, | 423 * If the used [http.Client] completes with an error when making a REST call, |
424 * this method will complete with the same error. | 424 * this method will complete with the same error. |
425 */ | 425 */ |
426 async.Future<AdUnit> insert(AdUnit request, core.String accountId, core.String
adClientId) { | 426 async.Future<AdUnit> insert(AdUnit request, core.String accountId, core.String
adClientId) { |
427 var _url = null; | 427 var _url = null; |
428 var _queryParams = new core.Map(); | 428 var _queryParams = new core.Map(); |
429 var _uploadMedia = null; | 429 var _uploadMedia = null; |
430 var _uploadOptions = null; | 430 var _uploadOptions = null; |
431 var _downloadOptions = common.DownloadOptions.Metadata; | 431 var _downloadOptions = commons.DownloadOptions.Metadata; |
432 var _body = null; | 432 var _body = null; |
433 | 433 |
434 if (request != null) { | 434 if (request != null) { |
435 _body = convert.JSON.encode((request).toJson()); | 435 _body = convert.JSON.encode((request).toJson()); |
436 } | 436 } |
437 if (accountId == null) { | 437 if (accountId == null) { |
438 throw new core.ArgumentError("Parameter accountId is required."); | 438 throw new core.ArgumentError("Parameter accountId is required."); |
439 } | 439 } |
440 if (adClientId == null) { | 440 if (adClientId == null) { |
441 throw new core.ArgumentError("Parameter adClientId is required."); | 441 throw new core.ArgumentError("Parameter adClientId is required."); |
442 } | 442 } |
443 | 443 |
444 | 444 |
445 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + '
/adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits'
; | 445 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId') + '/adclien
ts/' + commons.Escaper.ecapeVariable('$adClientId') + '/adunits'; |
446 | 446 |
447 var _response = _requester.request(_url, | 447 var _response = _requester.request(_url, |
448 "POST", | 448 "POST", |
449 body: _body, | 449 body: _body, |
450 queryParams: _queryParams, | 450 queryParams: _queryParams, |
451 uploadOptions: _uploadOptions, | 451 uploadOptions: _uploadOptions, |
452 uploadMedia: _uploadMedia, | 452 uploadMedia: _uploadMedia, |
453 downloadOptions: _downloadOptions); | 453 downloadOptions: _downloadOptions); |
454 return _response.then((data) => new AdUnit.fromJson(data)); | 454 return _response.then((data) => new AdUnit.fromJson(data)); |
455 } | 455 } |
(...skipping 12 matching lines...) Expand all Loading... |
468 * [maxResults] - The maximum number of ad units to include in the response, | 468 * [maxResults] - The maximum number of ad units to include in the response, |
469 * used for paging. | 469 * used for paging. |
470 * Value must be between "0" and "10000". | 470 * Value must be between "0" and "10000". |
471 * | 471 * |
472 * [pageToken] - A continuation token, used to page through ad units. To | 472 * [pageToken] - A continuation token, used to page through ad units. To |
473 * retrieve the next page, set this parameter to the value of "nextPageToken" | 473 * retrieve the next page, set this parameter to the value of "nextPageToken" |
474 * from the previous response. | 474 * from the previous response. |
475 * | 475 * |
476 * Completes with a [AdUnits]. | 476 * Completes with a [AdUnits]. |
477 * | 477 * |
478 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 478 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
479 * error. | 479 * error. |
480 * | 480 * |
481 * If the used [http.Client] completes with an error when making a REST call, | 481 * If the used [http.Client] completes with an error when making a REST call, |
482 * this method will complete with the same error. | 482 * this method will complete with the same error. |
483 */ | 483 */ |
484 async.Future<AdUnits> list(core.String accountId, core.String adClientId, {cor
e.bool includeInactive, core.int maxResults, core.String pageToken}) { | 484 async.Future<AdUnits> list(core.String accountId, core.String adClientId, {cor
e.bool includeInactive, core.int maxResults, core.String pageToken}) { |
485 var _url = null; | 485 var _url = null; |
486 var _queryParams = new core.Map(); | 486 var _queryParams = new core.Map(); |
487 var _uploadMedia = null; | 487 var _uploadMedia = null; |
488 var _uploadOptions = null; | 488 var _uploadOptions = null; |
489 var _downloadOptions = common.DownloadOptions.Metadata; | 489 var _downloadOptions = commons.DownloadOptions.Metadata; |
490 var _body = null; | 490 var _body = null; |
491 | 491 |
492 if (accountId == null) { | 492 if (accountId == null) { |
493 throw new core.ArgumentError("Parameter accountId is required."); | 493 throw new core.ArgumentError("Parameter accountId is required."); |
494 } | 494 } |
495 if (adClientId == null) { | 495 if (adClientId == null) { |
496 throw new core.ArgumentError("Parameter adClientId is required."); | 496 throw new core.ArgumentError("Parameter adClientId is required."); |
497 } | 497 } |
498 if (includeInactive != null) { | 498 if (includeInactive != null) { |
499 _queryParams["includeInactive"] = ["${includeInactive}"]; | 499 _queryParams["includeInactive"] = ["${includeInactive}"]; |
500 } | 500 } |
501 if (maxResults != null) { | 501 if (maxResults != null) { |
502 _queryParams["maxResults"] = ["${maxResults}"]; | 502 _queryParams["maxResults"] = ["${maxResults}"]; |
503 } | 503 } |
504 if (pageToken != null) { | 504 if (pageToken != null) { |
505 _queryParams["pageToken"] = [pageToken]; | 505 _queryParams["pageToken"] = [pageToken]; |
506 } | 506 } |
507 | 507 |
508 | 508 |
509 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + '
/adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits'
; | 509 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId') + '/adclien
ts/' + commons.Escaper.ecapeVariable('$adClientId') + '/adunits'; |
510 | 510 |
511 var _response = _requester.request(_url, | 511 var _response = _requester.request(_url, |
512 "GET", | 512 "GET", |
513 body: _body, | 513 body: _body, |
514 queryParams: _queryParams, | 514 queryParams: _queryParams, |
515 uploadOptions: _uploadOptions, | 515 uploadOptions: _uploadOptions, |
516 uploadMedia: _uploadMedia, | 516 uploadMedia: _uploadMedia, |
517 downloadOptions: _downloadOptions); | 517 downloadOptions: _downloadOptions); |
518 return _response.then((data) => new AdUnits.fromJson(data)); | 518 return _response.then((data) => new AdUnits.fromJson(data)); |
519 } | 519 } |
520 | 520 |
521 /** | 521 /** |
522 * Update the supplied ad unit in the specified publisher AdSense account. | 522 * Update the supplied ad unit in the specified publisher AdSense account. |
523 * This method supports patch semantics. | 523 * This method supports patch semantics. |
524 * | 524 * |
525 * [request] - The metadata request object. | 525 * [request] - The metadata request object. |
526 * | 526 * |
527 * Request parameters: | 527 * Request parameters: |
528 * | 528 * |
529 * [accountId] - Account which contains the ad client. | 529 * [accountId] - Account which contains the ad client. |
530 * | 530 * |
531 * [adClientId] - Ad client which contains the ad unit. | 531 * [adClientId] - Ad client which contains the ad unit. |
532 * | 532 * |
533 * [adUnitId] - Ad unit to get. | 533 * [adUnitId] - Ad unit to get. |
534 * | 534 * |
535 * Completes with a [AdUnit]. | 535 * Completes with a [AdUnit]. |
536 * | 536 * |
537 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 537 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
538 * error. | 538 * error. |
539 * | 539 * |
540 * If the used [http.Client] completes with an error when making a REST call, | 540 * If the used [http.Client] completes with an error when making a REST call, |
541 * this method will complete with the same error. | 541 * this method will complete with the same error. |
542 */ | 542 */ |
543 async.Future<AdUnit> patch(AdUnit request, core.String accountId, core.String
adClientId, core.String adUnitId) { | 543 async.Future<AdUnit> patch(AdUnit request, core.String accountId, core.String
adClientId, core.String adUnitId) { |
544 var _url = null; | 544 var _url = null; |
545 var _queryParams = new core.Map(); | 545 var _queryParams = new core.Map(); |
546 var _uploadMedia = null; | 546 var _uploadMedia = null; |
547 var _uploadOptions = null; | 547 var _uploadOptions = null; |
548 var _downloadOptions = common.DownloadOptions.Metadata; | 548 var _downloadOptions = commons.DownloadOptions.Metadata; |
549 var _body = null; | 549 var _body = null; |
550 | 550 |
551 if (request != null) { | 551 if (request != null) { |
552 _body = convert.JSON.encode((request).toJson()); | 552 _body = convert.JSON.encode((request).toJson()); |
553 } | 553 } |
554 if (accountId == null) { | 554 if (accountId == null) { |
555 throw new core.ArgumentError("Parameter accountId is required."); | 555 throw new core.ArgumentError("Parameter accountId is required."); |
556 } | 556 } |
557 if (adClientId == null) { | 557 if (adClientId == null) { |
558 throw new core.ArgumentError("Parameter adClientId is required."); | 558 throw new core.ArgumentError("Parameter adClientId is required."); |
559 } | 559 } |
560 if (adUnitId == null) { | 560 if (adUnitId == null) { |
561 throw new core.ArgumentError("Parameter adUnitId is required."); | 561 throw new core.ArgumentError("Parameter adUnitId is required."); |
562 } | 562 } |
563 _queryParams["adUnitId"] = [adUnitId]; | 563 _queryParams["adUnitId"] = [adUnitId]; |
564 | 564 |
565 | 565 |
566 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + '
/adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits'
; | 566 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId') + '/adclien
ts/' + commons.Escaper.ecapeVariable('$adClientId') + '/adunits'; |
567 | 567 |
568 var _response = _requester.request(_url, | 568 var _response = _requester.request(_url, |
569 "PATCH", | 569 "PATCH", |
570 body: _body, | 570 body: _body, |
571 queryParams: _queryParams, | 571 queryParams: _queryParams, |
572 uploadOptions: _uploadOptions, | 572 uploadOptions: _uploadOptions, |
573 uploadMedia: _uploadMedia, | 573 uploadMedia: _uploadMedia, |
574 downloadOptions: _downloadOptions); | 574 downloadOptions: _downloadOptions); |
575 return _response.then((data) => new AdUnit.fromJson(data)); | 575 return _response.then((data) => new AdUnit.fromJson(data)); |
576 } | 576 } |
577 | 577 |
578 /** | 578 /** |
579 * Update the supplied ad unit in the specified publisher AdSense account. | 579 * Update the supplied ad unit in the specified publisher AdSense account. |
580 * | 580 * |
581 * [request] - The metadata request object. | 581 * [request] - The metadata request object. |
582 * | 582 * |
583 * Request parameters: | 583 * Request parameters: |
584 * | 584 * |
585 * [accountId] - Account which contains the ad client. | 585 * [accountId] - Account which contains the ad client. |
586 * | 586 * |
587 * [adClientId] - Ad client which contains the ad unit. | 587 * [adClientId] - Ad client which contains the ad unit. |
588 * | 588 * |
589 * Completes with a [AdUnit]. | 589 * Completes with a [AdUnit]. |
590 * | 590 * |
591 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 591 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
592 * error. | 592 * error. |
593 * | 593 * |
594 * If the used [http.Client] completes with an error when making a REST call, | 594 * If the used [http.Client] completes with an error when making a REST call, |
595 * this method will complete with the same error. | 595 * this method will complete with the same error. |
596 */ | 596 */ |
597 async.Future<AdUnit> update(AdUnit request, core.String accountId, core.String
adClientId) { | 597 async.Future<AdUnit> update(AdUnit request, core.String accountId, core.String
adClientId) { |
598 var _url = null; | 598 var _url = null; |
599 var _queryParams = new core.Map(); | 599 var _queryParams = new core.Map(); |
600 var _uploadMedia = null; | 600 var _uploadMedia = null; |
601 var _uploadOptions = null; | 601 var _uploadOptions = null; |
602 var _downloadOptions = common.DownloadOptions.Metadata; | 602 var _downloadOptions = commons.DownloadOptions.Metadata; |
603 var _body = null; | 603 var _body = null; |
604 | 604 |
605 if (request != null) { | 605 if (request != null) { |
606 _body = convert.JSON.encode((request).toJson()); | 606 _body = convert.JSON.encode((request).toJson()); |
607 } | 607 } |
608 if (accountId == null) { | 608 if (accountId == null) { |
609 throw new core.ArgumentError("Parameter accountId is required."); | 609 throw new core.ArgumentError("Parameter accountId is required."); |
610 } | 610 } |
611 if (adClientId == null) { | 611 if (adClientId == null) { |
612 throw new core.ArgumentError("Parameter adClientId is required."); | 612 throw new core.ArgumentError("Parameter adClientId is required."); |
613 } | 613 } |
614 | 614 |
615 | 615 |
616 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + '
/adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') + '/adunits'
; | 616 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId') + '/adclien
ts/' + commons.Escaper.ecapeVariable('$adClientId') + '/adunits'; |
617 | 617 |
618 var _response = _requester.request(_url, | 618 var _response = _requester.request(_url, |
619 "PUT", | 619 "PUT", |
620 body: _body, | 620 body: _body, |
621 queryParams: _queryParams, | 621 queryParams: _queryParams, |
622 uploadOptions: _uploadOptions, | 622 uploadOptions: _uploadOptions, |
623 uploadMedia: _uploadMedia, | 623 uploadMedia: _uploadMedia, |
624 downloadOptions: _downloadOptions); | 624 downloadOptions: _downloadOptions); |
625 return _response.then((data) => new AdUnit.fromJson(data)); | 625 return _response.then((data) => new AdUnit.fromJson(data)); |
626 } | 626 } |
627 | 627 |
628 } | 628 } |
629 | 629 |
630 | 630 |
631 /** Not documented yet. */ | |
632 class AccountsReportsResourceApi { | 631 class AccountsReportsResourceApi { |
633 final common_internal.ApiRequester _requester; | 632 final commons.ApiRequester _requester; |
634 | 633 |
635 AccountsReportsResourceApi(common_internal.ApiRequester client) : | 634 AccountsReportsResourceApi(commons.ApiRequester client) : |
636 _requester = client; | 635 _requester = client; |
637 | 636 |
638 /** | 637 /** |
639 * Generate an AdSense report based on the report request sent in the query | 638 * Generate an AdSense report based on the report request sent in the query |
640 * parameters. Returns the result as JSON; to retrieve output in CSV format | 639 * parameters. Returns the result as JSON; to retrieve output in CSV format |
641 * specify "alt=csv" as a query parameter. | 640 * specify "alt=csv" as a query parameter. |
642 * | 641 * |
643 * Request parameters: | 642 * Request parameters: |
644 * | 643 * |
645 * [accountId] - Hosted account upon which to report. | 644 * [accountId] - Hosted account upon which to report. |
(...skipping 27 matching lines...) Expand all Loading... |
673 * [sort] - The name of a dimension or metric to sort the resulting report on, | 672 * [sort] - The name of a dimension or metric to sort the resulting report on, |
674 * optionally prefixed with "+" to sort ascending or "-" to sort descending. | 673 * optionally prefixed with "+" to sort ascending or "-" to sort descending. |
675 * If no prefix is specified, the column is sorted ascending. | 674 * If no prefix is specified, the column is sorted ascending. |
676 * Value must have pattern "(\+|-)?[a-zA-Z_]+". | 675 * Value must have pattern "(\+|-)?[a-zA-Z_]+". |
677 * | 676 * |
678 * [startIndex] - Index of the first row of report data to return. | 677 * [startIndex] - Index of the first row of report data to return. |
679 * Value must be between "0" and "5000". | 678 * Value must be between "0" and "5000". |
680 * | 679 * |
681 * Completes with a [Report]. | 680 * Completes with a [Report]. |
682 * | 681 * |
683 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 682 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
684 * error. | 683 * error. |
685 * | 684 * |
686 * If the used [http.Client] completes with an error when making a REST call, | 685 * If the used [http.Client] completes with an error when making a REST call, |
687 * this method will complete with the same error. | 686 * this method will complete with the same error. |
688 */ | 687 */ |
689 async.Future<Report> generate(core.String accountId, core.String startDate, co
re.String endDate, {core.List<core.String> dimension, core.List<core.String> fil
ter, core.String locale, core.int maxResults, core.List<core.String> metric, cor
e.List<core.String> sort, core.int startIndex}) { | 688 async.Future<Report> generate(core.String accountId, core.String startDate, co
re.String endDate, {core.List<core.String> dimension, core.List<core.String> fil
ter, core.String locale, core.int maxResults, core.List<core.String> metric, cor
e.List<core.String> sort, core.int startIndex}) { |
690 var _url = null; | 689 var _url = null; |
691 var _queryParams = new core.Map(); | 690 var _queryParams = new core.Map(); |
692 var _uploadMedia = null; | 691 var _uploadMedia = null; |
693 var _uploadOptions = null; | 692 var _uploadOptions = null; |
694 var _downloadOptions = common.DownloadOptions.Metadata; | 693 var _downloadOptions = commons.DownloadOptions.Metadata; |
695 var _body = null; | 694 var _body = null; |
696 | 695 |
697 if (accountId == null) { | 696 if (accountId == null) { |
698 throw new core.ArgumentError("Parameter accountId is required."); | 697 throw new core.ArgumentError("Parameter accountId is required."); |
699 } | 698 } |
700 if (startDate == null) { | 699 if (startDate == null) { |
701 throw new core.ArgumentError("Parameter startDate is required."); | 700 throw new core.ArgumentError("Parameter startDate is required."); |
702 } | 701 } |
703 _queryParams["startDate"] = [startDate]; | 702 _queryParams["startDate"] = [startDate]; |
704 if (endDate == null) { | 703 if (endDate == null) { |
(...skipping 16 matching lines...) Expand all Loading... |
721 _queryParams["metric"] = metric; | 720 _queryParams["metric"] = metric; |
722 } | 721 } |
723 if (sort != null) { | 722 if (sort != null) { |
724 _queryParams["sort"] = sort; | 723 _queryParams["sort"] = sort; |
725 } | 724 } |
726 if (startIndex != null) { | 725 if (startIndex != null) { |
727 _queryParams["startIndex"] = ["${startIndex}"]; | 726 _queryParams["startIndex"] = ["${startIndex}"]; |
728 } | 727 } |
729 | 728 |
730 | 729 |
731 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$accountId') + '
/reports'; | 730 _url = 'accounts/' + commons.Escaper.ecapeVariable('$accountId') + '/reports
'; |
732 | 731 |
733 var _response = _requester.request(_url, | 732 var _response = _requester.request(_url, |
734 "GET", | 733 "GET", |
735 body: _body, | 734 body: _body, |
736 queryParams: _queryParams, | 735 queryParams: _queryParams, |
737 uploadOptions: _uploadOptions, | 736 uploadOptions: _uploadOptions, |
738 uploadMedia: _uploadMedia, | 737 uploadMedia: _uploadMedia, |
739 downloadOptions: _downloadOptions); | 738 downloadOptions: _downloadOptions); |
740 return _response.then((data) => new Report.fromJson(data)); | 739 return _response.then((data) => new Report.fromJson(data)); |
741 } | 740 } |
742 | 741 |
743 } | 742 } |
744 | 743 |
745 | 744 |
746 /** Not documented yet. */ | |
747 class AdclientsResourceApi { | 745 class AdclientsResourceApi { |
748 final common_internal.ApiRequester _requester; | 746 final commons.ApiRequester _requester; |
749 | 747 |
750 AdclientsResourceApi(common_internal.ApiRequester client) : | 748 AdclientsResourceApi(commons.ApiRequester client) : |
751 _requester = client; | 749 _requester = client; |
752 | 750 |
753 /** | 751 /** |
754 * Get information about one of the ad clients in the Host AdSense account. | 752 * Get information about one of the ad clients in the Host AdSense account. |
755 * | 753 * |
756 * Request parameters: | 754 * Request parameters: |
757 * | 755 * |
758 * [adClientId] - Ad client to get. | 756 * [adClientId] - Ad client to get. |
759 * | 757 * |
760 * Completes with a [AdClient]. | 758 * Completes with a [AdClient]. |
761 * | 759 * |
762 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 760 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
763 * error. | 761 * error. |
764 * | 762 * |
765 * If the used [http.Client] completes with an error when making a REST call, | 763 * If the used [http.Client] completes with an error when making a REST call, |
766 * this method will complete with the same error. | 764 * this method will complete with the same error. |
767 */ | 765 */ |
768 async.Future<AdClient> get(core.String adClientId) { | 766 async.Future<AdClient> get(core.String adClientId) { |
769 var _url = null; | 767 var _url = null; |
770 var _queryParams = new core.Map(); | 768 var _queryParams = new core.Map(); |
771 var _uploadMedia = null; | 769 var _uploadMedia = null; |
772 var _uploadOptions = null; | 770 var _uploadOptions = null; |
773 var _downloadOptions = common.DownloadOptions.Metadata; | 771 var _downloadOptions = commons.DownloadOptions.Metadata; |
774 var _body = null; | 772 var _body = null; |
775 | 773 |
776 if (adClientId == null) { | 774 if (adClientId == null) { |
777 throw new core.ArgumentError("Parameter adClientId is required."); | 775 throw new core.ArgumentError("Parameter adClientId is required."); |
778 } | 776 } |
779 | 777 |
780 | 778 |
781 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId'); | 779 _url = 'adclients/' + commons.Escaper.ecapeVariable('$adClientId'); |
782 | 780 |
783 var _response = _requester.request(_url, | 781 var _response = _requester.request(_url, |
784 "GET", | 782 "GET", |
785 body: _body, | 783 body: _body, |
786 queryParams: _queryParams, | 784 queryParams: _queryParams, |
787 uploadOptions: _uploadOptions, | 785 uploadOptions: _uploadOptions, |
788 uploadMedia: _uploadMedia, | 786 uploadMedia: _uploadMedia, |
789 downloadOptions: _downloadOptions); | 787 downloadOptions: _downloadOptions); |
790 return _response.then((data) => new AdClient.fromJson(data)); | 788 return _response.then((data) => new AdClient.fromJson(data)); |
791 } | 789 } |
792 | 790 |
793 /** | 791 /** |
794 * List all host ad clients in this AdSense account. | 792 * List all host ad clients in this AdSense account. |
795 * | 793 * |
796 * Request parameters: | 794 * Request parameters: |
797 * | 795 * |
798 * [maxResults] - The maximum number of ad clients to include in the response, | 796 * [maxResults] - The maximum number of ad clients to include in the response, |
799 * used for paging. | 797 * used for paging. |
800 * Value must be between "0" and "10000". | 798 * Value must be between "0" and "10000". |
801 * | 799 * |
802 * [pageToken] - A continuation token, used to page through ad clients. To | 800 * [pageToken] - A continuation token, used to page through ad clients. To |
803 * retrieve the next page, set this parameter to the value of "nextPageToken" | 801 * retrieve the next page, set this parameter to the value of "nextPageToken" |
804 * from the previous response. | 802 * from the previous response. |
805 * | 803 * |
806 * Completes with a [AdClients]. | 804 * Completes with a [AdClients]. |
807 * | 805 * |
808 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 806 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
809 * error. | 807 * error. |
810 * | 808 * |
811 * If the used [http.Client] completes with an error when making a REST call, | 809 * If the used [http.Client] completes with an error when making a REST call, |
812 * this method will complete with the same error. | 810 * this method will complete with the same error. |
813 */ | 811 */ |
814 async.Future<AdClients> list({core.int maxResults, core.String pageToken}) { | 812 async.Future<AdClients> list({core.int maxResults, core.String pageToken}) { |
815 var _url = null; | 813 var _url = null; |
816 var _queryParams = new core.Map(); | 814 var _queryParams = new core.Map(); |
817 var _uploadMedia = null; | 815 var _uploadMedia = null; |
818 var _uploadOptions = null; | 816 var _uploadOptions = null; |
819 var _downloadOptions = common.DownloadOptions.Metadata; | 817 var _downloadOptions = commons.DownloadOptions.Metadata; |
820 var _body = null; | 818 var _body = null; |
821 | 819 |
822 if (maxResults != null) { | 820 if (maxResults != null) { |
823 _queryParams["maxResults"] = ["${maxResults}"]; | 821 _queryParams["maxResults"] = ["${maxResults}"]; |
824 } | 822 } |
825 if (pageToken != null) { | 823 if (pageToken != null) { |
826 _queryParams["pageToken"] = [pageToken]; | 824 _queryParams["pageToken"] = [pageToken]; |
827 } | 825 } |
828 | 826 |
829 | 827 |
830 _url = 'adclients'; | 828 _url = 'adclients'; |
831 | 829 |
832 var _response = _requester.request(_url, | 830 var _response = _requester.request(_url, |
833 "GET", | 831 "GET", |
834 body: _body, | 832 body: _body, |
835 queryParams: _queryParams, | 833 queryParams: _queryParams, |
836 uploadOptions: _uploadOptions, | 834 uploadOptions: _uploadOptions, |
837 uploadMedia: _uploadMedia, | 835 uploadMedia: _uploadMedia, |
838 downloadOptions: _downloadOptions); | 836 downloadOptions: _downloadOptions); |
839 return _response.then((data) => new AdClients.fromJson(data)); | 837 return _response.then((data) => new AdClients.fromJson(data)); |
840 } | 838 } |
841 | 839 |
842 } | 840 } |
843 | 841 |
844 | 842 |
845 /** Not documented yet. */ | |
846 class AssociationsessionsResourceApi { | 843 class AssociationsessionsResourceApi { |
847 final common_internal.ApiRequester _requester; | 844 final commons.ApiRequester _requester; |
848 | 845 |
849 AssociationsessionsResourceApi(common_internal.ApiRequester client) : | 846 AssociationsessionsResourceApi(commons.ApiRequester client) : |
850 _requester = client; | 847 _requester = client; |
851 | 848 |
852 /** | 849 /** |
853 * Create an association session for initiating an association with an AdSense | 850 * Create an association session for initiating an association with an AdSense |
854 * user. | 851 * user. |
855 * | 852 * |
856 * Request parameters: | 853 * Request parameters: |
857 * | 854 * |
858 * [productCode] - Products to associate with the user. | 855 * [productCode] - Products to associate with the user. |
859 * | 856 * |
860 * [websiteUrl] - The URL of the user's hosted website. | 857 * [websiteUrl] - The URL of the user's hosted website. |
861 * | 858 * |
862 * [userLocale] - The preferred locale of the user. | 859 * [userLocale] - The preferred locale of the user. |
863 * | 860 * |
864 * [websiteLocale] - The locale of the user's hosted website. | 861 * [websiteLocale] - The locale of the user's hosted website. |
865 * | 862 * |
866 * Completes with a [AssociationSession]. | 863 * Completes with a [AssociationSession]. |
867 * | 864 * |
868 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 865 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
869 * error. | 866 * error. |
870 * | 867 * |
871 * If the used [http.Client] completes with an error when making a REST call, | 868 * If the used [http.Client] completes with an error when making a REST call, |
872 * this method will complete with the same error. | 869 * this method will complete with the same error. |
873 */ | 870 */ |
874 async.Future<AssociationSession> start(core.List<core.String> productCode, cor
e.String websiteUrl, {core.String userLocale, core.String websiteLocale}) { | 871 async.Future<AssociationSession> start(core.List<core.String> productCode, cor
e.String websiteUrl, {core.String userLocale, core.String websiteLocale}) { |
875 var _url = null; | 872 var _url = null; |
876 var _queryParams = new core.Map(); | 873 var _queryParams = new core.Map(); |
877 var _uploadMedia = null; | 874 var _uploadMedia = null; |
878 var _uploadOptions = null; | 875 var _uploadOptions = null; |
879 var _downloadOptions = common.DownloadOptions.Metadata; | 876 var _downloadOptions = commons.DownloadOptions.Metadata; |
880 var _body = null; | 877 var _body = null; |
881 | 878 |
882 if (productCode == null || productCode.isEmpty) { | 879 if (productCode == null || productCode.isEmpty) { |
883 throw new core.ArgumentError("Parameter productCode is required."); | 880 throw new core.ArgumentError("Parameter productCode is required."); |
884 } | 881 } |
885 _queryParams["productCode"] = productCode; | 882 _queryParams["productCode"] = productCode; |
886 if (websiteUrl == null) { | 883 if (websiteUrl == null) { |
887 throw new core.ArgumentError("Parameter websiteUrl is required."); | 884 throw new core.ArgumentError("Parameter websiteUrl is required."); |
888 } | 885 } |
889 _queryParams["websiteUrl"] = [websiteUrl]; | 886 _queryParams["websiteUrl"] = [websiteUrl]; |
(...skipping 20 matching lines...) Expand all Loading... |
910 /** | 907 /** |
911 * Verify an association session after the association callback returns from | 908 * Verify an association session after the association callback returns from |
912 * AdSense signup. | 909 * AdSense signup. |
913 * | 910 * |
914 * Request parameters: | 911 * Request parameters: |
915 * | 912 * |
916 * [token] - The token returned to the association callback URL. | 913 * [token] - The token returned to the association callback URL. |
917 * | 914 * |
918 * Completes with a [AssociationSession]. | 915 * Completes with a [AssociationSession]. |
919 * | 916 * |
920 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 917 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
921 * error. | 918 * error. |
922 * | 919 * |
923 * If the used [http.Client] completes with an error when making a REST call, | 920 * If the used [http.Client] completes with an error when making a REST call, |
924 * this method will complete with the same error. | 921 * this method will complete with the same error. |
925 */ | 922 */ |
926 async.Future<AssociationSession> verify(core.String token) { | 923 async.Future<AssociationSession> verify(core.String token) { |
927 var _url = null; | 924 var _url = null; |
928 var _queryParams = new core.Map(); | 925 var _queryParams = new core.Map(); |
929 var _uploadMedia = null; | 926 var _uploadMedia = null; |
930 var _uploadOptions = null; | 927 var _uploadOptions = null; |
931 var _downloadOptions = common.DownloadOptions.Metadata; | 928 var _downloadOptions = commons.DownloadOptions.Metadata; |
932 var _body = null; | 929 var _body = null; |
933 | 930 |
934 if (token == null) { | 931 if (token == null) { |
935 throw new core.ArgumentError("Parameter token is required."); | 932 throw new core.ArgumentError("Parameter token is required."); |
936 } | 933 } |
937 _queryParams["token"] = [token]; | 934 _queryParams["token"] = [token]; |
938 | 935 |
939 | 936 |
940 _url = 'associationsessions/verify'; | 937 _url = 'associationsessions/verify'; |
941 | 938 |
942 var _response = _requester.request(_url, | 939 var _response = _requester.request(_url, |
943 "GET", | 940 "GET", |
944 body: _body, | 941 body: _body, |
945 queryParams: _queryParams, | 942 queryParams: _queryParams, |
946 uploadOptions: _uploadOptions, | 943 uploadOptions: _uploadOptions, |
947 uploadMedia: _uploadMedia, | 944 uploadMedia: _uploadMedia, |
948 downloadOptions: _downloadOptions); | 945 downloadOptions: _downloadOptions); |
949 return _response.then((data) => new AssociationSession.fromJson(data)); | 946 return _response.then((data) => new AssociationSession.fromJson(data)); |
950 } | 947 } |
951 | 948 |
952 } | 949 } |
953 | 950 |
954 | 951 |
955 /** Not documented yet. */ | |
956 class CustomchannelsResourceApi { | 952 class CustomchannelsResourceApi { |
957 final common_internal.ApiRequester _requester; | 953 final commons.ApiRequester _requester; |
958 | 954 |
959 CustomchannelsResourceApi(common_internal.ApiRequester client) : | 955 CustomchannelsResourceApi(commons.ApiRequester client) : |
960 _requester = client; | 956 _requester = client; |
961 | 957 |
962 /** | 958 /** |
963 * Delete a specific custom channel from the host AdSense account. | 959 * Delete a specific custom channel from the host AdSense account. |
964 * | 960 * |
965 * Request parameters: | 961 * Request parameters: |
966 * | 962 * |
967 * [adClientId] - Ad client from which to delete the custom channel. | 963 * [adClientId] - Ad client from which to delete the custom channel. |
968 * | 964 * |
969 * [customChannelId] - Custom channel to delete. | 965 * [customChannelId] - Custom channel to delete. |
970 * | 966 * |
971 * Completes with a [CustomChannel]. | 967 * Completes with a [CustomChannel]. |
972 * | 968 * |
973 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 969 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
974 * error. | 970 * error. |
975 * | 971 * |
976 * If the used [http.Client] completes with an error when making a REST call, | 972 * If the used [http.Client] completes with an error when making a REST call, |
977 * this method will complete with the same error. | 973 * this method will complete with the same error. |
978 */ | 974 */ |
979 async.Future<CustomChannel> delete(core.String adClientId, core.String customC
hannelId) { | 975 async.Future<CustomChannel> delete(core.String adClientId, core.String customC
hannelId) { |
980 var _url = null; | 976 var _url = null; |
981 var _queryParams = new core.Map(); | 977 var _queryParams = new core.Map(); |
982 var _uploadMedia = null; | 978 var _uploadMedia = null; |
983 var _uploadOptions = null; | 979 var _uploadOptions = null; |
984 var _downloadOptions = common.DownloadOptions.Metadata; | 980 var _downloadOptions = commons.DownloadOptions.Metadata; |
985 var _body = null; | 981 var _body = null; |
986 | 982 |
987 if (adClientId == null) { | 983 if (adClientId == null) { |
988 throw new core.ArgumentError("Parameter adClientId is required."); | 984 throw new core.ArgumentError("Parameter adClientId is required."); |
989 } | 985 } |
990 if (customChannelId == null) { | 986 if (customChannelId == null) { |
991 throw new core.ArgumentError("Parameter customChannelId is required."); | 987 throw new core.ArgumentError("Parameter customChannelId is required."); |
992 } | 988 } |
993 | 989 |
994 | 990 |
995 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') +
'/customchannels/' + common_internal.Escaper.ecapeVariable('$customChannelId'); | 991 _url = 'adclients/' + commons.Escaper.ecapeVariable('$adClientId') + '/custo
mchannels/' + commons.Escaper.ecapeVariable('$customChannelId'); |
996 | 992 |
997 var _response = _requester.request(_url, | 993 var _response = _requester.request(_url, |
998 "DELETE", | 994 "DELETE", |
999 body: _body, | 995 body: _body, |
1000 queryParams: _queryParams, | 996 queryParams: _queryParams, |
1001 uploadOptions: _uploadOptions, | 997 uploadOptions: _uploadOptions, |
1002 uploadMedia: _uploadMedia, | 998 uploadMedia: _uploadMedia, |
1003 downloadOptions: _downloadOptions); | 999 downloadOptions: _downloadOptions); |
1004 return _response.then((data) => new CustomChannel.fromJson(data)); | 1000 return _response.then((data) => new CustomChannel.fromJson(data)); |
1005 } | 1001 } |
1006 | 1002 |
1007 /** | 1003 /** |
1008 * Get a specific custom channel from the host AdSense account. | 1004 * Get a specific custom channel from the host AdSense account. |
1009 * | 1005 * |
1010 * Request parameters: | 1006 * Request parameters: |
1011 * | 1007 * |
1012 * [adClientId] - Ad client from which to get the custom channel. | 1008 * [adClientId] - Ad client from which to get the custom channel. |
1013 * | 1009 * |
1014 * [customChannelId] - Custom channel to get. | 1010 * [customChannelId] - Custom channel to get. |
1015 * | 1011 * |
1016 * Completes with a [CustomChannel]. | 1012 * Completes with a [CustomChannel]. |
1017 * | 1013 * |
1018 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1014 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1019 * error. | 1015 * error. |
1020 * | 1016 * |
1021 * If the used [http.Client] completes with an error when making a REST call, | 1017 * If the used [http.Client] completes with an error when making a REST call, |
1022 * this method will complete with the same error. | 1018 * this method will complete with the same error. |
1023 */ | 1019 */ |
1024 async.Future<CustomChannel> get(core.String adClientId, core.String customChan
nelId) { | 1020 async.Future<CustomChannel> get(core.String adClientId, core.String customChan
nelId) { |
1025 var _url = null; | 1021 var _url = null; |
1026 var _queryParams = new core.Map(); | 1022 var _queryParams = new core.Map(); |
1027 var _uploadMedia = null; | 1023 var _uploadMedia = null; |
1028 var _uploadOptions = null; | 1024 var _uploadOptions = null; |
1029 var _downloadOptions = common.DownloadOptions.Metadata; | 1025 var _downloadOptions = commons.DownloadOptions.Metadata; |
1030 var _body = null; | 1026 var _body = null; |
1031 | 1027 |
1032 if (adClientId == null) { | 1028 if (adClientId == null) { |
1033 throw new core.ArgumentError("Parameter adClientId is required."); | 1029 throw new core.ArgumentError("Parameter adClientId is required."); |
1034 } | 1030 } |
1035 if (customChannelId == null) { | 1031 if (customChannelId == null) { |
1036 throw new core.ArgumentError("Parameter customChannelId is required."); | 1032 throw new core.ArgumentError("Parameter customChannelId is required."); |
1037 } | 1033 } |
1038 | 1034 |
1039 | 1035 |
1040 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') +
'/customchannels/' + common_internal.Escaper.ecapeVariable('$customChannelId'); | 1036 _url = 'adclients/' + commons.Escaper.ecapeVariable('$adClientId') + '/custo
mchannels/' + commons.Escaper.ecapeVariable('$customChannelId'); |
1041 | 1037 |
1042 var _response = _requester.request(_url, | 1038 var _response = _requester.request(_url, |
1043 "GET", | 1039 "GET", |
1044 body: _body, | 1040 body: _body, |
1045 queryParams: _queryParams, | 1041 queryParams: _queryParams, |
1046 uploadOptions: _uploadOptions, | 1042 uploadOptions: _uploadOptions, |
1047 uploadMedia: _uploadMedia, | 1043 uploadMedia: _uploadMedia, |
1048 downloadOptions: _downloadOptions); | 1044 downloadOptions: _downloadOptions); |
1049 return _response.then((data) => new CustomChannel.fromJson(data)); | 1045 return _response.then((data) => new CustomChannel.fromJson(data)); |
1050 } | 1046 } |
1051 | 1047 |
1052 /** | 1048 /** |
1053 * Add a new custom channel to the host AdSense account. | 1049 * Add a new custom channel to the host AdSense account. |
1054 * | 1050 * |
1055 * [request] - The metadata request object. | 1051 * [request] - The metadata request object. |
1056 * | 1052 * |
1057 * Request parameters: | 1053 * Request parameters: |
1058 * | 1054 * |
1059 * [adClientId] - Ad client to which the new custom channel will be added. | 1055 * [adClientId] - Ad client to which the new custom channel will be added. |
1060 * | 1056 * |
1061 * Completes with a [CustomChannel]. | 1057 * Completes with a [CustomChannel]. |
1062 * | 1058 * |
1063 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1059 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1064 * error. | 1060 * error. |
1065 * | 1061 * |
1066 * If the used [http.Client] completes with an error when making a REST call, | 1062 * If the used [http.Client] completes with an error when making a REST call, |
1067 * this method will complete with the same error. | 1063 * this method will complete with the same error. |
1068 */ | 1064 */ |
1069 async.Future<CustomChannel> insert(CustomChannel request, core.String adClient
Id) { | 1065 async.Future<CustomChannel> insert(CustomChannel request, core.String adClient
Id) { |
1070 var _url = null; | 1066 var _url = null; |
1071 var _queryParams = new core.Map(); | 1067 var _queryParams = new core.Map(); |
1072 var _uploadMedia = null; | 1068 var _uploadMedia = null; |
1073 var _uploadOptions = null; | 1069 var _uploadOptions = null; |
1074 var _downloadOptions = common.DownloadOptions.Metadata; | 1070 var _downloadOptions = commons.DownloadOptions.Metadata; |
1075 var _body = null; | 1071 var _body = null; |
1076 | 1072 |
1077 if (request != null) { | 1073 if (request != null) { |
1078 _body = convert.JSON.encode((request).toJson()); | 1074 _body = convert.JSON.encode((request).toJson()); |
1079 } | 1075 } |
1080 if (adClientId == null) { | 1076 if (adClientId == null) { |
1081 throw new core.ArgumentError("Parameter adClientId is required."); | 1077 throw new core.ArgumentError("Parameter adClientId is required."); |
1082 } | 1078 } |
1083 | 1079 |
1084 | 1080 |
1085 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') +
'/customchannels'; | 1081 _url = 'adclients/' + commons.Escaper.ecapeVariable('$adClientId') + '/custo
mchannels'; |
1086 | 1082 |
1087 var _response = _requester.request(_url, | 1083 var _response = _requester.request(_url, |
1088 "POST", | 1084 "POST", |
1089 body: _body, | 1085 body: _body, |
1090 queryParams: _queryParams, | 1086 queryParams: _queryParams, |
1091 uploadOptions: _uploadOptions, | 1087 uploadOptions: _uploadOptions, |
1092 uploadMedia: _uploadMedia, | 1088 uploadMedia: _uploadMedia, |
1093 downloadOptions: _downloadOptions); | 1089 downloadOptions: _downloadOptions); |
1094 return _response.then((data) => new CustomChannel.fromJson(data)); | 1090 return _response.then((data) => new CustomChannel.fromJson(data)); |
1095 } | 1091 } |
1096 | 1092 |
1097 /** | 1093 /** |
1098 * List all host custom channels in this AdSense account. | 1094 * List all host custom channels in this AdSense account. |
1099 * | 1095 * |
1100 * Request parameters: | 1096 * Request parameters: |
1101 * | 1097 * |
1102 * [adClientId] - Ad client for which to list custom channels. | 1098 * [adClientId] - Ad client for which to list custom channels. |
1103 * | 1099 * |
1104 * [maxResults] - The maximum number of custom channels to include in the | 1100 * [maxResults] - The maximum number of custom channels to include in the |
1105 * response, used for paging. | 1101 * response, used for paging. |
1106 * Value must be between "0" and "10000". | 1102 * Value must be between "0" and "10000". |
1107 * | 1103 * |
1108 * [pageToken] - A continuation token, used to page through custom channels. | 1104 * [pageToken] - A continuation token, used to page through custom channels. |
1109 * To retrieve the next page, set this parameter to the value of | 1105 * To retrieve the next page, set this parameter to the value of |
1110 * "nextPageToken" from the previous response. | 1106 * "nextPageToken" from the previous response. |
1111 * | 1107 * |
1112 * Completes with a [CustomChannels]. | 1108 * Completes with a [CustomChannels]. |
1113 * | 1109 * |
1114 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1110 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1115 * error. | 1111 * error. |
1116 * | 1112 * |
1117 * If the used [http.Client] completes with an error when making a REST call, | 1113 * If the used [http.Client] completes with an error when making a REST call, |
1118 * this method will complete with the same error. | 1114 * this method will complete with the same error. |
1119 */ | 1115 */ |
1120 async.Future<CustomChannels> list(core.String adClientId, {core.int maxResults
, core.String pageToken}) { | 1116 async.Future<CustomChannels> list(core.String adClientId, {core.int maxResults
, core.String pageToken}) { |
1121 var _url = null; | 1117 var _url = null; |
1122 var _queryParams = new core.Map(); | 1118 var _queryParams = new core.Map(); |
1123 var _uploadMedia = null; | 1119 var _uploadMedia = null; |
1124 var _uploadOptions = null; | 1120 var _uploadOptions = null; |
1125 var _downloadOptions = common.DownloadOptions.Metadata; | 1121 var _downloadOptions = commons.DownloadOptions.Metadata; |
1126 var _body = null; | 1122 var _body = null; |
1127 | 1123 |
1128 if (adClientId == null) { | 1124 if (adClientId == null) { |
1129 throw new core.ArgumentError("Parameter adClientId is required."); | 1125 throw new core.ArgumentError("Parameter adClientId is required."); |
1130 } | 1126 } |
1131 if (maxResults != null) { | 1127 if (maxResults != null) { |
1132 _queryParams["maxResults"] = ["${maxResults}"]; | 1128 _queryParams["maxResults"] = ["${maxResults}"]; |
1133 } | 1129 } |
1134 if (pageToken != null) { | 1130 if (pageToken != null) { |
1135 _queryParams["pageToken"] = [pageToken]; | 1131 _queryParams["pageToken"] = [pageToken]; |
1136 } | 1132 } |
1137 | 1133 |
1138 | 1134 |
1139 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') +
'/customchannels'; | 1135 _url = 'adclients/' + commons.Escaper.ecapeVariable('$adClientId') + '/custo
mchannels'; |
1140 | 1136 |
1141 var _response = _requester.request(_url, | 1137 var _response = _requester.request(_url, |
1142 "GET", | 1138 "GET", |
1143 body: _body, | 1139 body: _body, |
1144 queryParams: _queryParams, | 1140 queryParams: _queryParams, |
1145 uploadOptions: _uploadOptions, | 1141 uploadOptions: _uploadOptions, |
1146 uploadMedia: _uploadMedia, | 1142 uploadMedia: _uploadMedia, |
1147 downloadOptions: _downloadOptions); | 1143 downloadOptions: _downloadOptions); |
1148 return _response.then((data) => new CustomChannels.fromJson(data)); | 1144 return _response.then((data) => new CustomChannels.fromJson(data)); |
1149 } | 1145 } |
1150 | 1146 |
1151 /** | 1147 /** |
1152 * Update a custom channel in the host AdSense account. This method supports | 1148 * Update a custom channel in the host AdSense account. This method supports |
1153 * patch semantics. | 1149 * patch semantics. |
1154 * | 1150 * |
1155 * [request] - The metadata request object. | 1151 * [request] - The metadata request object. |
1156 * | 1152 * |
1157 * Request parameters: | 1153 * Request parameters: |
1158 * | 1154 * |
1159 * [adClientId] - Ad client in which the custom channel will be updated. | 1155 * [adClientId] - Ad client in which the custom channel will be updated. |
1160 * | 1156 * |
1161 * [customChannelId] - Custom channel to get. | 1157 * [customChannelId] - Custom channel to get. |
1162 * | 1158 * |
1163 * Completes with a [CustomChannel]. | 1159 * Completes with a [CustomChannel]. |
1164 * | 1160 * |
1165 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1161 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1166 * error. | 1162 * error. |
1167 * | 1163 * |
1168 * If the used [http.Client] completes with an error when making a REST call, | 1164 * If the used [http.Client] completes with an error when making a REST call, |
1169 * this method will complete with the same error. | 1165 * this method will complete with the same error. |
1170 */ | 1166 */ |
1171 async.Future<CustomChannel> patch(CustomChannel request, core.String adClientI
d, core.String customChannelId) { | 1167 async.Future<CustomChannel> patch(CustomChannel request, core.String adClientI
d, core.String customChannelId) { |
1172 var _url = null; | 1168 var _url = null; |
1173 var _queryParams = new core.Map(); | 1169 var _queryParams = new core.Map(); |
1174 var _uploadMedia = null; | 1170 var _uploadMedia = null; |
1175 var _uploadOptions = null; | 1171 var _uploadOptions = null; |
1176 var _downloadOptions = common.DownloadOptions.Metadata; | 1172 var _downloadOptions = commons.DownloadOptions.Metadata; |
1177 var _body = null; | 1173 var _body = null; |
1178 | 1174 |
1179 if (request != null) { | 1175 if (request != null) { |
1180 _body = convert.JSON.encode((request).toJson()); | 1176 _body = convert.JSON.encode((request).toJson()); |
1181 } | 1177 } |
1182 if (adClientId == null) { | 1178 if (adClientId == null) { |
1183 throw new core.ArgumentError("Parameter adClientId is required."); | 1179 throw new core.ArgumentError("Parameter adClientId is required."); |
1184 } | 1180 } |
1185 if (customChannelId == null) { | 1181 if (customChannelId == null) { |
1186 throw new core.ArgumentError("Parameter customChannelId is required."); | 1182 throw new core.ArgumentError("Parameter customChannelId is required."); |
1187 } | 1183 } |
1188 _queryParams["customChannelId"] = [customChannelId]; | 1184 _queryParams["customChannelId"] = [customChannelId]; |
1189 | 1185 |
1190 | 1186 |
1191 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') +
'/customchannels'; | 1187 _url = 'adclients/' + commons.Escaper.ecapeVariable('$adClientId') + '/custo
mchannels'; |
1192 | 1188 |
1193 var _response = _requester.request(_url, | 1189 var _response = _requester.request(_url, |
1194 "PATCH", | 1190 "PATCH", |
1195 body: _body, | 1191 body: _body, |
1196 queryParams: _queryParams, | 1192 queryParams: _queryParams, |
1197 uploadOptions: _uploadOptions, | 1193 uploadOptions: _uploadOptions, |
1198 uploadMedia: _uploadMedia, | 1194 uploadMedia: _uploadMedia, |
1199 downloadOptions: _downloadOptions); | 1195 downloadOptions: _downloadOptions); |
1200 return _response.then((data) => new CustomChannel.fromJson(data)); | 1196 return _response.then((data) => new CustomChannel.fromJson(data)); |
1201 } | 1197 } |
1202 | 1198 |
1203 /** | 1199 /** |
1204 * Update a custom channel in the host AdSense account. | 1200 * Update a custom channel in the host AdSense account. |
1205 * | 1201 * |
1206 * [request] - The metadata request object. | 1202 * [request] - The metadata request object. |
1207 * | 1203 * |
1208 * Request parameters: | 1204 * Request parameters: |
1209 * | 1205 * |
1210 * [adClientId] - Ad client in which the custom channel will be updated. | 1206 * [adClientId] - Ad client in which the custom channel will be updated. |
1211 * | 1207 * |
1212 * Completes with a [CustomChannel]. | 1208 * Completes with a [CustomChannel]. |
1213 * | 1209 * |
1214 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1210 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1215 * error. | 1211 * error. |
1216 * | 1212 * |
1217 * If the used [http.Client] completes with an error when making a REST call, | 1213 * If the used [http.Client] completes with an error when making a REST call, |
1218 * this method will complete with the same error. | 1214 * this method will complete with the same error. |
1219 */ | 1215 */ |
1220 async.Future<CustomChannel> update(CustomChannel request, core.String adClient
Id) { | 1216 async.Future<CustomChannel> update(CustomChannel request, core.String adClient
Id) { |
1221 var _url = null; | 1217 var _url = null; |
1222 var _queryParams = new core.Map(); | 1218 var _queryParams = new core.Map(); |
1223 var _uploadMedia = null; | 1219 var _uploadMedia = null; |
1224 var _uploadOptions = null; | 1220 var _uploadOptions = null; |
1225 var _downloadOptions = common.DownloadOptions.Metadata; | 1221 var _downloadOptions = commons.DownloadOptions.Metadata; |
1226 var _body = null; | 1222 var _body = null; |
1227 | 1223 |
1228 if (request != null) { | 1224 if (request != null) { |
1229 _body = convert.JSON.encode((request).toJson()); | 1225 _body = convert.JSON.encode((request).toJson()); |
1230 } | 1226 } |
1231 if (adClientId == null) { | 1227 if (adClientId == null) { |
1232 throw new core.ArgumentError("Parameter adClientId is required."); | 1228 throw new core.ArgumentError("Parameter adClientId is required."); |
1233 } | 1229 } |
1234 | 1230 |
1235 | 1231 |
1236 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') +
'/customchannels'; | 1232 _url = 'adclients/' + commons.Escaper.ecapeVariable('$adClientId') + '/custo
mchannels'; |
1237 | 1233 |
1238 var _response = _requester.request(_url, | 1234 var _response = _requester.request(_url, |
1239 "PUT", | 1235 "PUT", |
1240 body: _body, | 1236 body: _body, |
1241 queryParams: _queryParams, | 1237 queryParams: _queryParams, |
1242 uploadOptions: _uploadOptions, | 1238 uploadOptions: _uploadOptions, |
1243 uploadMedia: _uploadMedia, | 1239 uploadMedia: _uploadMedia, |
1244 downloadOptions: _downloadOptions); | 1240 downloadOptions: _downloadOptions); |
1245 return _response.then((data) => new CustomChannel.fromJson(data)); | 1241 return _response.then((data) => new CustomChannel.fromJson(data)); |
1246 } | 1242 } |
1247 | 1243 |
1248 } | 1244 } |
1249 | 1245 |
1250 | 1246 |
1251 /** Not documented yet. */ | |
1252 class ReportsResourceApi { | 1247 class ReportsResourceApi { |
1253 final common_internal.ApiRequester _requester; | 1248 final commons.ApiRequester _requester; |
1254 | 1249 |
1255 ReportsResourceApi(common_internal.ApiRequester client) : | 1250 ReportsResourceApi(commons.ApiRequester client) : |
1256 _requester = client; | 1251 _requester = client; |
1257 | 1252 |
1258 /** | 1253 /** |
1259 * Generate an AdSense report based on the report request sent in the query | 1254 * Generate an AdSense report based on the report request sent in the query |
1260 * parameters. Returns the result as JSON; to retrieve output in CSV format | 1255 * parameters. Returns the result as JSON; to retrieve output in CSV format |
1261 * specify "alt=csv" as a query parameter. | 1256 * specify "alt=csv" as a query parameter. |
1262 * | 1257 * |
1263 * Request parameters: | 1258 * Request parameters: |
1264 * | 1259 * |
1265 * [startDate] - Start of the date range to report on in "YYYY-MM-DD" format, | 1260 * [startDate] - Start of the date range to report on in "YYYY-MM-DD" format, |
(...skipping 25 matching lines...) Expand all Loading... |
1291 * [sort] - The name of a dimension or metric to sort the resulting report on, | 1286 * [sort] - The name of a dimension or metric to sort the resulting report on, |
1292 * optionally prefixed with "+" to sort ascending or "-" to sort descending. | 1287 * optionally prefixed with "+" to sort ascending or "-" to sort descending. |
1293 * If no prefix is specified, the column is sorted ascending. | 1288 * If no prefix is specified, the column is sorted ascending. |
1294 * Value must have pattern "(\+|-)?[a-zA-Z_]+". | 1289 * Value must have pattern "(\+|-)?[a-zA-Z_]+". |
1295 * | 1290 * |
1296 * [startIndex] - Index of the first row of report data to return. | 1291 * [startIndex] - Index of the first row of report data to return. |
1297 * Value must be between "0" and "5000". | 1292 * Value must be between "0" and "5000". |
1298 * | 1293 * |
1299 * Completes with a [Report]. | 1294 * Completes with a [Report]. |
1300 * | 1295 * |
1301 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1296 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1302 * error. | 1297 * error. |
1303 * | 1298 * |
1304 * If the used [http.Client] completes with an error when making a REST call, | 1299 * If the used [http.Client] completes with an error when making a REST call, |
1305 * this method will complete with the same error. | 1300 * this method will complete with the same error. |
1306 */ | 1301 */ |
1307 async.Future<Report> generate(core.String startDate, core.String endDate, {cor
e.List<core.String> dimension, core.List<core.String> filter, core.String locale
, core.int maxResults, core.List<core.String> metric, core.List<core.String> sor
t, core.int startIndex}) { | 1302 async.Future<Report> generate(core.String startDate, core.String endDate, {cor
e.List<core.String> dimension, core.List<core.String> filter, core.String locale
, core.int maxResults, core.List<core.String> metric, core.List<core.String> sor
t, core.int startIndex}) { |
1308 var _url = null; | 1303 var _url = null; |
1309 var _queryParams = new core.Map(); | 1304 var _queryParams = new core.Map(); |
1310 var _uploadMedia = null; | 1305 var _uploadMedia = null; |
1311 var _uploadOptions = null; | 1306 var _uploadOptions = null; |
1312 var _downloadOptions = common.DownloadOptions.Metadata; | 1307 var _downloadOptions = commons.DownloadOptions.Metadata; |
1313 var _body = null; | 1308 var _body = null; |
1314 | 1309 |
1315 if (startDate == null) { | 1310 if (startDate == null) { |
1316 throw new core.ArgumentError("Parameter startDate is required."); | 1311 throw new core.ArgumentError("Parameter startDate is required."); |
1317 } | 1312 } |
1318 _queryParams["startDate"] = [startDate]; | 1313 _queryParams["startDate"] = [startDate]; |
1319 if (endDate == null) { | 1314 if (endDate == null) { |
1320 throw new core.ArgumentError("Parameter endDate is required."); | 1315 throw new core.ArgumentError("Parameter endDate is required."); |
1321 } | 1316 } |
1322 _queryParams["endDate"] = [endDate]; | 1317 _queryParams["endDate"] = [endDate]; |
(...skipping 28 matching lines...) Expand all Loading... |
1351 queryParams: _queryParams, | 1346 queryParams: _queryParams, |
1352 uploadOptions: _uploadOptions, | 1347 uploadOptions: _uploadOptions, |
1353 uploadMedia: _uploadMedia, | 1348 uploadMedia: _uploadMedia, |
1354 downloadOptions: _downloadOptions); | 1349 downloadOptions: _downloadOptions); |
1355 return _response.then((data) => new Report.fromJson(data)); | 1350 return _response.then((data) => new Report.fromJson(data)); |
1356 } | 1351 } |
1357 | 1352 |
1358 } | 1353 } |
1359 | 1354 |
1360 | 1355 |
1361 /** Not documented yet. */ | |
1362 class UrlchannelsResourceApi { | 1356 class UrlchannelsResourceApi { |
1363 final common_internal.ApiRequester _requester; | 1357 final commons.ApiRequester _requester; |
1364 | 1358 |
1365 UrlchannelsResourceApi(common_internal.ApiRequester client) : | 1359 UrlchannelsResourceApi(commons.ApiRequester client) : |
1366 _requester = client; | 1360 _requester = client; |
1367 | 1361 |
1368 /** | 1362 /** |
1369 * Delete a URL channel from the host AdSense account. | 1363 * Delete a URL channel from the host AdSense account. |
1370 * | 1364 * |
1371 * Request parameters: | 1365 * Request parameters: |
1372 * | 1366 * |
1373 * [adClientId] - Ad client from which to delete the URL channel. | 1367 * [adClientId] - Ad client from which to delete the URL channel. |
1374 * | 1368 * |
1375 * [urlChannelId] - URL channel to delete. | 1369 * [urlChannelId] - URL channel to delete. |
1376 * | 1370 * |
1377 * Completes with a [UrlChannel]. | 1371 * Completes with a [UrlChannel]. |
1378 * | 1372 * |
1379 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1373 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1380 * error. | 1374 * error. |
1381 * | 1375 * |
1382 * If the used [http.Client] completes with an error when making a REST call, | 1376 * If the used [http.Client] completes with an error when making a REST call, |
1383 * this method will complete with the same error. | 1377 * this method will complete with the same error. |
1384 */ | 1378 */ |
1385 async.Future<UrlChannel> delete(core.String adClientId, core.String urlChannel
Id) { | 1379 async.Future<UrlChannel> delete(core.String adClientId, core.String urlChannel
Id) { |
1386 var _url = null; | 1380 var _url = null; |
1387 var _queryParams = new core.Map(); | 1381 var _queryParams = new core.Map(); |
1388 var _uploadMedia = null; | 1382 var _uploadMedia = null; |
1389 var _uploadOptions = null; | 1383 var _uploadOptions = null; |
1390 var _downloadOptions = common.DownloadOptions.Metadata; | 1384 var _downloadOptions = commons.DownloadOptions.Metadata; |
1391 var _body = null; | 1385 var _body = null; |
1392 | 1386 |
1393 if (adClientId == null) { | 1387 if (adClientId == null) { |
1394 throw new core.ArgumentError("Parameter adClientId is required."); | 1388 throw new core.ArgumentError("Parameter adClientId is required."); |
1395 } | 1389 } |
1396 if (urlChannelId == null) { | 1390 if (urlChannelId == null) { |
1397 throw new core.ArgumentError("Parameter urlChannelId is required."); | 1391 throw new core.ArgumentError("Parameter urlChannelId is required."); |
1398 } | 1392 } |
1399 | 1393 |
1400 | 1394 |
1401 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') +
'/urlchannels/' + common_internal.Escaper.ecapeVariable('$urlChannelId'); | 1395 _url = 'adclients/' + commons.Escaper.ecapeVariable('$adClientId') + '/urlch
annels/' + commons.Escaper.ecapeVariable('$urlChannelId'); |
1402 | 1396 |
1403 var _response = _requester.request(_url, | 1397 var _response = _requester.request(_url, |
1404 "DELETE", | 1398 "DELETE", |
1405 body: _body, | 1399 body: _body, |
1406 queryParams: _queryParams, | 1400 queryParams: _queryParams, |
1407 uploadOptions: _uploadOptions, | 1401 uploadOptions: _uploadOptions, |
1408 uploadMedia: _uploadMedia, | 1402 uploadMedia: _uploadMedia, |
1409 downloadOptions: _downloadOptions); | 1403 downloadOptions: _downloadOptions); |
1410 return _response.then((data) => new UrlChannel.fromJson(data)); | 1404 return _response.then((data) => new UrlChannel.fromJson(data)); |
1411 } | 1405 } |
1412 | 1406 |
1413 /** | 1407 /** |
1414 * Add a new URL channel to the host AdSense account. | 1408 * Add a new URL channel to the host AdSense account. |
1415 * | 1409 * |
1416 * [request] - The metadata request object. | 1410 * [request] - The metadata request object. |
1417 * | 1411 * |
1418 * Request parameters: | 1412 * Request parameters: |
1419 * | 1413 * |
1420 * [adClientId] - Ad client to which the new URL channel will be added. | 1414 * [adClientId] - Ad client to which the new URL channel will be added. |
1421 * | 1415 * |
1422 * Completes with a [UrlChannel]. | 1416 * Completes with a [UrlChannel]. |
1423 * | 1417 * |
1424 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1418 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1425 * error. | 1419 * error. |
1426 * | 1420 * |
1427 * If the used [http.Client] completes with an error when making a REST call, | 1421 * If the used [http.Client] completes with an error when making a REST call, |
1428 * this method will complete with the same error. | 1422 * this method will complete with the same error. |
1429 */ | 1423 */ |
1430 async.Future<UrlChannel> insert(UrlChannel request, core.String adClientId) { | 1424 async.Future<UrlChannel> insert(UrlChannel request, core.String adClientId) { |
1431 var _url = null; | 1425 var _url = null; |
1432 var _queryParams = new core.Map(); | 1426 var _queryParams = new core.Map(); |
1433 var _uploadMedia = null; | 1427 var _uploadMedia = null; |
1434 var _uploadOptions = null; | 1428 var _uploadOptions = null; |
1435 var _downloadOptions = common.DownloadOptions.Metadata; | 1429 var _downloadOptions = commons.DownloadOptions.Metadata; |
1436 var _body = null; | 1430 var _body = null; |
1437 | 1431 |
1438 if (request != null) { | 1432 if (request != null) { |
1439 _body = convert.JSON.encode((request).toJson()); | 1433 _body = convert.JSON.encode((request).toJson()); |
1440 } | 1434 } |
1441 if (adClientId == null) { | 1435 if (adClientId == null) { |
1442 throw new core.ArgumentError("Parameter adClientId is required."); | 1436 throw new core.ArgumentError("Parameter adClientId is required."); |
1443 } | 1437 } |
1444 | 1438 |
1445 | 1439 |
1446 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') +
'/urlchannels'; | 1440 _url = 'adclients/' + commons.Escaper.ecapeVariable('$adClientId') + '/urlch
annels'; |
1447 | 1441 |
1448 var _response = _requester.request(_url, | 1442 var _response = _requester.request(_url, |
1449 "POST", | 1443 "POST", |
1450 body: _body, | 1444 body: _body, |
1451 queryParams: _queryParams, | 1445 queryParams: _queryParams, |
1452 uploadOptions: _uploadOptions, | 1446 uploadOptions: _uploadOptions, |
1453 uploadMedia: _uploadMedia, | 1447 uploadMedia: _uploadMedia, |
1454 downloadOptions: _downloadOptions); | 1448 downloadOptions: _downloadOptions); |
1455 return _response.then((data) => new UrlChannel.fromJson(data)); | 1449 return _response.then((data) => new UrlChannel.fromJson(data)); |
1456 } | 1450 } |
1457 | 1451 |
1458 /** | 1452 /** |
1459 * List all host URL channels in the host AdSense account. | 1453 * List all host URL channels in the host AdSense account. |
1460 * | 1454 * |
1461 * Request parameters: | 1455 * Request parameters: |
1462 * | 1456 * |
1463 * [adClientId] - Ad client for which to list URL channels. | 1457 * [adClientId] - Ad client for which to list URL channels. |
1464 * | 1458 * |
1465 * [maxResults] - The maximum number of URL channels to include in the | 1459 * [maxResults] - The maximum number of URL channels to include in the |
1466 * response, used for paging. | 1460 * response, used for paging. |
1467 * Value must be between "0" and "10000". | 1461 * Value must be between "0" and "10000". |
1468 * | 1462 * |
1469 * [pageToken] - A continuation token, used to page through URL channels. To | 1463 * [pageToken] - A continuation token, used to page through URL channels. To |
1470 * retrieve the next page, set this parameter to the value of "nextPageToken" | 1464 * retrieve the next page, set this parameter to the value of "nextPageToken" |
1471 * from the previous response. | 1465 * from the previous response. |
1472 * | 1466 * |
1473 * Completes with a [UrlChannels]. | 1467 * Completes with a [UrlChannels]. |
1474 * | 1468 * |
1475 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 1469 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1476 * error. | 1470 * error. |
1477 * | 1471 * |
1478 * If the used [http.Client] completes with an error when making a REST call, | 1472 * If the used [http.Client] completes with an error when making a REST call, |
1479 * this method will complete with the same error. | 1473 * this method will complete with the same error. |
1480 */ | 1474 */ |
1481 async.Future<UrlChannels> list(core.String adClientId, {core.int maxResults, c
ore.String pageToken}) { | 1475 async.Future<UrlChannels> list(core.String adClientId, {core.int maxResults, c
ore.String pageToken}) { |
1482 var _url = null; | 1476 var _url = null; |
1483 var _queryParams = new core.Map(); | 1477 var _queryParams = new core.Map(); |
1484 var _uploadMedia = null; | 1478 var _uploadMedia = null; |
1485 var _uploadOptions = null; | 1479 var _uploadOptions = null; |
1486 var _downloadOptions = common.DownloadOptions.Metadata; | 1480 var _downloadOptions = commons.DownloadOptions.Metadata; |
1487 var _body = null; | 1481 var _body = null; |
1488 | 1482 |
1489 if (adClientId == null) { | 1483 if (adClientId == null) { |
1490 throw new core.ArgumentError("Parameter adClientId is required."); | 1484 throw new core.ArgumentError("Parameter adClientId is required."); |
1491 } | 1485 } |
1492 if (maxResults != null) { | 1486 if (maxResults != null) { |
1493 _queryParams["maxResults"] = ["${maxResults}"]; | 1487 _queryParams["maxResults"] = ["${maxResults}"]; |
1494 } | 1488 } |
1495 if (pageToken != null) { | 1489 if (pageToken != null) { |
1496 _queryParams["pageToken"] = [pageToken]; | 1490 _queryParams["pageToken"] = [pageToken]; |
1497 } | 1491 } |
1498 | 1492 |
1499 | 1493 |
1500 _url = 'adclients/' + common_internal.Escaper.ecapeVariable('$adClientId') +
'/urlchannels'; | 1494 _url = 'adclients/' + commons.Escaper.ecapeVariable('$adClientId') + '/urlch
annels'; |
1501 | 1495 |
1502 var _response = _requester.request(_url, | 1496 var _response = _requester.request(_url, |
1503 "GET", | 1497 "GET", |
1504 body: _body, | 1498 body: _body, |
1505 queryParams: _queryParams, | 1499 queryParams: _queryParams, |
1506 uploadOptions: _uploadOptions, | 1500 uploadOptions: _uploadOptions, |
1507 uploadMedia: _uploadMedia, | 1501 uploadMedia: _uploadMedia, |
1508 downloadOptions: _downloadOptions); | 1502 downloadOptions: _downloadOptions); |
1509 return _response.then((data) => new UrlChannels.fromJson(data)); | 1503 return _response.then((data) => new UrlChannels.fromJson(data)); |
1510 } | 1504 } |
1511 | 1505 |
1512 } | 1506 } |
1513 | 1507 |
1514 | 1508 |
1515 | 1509 |
1516 /** Not documented yet. */ | |
1517 class Account { | 1510 class Account { |
1518 /** Unique identifier of this account. */ | 1511 /** Unique identifier of this account. */ |
1519 core.String id; | 1512 core.String id; |
1520 | 1513 |
1521 /** Kind of resource this is, in this case adsensehost#account. */ | 1514 /** Kind of resource this is, in this case adsensehost#account. */ |
1522 core.String kind; | 1515 core.String kind; |
1523 | 1516 |
1524 /** Name of this account. */ | 1517 /** Name of this account. */ |
1525 core.String name; | 1518 core.String name; |
1526 | 1519 |
(...skipping 30 matching lines...) Expand all Loading... |
1557 _json["name"] = name; | 1550 _json["name"] = name; |
1558 } | 1551 } |
1559 if (status != null) { | 1552 if (status != null) { |
1560 _json["status"] = status; | 1553 _json["status"] = status; |
1561 } | 1554 } |
1562 return _json; | 1555 return _json; |
1563 } | 1556 } |
1564 } | 1557 } |
1565 | 1558 |
1566 | 1559 |
1567 /** Not documented yet. */ | |
1568 class Accounts { | 1560 class Accounts { |
1569 /** ETag of this response for caching purposes. */ | 1561 /** ETag of this response for caching purposes. */ |
1570 core.String etag; | 1562 core.String etag; |
1571 | 1563 |
1572 /** The accounts returned in this list response. */ | 1564 /** The accounts returned in this list response. */ |
1573 core.List<Account> items; | 1565 core.List<Account> items; |
1574 | 1566 |
1575 /** Kind of list this is, in this case adsensehost#accounts. */ | 1567 /** Kind of list this is, in this case adsensehost#accounts. */ |
1576 core.String kind; | 1568 core.String kind; |
1577 | 1569 |
(...skipping 21 matching lines...) Expand all Loading... |
1599 _json["items"] = items.map((value) => (value).toJson()).toList(); | 1591 _json["items"] = items.map((value) => (value).toJson()).toList(); |
1600 } | 1592 } |
1601 if (kind != null) { | 1593 if (kind != null) { |
1602 _json["kind"] = kind; | 1594 _json["kind"] = kind; |
1603 } | 1595 } |
1604 return _json; | 1596 return _json; |
1605 } | 1597 } |
1606 } | 1598 } |
1607 | 1599 |
1608 | 1600 |
1609 /** Not documented yet. */ | |
1610 class AdClient { | 1601 class AdClient { |
1611 /** Whether this ad client is opted in to ARC. */ | 1602 /** Whether this ad client is opted in to ARC. */ |
1612 core.bool arcOptIn; | 1603 core.bool arcOptIn; |
1613 | 1604 |
1614 /** Unique identifier of this ad client. */ | 1605 /** Unique identifier of this ad client. */ |
1615 core.String id; | 1606 core.String id; |
1616 | 1607 |
1617 /** Kind of resource this is, in this case adsensehost#adClient. */ | 1608 /** Kind of resource this is, in this case adsensehost#adClient. */ |
1618 core.String kind; | 1609 core.String kind; |
1619 | 1610 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 _json["productCode"] = productCode; | 1653 _json["productCode"] = productCode; |
1663 } | 1654 } |
1664 if (supportsReporting != null) { | 1655 if (supportsReporting != null) { |
1665 _json["supportsReporting"] = supportsReporting; | 1656 _json["supportsReporting"] = supportsReporting; |
1666 } | 1657 } |
1667 return _json; | 1658 return _json; |
1668 } | 1659 } |
1669 } | 1660 } |
1670 | 1661 |
1671 | 1662 |
1672 /** Not documented yet. */ | |
1673 class AdClients { | 1663 class AdClients { |
1674 /** ETag of this response for caching purposes. */ | 1664 /** ETag of this response for caching purposes. */ |
1675 core.String etag; | 1665 core.String etag; |
1676 | 1666 |
1677 /** The ad clients returned in this list response. */ | 1667 /** The ad clients returned in this list response. */ |
1678 core.List<AdClient> items; | 1668 core.List<AdClient> items; |
1679 | 1669 |
1680 /** Kind of list this is, in this case adsensehost#adClients. */ | 1670 /** Kind of list this is, in this case adsensehost#adClients. */ |
1681 core.String kind; | 1671 core.String kind; |
1682 | 1672 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1716 _json["kind"] = kind; | 1706 _json["kind"] = kind; |
1717 } | 1707 } |
1718 if (nextPageToken != null) { | 1708 if (nextPageToken != null) { |
1719 _json["nextPageToken"] = nextPageToken; | 1709 _json["nextPageToken"] = nextPageToken; |
1720 } | 1710 } |
1721 return _json; | 1711 return _json; |
1722 } | 1712 } |
1723 } | 1713 } |
1724 | 1714 |
1725 | 1715 |
1726 /** Not documented yet. */ | |
1727 class AdCode { | 1716 class AdCode { |
1728 /** The ad code snippet. */ | 1717 /** The ad code snippet. */ |
1729 core.String adCode; | 1718 core.String adCode; |
1730 | 1719 |
1731 /** Kind this is, in this case adsensehost#adCode. */ | 1720 /** Kind this is, in this case adsensehost#adCode. */ |
1732 core.String kind; | 1721 core.String kind; |
1733 | 1722 |
1734 | 1723 |
1735 AdCode(); | 1724 AdCode(); |
1736 | 1725 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 _json["family"] = family; | 1840 _json["family"] = family; |
1852 } | 1841 } |
1853 if (size != null) { | 1842 if (size != null) { |
1854 _json["size"] = size; | 1843 _json["size"] = size; |
1855 } | 1844 } |
1856 return _json; | 1845 return _json; |
1857 } | 1846 } |
1858 } | 1847 } |
1859 | 1848 |
1860 | 1849 |
1861 /** Not documented yet. */ | |
1862 class AdStyle { | 1850 class AdStyle { |
1863 /** | 1851 /** |
1864 * The colors included in the style. These are represented as six hexadecimal | 1852 * The colors included in the style. These are represented as six hexadecimal |
1865 * characters, similar to HTML color codes, but without the leading hash. | 1853 * characters, similar to HTML color codes, but without the leading hash. |
1866 */ | 1854 */ |
1867 AdStyleColors colors; | 1855 AdStyleColors colors; |
1868 | 1856 |
1869 /** | 1857 /** |
1870 * The style of the corners in the ad. Possible values are SQUARE, | 1858 * The style of the corners in the ad. Possible values are SQUARE, |
1871 * SLIGHTLY_ROUNDED and VERY_ROUNDED. | 1859 * SLIGHTLY_ROUNDED and VERY_ROUNDED. |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2053 _json["size"] = size; | 2041 _json["size"] = size; |
2054 } | 2042 } |
2055 if (type != null) { | 2043 if (type != null) { |
2056 _json["type"] = type; | 2044 _json["type"] = type; |
2057 } | 2045 } |
2058 return _json; | 2046 return _json; |
2059 } | 2047 } |
2060 } | 2048 } |
2061 | 2049 |
2062 | 2050 |
2063 /** Not documented yet. */ | |
2064 class AdUnit { | 2051 class AdUnit { |
2065 /** | 2052 /** |
2066 * Identity code of this ad unit, not necessarily unique across ad clients. | 2053 * Identity code of this ad unit, not necessarily unique across ad clients. |
2067 */ | 2054 */ |
2068 core.String code; | 2055 core.String code; |
2069 | 2056 |
2070 /** | 2057 /** |
2071 * Settings specific to content ads (AFC) and highend mobile content ads | 2058 * Settings specific to content ads (AFC) and highend mobile content ads |
2072 * (AFMC). | 2059 * (AFMC). |
2073 */ | 2060 */ |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2158 _json["name"] = name; | 2145 _json["name"] = name; |
2159 } | 2146 } |
2160 if (status != null) { | 2147 if (status != null) { |
2161 _json["status"] = status; | 2148 _json["status"] = status; |
2162 } | 2149 } |
2163 return _json; | 2150 return _json; |
2164 } | 2151 } |
2165 } | 2152 } |
2166 | 2153 |
2167 | 2154 |
2168 /** Not documented yet. */ | |
2169 class AdUnits { | 2155 class AdUnits { |
2170 /** ETag of this response for caching purposes. */ | 2156 /** ETag of this response for caching purposes. */ |
2171 core.String etag; | 2157 core.String etag; |
2172 | 2158 |
2173 /** The ad units returned in this list response. */ | 2159 /** The ad units returned in this list response. */ |
2174 core.List<AdUnit> items; | 2160 core.List<AdUnit> items; |
2175 | 2161 |
2176 /** Kind of list this is, in this case adsensehost#adUnits. */ | 2162 /** Kind of list this is, in this case adsensehost#adUnits. */ |
2177 core.String kind; | 2163 core.String kind; |
2178 | 2164 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2212 _json["kind"] = kind; | 2198 _json["kind"] = kind; |
2213 } | 2199 } |
2214 if (nextPageToken != null) { | 2200 if (nextPageToken != null) { |
2215 _json["nextPageToken"] = nextPageToken; | 2201 _json["nextPageToken"] = nextPageToken; |
2216 } | 2202 } |
2217 return _json; | 2203 return _json; |
2218 } | 2204 } |
2219 } | 2205 } |
2220 | 2206 |
2221 | 2207 |
2222 /** Not documented yet. */ | |
2223 class AssociationSession { | 2208 class AssociationSession { |
2224 /** | 2209 /** |
2225 * Hosted account id of the associated publisher after association. Present if | 2210 * Hosted account id of the associated publisher after association. Present if |
2226 * status is ACCEPTED. | 2211 * status is ACCEPTED. |
2227 */ | 2212 */ |
2228 core.String accountId; | 2213 core.String accountId; |
2229 | 2214 |
2230 /** Unique identifier of this association session. */ | 2215 /** Unique identifier of this association session. */ |
2231 core.String id; | 2216 core.String id; |
2232 | 2217 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 _json["websiteLocale"] = websiteLocale; | 2305 _json["websiteLocale"] = websiteLocale; |
2321 } | 2306 } |
2322 if (websiteUrl != null) { | 2307 if (websiteUrl != null) { |
2323 _json["websiteUrl"] = websiteUrl; | 2308 _json["websiteUrl"] = websiteUrl; |
2324 } | 2309 } |
2325 return _json; | 2310 return _json; |
2326 } | 2311 } |
2327 } | 2312 } |
2328 | 2313 |
2329 | 2314 |
2330 /** Not documented yet. */ | |
2331 class CustomChannel { | 2315 class CustomChannel { |
2332 /** Code of this custom channel, not necessarily unique across ad clients. */ | 2316 /** Code of this custom channel, not necessarily unique across ad clients. */ |
2333 core.String code; | 2317 core.String code; |
2334 | 2318 |
2335 /** | 2319 /** |
2336 * Unique identifier of this custom channel. This should be considered an | 2320 * Unique identifier of this custom channel. This should be considered an |
2337 * opaque identifier; it is not safe to rely on it being in any particular | 2321 * opaque identifier; it is not safe to rely on it being in any particular |
2338 * format. | 2322 * format. |
2339 */ | 2323 */ |
2340 core.String id; | 2324 core.String id; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2375 _json["kind"] = kind; | 2359 _json["kind"] = kind; |
2376 } | 2360 } |
2377 if (name != null) { | 2361 if (name != null) { |
2378 _json["name"] = name; | 2362 _json["name"] = name; |
2379 } | 2363 } |
2380 return _json; | 2364 return _json; |
2381 } | 2365 } |
2382 } | 2366 } |
2383 | 2367 |
2384 | 2368 |
2385 /** Not documented yet. */ | |
2386 class CustomChannels { | 2369 class CustomChannels { |
2387 /** ETag of this response for caching purposes. */ | 2370 /** ETag of this response for caching purposes. */ |
2388 core.String etag; | 2371 core.String etag; |
2389 | 2372 |
2390 /** The custom channels returned in this list response. */ | 2373 /** The custom channels returned in this list response. */ |
2391 core.List<CustomChannel> items; | 2374 core.List<CustomChannel> items; |
2392 | 2375 |
2393 /** Kind of list this is, in this case adsensehost#customChannels. */ | 2376 /** Kind of list this is, in this case adsensehost#customChannels. */ |
2394 core.String kind; | 2377 core.String kind; |
2395 | 2378 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2429 _json["kind"] = kind; | 2412 _json["kind"] = kind; |
2430 } | 2413 } |
2431 if (nextPageToken != null) { | 2414 if (nextPageToken != null) { |
2432 _json["nextPageToken"] = nextPageToken; | 2415 _json["nextPageToken"] = nextPageToken; |
2433 } | 2416 } |
2434 return _json; | 2417 return _json; |
2435 } | 2418 } |
2436 } | 2419 } |
2437 | 2420 |
2438 | 2421 |
2439 /** Not documented yet. */ | |
2440 class ReportHeaders { | 2422 class ReportHeaders { |
2441 /** | 2423 /** |
2442 * The currency of this column. Only present if the header type is | 2424 * The currency of this column. Only present if the header type is |
2443 * METRIC_CURRENCY. | 2425 * METRIC_CURRENCY. |
2444 */ | 2426 */ |
2445 core.String currency; | 2427 core.String currency; |
2446 | 2428 |
2447 /** The name of the header. */ | 2429 /** The name of the header. */ |
2448 core.String name; | 2430 core.String name; |
2449 | 2431 |
(...skipping 27 matching lines...) Expand all Loading... |
2477 _json["name"] = name; | 2459 _json["name"] = name; |
2478 } | 2460 } |
2479 if (type != null) { | 2461 if (type != null) { |
2480 _json["type"] = type; | 2462 _json["type"] = type; |
2481 } | 2463 } |
2482 return _json; | 2464 return _json; |
2483 } | 2465 } |
2484 } | 2466 } |
2485 | 2467 |
2486 | 2468 |
2487 /** Not documented yet. */ | |
2488 class Report { | 2469 class Report { |
2489 /** | 2470 /** |
2490 * The averages of the report. This is the same length as any other row in the | 2471 * The averages of the report. This is the same length as any other row in the |
2491 * report; cells corresponding to dimension columns are empty. | 2472 * report; cells corresponding to dimension columns are empty. |
2492 */ | 2473 */ |
2493 core.List<core.String> averages; | 2474 core.List<core.String> averages; |
2494 | 2475 |
2495 /** | 2476 /** |
2496 * The header information of the columns requested in the report. This is a | 2477 * The header information of the columns requested in the report. This is a |
2497 * list of headers; one for each dimension in the request, followed by one for | 2478 * list of headers; one for each dimension in the request, followed by one for |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2573 _json["totals"] = totals; | 2554 _json["totals"] = totals; |
2574 } | 2555 } |
2575 if (warnings != null) { | 2556 if (warnings != null) { |
2576 _json["warnings"] = warnings; | 2557 _json["warnings"] = warnings; |
2577 } | 2558 } |
2578 return _json; | 2559 return _json; |
2579 } | 2560 } |
2580 } | 2561 } |
2581 | 2562 |
2582 | 2563 |
2583 /** Not documented yet. */ | |
2584 class UrlChannel { | 2564 class UrlChannel { |
2585 /** | 2565 /** |
2586 * Unique identifier of this URL channel. This should be considered an opaque | 2566 * Unique identifier of this URL channel. This should be considered an opaque |
2587 * identifier; it is not safe to rely on it being in any particular format. | 2567 * identifier; it is not safe to rely on it being in any particular format. |
2588 */ | 2568 */ |
2589 core.String id; | 2569 core.String id; |
2590 | 2570 |
2591 /** Kind of resource this is, in this case adsensehost#urlChannel. */ | 2571 /** Kind of resource this is, in this case adsensehost#urlChannel. */ |
2592 core.String kind; | 2572 core.String kind; |
2593 | 2573 |
(...skipping 27 matching lines...) Expand all Loading... |
2621 _json["kind"] = kind; | 2601 _json["kind"] = kind; |
2622 } | 2602 } |
2623 if (urlPattern != null) { | 2603 if (urlPattern != null) { |
2624 _json["urlPattern"] = urlPattern; | 2604 _json["urlPattern"] = urlPattern; |
2625 } | 2605 } |
2626 return _json; | 2606 return _json; |
2627 } | 2607 } |
2628 } | 2608 } |
2629 | 2609 |
2630 | 2610 |
2631 /** Not documented yet. */ | |
2632 class UrlChannels { | 2611 class UrlChannels { |
2633 /** ETag of this response for caching purposes. */ | 2612 /** ETag of this response for caching purposes. */ |
2634 core.String etag; | 2613 core.String etag; |
2635 | 2614 |
2636 /** The URL channels returned in this list response. */ | 2615 /** The URL channels returned in this list response. */ |
2637 core.List<UrlChannel> items; | 2616 core.List<UrlChannel> items; |
2638 | 2617 |
2639 /** Kind of list this is, in this case adsensehost#urlChannels. */ | 2618 /** Kind of list this is, in this case adsensehost#urlChannels. */ |
2640 core.String kind; | 2619 core.String kind; |
2641 | 2620 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2673 } | 2652 } |
2674 if (kind != null) { | 2653 if (kind != null) { |
2675 _json["kind"] = kind; | 2654 _json["kind"] = kind; |
2676 } | 2655 } |
2677 if (nextPageToken != null) { | 2656 if (nextPageToken != null) { |
2678 _json["nextPageToken"] = nextPageToken; | 2657 _json["nextPageToken"] = nextPageToken; |
2679 } | 2658 } |
2680 return _json; | 2659 return _json; |
2681 } | 2660 } |
2682 } | 2661 } |
2683 | |
2684 | |
OLD | NEW |