blob: f0a5f2caa690840683f45b6fdb376d0d76c6fedb [file] [log] [blame]
Kevin Moore6d21e902021-01-15 06:41:08 -08001// ignore_for_file: camel_case_types
2// ignore_for_file: comment_references
Kevin Moore1ad61ef2021-01-22 17:52:58 -08003// ignore_for_file: file_names
Kevin Moore6d21e902021-01-15 06:41:08 -08004// ignore_for_file: library_names
5// ignore_for_file: lines_longer_than_80_chars
6// ignore_for_file: non_constant_identifier_names
Kevin Moore1ad61ef2021-01-22 17:52:58 -08007// ignore_for_file: prefer_expression_function_bodies
Kevin Moore6d21e902021-01-15 06:41:08 -08008// ignore_for_file: prefer_interpolation_to_compose_strings
Kevin Moore6d21e902021-01-15 06:41:08 -08009// ignore_for_file: unnecessary_brace_in_string_interps
10// ignore_for_file: unnecessary_cast
Kevin Moore1ad61ef2021-01-22 17:52:58 -080011// ignore_for_file: unnecessary_lambdas
Kevin Moore6d21e902021-01-15 06:41:08 -080012// ignore_for_file: unnecessary_parenthesis
13// ignore_for_file: unnecessary_string_interpolations
Kevin Moore6d21e902021-01-15 06:41:08 -080014// ignore_for_file: avoid_returning_null
15// ignore_for_file: cascade_invocations
Kevin Moorec007ffb2021-02-05 10:06:35 -080016// ignore_for_file: prefer_final_locals
Kevin Moored0251702021-01-15 06:41:08 -080017// ignore_for_file: prefer_single_quotes
Kevin Moore6d21e902021-01-15 06:41:08 -080018// ignore_for_file: unused_local_variable
19
Kevin Moore2282df32021-01-27 19:15:24 -080020import 'dart:async' as async;
21import 'dart:convert' as convert;
22import 'dart:core' as core;
Martin Kustermannfa83e312017-07-31 12:48:45 +020023
24import 'package:http/http.dart' as http;
Martin Kustermannfa83e312017-07-31 12:48:45 +020025import 'package:test/test.dart' as unittest;
Martin Kustermannfa83e312017-07-31 12:48:45 +020026import 'package:googleapis/androiddeviceprovisioning/v1.dart' as api;
27
Kevin Moore2282df32021-01-27 19:15:24 -080028import '../test_shared.dart';
Martin Kustermannfa83e312017-07-31 12:48:45 +020029
30core.int buildCounterClaimDeviceRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -080031api.ClaimDeviceRequest buildClaimDeviceRequest() {
32 var o = api.ClaimDeviceRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +020033 buildCounterClaimDeviceRequest++;
34 if (buildCounterClaimDeviceRequest < 3) {
Kevin Moored0251702021-01-15 06:41:08 -080035 o.customerId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +020036 o.deviceIdentifier = buildDeviceIdentifier();
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +010037 o.deviceMetadata = buildDeviceMetadata();
Kevin Moored0251702021-01-15 06:41:08 -080038 o.sectionType = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +020039 }
40 buildCounterClaimDeviceRequest--;
41 return o;
42}
43
Kevin Moore6d21e902021-01-15 06:41:08 -080044void checkClaimDeviceRequest(api.ClaimDeviceRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +020045 buildCounterClaimDeviceRequest++;
46 if (buildCounterClaimDeviceRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -080047 unittest.expect(
48 o.customerId!,
49 unittest.equals('foo'),
50 );
51 checkDeviceIdentifier(o.deviceIdentifier! as api.DeviceIdentifier);
52 checkDeviceMetadata(o.deviceMetadata! as api.DeviceMetadata);
53 unittest.expect(
54 o.sectionType!,
55 unittest.equals('foo'),
56 );
Martin Kustermannfa83e312017-07-31 12:48:45 +020057 }
58 buildCounterClaimDeviceRequest--;
59}
60
61core.int buildCounterClaimDeviceResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -080062api.ClaimDeviceResponse buildClaimDeviceResponse() {
63 var o = api.ClaimDeviceResponse();
Martin Kustermannfa83e312017-07-31 12:48:45 +020064 buildCounterClaimDeviceResponse++;
65 if (buildCounterClaimDeviceResponse < 3) {
Kevin Moored0251702021-01-15 06:41:08 -080066 o.deviceId = 'foo';
67 o.deviceName = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +020068 }
69 buildCounterClaimDeviceResponse--;
70 return o;
71}
72
Kevin Moore6d21e902021-01-15 06:41:08 -080073void checkClaimDeviceResponse(api.ClaimDeviceResponse o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +020074 buildCounterClaimDeviceResponse++;
75 if (buildCounterClaimDeviceResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -080076 unittest.expect(
77 o.deviceId!,
78 unittest.equals('foo'),
79 );
80 unittest.expect(
81 o.deviceName!,
82 unittest.equals('foo'),
83 );
Martin Kustermannfa83e312017-07-31 12:48:45 +020084 }
85 buildCounterClaimDeviceResponse--;
86}
87
Kevin Mooreb3758bc2021-02-25 10:03:59 -080088core.List<api.PartnerClaim> buildUnnamed3656() {
Kevin Moore6d21e902021-01-15 06:41:08 -080089 var o = <api.PartnerClaim>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +020090 o.add(buildPartnerClaim());
91 o.add(buildPartnerClaim());
92 return o;
93}
94
Kevin Mooreb3758bc2021-02-25 10:03:59 -080095void checkUnnamed3656(core.List<api.PartnerClaim> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +020096 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -080097 checkPartnerClaim(o[0] as api.PartnerClaim);
98 checkPartnerClaim(o[1] as api.PartnerClaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +020099}
100
101core.int buildCounterClaimDevicesRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800102api.ClaimDevicesRequest buildClaimDevicesRequest() {
103 var o = api.ClaimDevicesRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200104 buildCounterClaimDevicesRequest++;
105 if (buildCounterClaimDevicesRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800106 o.claims = buildUnnamed3656();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200107 }
108 buildCounterClaimDevicesRequest--;
109 return o;
110}
111
Kevin Moore6d21e902021-01-15 06:41:08 -0800112void checkClaimDevicesRequest(api.ClaimDevicesRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200113 buildCounterClaimDevicesRequest++;
114 if (buildCounterClaimDevicesRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800115 checkUnnamed3656(o.claims!);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200116 }
117 buildCounterClaimDevicesRequest--;
118}
119
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800120core.List<core.String> buildUnnamed3657() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800121 var o = <core.String>[];
Kevin Moored0251702021-01-15 06:41:08 -0800122 o.add('foo');
123 o.add('foo');
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200124 return o;
125}
126
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800127void checkUnnamed3657(core.List<core.String> o) {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200128 unittest.expect(o, unittest.hasLength(2));
Kevin Moore58e22332021-02-25 10:11:41 -0800129 unittest.expect(
130 o[0],
131 unittest.equals('foo'),
132 );
133 unittest.expect(
134 o[1],
135 unittest.equals('foo'),
136 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200137}
138
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800139core.List<core.String> buildUnnamed3658() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800140 var o = <core.String>[];
Kevin Moored0251702021-01-15 06:41:08 -0800141 o.add('foo');
142 o.add('foo');
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200143 return o;
144}
145
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800146void checkUnnamed3658(core.List<core.String> o) {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200147 unittest.expect(o, unittest.hasLength(2));
Kevin Moore58e22332021-02-25 10:11:41 -0800148 unittest.expect(
149 o[0],
150 unittest.equals('foo'),
151 );
152 unittest.expect(
153 o[1],
154 unittest.equals('foo'),
155 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200156}
157
Martin Kustermannfa83e312017-07-31 12:48:45 +0200158core.int buildCounterCompany = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800159api.Company buildCompany() {
160 var o = api.Company();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200161 buildCounterCompany++;
162 if (buildCounterCompany < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800163 o.adminEmails = buildUnnamed3657();
Kevin Moored0251702021-01-15 06:41:08 -0800164 o.companyId = 'foo';
165 o.companyName = 'foo';
166 o.name = 'foo';
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800167 o.ownerEmails = buildUnnamed3658();
Kevin Moored0251702021-01-15 06:41:08 -0800168 o.termsStatus = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200169 }
170 buildCounterCompany--;
171 return o;
172}
173
Kevin Moore6d21e902021-01-15 06:41:08 -0800174void checkCompany(api.Company o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200175 buildCounterCompany++;
176 if (buildCounterCompany < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800177 checkUnnamed3657(o.adminEmails!);
178 unittest.expect(
179 o.companyId!,
180 unittest.equals('foo'),
181 );
182 unittest.expect(
183 o.companyName!,
184 unittest.equals('foo'),
185 );
186 unittest.expect(
187 o.name!,
188 unittest.equals('foo'),
189 );
190 checkUnnamed3658(o.ownerEmails!);
191 unittest.expect(
192 o.termsStatus!,
193 unittest.equals('foo'),
194 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200195 }
196 buildCounterCompany--;
197}
198
Martin Kustermannf9109a82018-01-08 15:24:20 +0100199core.int buildCounterConfiguration = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800200api.Configuration buildConfiguration() {
201 var o = api.Configuration();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100202 buildCounterConfiguration++;
203 if (buildCounterConfiguration < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800204 o.companyName = 'foo';
205 o.configurationId = 'foo';
206 o.configurationName = 'foo';
207 o.contactEmail = 'foo';
208 o.contactPhone = 'foo';
209 o.customMessage = 'foo';
210 o.dpcExtras = 'foo';
211 o.dpcResourcePath = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100212 o.isDefault = true;
Kevin Moored0251702021-01-15 06:41:08 -0800213 o.name = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100214 }
215 buildCounterConfiguration--;
216 return o;
217}
218
Kevin Moore6d21e902021-01-15 06:41:08 -0800219void checkConfiguration(api.Configuration o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100220 buildCounterConfiguration++;
221 if (buildCounterConfiguration < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800222 unittest.expect(
223 o.companyName!,
224 unittest.equals('foo'),
225 );
226 unittest.expect(
227 o.configurationId!,
228 unittest.equals('foo'),
229 );
230 unittest.expect(
231 o.configurationName!,
232 unittest.equals('foo'),
233 );
234 unittest.expect(
235 o.contactEmail!,
236 unittest.equals('foo'),
237 );
238 unittest.expect(
239 o.contactPhone!,
240 unittest.equals('foo'),
241 );
242 unittest.expect(
243 o.customMessage!,
244 unittest.equals('foo'),
245 );
246 unittest.expect(
247 o.dpcExtras!,
248 unittest.equals('foo'),
249 );
250 unittest.expect(
251 o.dpcResourcePath!,
252 unittest.equals('foo'),
253 );
254 unittest.expect(o.isDefault!, unittest.isTrue);
255 unittest.expect(
256 o.name!,
257 unittest.equals('foo'),
258 );
Martin Kustermannf9109a82018-01-08 15:24:20 +0100259 }
260 buildCounterConfiguration--;
261}
262
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200263core.int buildCounterCreateCustomerRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800264api.CreateCustomerRequest buildCreateCustomerRequest() {
265 var o = api.CreateCustomerRequest();
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200266 buildCounterCreateCustomerRequest++;
267 if (buildCounterCreateCustomerRequest < 3) {
268 o.customer = buildCompany();
269 }
270 buildCounterCreateCustomerRequest--;
271 return o;
272}
273
Kevin Moore6d21e902021-01-15 06:41:08 -0800274void checkCreateCustomerRequest(api.CreateCustomerRequest o) {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200275 buildCounterCreateCustomerRequest++;
276 if (buildCounterCreateCustomerRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800277 checkCompany(o.customer! as api.Company);
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200278 }
279 buildCounterCreateCustomerRequest--;
280}
281
Martin Kustermannf9109a82018-01-08 15:24:20 +0100282core.int buildCounterCustomerApplyConfigurationRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800283api.CustomerApplyConfigurationRequest buildCustomerApplyConfigurationRequest() {
284 var o = api.CustomerApplyConfigurationRequest();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100285 buildCounterCustomerApplyConfigurationRequest++;
286 if (buildCounterCustomerApplyConfigurationRequest < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800287 o.configuration = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100288 o.device = buildDeviceReference();
289 }
290 buildCounterCustomerApplyConfigurationRequest--;
291 return o;
292}
293
Kevin Moore6d21e902021-01-15 06:41:08 -0800294void checkCustomerApplyConfigurationRequest(
Martin Kustermannf9109a82018-01-08 15:24:20 +0100295 api.CustomerApplyConfigurationRequest o) {
296 buildCounterCustomerApplyConfigurationRequest++;
297 if (buildCounterCustomerApplyConfigurationRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800298 unittest.expect(
299 o.configuration!,
300 unittest.equals('foo'),
301 );
302 checkDeviceReference(o.device! as api.DeviceReference);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100303 }
304 buildCounterCustomerApplyConfigurationRequest--;
305}
306
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800307core.List<api.Configuration> buildUnnamed3659() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800308 var o = <api.Configuration>[];
Martin Kustermannf9109a82018-01-08 15:24:20 +0100309 o.add(buildConfiguration());
310 o.add(buildConfiguration());
311 return o;
312}
313
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800314void checkUnnamed3659(core.List<api.Configuration> o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100315 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800316 checkConfiguration(o[0] as api.Configuration);
317 checkConfiguration(o[1] as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100318}
319
320core.int buildCounterCustomerListConfigurationsResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800321api.CustomerListConfigurationsResponse
322 buildCustomerListConfigurationsResponse() {
323 var o = api.CustomerListConfigurationsResponse();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100324 buildCounterCustomerListConfigurationsResponse++;
325 if (buildCounterCustomerListConfigurationsResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800326 o.configurations = buildUnnamed3659();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100327 }
328 buildCounterCustomerListConfigurationsResponse--;
329 return o;
330}
331
Kevin Moore6d21e902021-01-15 06:41:08 -0800332void checkCustomerListConfigurationsResponse(
Martin Kustermannf9109a82018-01-08 15:24:20 +0100333 api.CustomerListConfigurationsResponse o) {
334 buildCounterCustomerListConfigurationsResponse++;
335 if (buildCounterCustomerListConfigurationsResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800336 checkUnnamed3659(o.configurations!);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100337 }
338 buildCounterCustomerListConfigurationsResponse--;
339}
340
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800341core.List<api.Company> buildUnnamed3660() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800342 var o = <api.Company>[];
Martin Kustermannf9109a82018-01-08 15:24:20 +0100343 o.add(buildCompany());
344 o.add(buildCompany());
345 return o;
346}
347
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800348void checkUnnamed3660(core.List<api.Company> o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100349 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800350 checkCompany(o[0] as api.Company);
351 checkCompany(o[1] as api.Company);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100352}
353
354core.int buildCounterCustomerListCustomersResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800355api.CustomerListCustomersResponse buildCustomerListCustomersResponse() {
356 var o = api.CustomerListCustomersResponse();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100357 buildCounterCustomerListCustomersResponse++;
358 if (buildCounterCustomerListCustomersResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800359 o.customers = buildUnnamed3660();
Kevin Moored0251702021-01-15 06:41:08 -0800360 o.nextPageToken = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100361 }
362 buildCounterCustomerListCustomersResponse--;
363 return o;
364}
365
Kevin Moore6d21e902021-01-15 06:41:08 -0800366void checkCustomerListCustomersResponse(api.CustomerListCustomersResponse o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100367 buildCounterCustomerListCustomersResponse++;
368 if (buildCounterCustomerListCustomersResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800369 checkUnnamed3660(o.customers!);
370 unittest.expect(
371 o.nextPageToken!,
372 unittest.equals('foo'),
373 );
Martin Kustermannf9109a82018-01-08 15:24:20 +0100374 }
375 buildCounterCustomerListCustomersResponse--;
376}
377
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800378core.List<api.Device> buildUnnamed3661() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800379 var o = <api.Device>[];
Martin Kustermannf9109a82018-01-08 15:24:20 +0100380 o.add(buildDevice());
381 o.add(buildDevice());
382 return o;
383}
384
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800385void checkUnnamed3661(core.List<api.Device> o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100386 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800387 checkDevice(o[0] as api.Device);
388 checkDevice(o[1] as api.Device);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100389}
390
391core.int buildCounterCustomerListDevicesResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800392api.CustomerListDevicesResponse buildCustomerListDevicesResponse() {
393 var o = api.CustomerListDevicesResponse();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100394 buildCounterCustomerListDevicesResponse++;
395 if (buildCounterCustomerListDevicesResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800396 o.devices = buildUnnamed3661();
Kevin Moored0251702021-01-15 06:41:08 -0800397 o.nextPageToken = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100398 }
399 buildCounterCustomerListDevicesResponse--;
400 return o;
401}
402
Kevin Moore6d21e902021-01-15 06:41:08 -0800403void checkCustomerListDevicesResponse(api.CustomerListDevicesResponse o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100404 buildCounterCustomerListDevicesResponse++;
405 if (buildCounterCustomerListDevicesResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800406 checkUnnamed3661(o.devices!);
407 unittest.expect(
408 o.nextPageToken!,
409 unittest.equals('foo'),
410 );
Martin Kustermannf9109a82018-01-08 15:24:20 +0100411 }
412 buildCounterCustomerListDevicesResponse--;
413}
414
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800415core.List<api.Dpc> buildUnnamed3662() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800416 var o = <api.Dpc>[];
Martin Kustermannf9109a82018-01-08 15:24:20 +0100417 o.add(buildDpc());
418 o.add(buildDpc());
419 return o;
420}
421
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800422void checkUnnamed3662(core.List<api.Dpc> o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100423 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800424 checkDpc(o[0] as api.Dpc);
425 checkDpc(o[1] as api.Dpc);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100426}
427
428core.int buildCounterCustomerListDpcsResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800429api.CustomerListDpcsResponse buildCustomerListDpcsResponse() {
430 var o = api.CustomerListDpcsResponse();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100431 buildCounterCustomerListDpcsResponse++;
432 if (buildCounterCustomerListDpcsResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800433 o.dpcs = buildUnnamed3662();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100434 }
435 buildCounterCustomerListDpcsResponse--;
436 return o;
437}
438
Kevin Moore6d21e902021-01-15 06:41:08 -0800439void checkCustomerListDpcsResponse(api.CustomerListDpcsResponse o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100440 buildCounterCustomerListDpcsResponse++;
441 if (buildCounterCustomerListDpcsResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800442 checkUnnamed3662(o.dpcs!);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100443 }
444 buildCounterCustomerListDpcsResponse--;
445}
446
447core.int buildCounterCustomerRemoveConfigurationRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800448api.CustomerRemoveConfigurationRequest
449 buildCustomerRemoveConfigurationRequest() {
450 var o = api.CustomerRemoveConfigurationRequest();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100451 buildCounterCustomerRemoveConfigurationRequest++;
452 if (buildCounterCustomerRemoveConfigurationRequest < 3) {
453 o.device = buildDeviceReference();
454 }
455 buildCounterCustomerRemoveConfigurationRequest--;
456 return o;
457}
458
Kevin Moore6d21e902021-01-15 06:41:08 -0800459void checkCustomerRemoveConfigurationRequest(
Martin Kustermannf9109a82018-01-08 15:24:20 +0100460 api.CustomerRemoveConfigurationRequest o) {
461 buildCounterCustomerRemoveConfigurationRequest++;
462 if (buildCounterCustomerRemoveConfigurationRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800463 checkDeviceReference(o.device! as api.DeviceReference);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100464 }
465 buildCounterCustomerRemoveConfigurationRequest--;
466}
467
468core.int buildCounterCustomerUnclaimDeviceRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800469api.CustomerUnclaimDeviceRequest buildCustomerUnclaimDeviceRequest() {
470 var o = api.CustomerUnclaimDeviceRequest();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100471 buildCounterCustomerUnclaimDeviceRequest++;
472 if (buildCounterCustomerUnclaimDeviceRequest < 3) {
473 o.device = buildDeviceReference();
474 }
475 buildCounterCustomerUnclaimDeviceRequest--;
476 return o;
477}
478
Kevin Moore6d21e902021-01-15 06:41:08 -0800479void checkCustomerUnclaimDeviceRequest(api.CustomerUnclaimDeviceRequest o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100480 buildCounterCustomerUnclaimDeviceRequest++;
481 if (buildCounterCustomerUnclaimDeviceRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800482 checkDeviceReference(o.device! as api.DeviceReference);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100483 }
484 buildCounterCustomerUnclaimDeviceRequest--;
485}
486
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800487core.List<api.DeviceClaim> buildUnnamed3663() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800488 var o = <api.DeviceClaim>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +0200489 o.add(buildDeviceClaim());
490 o.add(buildDeviceClaim());
491 return o;
492}
493
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800494void checkUnnamed3663(core.List<api.DeviceClaim> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200495 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800496 checkDeviceClaim(o[0] as api.DeviceClaim);
497 checkDeviceClaim(o[1] as api.DeviceClaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200498}
499
500core.int buildCounterDevice = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800501api.Device buildDevice() {
502 var o = api.Device();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200503 buildCounterDevice++;
504 if (buildCounterDevice < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800505 o.claims = buildUnnamed3663();
Kevin Moored0251702021-01-15 06:41:08 -0800506 o.configuration = 'foo';
507 o.deviceId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200508 o.deviceIdentifier = buildDeviceIdentifier();
509 o.deviceMetadata = buildDeviceMetadata();
Kevin Moored0251702021-01-15 06:41:08 -0800510 o.name = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200511 }
512 buildCounterDevice--;
513 return o;
514}
515
Kevin Moore6d21e902021-01-15 06:41:08 -0800516void checkDevice(api.Device o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200517 buildCounterDevice++;
518 if (buildCounterDevice < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800519 checkUnnamed3663(o.claims!);
520 unittest.expect(
521 o.configuration!,
522 unittest.equals('foo'),
523 );
524 unittest.expect(
525 o.deviceId!,
526 unittest.equals('foo'),
527 );
528 checkDeviceIdentifier(o.deviceIdentifier! as api.DeviceIdentifier);
529 checkDeviceMetadata(o.deviceMetadata! as api.DeviceMetadata);
530 unittest.expect(
531 o.name!,
532 unittest.equals('foo'),
533 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200534 }
535 buildCounterDevice--;
536}
537
538core.int buildCounterDeviceClaim = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800539api.DeviceClaim buildDeviceClaim() {
540 var o = api.DeviceClaim();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200541 buildCounterDeviceClaim++;
542 if (buildCounterDeviceClaim < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800543 o.ownerCompanyId = 'foo';
544 o.resellerId = 'foo';
545 o.sectionType = 'foo';
546 o.vacationModeExpireTime = 'foo';
547 o.vacationModeStartTime = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200548 }
549 buildCounterDeviceClaim--;
550 return o;
551}
552
Kevin Moore6d21e902021-01-15 06:41:08 -0800553void checkDeviceClaim(api.DeviceClaim o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200554 buildCounterDeviceClaim++;
555 if (buildCounterDeviceClaim < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800556 unittest.expect(
557 o.ownerCompanyId!,
558 unittest.equals('foo'),
559 );
560 unittest.expect(
561 o.resellerId!,
562 unittest.equals('foo'),
563 );
564 unittest.expect(
565 o.sectionType!,
566 unittest.equals('foo'),
567 );
568 unittest.expect(
569 o.vacationModeExpireTime!,
570 unittest.equals('foo'),
571 );
572 unittest.expect(
573 o.vacationModeStartTime!,
574 unittest.equals('foo'),
575 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200576 }
577 buildCounterDeviceClaim--;
578}
579
580core.int buildCounterDeviceIdentifier = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800581api.DeviceIdentifier buildDeviceIdentifier() {
582 var o = api.DeviceIdentifier();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200583 buildCounterDeviceIdentifier++;
584 if (buildCounterDeviceIdentifier < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800585 o.imei = 'foo';
586 o.manufacturer = 'foo';
587 o.meid = 'foo';
588 o.model = 'foo';
589 o.serialNumber = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200590 }
591 buildCounterDeviceIdentifier--;
592 return o;
593}
594
Kevin Moore6d21e902021-01-15 06:41:08 -0800595void checkDeviceIdentifier(api.DeviceIdentifier o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200596 buildCounterDeviceIdentifier++;
597 if (buildCounterDeviceIdentifier < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800598 unittest.expect(
599 o.imei!,
600 unittest.equals('foo'),
601 );
602 unittest.expect(
603 o.manufacturer!,
604 unittest.equals('foo'),
605 );
606 unittest.expect(
607 o.meid!,
608 unittest.equals('foo'),
609 );
610 unittest.expect(
611 o.model!,
612 unittest.equals('foo'),
613 );
614 unittest.expect(
615 o.serialNumber!,
616 unittest.equals('foo'),
617 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200618 }
619 buildCounterDeviceIdentifier--;
620}
621
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800622core.Map<core.String, core.String> buildUnnamed3664() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800623 var o = <core.String, core.String>{};
Kevin Moored0251702021-01-15 06:41:08 -0800624 o['x'] = 'foo';
625 o['y'] = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200626 return o;
627}
628
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800629void checkUnnamed3664(core.Map<core.String, core.String> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200630 unittest.expect(o, unittest.hasLength(2));
Kevin Moore58e22332021-02-25 10:11:41 -0800631 unittest.expect(
632 o['x']!,
633 unittest.equals('foo'),
634 );
635 unittest.expect(
636 o['y']!,
637 unittest.equals('foo'),
638 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200639}
640
641core.int buildCounterDeviceMetadata = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800642api.DeviceMetadata buildDeviceMetadata() {
643 var o = api.DeviceMetadata();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200644 buildCounterDeviceMetadata++;
645 if (buildCounterDeviceMetadata < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800646 o.entries = buildUnnamed3664();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200647 }
648 buildCounterDeviceMetadata--;
649 return o;
650}
651
Kevin Moore6d21e902021-01-15 06:41:08 -0800652void checkDeviceMetadata(api.DeviceMetadata o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200653 buildCounterDeviceMetadata++;
654 if (buildCounterDeviceMetadata < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800655 checkUnnamed3664(o.entries!);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200656 }
657 buildCounterDeviceMetadata--;
658}
659
Martin Kustermannf9109a82018-01-08 15:24:20 +0100660core.int buildCounterDeviceReference = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800661api.DeviceReference buildDeviceReference() {
662 var o = api.DeviceReference();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100663 buildCounterDeviceReference++;
664 if (buildCounterDeviceReference < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800665 o.deviceId = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100666 o.deviceIdentifier = buildDeviceIdentifier();
667 }
668 buildCounterDeviceReference--;
669 return o;
670}
671
Kevin Moore6d21e902021-01-15 06:41:08 -0800672void checkDeviceReference(api.DeviceReference o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100673 buildCounterDeviceReference++;
674 if (buildCounterDeviceReference < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800675 unittest.expect(
676 o.deviceId!,
677 unittest.equals('foo'),
678 );
679 checkDeviceIdentifier(o.deviceIdentifier! as api.DeviceIdentifier);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100680 }
681 buildCounterDeviceReference--;
682}
683
Martin Kustermannfa83e312017-07-31 12:48:45 +0200684core.int buildCounterDevicesLongRunningOperationMetadata = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800685api.DevicesLongRunningOperationMetadata
686 buildDevicesLongRunningOperationMetadata() {
687 var o = api.DevicesLongRunningOperationMetadata();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200688 buildCounterDevicesLongRunningOperationMetadata++;
689 if (buildCounterDevicesLongRunningOperationMetadata < 3) {
690 o.devicesCount = 42;
Kevin Moored0251702021-01-15 06:41:08 -0800691 o.processingStatus = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200692 o.progress = 42;
693 }
694 buildCounterDevicesLongRunningOperationMetadata--;
695 return o;
696}
697
Kevin Moore6d21e902021-01-15 06:41:08 -0800698void checkDevicesLongRunningOperationMetadata(
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200699 api.DevicesLongRunningOperationMetadata o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200700 buildCounterDevicesLongRunningOperationMetadata++;
701 if (buildCounterDevicesLongRunningOperationMetadata < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800702 unittest.expect(
703 o.devicesCount!,
704 unittest.equals(42),
705 );
706 unittest.expect(
707 o.processingStatus!,
708 unittest.equals('foo'),
709 );
710 unittest.expect(
711 o.progress!,
712 unittest.equals(42),
713 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200714 }
715 buildCounterDevicesLongRunningOperationMetadata--;
716}
717
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800718core.List<api.OperationPerDevice> buildUnnamed3665() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800719 var o = <api.OperationPerDevice>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +0200720 o.add(buildOperationPerDevice());
721 o.add(buildOperationPerDevice());
722 return o;
723}
724
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800725void checkUnnamed3665(core.List<api.OperationPerDevice> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200726 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800727 checkOperationPerDevice(o[0] as api.OperationPerDevice);
728 checkOperationPerDevice(o[1] as api.OperationPerDevice);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200729}
730
731core.int buildCounterDevicesLongRunningOperationResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800732api.DevicesLongRunningOperationResponse
733 buildDevicesLongRunningOperationResponse() {
734 var o = api.DevicesLongRunningOperationResponse();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200735 buildCounterDevicesLongRunningOperationResponse++;
736 if (buildCounterDevicesLongRunningOperationResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800737 o.perDeviceStatus = buildUnnamed3665();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200738 o.successCount = 42;
739 }
740 buildCounterDevicesLongRunningOperationResponse--;
741 return o;
742}
743
Kevin Moore6d21e902021-01-15 06:41:08 -0800744void checkDevicesLongRunningOperationResponse(
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200745 api.DevicesLongRunningOperationResponse o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200746 buildCounterDevicesLongRunningOperationResponse++;
747 if (buildCounterDevicesLongRunningOperationResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800748 checkUnnamed3665(o.perDeviceStatus!);
749 unittest.expect(
750 o.successCount!,
751 unittest.equals(42),
752 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200753 }
754 buildCounterDevicesLongRunningOperationResponse--;
755}
756
Martin Kustermannf9109a82018-01-08 15:24:20 +0100757core.int buildCounterDpc = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800758api.Dpc buildDpc() {
759 var o = api.Dpc();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100760 buildCounterDpc++;
761 if (buildCounterDpc < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800762 o.dpcName = 'foo';
763 o.name = 'foo';
764 o.packageName = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100765 }
766 buildCounterDpc--;
767 return o;
768}
769
Kevin Moore6d21e902021-01-15 06:41:08 -0800770void checkDpc(api.Dpc o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100771 buildCounterDpc++;
772 if (buildCounterDpc < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800773 unittest.expect(
774 o.dpcName!,
775 unittest.equals('foo'),
776 );
777 unittest.expect(
778 o.name!,
779 unittest.equals('foo'),
780 );
781 unittest.expect(
782 o.packageName!,
783 unittest.equals('foo'),
784 );
Martin Kustermannf9109a82018-01-08 15:24:20 +0100785 }
786 buildCounterDpc--;
787}
788
Martin Kustermannfa83e312017-07-31 12:48:45 +0200789core.int buildCounterEmpty = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800790api.Empty buildEmpty() {
791 var o = api.Empty();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200792 buildCounterEmpty++;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200793 if (buildCounterEmpty < 3) {}
Martin Kustermannfa83e312017-07-31 12:48:45 +0200794 buildCounterEmpty--;
795 return o;
796}
797
Kevin Moore6d21e902021-01-15 06:41:08 -0800798void checkEmpty(api.Empty o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200799 buildCounterEmpty++;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200800 if (buildCounterEmpty < 3) {}
Martin Kustermannfa83e312017-07-31 12:48:45 +0200801 buildCounterEmpty--;
802}
803
804core.int buildCounterFindDevicesByDeviceIdentifierRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800805api.FindDevicesByDeviceIdentifierRequest
806 buildFindDevicesByDeviceIdentifierRequest() {
807 var o = api.FindDevicesByDeviceIdentifierRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200808 buildCounterFindDevicesByDeviceIdentifierRequest++;
809 if (buildCounterFindDevicesByDeviceIdentifierRequest < 3) {
810 o.deviceIdentifier = buildDeviceIdentifier();
Kevin Moored0251702021-01-15 06:41:08 -0800811 o.limit = 'foo';
812 o.pageToken = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200813 }
814 buildCounterFindDevicesByDeviceIdentifierRequest--;
815 return o;
816}
817
Kevin Moore6d21e902021-01-15 06:41:08 -0800818void checkFindDevicesByDeviceIdentifierRequest(
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200819 api.FindDevicesByDeviceIdentifierRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200820 buildCounterFindDevicesByDeviceIdentifierRequest++;
821 if (buildCounterFindDevicesByDeviceIdentifierRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800822 checkDeviceIdentifier(o.deviceIdentifier! as api.DeviceIdentifier);
823 unittest.expect(
824 o.limit!,
825 unittest.equals('foo'),
826 );
827 unittest.expect(
828 o.pageToken!,
829 unittest.equals('foo'),
830 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200831 }
832 buildCounterFindDevicesByDeviceIdentifierRequest--;
833}
834
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800835core.List<api.Device> buildUnnamed3666() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800836 var o = <api.Device>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +0200837 o.add(buildDevice());
838 o.add(buildDevice());
839 return o;
840}
841
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800842void checkUnnamed3666(core.List<api.Device> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200843 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800844 checkDevice(o[0] as api.Device);
845 checkDevice(o[1] as api.Device);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200846}
847
848core.int buildCounterFindDevicesByDeviceIdentifierResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800849api.FindDevicesByDeviceIdentifierResponse
850 buildFindDevicesByDeviceIdentifierResponse() {
851 var o = api.FindDevicesByDeviceIdentifierResponse();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200852 buildCounterFindDevicesByDeviceIdentifierResponse++;
853 if (buildCounterFindDevicesByDeviceIdentifierResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800854 o.devices = buildUnnamed3666();
Kevin Moored0251702021-01-15 06:41:08 -0800855 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100856 o.totalSize = 42;
Martin Kustermannfa83e312017-07-31 12:48:45 +0200857 }
858 buildCounterFindDevicesByDeviceIdentifierResponse--;
859 return o;
860}
861
Kevin Moore6d21e902021-01-15 06:41:08 -0800862void checkFindDevicesByDeviceIdentifierResponse(
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200863 api.FindDevicesByDeviceIdentifierResponse o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200864 buildCounterFindDevicesByDeviceIdentifierResponse++;
865 if (buildCounterFindDevicesByDeviceIdentifierResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800866 checkUnnamed3666(o.devices!);
867 unittest.expect(
868 o.nextPageToken!,
869 unittest.equals('foo'),
870 );
871 unittest.expect(
872 o.totalSize!,
873 unittest.equals(42),
874 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200875 }
876 buildCounterFindDevicesByDeviceIdentifierResponse--;
877}
878
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800879core.List<core.String> buildUnnamed3667() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800880 var o = <core.String>[];
Kevin Moored0251702021-01-15 06:41:08 -0800881 o.add('foo');
882 o.add('foo');
Martin Kustermannfa83e312017-07-31 12:48:45 +0200883 return o;
884}
885
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800886void checkUnnamed3667(core.List<core.String> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200887 unittest.expect(o, unittest.hasLength(2));
Kevin Moore58e22332021-02-25 10:11:41 -0800888 unittest.expect(
889 o[0],
890 unittest.equals('foo'),
891 );
892 unittest.expect(
893 o[1],
894 unittest.equals('foo'),
895 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200896}
897
898core.int buildCounterFindDevicesByOwnerRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800899api.FindDevicesByOwnerRequest buildFindDevicesByOwnerRequest() {
900 var o = api.FindDevicesByOwnerRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200901 buildCounterFindDevicesByOwnerRequest++;
902 if (buildCounterFindDevicesByOwnerRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800903 o.customerId = buildUnnamed3667();
Kevin Moored0251702021-01-15 06:41:08 -0800904 o.limit = 'foo';
905 o.pageToken = 'foo';
906 o.sectionType = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200907 }
908 buildCounterFindDevicesByOwnerRequest--;
909 return o;
910}
911
Kevin Moore6d21e902021-01-15 06:41:08 -0800912void checkFindDevicesByOwnerRequest(api.FindDevicesByOwnerRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200913 buildCounterFindDevicesByOwnerRequest++;
914 if (buildCounterFindDevicesByOwnerRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800915 checkUnnamed3667(o.customerId!);
916 unittest.expect(
917 o.limit!,
918 unittest.equals('foo'),
919 );
920 unittest.expect(
921 o.pageToken!,
922 unittest.equals('foo'),
923 );
924 unittest.expect(
925 o.sectionType!,
926 unittest.equals('foo'),
927 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200928 }
929 buildCounterFindDevicesByOwnerRequest--;
930}
931
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800932core.List<api.Device> buildUnnamed3668() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800933 var o = <api.Device>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +0200934 o.add(buildDevice());
935 o.add(buildDevice());
936 return o;
937}
938
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800939void checkUnnamed3668(core.List<api.Device> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200940 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800941 checkDevice(o[0] as api.Device);
942 checkDevice(o[1] as api.Device);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200943}
944
945core.int buildCounterFindDevicesByOwnerResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800946api.FindDevicesByOwnerResponse buildFindDevicesByOwnerResponse() {
947 var o = api.FindDevicesByOwnerResponse();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200948 buildCounterFindDevicesByOwnerResponse++;
949 if (buildCounterFindDevicesByOwnerResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800950 o.devices = buildUnnamed3668();
Kevin Moored0251702021-01-15 06:41:08 -0800951 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100952 o.totalSize = 42;
Martin Kustermannfa83e312017-07-31 12:48:45 +0200953 }
954 buildCounterFindDevicesByOwnerResponse--;
955 return o;
956}
957
Kevin Moore6d21e902021-01-15 06:41:08 -0800958void checkFindDevicesByOwnerResponse(api.FindDevicesByOwnerResponse o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200959 buildCounterFindDevicesByOwnerResponse++;
960 if (buildCounterFindDevicesByOwnerResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -0800961 checkUnnamed3668(o.devices!);
962 unittest.expect(
963 o.nextPageToken!,
964 unittest.equals('foo'),
965 );
966 unittest.expect(
967 o.totalSize!,
968 unittest.equals(42),
969 );
Martin Kustermannfa83e312017-07-31 12:48:45 +0200970 }
971 buildCounterFindDevicesByOwnerResponse--;
972}
973
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800974core.List<api.Company> buildUnnamed3669() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800975 var o = <api.Company>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +0200976 o.add(buildCompany());
977 o.add(buildCompany());
978 return o;
979}
980
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800981void checkUnnamed3669(core.List<api.Company> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200982 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800983 checkCompany(o[0] as api.Company);
984 checkCompany(o[1] as api.Company);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200985}
986
987core.int buildCounterListCustomersResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800988api.ListCustomersResponse buildListCustomersResponse() {
989 var o = api.ListCustomersResponse();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200990 buildCounterListCustomersResponse++;
991 if (buildCounterListCustomersResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800992 o.customers = buildUnnamed3669();
Kevin Moored0251702021-01-15 06:41:08 -0800993 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100994 o.totalSize = 42;
Martin Kustermannfa83e312017-07-31 12:48:45 +0200995 }
996 buildCounterListCustomersResponse--;
997 return o;
998}
999
Kevin Moore6d21e902021-01-15 06:41:08 -08001000void checkListCustomersResponse(api.ListCustomersResponse o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001001 buildCounterListCustomersResponse++;
1002 if (buildCounterListCustomersResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001003 checkUnnamed3669(o.customers!);
1004 unittest.expect(
1005 o.nextPageToken!,
1006 unittest.equals('foo'),
1007 );
1008 unittest.expect(
1009 o.totalSize!,
1010 unittest.equals(42),
1011 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02001012 }
1013 buildCounterListCustomersResponse--;
1014}
1015
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001016core.List<api.Company> buildUnnamed3670() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001017 var o = <api.Company>[];
Martin Kustermann12cdd522018-08-27 10:46:50 +02001018 o.add(buildCompany());
1019 o.add(buildCompany());
1020 return o;
1021}
1022
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001023void checkUnnamed3670(core.List<api.Company> o) {
Martin Kustermann12cdd522018-08-27 10:46:50 +02001024 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001025 checkCompany(o[0] as api.Company);
1026 checkCompany(o[1] as api.Company);
Martin Kustermann12cdd522018-08-27 10:46:50 +02001027}
1028
1029core.int buildCounterListVendorCustomersResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001030api.ListVendorCustomersResponse buildListVendorCustomersResponse() {
1031 var o = api.ListVendorCustomersResponse();
Martin Kustermann12cdd522018-08-27 10:46:50 +02001032 buildCounterListVendorCustomersResponse++;
1033 if (buildCounterListVendorCustomersResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001034 o.customers = buildUnnamed3670();
Kevin Moored0251702021-01-15 06:41:08 -08001035 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +01001036 o.totalSize = 42;
Martin Kustermann12cdd522018-08-27 10:46:50 +02001037 }
1038 buildCounterListVendorCustomersResponse--;
1039 return o;
1040}
1041
Kevin Moore6d21e902021-01-15 06:41:08 -08001042void checkListVendorCustomersResponse(api.ListVendorCustomersResponse o) {
Martin Kustermann12cdd522018-08-27 10:46:50 +02001043 buildCounterListVendorCustomersResponse++;
1044 if (buildCounterListVendorCustomersResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001045 checkUnnamed3670(o.customers!);
1046 unittest.expect(
1047 o.nextPageToken!,
1048 unittest.equals('foo'),
1049 );
1050 unittest.expect(
1051 o.totalSize!,
1052 unittest.equals(42),
1053 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02001054 }
1055 buildCounterListVendorCustomersResponse--;
1056}
1057
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001058core.List<api.Company> buildUnnamed3671() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001059 var o = <api.Company>[];
Martin Kustermann12cdd522018-08-27 10:46:50 +02001060 o.add(buildCompany());
1061 o.add(buildCompany());
1062 return o;
1063}
1064
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001065void checkUnnamed3671(core.List<api.Company> o) {
Martin Kustermann12cdd522018-08-27 10:46:50 +02001066 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001067 checkCompany(o[0] as api.Company);
1068 checkCompany(o[1] as api.Company);
Martin Kustermann12cdd522018-08-27 10:46:50 +02001069}
1070
1071core.int buildCounterListVendorsResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001072api.ListVendorsResponse buildListVendorsResponse() {
1073 var o = api.ListVendorsResponse();
Martin Kustermann12cdd522018-08-27 10:46:50 +02001074 buildCounterListVendorsResponse++;
1075 if (buildCounterListVendorsResponse < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001076 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +01001077 o.totalSize = 42;
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001078 o.vendors = buildUnnamed3671();
Martin Kustermann12cdd522018-08-27 10:46:50 +02001079 }
1080 buildCounterListVendorsResponse--;
1081 return o;
1082}
1083
Kevin Moore6d21e902021-01-15 06:41:08 -08001084void checkListVendorsResponse(api.ListVendorsResponse o) {
Martin Kustermann12cdd522018-08-27 10:46:50 +02001085 buildCounterListVendorsResponse++;
1086 if (buildCounterListVendorsResponse < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001087 unittest.expect(
1088 o.nextPageToken!,
1089 unittest.equals('foo'),
1090 );
1091 unittest.expect(
1092 o.totalSize!,
1093 unittest.equals(42),
1094 );
1095 checkUnnamed3671(o.vendors!);
Martin Kustermann12cdd522018-08-27 10:46:50 +02001096 }
1097 buildCounterListVendorsResponse--;
1098}
1099
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001100core.Map<core.String, core.Object> buildUnnamed3672() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001101 var o = <core.String, core.Object>{};
Kevin Moored0251702021-01-15 06:41:08 -08001102 o['x'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001103 'list': [1, 2, 3],
1104 'bool': true,
1105 'string': 'foo'
1106 };
Kevin Moored0251702021-01-15 06:41:08 -08001107 o['y'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001108 'list': [1, 2, 3],
1109 'bool': true,
1110 'string': 'foo'
1111 };
Martin Kustermannfa83e312017-07-31 12:48:45 +02001112 return o;
1113}
1114
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001115void checkUnnamed3672(core.Map<core.String, core.Object> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001116 unittest.expect(o, unittest.hasLength(2));
Kevin Moore58e22332021-02-25 10:11:41 -08001117 var casted1 = (o['x']!) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001118 unittest.expect(casted1, unittest.hasLength(3));
Kevin Moore58e22332021-02-25 10:11:41 -08001119 unittest.expect(
1120 casted1['list'],
1121 unittest.equals([1, 2, 3]),
1122 );
1123 unittest.expect(
1124 casted1['bool'],
1125 unittest.equals(true),
1126 );
1127 unittest.expect(
1128 casted1['string'],
1129 unittest.equals('foo'),
1130 );
1131 var casted2 = (o['y']!) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001132 unittest.expect(casted2, unittest.hasLength(3));
Kevin Moore58e22332021-02-25 10:11:41 -08001133 unittest.expect(
1134 casted2['list'],
1135 unittest.equals([1, 2, 3]),
1136 );
1137 unittest.expect(
1138 casted2['bool'],
1139 unittest.equals(true),
1140 );
1141 unittest.expect(
1142 casted2['string'],
1143 unittest.equals('foo'),
1144 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02001145}
1146
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001147core.Map<core.String, core.Object> buildUnnamed3673() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001148 var o = <core.String, core.Object>{};
Kevin Moored0251702021-01-15 06:41:08 -08001149 o['x'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001150 'list': [1, 2, 3],
1151 'bool': true,
1152 'string': 'foo'
1153 };
Kevin Moored0251702021-01-15 06:41:08 -08001154 o['y'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001155 'list': [1, 2, 3],
1156 'bool': true,
1157 'string': 'foo'
1158 };
Martin Kustermannfa83e312017-07-31 12:48:45 +02001159 return o;
1160}
1161
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001162void checkUnnamed3673(core.Map<core.String, core.Object> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001163 unittest.expect(o, unittest.hasLength(2));
Kevin Moore58e22332021-02-25 10:11:41 -08001164 var casted3 = (o['x']!) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001165 unittest.expect(casted3, unittest.hasLength(3));
Kevin Moore58e22332021-02-25 10:11:41 -08001166 unittest.expect(
1167 casted3['list'],
1168 unittest.equals([1, 2, 3]),
1169 );
1170 unittest.expect(
1171 casted3['bool'],
1172 unittest.equals(true),
1173 );
1174 unittest.expect(
1175 casted3['string'],
1176 unittest.equals('foo'),
1177 );
1178 var casted4 = (o['y']!) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001179 unittest.expect(casted4, unittest.hasLength(3));
Kevin Moore58e22332021-02-25 10:11:41 -08001180 unittest.expect(
1181 casted4['list'],
1182 unittest.equals([1, 2, 3]),
1183 );
1184 unittest.expect(
1185 casted4['bool'],
1186 unittest.equals(true),
1187 );
1188 unittest.expect(
1189 casted4['string'],
1190 unittest.equals('foo'),
1191 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02001192}
1193
1194core.int buildCounterOperation = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001195api.Operation buildOperation() {
1196 var o = api.Operation();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001197 buildCounterOperation++;
1198 if (buildCounterOperation < 3) {
1199 o.done = true;
1200 o.error = buildStatus();
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001201 o.metadata = buildUnnamed3672();
Kevin Moored0251702021-01-15 06:41:08 -08001202 o.name = 'foo';
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001203 o.response = buildUnnamed3673();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001204 }
1205 buildCounterOperation--;
1206 return o;
1207}
1208
Kevin Moore6d21e902021-01-15 06:41:08 -08001209void checkOperation(api.Operation o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001210 buildCounterOperation++;
1211 if (buildCounterOperation < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001212 unittest.expect(o.done!, unittest.isTrue);
1213 checkStatus(o.error! as api.Status);
1214 checkUnnamed3672(o.metadata!);
1215 unittest.expect(
1216 o.name!,
1217 unittest.equals('foo'),
1218 );
1219 checkUnnamed3673(o.response!);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001220 }
1221 buildCounterOperation--;
1222}
1223
1224core.int buildCounterOperationPerDevice = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001225api.OperationPerDevice buildOperationPerDevice() {
1226 var o = api.OperationPerDevice();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001227 buildCounterOperationPerDevice++;
1228 if (buildCounterOperationPerDevice < 3) {
1229 o.claim = buildPartnerClaim();
1230 o.result = buildPerDeviceStatusInBatch();
1231 o.unclaim = buildPartnerUnclaim();
1232 o.updateMetadata = buildUpdateMetadataArguments();
1233 }
1234 buildCounterOperationPerDevice--;
1235 return o;
1236}
1237
Kevin Moore6d21e902021-01-15 06:41:08 -08001238void checkOperationPerDevice(api.OperationPerDevice o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001239 buildCounterOperationPerDevice++;
1240 if (buildCounterOperationPerDevice < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001241 checkPartnerClaim(o.claim! as api.PartnerClaim);
1242 checkPerDeviceStatusInBatch(o.result! as api.PerDeviceStatusInBatch);
1243 checkPartnerUnclaim(o.unclaim! as api.PartnerUnclaim);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001244 checkUpdateMetadataArguments(
Kevin Moore58e22332021-02-25 10:11:41 -08001245 o.updateMetadata! as api.UpdateMetadataArguments);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001246 }
1247 buildCounterOperationPerDevice--;
1248}
1249
1250core.int buildCounterPartnerClaim = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001251api.PartnerClaim buildPartnerClaim() {
1252 var o = api.PartnerClaim();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001253 buildCounterPartnerClaim++;
1254 if (buildCounterPartnerClaim < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001255 o.customerId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001256 o.deviceIdentifier = buildDeviceIdentifier();
1257 o.deviceMetadata = buildDeviceMetadata();
Kevin Moored0251702021-01-15 06:41:08 -08001258 o.sectionType = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001259 }
1260 buildCounterPartnerClaim--;
1261 return o;
1262}
1263
Kevin Moore6d21e902021-01-15 06:41:08 -08001264void checkPartnerClaim(api.PartnerClaim o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001265 buildCounterPartnerClaim++;
1266 if (buildCounterPartnerClaim < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001267 unittest.expect(
1268 o.customerId!,
1269 unittest.equals('foo'),
1270 );
1271 checkDeviceIdentifier(o.deviceIdentifier! as api.DeviceIdentifier);
1272 checkDeviceMetadata(o.deviceMetadata! as api.DeviceMetadata);
1273 unittest.expect(
1274 o.sectionType!,
1275 unittest.equals('foo'),
1276 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02001277 }
1278 buildCounterPartnerClaim--;
1279}
1280
1281core.int buildCounterPartnerUnclaim = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001282api.PartnerUnclaim buildPartnerUnclaim() {
1283 var o = api.PartnerUnclaim();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001284 buildCounterPartnerUnclaim++;
1285 if (buildCounterPartnerUnclaim < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001286 o.deviceId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001287 o.deviceIdentifier = buildDeviceIdentifier();
Kevin Moored0251702021-01-15 06:41:08 -08001288 o.sectionType = 'foo';
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001289 o.vacationModeDays = 42;
Kevin Moored0251702021-01-15 06:41:08 -08001290 o.vacationModeExpireTime = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001291 }
1292 buildCounterPartnerUnclaim--;
1293 return o;
1294}
1295
Kevin Moore6d21e902021-01-15 06:41:08 -08001296void checkPartnerUnclaim(api.PartnerUnclaim o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001297 buildCounterPartnerUnclaim++;
1298 if (buildCounterPartnerUnclaim < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001299 unittest.expect(
1300 o.deviceId!,
1301 unittest.equals('foo'),
1302 );
1303 checkDeviceIdentifier(o.deviceIdentifier! as api.DeviceIdentifier);
1304 unittest.expect(
1305 o.sectionType!,
1306 unittest.equals('foo'),
1307 );
1308 unittest.expect(
1309 o.vacationModeDays!,
1310 unittest.equals(42),
1311 );
1312 unittest.expect(
1313 o.vacationModeExpireTime!,
1314 unittest.equals('foo'),
1315 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02001316 }
1317 buildCounterPartnerUnclaim--;
1318}
1319
1320core.int buildCounterPerDeviceStatusInBatch = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001321api.PerDeviceStatusInBatch buildPerDeviceStatusInBatch() {
1322 var o = api.PerDeviceStatusInBatch();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001323 buildCounterPerDeviceStatusInBatch++;
1324 if (buildCounterPerDeviceStatusInBatch < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001325 o.deviceId = 'foo';
1326 o.errorIdentifier = 'foo';
1327 o.errorMessage = 'foo';
1328 o.status = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001329 }
1330 buildCounterPerDeviceStatusInBatch--;
1331 return o;
1332}
1333
Kevin Moore6d21e902021-01-15 06:41:08 -08001334void checkPerDeviceStatusInBatch(api.PerDeviceStatusInBatch o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001335 buildCounterPerDeviceStatusInBatch++;
1336 if (buildCounterPerDeviceStatusInBatch < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001337 unittest.expect(
1338 o.deviceId!,
1339 unittest.equals('foo'),
1340 );
1341 unittest.expect(
1342 o.errorIdentifier!,
1343 unittest.equals('foo'),
1344 );
1345 unittest.expect(
1346 o.errorMessage!,
1347 unittest.equals('foo'),
1348 );
1349 unittest.expect(
1350 o.status!,
1351 unittest.equals('foo'),
1352 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02001353 }
1354 buildCounterPerDeviceStatusInBatch--;
1355}
1356
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001357core.Map<core.String, core.Object> buildUnnamed3674() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001358 var o = <core.String, core.Object>{};
Kevin Moored0251702021-01-15 06:41:08 -08001359 o['x'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001360 'list': [1, 2, 3],
1361 'bool': true,
1362 'string': 'foo'
1363 };
Kevin Moored0251702021-01-15 06:41:08 -08001364 o['y'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001365 'list': [1, 2, 3],
1366 'bool': true,
1367 'string': 'foo'
1368 };
Martin Kustermannfa83e312017-07-31 12:48:45 +02001369 return o;
1370}
1371
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001372void checkUnnamed3674(core.Map<core.String, core.Object> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001373 unittest.expect(o, unittest.hasLength(2));
Kevin Moore58e22332021-02-25 10:11:41 -08001374 var casted5 = (o['x']!) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001375 unittest.expect(casted5, unittest.hasLength(3));
Kevin Moore58e22332021-02-25 10:11:41 -08001376 unittest.expect(
1377 casted5['list'],
1378 unittest.equals([1, 2, 3]),
1379 );
1380 unittest.expect(
1381 casted5['bool'],
1382 unittest.equals(true),
1383 );
1384 unittest.expect(
1385 casted5['string'],
1386 unittest.equals('foo'),
1387 );
1388 var casted6 = (o['y']!) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001389 unittest.expect(casted6, unittest.hasLength(3));
Kevin Moore58e22332021-02-25 10:11:41 -08001390 unittest.expect(
1391 casted6['list'],
1392 unittest.equals([1, 2, 3]),
1393 );
1394 unittest.expect(
1395 casted6['bool'],
1396 unittest.equals(true),
1397 );
1398 unittest.expect(
1399 casted6['string'],
1400 unittest.equals('foo'),
1401 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02001402}
1403
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001404core.List<core.Map<core.String, core.Object>> buildUnnamed3675() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001405 var o = <core.Map<core.String, core.Object>>[];
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001406 o.add(buildUnnamed3674());
1407 o.add(buildUnnamed3674());
Martin Kustermannfa83e312017-07-31 12:48:45 +02001408 return o;
1409}
1410
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001411void checkUnnamed3675(core.List<core.Map<core.String, core.Object>> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001412 unittest.expect(o, unittest.hasLength(2));
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001413 checkUnnamed3674(o[0]);
1414 checkUnnamed3674(o[1]);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001415}
1416
1417core.int buildCounterStatus = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001418api.Status buildStatus() {
1419 var o = api.Status();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001420 buildCounterStatus++;
1421 if (buildCounterStatus < 3) {
1422 o.code = 42;
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001423 o.details = buildUnnamed3675();
Kevin Moored0251702021-01-15 06:41:08 -08001424 o.message = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001425 }
1426 buildCounterStatus--;
1427 return o;
1428}
1429
Kevin Moore6d21e902021-01-15 06:41:08 -08001430void checkStatus(api.Status o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001431 buildCounterStatus++;
1432 if (buildCounterStatus < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001433 unittest.expect(
1434 o.code!,
1435 unittest.equals(42),
1436 );
1437 checkUnnamed3675(o.details!);
1438 unittest.expect(
1439 o.message!,
1440 unittest.equals('foo'),
1441 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02001442 }
1443 buildCounterStatus--;
1444}
1445
1446core.int buildCounterUnclaimDeviceRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001447api.UnclaimDeviceRequest buildUnclaimDeviceRequest() {
1448 var o = api.UnclaimDeviceRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001449 buildCounterUnclaimDeviceRequest++;
1450 if (buildCounterUnclaimDeviceRequest < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001451 o.deviceId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001452 o.deviceIdentifier = buildDeviceIdentifier();
Kevin Moored0251702021-01-15 06:41:08 -08001453 o.sectionType = 'foo';
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001454 o.vacationModeDays = 42;
Kevin Moored0251702021-01-15 06:41:08 -08001455 o.vacationModeExpireTime = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001456 }
1457 buildCounterUnclaimDeviceRequest--;
1458 return o;
1459}
1460
Kevin Moore6d21e902021-01-15 06:41:08 -08001461void checkUnclaimDeviceRequest(api.UnclaimDeviceRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001462 buildCounterUnclaimDeviceRequest++;
1463 if (buildCounterUnclaimDeviceRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001464 unittest.expect(
1465 o.deviceId!,
1466 unittest.equals('foo'),
1467 );
1468 checkDeviceIdentifier(o.deviceIdentifier! as api.DeviceIdentifier);
1469 unittest.expect(
1470 o.sectionType!,
1471 unittest.equals('foo'),
1472 );
1473 unittest.expect(
1474 o.vacationModeDays!,
1475 unittest.equals(42),
1476 );
1477 unittest.expect(
1478 o.vacationModeExpireTime!,
1479 unittest.equals('foo'),
1480 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02001481 }
1482 buildCounterUnclaimDeviceRequest--;
1483}
1484
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001485core.List<api.PartnerUnclaim> buildUnnamed3676() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001486 var o = <api.PartnerUnclaim>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +02001487 o.add(buildPartnerUnclaim());
1488 o.add(buildPartnerUnclaim());
1489 return o;
1490}
1491
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001492void checkUnnamed3676(core.List<api.PartnerUnclaim> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001493 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001494 checkPartnerUnclaim(o[0] as api.PartnerUnclaim);
1495 checkPartnerUnclaim(o[1] as api.PartnerUnclaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001496}
1497
1498core.int buildCounterUnclaimDevicesRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001499api.UnclaimDevicesRequest buildUnclaimDevicesRequest() {
1500 var o = api.UnclaimDevicesRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001501 buildCounterUnclaimDevicesRequest++;
1502 if (buildCounterUnclaimDevicesRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001503 o.unclaims = buildUnnamed3676();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001504 }
1505 buildCounterUnclaimDevicesRequest--;
1506 return o;
1507}
1508
Kevin Moore6d21e902021-01-15 06:41:08 -08001509void checkUnclaimDevicesRequest(api.UnclaimDevicesRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001510 buildCounterUnclaimDevicesRequest++;
1511 if (buildCounterUnclaimDevicesRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001512 checkUnnamed3676(o.unclaims!);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001513 }
1514 buildCounterUnclaimDevicesRequest--;
1515}
1516
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001517core.List<api.UpdateMetadataArguments> buildUnnamed3677() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001518 var o = <api.UpdateMetadataArguments>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +02001519 o.add(buildUpdateMetadataArguments());
1520 o.add(buildUpdateMetadataArguments());
1521 return o;
1522}
1523
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001524void checkUnnamed3677(core.List<api.UpdateMetadataArguments> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001525 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001526 checkUpdateMetadataArguments(o[0] as api.UpdateMetadataArguments);
1527 checkUpdateMetadataArguments(o[1] as api.UpdateMetadataArguments);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001528}
1529
1530core.int buildCounterUpdateDeviceMetadataInBatchRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001531api.UpdateDeviceMetadataInBatchRequest
1532 buildUpdateDeviceMetadataInBatchRequest() {
1533 var o = api.UpdateDeviceMetadataInBatchRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001534 buildCounterUpdateDeviceMetadataInBatchRequest++;
1535 if (buildCounterUpdateDeviceMetadataInBatchRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001536 o.updates = buildUnnamed3677();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001537 }
1538 buildCounterUpdateDeviceMetadataInBatchRequest--;
1539 return o;
1540}
1541
Kevin Moore6d21e902021-01-15 06:41:08 -08001542void checkUpdateDeviceMetadataInBatchRequest(
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001543 api.UpdateDeviceMetadataInBatchRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001544 buildCounterUpdateDeviceMetadataInBatchRequest++;
1545 if (buildCounterUpdateDeviceMetadataInBatchRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001546 checkUnnamed3677(o.updates!);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001547 }
1548 buildCounterUpdateDeviceMetadataInBatchRequest--;
1549}
1550
1551core.int buildCounterUpdateDeviceMetadataRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001552api.UpdateDeviceMetadataRequest buildUpdateDeviceMetadataRequest() {
1553 var o = api.UpdateDeviceMetadataRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001554 buildCounterUpdateDeviceMetadataRequest++;
1555 if (buildCounterUpdateDeviceMetadataRequest < 3) {
1556 o.deviceMetadata = buildDeviceMetadata();
1557 }
1558 buildCounterUpdateDeviceMetadataRequest--;
1559 return o;
1560}
1561
Kevin Moore6d21e902021-01-15 06:41:08 -08001562void checkUpdateDeviceMetadataRequest(api.UpdateDeviceMetadataRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001563 buildCounterUpdateDeviceMetadataRequest++;
1564 if (buildCounterUpdateDeviceMetadataRequest < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001565 checkDeviceMetadata(o.deviceMetadata! as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001566 }
1567 buildCounterUpdateDeviceMetadataRequest--;
1568}
1569
1570core.int buildCounterUpdateMetadataArguments = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001571api.UpdateMetadataArguments buildUpdateMetadataArguments() {
1572 var o = api.UpdateMetadataArguments();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001573 buildCounterUpdateMetadataArguments++;
1574 if (buildCounterUpdateMetadataArguments < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001575 o.deviceId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001576 o.deviceIdentifier = buildDeviceIdentifier();
1577 o.deviceMetadata = buildDeviceMetadata();
1578 }
1579 buildCounterUpdateMetadataArguments--;
1580 return o;
1581}
1582
Kevin Moore6d21e902021-01-15 06:41:08 -08001583void checkUpdateMetadataArguments(api.UpdateMetadataArguments o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001584 buildCounterUpdateMetadataArguments++;
1585 if (buildCounterUpdateMetadataArguments < 3) {
Kevin Moore58e22332021-02-25 10:11:41 -08001586 unittest.expect(
1587 o.deviceId!,
1588 unittest.equals('foo'),
1589 );
1590 checkDeviceIdentifier(o.deviceIdentifier! as api.DeviceIdentifier);
1591 checkDeviceMetadata(o.deviceMetadata! as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001592 }
1593 buildCounterUpdateMetadataArguments--;
1594}
1595
Kevin Moore6d21e902021-01-15 06:41:08 -08001596void main() {
Kevin Moored0251702021-01-15 06:41:08 -08001597 unittest.group('obj-schema-ClaimDeviceRequest', () {
1598 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001599 var o = buildClaimDeviceRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001600 var od = api.ClaimDeviceRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001601 checkClaimDeviceRequest(od as api.ClaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001602 });
1603 });
1604
Kevin Moored0251702021-01-15 06:41:08 -08001605 unittest.group('obj-schema-ClaimDeviceResponse', () {
1606 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001607 var o = buildClaimDeviceResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001608 var od = api.ClaimDeviceResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001609 checkClaimDeviceResponse(od as api.ClaimDeviceResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001610 });
1611 });
1612
Kevin Moored0251702021-01-15 06:41:08 -08001613 unittest.group('obj-schema-ClaimDevicesRequest', () {
1614 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001615 var o = buildClaimDevicesRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001616 var od = api.ClaimDevicesRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001617 checkClaimDevicesRequest(od as api.ClaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001618 });
1619 });
1620
Kevin Moored0251702021-01-15 06:41:08 -08001621 unittest.group('obj-schema-Company', () {
1622 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001623 var o = buildCompany();
Kevin Moore6d21e902021-01-15 06:41:08 -08001624 var od = api.Company.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001625 checkCompany(od as api.Company);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001626 });
1627 });
1628
Kevin Moored0251702021-01-15 06:41:08 -08001629 unittest.group('obj-schema-Configuration', () {
1630 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001631 var o = buildConfiguration();
Kevin Moore6d21e902021-01-15 06:41:08 -08001632 var od = api.Configuration.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001633 checkConfiguration(od as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001634 });
1635 });
1636
Kevin Moored0251702021-01-15 06:41:08 -08001637 unittest.group('obj-schema-CreateCustomerRequest', () {
1638 unittest.test('to-json--from-json', () {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001639 var o = buildCreateCustomerRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001640 var od = api.CreateCustomerRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001641 checkCreateCustomerRequest(od as api.CreateCustomerRequest);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001642 });
1643 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02001644
Kevin Moored0251702021-01-15 06:41:08 -08001645 unittest.group('obj-schema-CustomerApplyConfigurationRequest', () {
1646 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001647 var o = buildCustomerApplyConfigurationRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001648 var od = api.CustomerApplyConfigurationRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001649 checkCustomerApplyConfigurationRequest(
1650 od as api.CustomerApplyConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001651 });
1652 });
1653
Kevin Moored0251702021-01-15 06:41:08 -08001654 unittest.group('obj-schema-CustomerListConfigurationsResponse', () {
1655 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001656 var o = buildCustomerListConfigurationsResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001657 var od = api.CustomerListConfigurationsResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001658 checkCustomerListConfigurationsResponse(
1659 od as api.CustomerListConfigurationsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001660 });
1661 });
1662
Kevin Moored0251702021-01-15 06:41:08 -08001663 unittest.group('obj-schema-CustomerListCustomersResponse', () {
1664 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001665 var o = buildCustomerListCustomersResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001666 var od = api.CustomerListCustomersResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001667 checkCustomerListCustomersResponse(
1668 od as api.CustomerListCustomersResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001669 });
1670 });
1671
Kevin Moored0251702021-01-15 06:41:08 -08001672 unittest.group('obj-schema-CustomerListDevicesResponse', () {
1673 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001674 var o = buildCustomerListDevicesResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001675 var od = api.CustomerListDevicesResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001676 checkCustomerListDevicesResponse(od as api.CustomerListDevicesResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001677 });
1678 });
1679
Kevin Moored0251702021-01-15 06:41:08 -08001680 unittest.group('obj-schema-CustomerListDpcsResponse', () {
1681 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001682 var o = buildCustomerListDpcsResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001683 var od = api.CustomerListDpcsResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001684 checkCustomerListDpcsResponse(od as api.CustomerListDpcsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001685 });
1686 });
1687
Kevin Moored0251702021-01-15 06:41:08 -08001688 unittest.group('obj-schema-CustomerRemoveConfigurationRequest', () {
1689 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001690 var o = buildCustomerRemoveConfigurationRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001691 var od = api.CustomerRemoveConfigurationRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001692 checkCustomerRemoveConfigurationRequest(
1693 od as api.CustomerRemoveConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001694 });
1695 });
1696
Kevin Moored0251702021-01-15 06:41:08 -08001697 unittest.group('obj-schema-CustomerUnclaimDeviceRequest', () {
1698 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001699 var o = buildCustomerUnclaimDeviceRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001700 var od = api.CustomerUnclaimDeviceRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001701 checkCustomerUnclaimDeviceRequest(od as api.CustomerUnclaimDeviceRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001702 });
1703 });
1704
Kevin Moored0251702021-01-15 06:41:08 -08001705 unittest.group('obj-schema-Device', () {
1706 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001707 var o = buildDevice();
Kevin Moore6d21e902021-01-15 06:41:08 -08001708 var od = api.Device.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001709 checkDevice(od as api.Device);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001710 });
1711 });
1712
Kevin Moored0251702021-01-15 06:41:08 -08001713 unittest.group('obj-schema-DeviceClaim', () {
1714 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001715 var o = buildDeviceClaim();
Kevin Moore6d21e902021-01-15 06:41:08 -08001716 var od = api.DeviceClaim.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001717 checkDeviceClaim(od as api.DeviceClaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001718 });
1719 });
1720
Kevin Moored0251702021-01-15 06:41:08 -08001721 unittest.group('obj-schema-DeviceIdentifier', () {
1722 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001723 var o = buildDeviceIdentifier();
Kevin Moore6d21e902021-01-15 06:41:08 -08001724 var od = api.DeviceIdentifier.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001725 checkDeviceIdentifier(od as api.DeviceIdentifier);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001726 });
1727 });
1728
Kevin Moored0251702021-01-15 06:41:08 -08001729 unittest.group('obj-schema-DeviceMetadata', () {
1730 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001731 var o = buildDeviceMetadata();
Kevin Moore6d21e902021-01-15 06:41:08 -08001732 var od = api.DeviceMetadata.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001733 checkDeviceMetadata(od as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001734 });
1735 });
1736
Kevin Moored0251702021-01-15 06:41:08 -08001737 unittest.group('obj-schema-DeviceReference', () {
1738 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001739 var o = buildDeviceReference();
Kevin Moore6d21e902021-01-15 06:41:08 -08001740 var od = api.DeviceReference.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001741 checkDeviceReference(od as api.DeviceReference);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001742 });
1743 });
1744
Kevin Moored0251702021-01-15 06:41:08 -08001745 unittest.group('obj-schema-DevicesLongRunningOperationMetadata', () {
1746 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001747 var o = buildDevicesLongRunningOperationMetadata();
Kevin Moore6d21e902021-01-15 06:41:08 -08001748 var od = api.DevicesLongRunningOperationMetadata.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001749 checkDevicesLongRunningOperationMetadata(
1750 od as api.DevicesLongRunningOperationMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001751 });
1752 });
1753
Kevin Moored0251702021-01-15 06:41:08 -08001754 unittest.group('obj-schema-DevicesLongRunningOperationResponse', () {
1755 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001756 var o = buildDevicesLongRunningOperationResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001757 var od = api.DevicesLongRunningOperationResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001758 checkDevicesLongRunningOperationResponse(
1759 od as api.DevicesLongRunningOperationResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001760 });
1761 });
1762
Kevin Moored0251702021-01-15 06:41:08 -08001763 unittest.group('obj-schema-Dpc', () {
1764 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001765 var o = buildDpc();
Kevin Moore6d21e902021-01-15 06:41:08 -08001766 var od = api.Dpc.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001767 checkDpc(od as api.Dpc);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001768 });
1769 });
1770
Kevin Moored0251702021-01-15 06:41:08 -08001771 unittest.group('obj-schema-Empty', () {
1772 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001773 var o = buildEmpty();
Kevin Moore6d21e902021-01-15 06:41:08 -08001774 var od = api.Empty.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001775 checkEmpty(od as api.Empty);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001776 });
1777 });
1778
Kevin Moored0251702021-01-15 06:41:08 -08001779 unittest.group('obj-schema-FindDevicesByDeviceIdentifierRequest', () {
1780 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001781 var o = buildFindDevicesByDeviceIdentifierRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001782 var od = api.FindDevicesByDeviceIdentifierRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001783 checkFindDevicesByDeviceIdentifierRequest(
1784 od as api.FindDevicesByDeviceIdentifierRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001785 });
1786 });
1787
Kevin Moored0251702021-01-15 06:41:08 -08001788 unittest.group('obj-schema-FindDevicesByDeviceIdentifierResponse', () {
1789 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001790 var o = buildFindDevicesByDeviceIdentifierResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001791 var od = api.FindDevicesByDeviceIdentifierResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001792 checkFindDevicesByDeviceIdentifierResponse(
1793 od as api.FindDevicesByDeviceIdentifierResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001794 });
1795 });
1796
Kevin Moored0251702021-01-15 06:41:08 -08001797 unittest.group('obj-schema-FindDevicesByOwnerRequest', () {
1798 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001799 var o = buildFindDevicesByOwnerRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001800 var od = api.FindDevicesByOwnerRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001801 checkFindDevicesByOwnerRequest(od as api.FindDevicesByOwnerRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001802 });
1803 });
1804
Kevin Moored0251702021-01-15 06:41:08 -08001805 unittest.group('obj-schema-FindDevicesByOwnerResponse', () {
1806 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001807 var o = buildFindDevicesByOwnerResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001808 var od = api.FindDevicesByOwnerResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001809 checkFindDevicesByOwnerResponse(od as api.FindDevicesByOwnerResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001810 });
1811 });
1812
Kevin Moored0251702021-01-15 06:41:08 -08001813 unittest.group('obj-schema-ListCustomersResponse', () {
1814 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001815 var o = buildListCustomersResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001816 var od = api.ListCustomersResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001817 checkListCustomersResponse(od as api.ListCustomersResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001818 });
1819 });
1820
Kevin Moored0251702021-01-15 06:41:08 -08001821 unittest.group('obj-schema-ListVendorCustomersResponse', () {
1822 unittest.test('to-json--from-json', () {
Martin Kustermann12cdd522018-08-27 10:46:50 +02001823 var o = buildListVendorCustomersResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001824 var od = api.ListVendorCustomersResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001825 checkListVendorCustomersResponse(od as api.ListVendorCustomersResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02001826 });
1827 });
1828
Kevin Moored0251702021-01-15 06:41:08 -08001829 unittest.group('obj-schema-ListVendorsResponse', () {
1830 unittest.test('to-json--from-json', () {
Martin Kustermann12cdd522018-08-27 10:46:50 +02001831 var o = buildListVendorsResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001832 var od = api.ListVendorsResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001833 checkListVendorsResponse(od as api.ListVendorsResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02001834 });
1835 });
1836
Kevin Moored0251702021-01-15 06:41:08 -08001837 unittest.group('obj-schema-Operation', () {
1838 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001839 var o = buildOperation();
Kevin Moore6d21e902021-01-15 06:41:08 -08001840 var od = api.Operation.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001841 checkOperation(od as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001842 });
1843 });
1844
Kevin Moored0251702021-01-15 06:41:08 -08001845 unittest.group('obj-schema-OperationPerDevice', () {
1846 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001847 var o = buildOperationPerDevice();
Kevin Moore6d21e902021-01-15 06:41:08 -08001848 var od = api.OperationPerDevice.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001849 checkOperationPerDevice(od as api.OperationPerDevice);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001850 });
1851 });
1852
Kevin Moored0251702021-01-15 06:41:08 -08001853 unittest.group('obj-schema-PartnerClaim', () {
1854 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001855 var o = buildPartnerClaim();
Kevin Moore6d21e902021-01-15 06:41:08 -08001856 var od = api.PartnerClaim.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001857 checkPartnerClaim(od as api.PartnerClaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001858 });
1859 });
1860
Kevin Moored0251702021-01-15 06:41:08 -08001861 unittest.group('obj-schema-PartnerUnclaim', () {
1862 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001863 var o = buildPartnerUnclaim();
Kevin Moore6d21e902021-01-15 06:41:08 -08001864 var od = api.PartnerUnclaim.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001865 checkPartnerUnclaim(od as api.PartnerUnclaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001866 });
1867 });
1868
Kevin Moored0251702021-01-15 06:41:08 -08001869 unittest.group('obj-schema-PerDeviceStatusInBatch', () {
1870 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001871 var o = buildPerDeviceStatusInBatch();
Kevin Moore6d21e902021-01-15 06:41:08 -08001872 var od = api.PerDeviceStatusInBatch.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001873 checkPerDeviceStatusInBatch(od as api.PerDeviceStatusInBatch);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001874 });
1875 });
1876
Kevin Moored0251702021-01-15 06:41:08 -08001877 unittest.group('obj-schema-Status', () {
1878 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001879 var o = buildStatus();
Kevin Moore6d21e902021-01-15 06:41:08 -08001880 var od = api.Status.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001881 checkStatus(od as api.Status);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001882 });
1883 });
1884
Kevin Moored0251702021-01-15 06:41:08 -08001885 unittest.group('obj-schema-UnclaimDeviceRequest', () {
1886 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001887 var o = buildUnclaimDeviceRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001888 var od = api.UnclaimDeviceRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001889 checkUnclaimDeviceRequest(od as api.UnclaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001890 });
1891 });
1892
Kevin Moored0251702021-01-15 06:41:08 -08001893 unittest.group('obj-schema-UnclaimDevicesRequest', () {
1894 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001895 var o = buildUnclaimDevicesRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001896 var od = api.UnclaimDevicesRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001897 checkUnclaimDevicesRequest(od as api.UnclaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001898 });
1899 });
1900
Kevin Moored0251702021-01-15 06:41:08 -08001901 unittest.group('obj-schema-UpdateDeviceMetadataInBatchRequest', () {
1902 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001903 var o = buildUpdateDeviceMetadataInBatchRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001904 var od = api.UpdateDeviceMetadataInBatchRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001905 checkUpdateDeviceMetadataInBatchRequest(
1906 od as api.UpdateDeviceMetadataInBatchRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001907 });
1908 });
1909
Kevin Moored0251702021-01-15 06:41:08 -08001910 unittest.group('obj-schema-UpdateDeviceMetadataRequest', () {
1911 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001912 var o = buildUpdateDeviceMetadataRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001913 var od = api.UpdateDeviceMetadataRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001914 checkUpdateDeviceMetadataRequest(od as api.UpdateDeviceMetadataRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001915 });
1916 });
1917
Kevin Moored0251702021-01-15 06:41:08 -08001918 unittest.group('obj-schema-UpdateMetadataArguments', () {
1919 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001920 var o = buildUpdateMetadataArguments();
Kevin Moore6d21e902021-01-15 06:41:08 -08001921 var od = api.UpdateMetadataArguments.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001922 checkUpdateMetadataArguments(od as api.UpdateMetadataArguments);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001923 });
1924 });
1925
Kevin Moore88512712021-01-28 14:43:28 -08001926 unittest.group('resource-CustomersResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08001927 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08001928 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08001929 var res = api.AndroidProvisioningPartnerApi(mock).customers;
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001930 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08001931 var arg_pageToken = 'foo';
1932 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01001933 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1934 var path = (req.url).path;
1935 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001936 core.int index;
1937 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001938 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08001939 path.substring(pathOffset, pathOffset + 1),
1940 unittest.equals("/"),
1941 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001942 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08001943 unittest.expect(
1944 path.substring(pathOffset, pathOffset + 12),
1945 unittest.equals("v1/customers"),
1946 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001947 pathOffset += 12;
1948
1949 var query = (req.url).query;
1950 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02001951 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08001952 void addQueryParam(core.String n, core.String v) =>
1953 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001954
Kevin Moore6d21e902021-01-15 06:41:08 -08001955 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08001956 for (var part in query.split('&')) {
1957 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08001958 addQueryParam(
1959 core.Uri.decodeQueryComponent(keyValue[0]),
1960 core.Uri.decodeQueryComponent(keyValue[1]),
1961 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001962 }
1963 }
Jonas Finnemann Jensenb223bd52020-10-09 13:02:08 +02001964 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08001965 core.int.parse(queryMap["pageSize"]!.first),
1966 unittest.equals(arg_pageSize),
1967 );
1968 unittest.expect(
1969 queryMap["pageToken"]!.first,
1970 unittest.equals(arg_pageToken),
1971 );
1972 unittest.expect(
1973 queryMap["fields"]!.first,
1974 unittest.equals(arg_$fields),
1975 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001976
1977 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08001978 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01001979 };
Jakob Andersen52715df2018-05-01 13:58:48 +02001980 var resp = convert.json.encode(buildCustomerListCustomersResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08001981 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01001982 }), true);
1983 res
1984 .list(
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001985 pageSize: arg_pageSize,
Jonas Finnemann Jensenb223bd52020-10-09 13:02:08 +02001986 pageToken: arg_pageToken,
Martin Kustermannf9109a82018-01-08 15:24:20 +01001987 $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02001988 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001989 checkCustomerListCustomersResponse(
1990 response as api.CustomerListCustomersResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001991 })));
1992 });
1993 });
1994
Kevin Moore88512712021-01-28 14:43:28 -08001995 unittest.group('resource-CustomersConfigurationsResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08001996 unittest.test('method--create', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08001997 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08001998 var res =
1999 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002000 var arg_request = buildConfiguration();
Kevin Moored0251702021-01-15 06:41:08 -08002001 var arg_parent = 'foo';
2002 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002003 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002004 var obj = api.Configuration.fromJson(
2005 json as core.Map<core.String, core.dynamic>);
2006 checkConfiguration(obj as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002007
2008 var path = (req.url).path;
2009 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002010 core.int index;
2011 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002012 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002013 path.substring(pathOffset, pathOffset + 1),
2014 unittest.equals("/"),
2015 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002016 pathOffset += 1;
2017 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002018 path.substring(pathOffset, pathOffset + 3),
2019 unittest.equals("v1/"),
2020 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002021 pathOffset += 3;
2022 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2023
2024 var query = (req.url).query;
2025 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002026 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002027 void addQueryParam(core.String n, core.String v) =>
2028 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002029
Kevin Moore6d21e902021-01-15 06:41:08 -08002030 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002031 for (var part in query.split('&')) {
2032 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002033 addQueryParam(
2034 core.Uri.decodeQueryComponent(keyValue[0]),
2035 core.Uri.decodeQueryComponent(keyValue[1]),
2036 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002037 }
2038 }
Kevin Moore58e22332021-02-25 10:11:41 -08002039 unittest.expect(
2040 queryMap["fields"]!.first,
2041 unittest.equals(arg_$fields),
2042 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002043
2044 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002045 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002046 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002047 var resp = convert.json.encode(buildConfiguration());
Kevin Moore6d21e902021-01-15 06:41:08 -08002048 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002049 }), true);
2050 res
2051 .create(arg_request, arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002052 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002053 checkConfiguration(response as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002054 })));
2055 });
2056
Kevin Moored0251702021-01-15 06:41:08 -08002057 unittest.test('method--delete', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002058 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002059 var res =
2060 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Kevin Moored0251702021-01-15 06:41:08 -08002061 var arg_name = 'foo';
2062 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002063 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2064 var path = (req.url).path;
2065 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002066 core.int index;
2067 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002068 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002069 path.substring(pathOffset, pathOffset + 1),
2070 unittest.equals("/"),
2071 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002072 pathOffset += 1;
2073 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002074 path.substring(pathOffset, pathOffset + 3),
2075 unittest.equals("v1/"),
2076 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002077 pathOffset += 3;
2078 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2079
2080 var query = (req.url).query;
2081 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002082 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002083 void addQueryParam(core.String n, core.String v) =>
2084 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002085
Kevin Moore6d21e902021-01-15 06:41:08 -08002086 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002087 for (var part in query.split('&')) {
2088 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002089 addQueryParam(
2090 core.Uri.decodeQueryComponent(keyValue[0]),
2091 core.Uri.decodeQueryComponent(keyValue[1]),
2092 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002093 }
2094 }
Kevin Moore58e22332021-02-25 10:11:41 -08002095 unittest.expect(
2096 queryMap["fields"]!.first,
2097 unittest.equals(arg_$fields),
2098 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002099
2100 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002101 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002102 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002103 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002104 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002105 }), true);
2106 res
2107 .delete(arg_name, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002108 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002109 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002110 })));
2111 });
2112
Kevin Moored0251702021-01-15 06:41:08 -08002113 unittest.test('method--get', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002114 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002115 var res =
2116 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Kevin Moored0251702021-01-15 06:41:08 -08002117 var arg_name = 'foo';
2118 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002119 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2120 var path = (req.url).path;
2121 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002122 core.int index;
2123 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002124 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002125 path.substring(pathOffset, pathOffset + 1),
2126 unittest.equals("/"),
2127 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002128 pathOffset += 1;
2129 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002130 path.substring(pathOffset, pathOffset + 3),
2131 unittest.equals("v1/"),
2132 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002133 pathOffset += 3;
2134 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2135
2136 var query = (req.url).query;
2137 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002138 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002139 void addQueryParam(core.String n, core.String v) =>
2140 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002141
Kevin Moore6d21e902021-01-15 06:41:08 -08002142 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002143 for (var part in query.split('&')) {
2144 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002145 addQueryParam(
2146 core.Uri.decodeQueryComponent(keyValue[0]),
2147 core.Uri.decodeQueryComponent(keyValue[1]),
2148 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002149 }
2150 }
Kevin Moore58e22332021-02-25 10:11:41 -08002151 unittest.expect(
2152 queryMap["fields"]!.first,
2153 unittest.equals(arg_$fields),
2154 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002155
2156 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002157 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002158 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002159 var resp = convert.json.encode(buildConfiguration());
Kevin Moore6d21e902021-01-15 06:41:08 -08002160 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002161 }), true);
2162 res
2163 .get(arg_name, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002164 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002165 checkConfiguration(response as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002166 })));
2167 });
2168
Kevin Moored0251702021-01-15 06:41:08 -08002169 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002170 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002171 var res =
2172 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Kevin Moored0251702021-01-15 06:41:08 -08002173 var arg_parent = 'foo';
2174 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002175 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2176 var path = (req.url).path;
2177 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002178 core.int index;
2179 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002180 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002181 path.substring(pathOffset, pathOffset + 1),
2182 unittest.equals("/"),
2183 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002184 pathOffset += 1;
2185 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002186 path.substring(pathOffset, pathOffset + 3),
2187 unittest.equals("v1/"),
2188 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002189 pathOffset += 3;
2190 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2191
2192 var query = (req.url).query;
2193 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002194 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002195 void addQueryParam(core.String n, core.String v) =>
2196 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002197
Kevin Moore6d21e902021-01-15 06:41:08 -08002198 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002199 for (var part in query.split('&')) {
2200 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002201 addQueryParam(
2202 core.Uri.decodeQueryComponent(keyValue[0]),
2203 core.Uri.decodeQueryComponent(keyValue[1]),
2204 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002205 }
2206 }
Kevin Moore58e22332021-02-25 10:11:41 -08002207 unittest.expect(
2208 queryMap["fields"]!.first,
2209 unittest.equals(arg_$fields),
2210 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002211
2212 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002213 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002214 };
2215 var resp =
Jakob Andersen52715df2018-05-01 13:58:48 +02002216 convert.json.encode(buildCustomerListConfigurationsResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002217 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002218 }), true);
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002219 res
2220 .list(arg_parent, $fields: arg_$fields)
2221 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002222 checkCustomerListConfigurationsResponse(
2223 response as api.CustomerListConfigurationsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002224 })));
2225 });
2226
Kevin Moored0251702021-01-15 06:41:08 -08002227 unittest.test('method--patch', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002228 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002229 var res =
2230 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002231 var arg_request = buildConfiguration();
Kevin Moored0251702021-01-15 06:41:08 -08002232 var arg_name = 'foo';
2233 var arg_updateMask = 'foo';
2234 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002235 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002236 var obj = api.Configuration.fromJson(
2237 json as core.Map<core.String, core.dynamic>);
2238 checkConfiguration(obj as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002239
2240 var path = (req.url).path;
2241 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002242 core.int index;
2243 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002244 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002245 path.substring(pathOffset, pathOffset + 1),
2246 unittest.equals("/"),
2247 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002248 pathOffset += 1;
2249 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002250 path.substring(pathOffset, pathOffset + 3),
2251 unittest.equals("v1/"),
2252 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002253 pathOffset += 3;
2254 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2255
2256 var query = (req.url).query;
2257 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002258 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002259 void addQueryParam(core.String n, core.String v) =>
2260 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002261
Kevin Moore6d21e902021-01-15 06:41:08 -08002262 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002263 for (var part in query.split('&')) {
2264 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002265 addQueryParam(
2266 core.Uri.decodeQueryComponent(keyValue[0]),
2267 core.Uri.decodeQueryComponent(keyValue[1]),
2268 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002269 }
2270 }
2271 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002272 queryMap["updateMask"]!.first,
2273 unittest.equals(arg_updateMask),
2274 );
2275 unittest.expect(
2276 queryMap["fields"]!.first,
2277 unittest.equals(arg_$fields),
2278 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002279
2280 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002281 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002282 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002283 var resp = convert.json.encode(buildConfiguration());
Kevin Moore6d21e902021-01-15 06:41:08 -08002284 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002285 }), true);
2286 res
2287 .patch(arg_request, arg_name,
2288 updateMask: arg_updateMask, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002289 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002290 checkConfiguration(response as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002291 })));
2292 });
2293 });
2294
Kevin Moore88512712021-01-28 14:43:28 -08002295 unittest.group('resource-CustomersDevicesResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002296 unittest.test('method--applyConfiguration', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002297 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002298 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002299 var arg_request = buildCustomerApplyConfigurationRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002300 var arg_parent = 'foo';
2301 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002302 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002303 var obj = api.CustomerApplyConfigurationRequest.fromJson(
2304 json as core.Map<core.String, core.dynamic>);
2305 checkCustomerApplyConfigurationRequest(
2306 obj as api.CustomerApplyConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002307
2308 var path = (req.url).path;
2309 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002310 core.int index;
2311 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002312 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002313 path.substring(pathOffset, pathOffset + 1),
2314 unittest.equals("/"),
2315 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002316 pathOffset += 1;
2317 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002318 path.substring(pathOffset, pathOffset + 3),
2319 unittest.equals("v1/"),
2320 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002321 pathOffset += 3;
2322 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2323
2324 var query = (req.url).query;
2325 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002326 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002327 void addQueryParam(core.String n, core.String v) =>
2328 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002329
Kevin Moore6d21e902021-01-15 06:41:08 -08002330 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002331 for (var part in query.split('&')) {
2332 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002333 addQueryParam(
2334 core.Uri.decodeQueryComponent(keyValue[0]),
2335 core.Uri.decodeQueryComponent(keyValue[1]),
2336 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002337 }
2338 }
Kevin Moore58e22332021-02-25 10:11:41 -08002339 unittest.expect(
2340 queryMap["fields"]!.first,
2341 unittest.equals(arg_$fields),
2342 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002343
2344 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002345 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002346 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002347 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002348 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002349 }), true);
2350 res
2351 .applyConfiguration(arg_request, arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002352 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002353 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002354 })));
2355 });
2356
Kevin Moored0251702021-01-15 06:41:08 -08002357 unittest.test('method--get', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002358 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002359 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Kevin Moored0251702021-01-15 06:41:08 -08002360 var arg_name = 'foo';
2361 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002362 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2363 var path = (req.url).path;
2364 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002365 core.int index;
2366 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002367 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002368 path.substring(pathOffset, pathOffset + 1),
2369 unittest.equals("/"),
2370 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002371 pathOffset += 1;
2372 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002373 path.substring(pathOffset, pathOffset + 3),
2374 unittest.equals("v1/"),
2375 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002376 pathOffset += 3;
2377 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2378
2379 var query = (req.url).query;
2380 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002381 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002382 void addQueryParam(core.String n, core.String v) =>
2383 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002384
Kevin Moore6d21e902021-01-15 06:41:08 -08002385 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002386 for (var part in query.split('&')) {
2387 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002388 addQueryParam(
2389 core.Uri.decodeQueryComponent(keyValue[0]),
2390 core.Uri.decodeQueryComponent(keyValue[1]),
2391 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002392 }
2393 }
Kevin Moore58e22332021-02-25 10:11:41 -08002394 unittest.expect(
2395 queryMap["fields"]!.first,
2396 unittest.equals(arg_$fields),
2397 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002398
2399 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002400 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002401 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002402 var resp = convert.json.encode(buildDevice());
Kevin Moore6d21e902021-01-15 06:41:08 -08002403 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002404 }), true);
2405 res
2406 .get(arg_name, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002407 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002408 checkDevice(response as api.Device);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002409 })));
2410 });
2411
Kevin Moored0251702021-01-15 06:41:08 -08002412 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002413 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002414 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Kevin Moored0251702021-01-15 06:41:08 -08002415 var arg_parent = 'foo';
Kevin Moored0251702021-01-15 06:41:08 -08002416 var arg_pageSize = 'foo';
Kevin Moore8810e8b2021-01-19 13:22:15 -08002417 var arg_pageToken = 'foo';
Kevin Moored0251702021-01-15 06:41:08 -08002418 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002419 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2420 var path = (req.url).path;
2421 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002422 core.int index;
2423 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002424 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002425 path.substring(pathOffset, pathOffset + 1),
2426 unittest.equals("/"),
2427 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002428 pathOffset += 1;
2429 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002430 path.substring(pathOffset, pathOffset + 3),
2431 unittest.equals("v1/"),
2432 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002433 pathOffset += 3;
2434 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2435
2436 var query = (req.url).query;
2437 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002438 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002439 void addQueryParam(core.String n, core.String v) =>
2440 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002441
Kevin Moore6d21e902021-01-15 06:41:08 -08002442 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002443 for (var part in query.split('&')) {
2444 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002445 addQueryParam(
2446 core.Uri.decodeQueryComponent(keyValue[0]),
2447 core.Uri.decodeQueryComponent(keyValue[1]),
2448 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002449 }
2450 }
2451 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002452 queryMap["pageSize"]!.first,
2453 unittest.equals(arg_pageSize),
2454 );
Kevin Moore8810e8b2021-01-19 13:22:15 -08002455 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002456 queryMap["pageToken"]!.first,
2457 unittest.equals(arg_pageToken),
2458 );
2459 unittest.expect(
2460 queryMap["fields"]!.first,
2461 unittest.equals(arg_$fields),
2462 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002463
2464 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002465 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002466 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002467 var resp = convert.json.encode(buildCustomerListDevicesResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002468 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002469 }), true);
2470 res
2471 .list(arg_parent,
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02002472 pageSize: arg_pageSize,
Kevin Moore8810e8b2021-01-19 13:22:15 -08002473 pageToken: arg_pageToken,
Martin Kustermannf9109a82018-01-08 15:24:20 +01002474 $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002475 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002476 checkCustomerListDevicesResponse(
2477 response as api.CustomerListDevicesResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002478 })));
2479 });
2480
Kevin Moored0251702021-01-15 06:41:08 -08002481 unittest.test('method--removeConfiguration', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002482 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002483 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002484 var arg_request = buildCustomerRemoveConfigurationRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002485 var arg_parent = 'foo';
2486 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002487 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002488 var obj = api.CustomerRemoveConfigurationRequest.fromJson(
2489 json as core.Map<core.String, core.dynamic>);
2490 checkCustomerRemoveConfigurationRequest(
2491 obj as api.CustomerRemoveConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002492
2493 var path = (req.url).path;
2494 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002495 core.int index;
2496 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002497 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002498 path.substring(pathOffset, pathOffset + 1),
2499 unittest.equals("/"),
2500 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002501 pathOffset += 1;
2502 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002503 path.substring(pathOffset, pathOffset + 3),
2504 unittest.equals("v1/"),
2505 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002506 pathOffset += 3;
2507 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2508
2509 var query = (req.url).query;
2510 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002511 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002512 void addQueryParam(core.String n, core.String v) =>
2513 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002514
Kevin Moore6d21e902021-01-15 06:41:08 -08002515 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002516 for (var part in query.split('&')) {
2517 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002518 addQueryParam(
2519 core.Uri.decodeQueryComponent(keyValue[0]),
2520 core.Uri.decodeQueryComponent(keyValue[1]),
2521 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002522 }
2523 }
Kevin Moore58e22332021-02-25 10:11:41 -08002524 unittest.expect(
2525 queryMap["fields"]!.first,
2526 unittest.equals(arg_$fields),
2527 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002528
2529 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002530 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002531 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002532 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002533 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002534 }), true);
2535 res
2536 .removeConfiguration(arg_request, arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002537 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002538 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002539 })));
2540 });
2541
Kevin Moored0251702021-01-15 06:41:08 -08002542 unittest.test('method--unclaim', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002543 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002544 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002545 var arg_request = buildCustomerUnclaimDeviceRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002546 var arg_parent = 'foo';
2547 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002548 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002549 var obj = api.CustomerUnclaimDeviceRequest.fromJson(
2550 json as core.Map<core.String, core.dynamic>);
2551 checkCustomerUnclaimDeviceRequest(
2552 obj as api.CustomerUnclaimDeviceRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002553
2554 var path = (req.url).path;
2555 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002556 core.int index;
2557 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002558 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002559 path.substring(pathOffset, pathOffset + 1),
2560 unittest.equals("/"),
2561 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002562 pathOffset += 1;
2563 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002564 path.substring(pathOffset, pathOffset + 3),
2565 unittest.equals("v1/"),
2566 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002567 pathOffset += 3;
2568 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2569
2570 var query = (req.url).query;
2571 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002572 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002573 void addQueryParam(core.String n, core.String v) =>
2574 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002575
Kevin Moore6d21e902021-01-15 06:41:08 -08002576 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002577 for (var part in query.split('&')) {
2578 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002579 addQueryParam(
2580 core.Uri.decodeQueryComponent(keyValue[0]),
2581 core.Uri.decodeQueryComponent(keyValue[1]),
2582 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002583 }
2584 }
Kevin Moore58e22332021-02-25 10:11:41 -08002585 unittest.expect(
2586 queryMap["fields"]!.first,
2587 unittest.equals(arg_$fields),
2588 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002589
2590 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002591 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002592 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002593 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002594 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002595 }), true);
2596 res
2597 .unclaim(arg_request, arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002598 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002599 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002600 })));
2601 });
2602 });
2603
Kevin Moore88512712021-01-28 14:43:28 -08002604 unittest.group('resource-CustomersDpcsResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002605 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002606 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002607 var res = api.AndroidProvisioningPartnerApi(mock).customers.dpcs;
Kevin Moored0251702021-01-15 06:41:08 -08002608 var arg_parent = 'foo';
2609 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002610 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2611 var path = (req.url).path;
2612 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002613 core.int index;
2614 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002615 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002616 path.substring(pathOffset, pathOffset + 1),
2617 unittest.equals("/"),
2618 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002619 pathOffset += 1;
2620 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002621 path.substring(pathOffset, pathOffset + 3),
2622 unittest.equals("v1/"),
2623 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002624 pathOffset += 3;
2625 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2626
2627 var query = (req.url).query;
2628 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002629 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002630 void addQueryParam(core.String n, core.String v) =>
2631 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002632
Kevin Moore6d21e902021-01-15 06:41:08 -08002633 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002634 for (var part in query.split('&')) {
2635 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002636 addQueryParam(
2637 core.Uri.decodeQueryComponent(keyValue[0]),
2638 core.Uri.decodeQueryComponent(keyValue[1]),
2639 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002640 }
2641 }
Kevin Moore58e22332021-02-25 10:11:41 -08002642 unittest.expect(
2643 queryMap["fields"]!.first,
2644 unittest.equals(arg_$fields),
2645 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002646
2647 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002648 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002649 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002650 var resp = convert.json.encode(buildCustomerListDpcsResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002651 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002652 }), true);
2653 res
2654 .list(arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002655 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002656 checkCustomerListDpcsResponse(response as api.CustomerListDpcsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002657 })));
2658 });
2659 });
2660
Kevin Moore88512712021-01-28 14:43:28 -08002661 unittest.group('resource-OperationsResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002662 unittest.test('method--get', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002663 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002664 var res = api.AndroidProvisioningPartnerApi(mock).operations;
Kevin Moored0251702021-01-15 06:41:08 -08002665 var arg_name = 'foo';
2666 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002667 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2668 var path = (req.url).path;
2669 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002670 core.int index;
2671 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002672 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002673 path.substring(pathOffset, pathOffset + 1),
2674 unittest.equals("/"),
2675 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002676 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002677 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002678 path.substring(pathOffset, pathOffset + 3),
2679 unittest.equals("v1/"),
2680 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002681 pathOffset += 3;
2682 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2683
2684 var query = (req.url).query;
2685 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002686 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002687 void addQueryParam(core.String n, core.String v) =>
2688 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002689
Kevin Moore6d21e902021-01-15 06:41:08 -08002690 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002691 for (var part in query.split('&')) {
2692 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002693 addQueryParam(
2694 core.Uri.decodeQueryComponent(keyValue[0]),
2695 core.Uri.decodeQueryComponent(keyValue[1]),
2696 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002697 }
2698 }
Kevin Moore58e22332021-02-25 10:11:41 -08002699 unittest.expect(
2700 queryMap["fields"]!.first,
2701 unittest.equals(arg_$fields),
2702 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002703
Martin Kustermannfa83e312017-07-31 12:48:45 +02002704 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002705 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002706 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002707 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08002708 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002709 }), true);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002710 res
2711 .get(arg_name, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002712 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002713 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002714 })));
2715 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02002716 });
2717
Kevin Moore88512712021-01-28 14:43:28 -08002718 unittest.group('resource-PartnersCustomersResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002719 unittest.test('method--create', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002720 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002721 var res = api.AndroidProvisioningPartnerApi(mock).partners.customers;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002722 var arg_request = buildCreateCustomerRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002723 var arg_parent = 'foo';
2724 var arg_$fields = 'foo';
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002725 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002726 var obj = api.CreateCustomerRequest.fromJson(
2727 json as core.Map<core.String, core.dynamic>);
2728 checkCreateCustomerRequest(obj as api.CreateCustomerRequest);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002729
2730 var path = (req.url).path;
2731 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002732 core.int index;
2733 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002734 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002735 path.substring(pathOffset, pathOffset + 1),
2736 unittest.equals("/"),
2737 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002738 pathOffset += 1;
2739 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002740 path.substring(pathOffset, pathOffset + 3),
2741 unittest.equals("v1/"),
2742 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002743 pathOffset += 3;
2744 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2745
2746 var query = (req.url).query;
2747 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002748 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002749 void addQueryParam(core.String n, core.String v) =>
2750 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002751
Kevin Moore6d21e902021-01-15 06:41:08 -08002752 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002753 for (var part in query.split('&')) {
2754 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002755 addQueryParam(
2756 core.Uri.decodeQueryComponent(keyValue[0]),
2757 core.Uri.decodeQueryComponent(keyValue[1]),
2758 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002759 }
2760 }
Kevin Moore58e22332021-02-25 10:11:41 -08002761 unittest.expect(
2762 queryMap["fields"]!.first,
2763 unittest.equals(arg_$fields),
2764 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002765
2766 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002767 'content-type': 'application/json; charset=utf-8',
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002768 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002769 var resp = convert.json.encode(buildCompany());
Kevin Moore6d21e902021-01-15 06:41:08 -08002770 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002771 }), true);
2772 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002773 .create(arg_request, arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002774 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002775 checkCompany(response as api.Company);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002776 })));
2777 });
2778
Kevin Moored0251702021-01-15 06:41:08 -08002779 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002780 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002781 var res = api.AndroidProvisioningPartnerApi(mock).partners.customers;
Kevin Moored0251702021-01-15 06:41:08 -08002782 var arg_partnerId = 'foo';
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02002783 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08002784 var arg_pageToken = 'foo';
2785 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002786 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2787 var path = (req.url).path;
2788 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002789 core.int index;
2790 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002791 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002792 path.substring(pathOffset, pathOffset + 1),
2793 unittest.equals("/"),
2794 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002795 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08002796 unittest.expect(
2797 path.substring(pathOffset, pathOffset + 12),
2798 unittest.equals("v1/partners/"),
2799 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002800 pathOffset += 12;
2801 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2802
2803 var query = (req.url).query;
2804 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002805 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002806 void addQueryParam(core.String n, core.String v) =>
2807 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002808
Kevin Moore6d21e902021-01-15 06:41:08 -08002809 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002810 for (var part in query.split('&')) {
2811 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002812 addQueryParam(
2813 core.Uri.decodeQueryComponent(keyValue[0]),
2814 core.Uri.decodeQueryComponent(keyValue[1]),
2815 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002816 }
2817 }
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +02002818 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002819 core.int.parse(queryMap["pageSize"]!.first),
2820 unittest.equals(arg_pageSize),
2821 );
2822 unittest.expect(
2823 queryMap["pageToken"]!.first,
2824 unittest.equals(arg_pageToken),
2825 );
2826 unittest.expect(
2827 queryMap["fields"]!.first,
2828 unittest.equals(arg_$fields),
2829 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002830
Martin Kustermannfa83e312017-07-31 12:48:45 +02002831 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002832 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002833 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002834 var resp = convert.json.encode(buildListCustomersResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002835 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002836 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002837 res
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +01002838 .list(arg_partnerId,
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02002839 pageSize: arg_pageSize,
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +02002840 pageToken: arg_pageToken,
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +01002841 $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002842 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002843 checkListCustomersResponse(response as api.ListCustomersResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002844 })));
2845 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02002846 });
2847
Kevin Moore88512712021-01-28 14:43:28 -08002848 unittest.group('resource-PartnersDevicesResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002849 unittest.test('method--claim', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002850 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002851 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002852 var arg_request = buildClaimDeviceRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002853 var arg_partnerId = 'foo';
2854 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002855 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002856 var obj = api.ClaimDeviceRequest.fromJson(
2857 json as core.Map<core.String, core.dynamic>);
2858 checkClaimDeviceRequest(obj as api.ClaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002859
2860 var path = (req.url).path;
2861 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002862 core.int index;
2863 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002864 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002865 path.substring(pathOffset, pathOffset + 1),
2866 unittest.equals("/"),
2867 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002868 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08002869 unittest.expect(
2870 path.substring(pathOffset, pathOffset + 12),
2871 unittest.equals("v1/partners/"),
2872 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002873 pathOffset += 12;
2874 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2875
2876 var query = (req.url).query;
2877 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002878 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002879 void addQueryParam(core.String n, core.String v) =>
2880 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002881
Kevin Moore6d21e902021-01-15 06:41:08 -08002882 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002883 for (var part in query.split('&')) {
2884 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002885 addQueryParam(
2886 core.Uri.decodeQueryComponent(keyValue[0]),
2887 core.Uri.decodeQueryComponent(keyValue[1]),
2888 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002889 }
2890 }
Kevin Moore58e22332021-02-25 10:11:41 -08002891 unittest.expect(
2892 queryMap["fields"]!.first,
2893 unittest.equals(arg_$fields),
2894 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002895
Martin Kustermannfa83e312017-07-31 12:48:45 +02002896 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002897 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002898 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002899 var resp = convert.json.encode(buildClaimDeviceResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002900 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002901 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002902 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002903 .claim(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002904 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002905 checkClaimDeviceResponse(response as api.ClaimDeviceResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002906 })));
2907 });
2908
Kevin Moored0251702021-01-15 06:41:08 -08002909 unittest.test('method--claimAsync', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002910 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002911 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002912 var arg_request = buildClaimDevicesRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002913 var arg_partnerId = 'foo';
2914 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002915 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002916 var obj = api.ClaimDevicesRequest.fromJson(
2917 json as core.Map<core.String, core.dynamic>);
2918 checkClaimDevicesRequest(obj as api.ClaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002919
2920 var path = (req.url).path;
2921 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002922 core.int index;
2923 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002924 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002925 path.substring(pathOffset, pathOffset + 1),
2926 unittest.equals("/"),
2927 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002928 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08002929 unittest.expect(
2930 path.substring(pathOffset, pathOffset + 12),
2931 unittest.equals("v1/partners/"),
2932 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002933 pathOffset += 12;
2934 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2935
2936 var query = (req.url).query;
2937 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002938 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002939 void addQueryParam(core.String n, core.String v) =>
2940 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002941
Kevin Moore6d21e902021-01-15 06:41:08 -08002942 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002943 for (var part in query.split('&')) {
2944 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002945 addQueryParam(
2946 core.Uri.decodeQueryComponent(keyValue[0]),
2947 core.Uri.decodeQueryComponent(keyValue[1]),
2948 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002949 }
2950 }
Kevin Moore58e22332021-02-25 10:11:41 -08002951 unittest.expect(
2952 queryMap["fields"]!.first,
2953 unittest.equals(arg_$fields),
2954 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002955
Martin Kustermannfa83e312017-07-31 12:48:45 +02002956 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002957 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002958 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002959 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08002960 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002961 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002962 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002963 .claimAsync(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002964 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002965 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002966 })));
2967 });
2968
Kevin Moored0251702021-01-15 06:41:08 -08002969 unittest.test('method--findByIdentifier', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002970 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002971 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002972 var arg_request = buildFindDevicesByDeviceIdentifierRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002973 var arg_partnerId = 'foo';
2974 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002975 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002976 var obj = api.FindDevicesByDeviceIdentifierRequest.fromJson(
2977 json as core.Map<core.String, core.dynamic>);
2978 checkFindDevicesByDeviceIdentifierRequest(
2979 obj as api.FindDevicesByDeviceIdentifierRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002980
2981 var path = (req.url).path;
2982 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002983 core.int index;
2984 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002985 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002986 path.substring(pathOffset, pathOffset + 1),
2987 unittest.equals("/"),
2988 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002989 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08002990 unittest.expect(
2991 path.substring(pathOffset, pathOffset + 12),
2992 unittest.equals("v1/partners/"),
2993 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002994 pathOffset += 12;
2995 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2996
2997 var query = (req.url).query;
2998 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002999 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003000 void addQueryParam(core.String n, core.String v) =>
3001 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003002
Kevin Moore6d21e902021-01-15 06:41:08 -08003003 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003004 for (var part in query.split('&')) {
3005 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003006 addQueryParam(
3007 core.Uri.decodeQueryComponent(keyValue[0]),
3008 core.Uri.decodeQueryComponent(keyValue[1]),
3009 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003010 }
3011 }
Kevin Moore58e22332021-02-25 10:11:41 -08003012 unittest.expect(
3013 queryMap["fields"]!.first,
3014 unittest.equals(arg_$fields),
3015 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003016
Martin Kustermannfa83e312017-07-31 12:48:45 +02003017 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003018 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003019 };
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003020 var resp =
Jakob Andersen52715df2018-05-01 13:58:48 +02003021 convert.json.encode(buildFindDevicesByDeviceIdentifierResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08003022 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003023 }), true);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02003024 res
3025 .findByIdentifier(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02003026 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003027 checkFindDevicesByDeviceIdentifierResponse(
3028 response as api.FindDevicesByDeviceIdentifierResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003029 })));
3030 });
3031
Kevin Moored0251702021-01-15 06:41:08 -08003032 unittest.test('method--findByOwner', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08003033 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003034 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003035 var arg_request = buildFindDevicesByOwnerRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003036 var arg_partnerId = 'foo';
3037 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003038 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003039 var obj = api.FindDevicesByOwnerRequest.fromJson(
3040 json as core.Map<core.String, core.dynamic>);
3041 checkFindDevicesByOwnerRequest(obj as api.FindDevicesByOwnerRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003042
3043 var path = (req.url).path;
3044 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003045 core.int index;
3046 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003047 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003048 path.substring(pathOffset, pathOffset + 1),
3049 unittest.equals("/"),
3050 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003051 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003052 unittest.expect(
3053 path.substring(pathOffset, pathOffset + 12),
3054 unittest.equals("v1/partners/"),
3055 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003056 pathOffset += 12;
3057 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3058
3059 var query = (req.url).query;
3060 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003061 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003062 void addQueryParam(core.String n, core.String v) =>
3063 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003064
Kevin Moore6d21e902021-01-15 06:41:08 -08003065 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003066 for (var part in query.split('&')) {
3067 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003068 addQueryParam(
3069 core.Uri.decodeQueryComponent(keyValue[0]),
3070 core.Uri.decodeQueryComponent(keyValue[1]),
3071 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003072 }
3073 }
Kevin Moore58e22332021-02-25 10:11:41 -08003074 unittest.expect(
3075 queryMap["fields"]!.first,
3076 unittest.equals(arg_$fields),
3077 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003078
Martin Kustermannfa83e312017-07-31 12:48:45 +02003079 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003080 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003081 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003082 var resp = convert.json.encode(buildFindDevicesByOwnerResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08003083 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003084 }), true);
Jakob Andersen4ce761d2018-04-19 11:19:11 +02003085 res
3086 .findByOwner(arg_request, arg_partnerId, $fields: arg_$fields)
3087 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003088 checkFindDevicesByOwnerResponse(
3089 response as api.FindDevicesByOwnerResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003090 })));
3091 });
3092
Kevin Moored0251702021-01-15 06:41:08 -08003093 unittest.test('method--get', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08003094 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003095 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Kevin Moored0251702021-01-15 06:41:08 -08003096 var arg_name = 'foo';
3097 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003098 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3099 var path = (req.url).path;
3100 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003101 core.int index;
3102 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003103 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003104 path.substring(pathOffset, pathOffset + 1),
3105 unittest.equals("/"),
3106 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003107 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003108 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003109 path.substring(pathOffset, pathOffset + 3),
3110 unittest.equals("v1/"),
3111 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003112 pathOffset += 3;
3113 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3114
3115 var query = (req.url).query;
3116 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003117 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003118 void addQueryParam(core.String n, core.String v) =>
3119 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003120
Kevin Moore6d21e902021-01-15 06:41:08 -08003121 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003122 for (var part in query.split('&')) {
3123 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003124 addQueryParam(
3125 core.Uri.decodeQueryComponent(keyValue[0]),
3126 core.Uri.decodeQueryComponent(keyValue[1]),
3127 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003128 }
3129 }
Kevin Moore58e22332021-02-25 10:11:41 -08003130 unittest.expect(
3131 queryMap["fields"]!.first,
3132 unittest.equals(arg_$fields),
3133 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003134
Martin Kustermannfa83e312017-07-31 12:48:45 +02003135 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003136 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003137 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003138 var resp = convert.json.encode(buildDevice());
Kevin Moore6d21e902021-01-15 06:41:08 -08003139 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003140 }), true);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02003141 res
3142 .get(arg_name, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02003143 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003144 checkDevice(response as api.Device);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003145 })));
3146 });
3147
Kevin Moored0251702021-01-15 06:41:08 -08003148 unittest.test('method--metadata', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08003149 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003150 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003151 var arg_request = buildUpdateDeviceMetadataRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003152 var arg_metadataOwnerId = 'foo';
3153 var arg_deviceId = 'foo';
3154 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003155 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003156 var obj = api.UpdateDeviceMetadataRequest.fromJson(
3157 json as core.Map<core.String, core.dynamic>);
3158 checkUpdateDeviceMetadataRequest(
3159 obj as api.UpdateDeviceMetadataRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003160
3161 var path = (req.url).path;
3162 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003163 core.int index;
3164 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003165 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003166 path.substring(pathOffset, pathOffset + 1),
3167 unittest.equals("/"),
3168 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003169 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003170 unittest.expect(
3171 path.substring(pathOffset, pathOffset + 12),
3172 unittest.equals("v1/partners/"),
3173 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003174 pathOffset += 12;
3175 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3176
3177 var query = (req.url).query;
3178 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003179 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003180 void addQueryParam(core.String n, core.String v) =>
3181 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003182
Kevin Moore6d21e902021-01-15 06:41:08 -08003183 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003184 for (var part in query.split('&')) {
3185 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003186 addQueryParam(
3187 core.Uri.decodeQueryComponent(keyValue[0]),
3188 core.Uri.decodeQueryComponent(keyValue[1]),
3189 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003190 }
3191 }
Kevin Moore58e22332021-02-25 10:11:41 -08003192 unittest.expect(
3193 queryMap["fields"]!.first,
3194 unittest.equals(arg_$fields),
3195 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003196
Martin Kustermannfa83e312017-07-31 12:48:45 +02003197 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003198 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003199 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003200 var resp = convert.json.encode(buildDeviceMetadata());
Kevin Moore6d21e902021-01-15 06:41:08 -08003201 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003202 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003203 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02003204 .metadata(arg_request, arg_metadataOwnerId, arg_deviceId,
3205 $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02003206 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003207 checkDeviceMetadata(response as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003208 })));
3209 });
3210
Kevin Moored0251702021-01-15 06:41:08 -08003211 unittest.test('method--unclaim', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08003212 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003213 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003214 var arg_request = buildUnclaimDeviceRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003215 var arg_partnerId = 'foo';
3216 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003217 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003218 var obj = api.UnclaimDeviceRequest.fromJson(
3219 json as core.Map<core.String, core.dynamic>);
3220 checkUnclaimDeviceRequest(obj as api.UnclaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003221
3222 var path = (req.url).path;
3223 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003224 core.int index;
3225 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003226 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003227 path.substring(pathOffset, pathOffset + 1),
3228 unittest.equals("/"),
3229 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003230 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003231 unittest.expect(
3232 path.substring(pathOffset, pathOffset + 12),
3233 unittest.equals("v1/partners/"),
3234 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003235 pathOffset += 12;
3236 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3237
3238 var query = (req.url).query;
3239 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003240 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003241 void addQueryParam(core.String n, core.String v) =>
3242 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003243
Kevin Moore6d21e902021-01-15 06:41:08 -08003244 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003245 for (var part in query.split('&')) {
3246 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003247 addQueryParam(
3248 core.Uri.decodeQueryComponent(keyValue[0]),
3249 core.Uri.decodeQueryComponent(keyValue[1]),
3250 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003251 }
3252 }
Kevin Moore58e22332021-02-25 10:11:41 -08003253 unittest.expect(
3254 queryMap["fields"]!.first,
3255 unittest.equals(arg_$fields),
3256 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003257
Martin Kustermannfa83e312017-07-31 12:48:45 +02003258 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003259 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003260 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003261 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08003262 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003263 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003264 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02003265 .unclaim(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02003266 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003267 checkEmpty(response as api.Empty);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003268 })));
3269 });
3270
Kevin Moored0251702021-01-15 06:41:08 -08003271 unittest.test('method--unclaimAsync', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08003272 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003273 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003274 var arg_request = buildUnclaimDevicesRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003275 var arg_partnerId = 'foo';
3276 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003277 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003278 var obj = api.UnclaimDevicesRequest.fromJson(
3279 json as core.Map<core.String, core.dynamic>);
3280 checkUnclaimDevicesRequest(obj as api.UnclaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003281
3282 var path = (req.url).path;
3283 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003284 core.int index;
3285 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003286 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003287 path.substring(pathOffset, pathOffset + 1),
3288 unittest.equals("/"),
3289 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003290 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003291 unittest.expect(
3292 path.substring(pathOffset, pathOffset + 12),
3293 unittest.equals("v1/partners/"),
3294 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003295 pathOffset += 12;
3296 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3297
3298 var query = (req.url).query;
3299 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003300 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003301 void addQueryParam(core.String n, core.String v) =>
3302 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003303
Kevin Moore6d21e902021-01-15 06:41:08 -08003304 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003305 for (var part in query.split('&')) {
3306 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003307 addQueryParam(
3308 core.Uri.decodeQueryComponent(keyValue[0]),
3309 core.Uri.decodeQueryComponent(keyValue[1]),
3310 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003311 }
3312 }
Kevin Moore58e22332021-02-25 10:11:41 -08003313 unittest.expect(
3314 queryMap["fields"]!.first,
3315 unittest.equals(arg_$fields),
3316 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003317
Martin Kustermannfa83e312017-07-31 12:48:45 +02003318 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003319 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003320 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003321 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08003322 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003323 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003324 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02003325 .unclaimAsync(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02003326 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003327 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003328 })));
3329 });
3330
Kevin Moored0251702021-01-15 06:41:08 -08003331 unittest.test('method--updateMetadataAsync', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08003332 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003333 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003334 var arg_request = buildUpdateDeviceMetadataInBatchRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003335 var arg_partnerId = 'foo';
3336 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003337 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003338 var obj = api.UpdateDeviceMetadataInBatchRequest.fromJson(
3339 json as core.Map<core.String, core.dynamic>);
3340 checkUpdateDeviceMetadataInBatchRequest(
3341 obj as api.UpdateDeviceMetadataInBatchRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003342
3343 var path = (req.url).path;
3344 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003345 core.int index;
3346 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003347 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003348 path.substring(pathOffset, pathOffset + 1),
3349 unittest.equals("/"),
3350 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003351 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003352 unittest.expect(
3353 path.substring(pathOffset, pathOffset + 12),
3354 unittest.equals("v1/partners/"),
3355 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003356 pathOffset += 12;
3357 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3358
3359 var query = (req.url).query;
3360 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003361 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003362 void addQueryParam(core.String n, core.String v) =>
3363 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003364
Kevin Moore6d21e902021-01-15 06:41:08 -08003365 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003366 for (var part in query.split('&')) {
3367 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003368 addQueryParam(
3369 core.Uri.decodeQueryComponent(keyValue[0]),
3370 core.Uri.decodeQueryComponent(keyValue[1]),
3371 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003372 }
3373 }
Kevin Moore58e22332021-02-25 10:11:41 -08003374 unittest.expect(
3375 queryMap["fields"]!.first,
3376 unittest.equals(arg_$fields),
3377 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003378
Martin Kustermannfa83e312017-07-31 12:48:45 +02003379 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003380 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003381 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003382 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08003383 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003384 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003385 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02003386 .updateMetadataAsync(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02003387 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003388 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003389 })));
3390 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02003391 });
Martin Kustermann12cdd522018-08-27 10:46:50 +02003392
Kevin Moore88512712021-01-28 14:43:28 -08003393 unittest.group('resource-PartnersVendorsResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08003394 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08003395 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003396 var res = api.AndroidProvisioningPartnerApi(mock).partners.vendors;
Kevin Moored0251702021-01-15 06:41:08 -08003397 var arg_parent = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02003398 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08003399 var arg_pageToken = 'foo';
3400 var arg_$fields = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02003401 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3402 var path = (req.url).path;
3403 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003404 core.int index;
3405 core.String subPart;
Martin Kustermann12cdd522018-08-27 10:46:50 +02003406 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003407 path.substring(pathOffset, pathOffset + 1),
3408 unittest.equals("/"),
3409 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003410 pathOffset += 1;
3411 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003412 path.substring(pathOffset, pathOffset + 3),
3413 unittest.equals("v1/"),
3414 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003415 pathOffset += 3;
3416 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3417
3418 var query = (req.url).query;
3419 var queryOffset = 0;
3420 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003421 void addQueryParam(core.String n, core.String v) =>
3422 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann12cdd522018-08-27 10:46:50 +02003423
Kevin Moore6d21e902021-01-15 06:41:08 -08003424 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003425 for (var part in query.split('&')) {
3426 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003427 addQueryParam(
3428 core.Uri.decodeQueryComponent(keyValue[0]),
3429 core.Uri.decodeQueryComponent(keyValue[1]),
3430 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003431 }
3432 }
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +02003433 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003434 core.int.parse(queryMap["pageSize"]!.first),
3435 unittest.equals(arg_pageSize),
3436 );
3437 unittest.expect(
3438 queryMap["pageToken"]!.first,
3439 unittest.equals(arg_pageToken),
3440 );
3441 unittest.expect(
3442 queryMap["fields"]!.first,
3443 unittest.equals(arg_$fields),
3444 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003445
3446 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003447 'content-type': 'application/json; charset=utf-8',
Martin Kustermann12cdd522018-08-27 10:46:50 +02003448 };
3449 var resp = convert.json.encode(buildListVendorsResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08003450 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermann12cdd522018-08-27 10:46:50 +02003451 }), true);
3452 res
3453 .list(arg_parent,
Martin Kustermann12cdd522018-08-27 10:46:50 +02003454 pageSize: arg_pageSize,
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +02003455 pageToken: arg_pageToken,
Martin Kustermann12cdd522018-08-27 10:46:50 +02003456 $fields: arg_$fields)
3457 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003458 checkListVendorsResponse(response as api.ListVendorsResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02003459 })));
3460 });
3461 });
3462
Kevin Moore88512712021-01-28 14:43:28 -08003463 unittest.group('resource-PartnersVendorsCustomersResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08003464 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08003465 var mock = HttpServerMock();
Kevin Mooref1c03382021-01-22 19:48:10 -08003466 var res =
Kevin Moore5889af72021-01-28 13:31:53 -08003467 api.AndroidProvisioningPartnerApi(mock).partners.vendors.customers;
Kevin Moored0251702021-01-15 06:41:08 -08003468 var arg_parent = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02003469 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08003470 var arg_pageToken = 'foo';
3471 var arg_$fields = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02003472 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3473 var path = (req.url).path;
3474 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003475 core.int index;
3476 core.String subPart;
Martin Kustermann12cdd522018-08-27 10:46:50 +02003477 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003478 path.substring(pathOffset, pathOffset + 1),
3479 unittest.equals("/"),
3480 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003481 pathOffset += 1;
3482 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003483 path.substring(pathOffset, pathOffset + 3),
3484 unittest.equals("v1/"),
3485 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003486 pathOffset += 3;
3487 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3488
3489 var query = (req.url).query;
3490 var queryOffset = 0;
3491 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003492 void addQueryParam(core.String n, core.String v) =>
3493 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann12cdd522018-08-27 10:46:50 +02003494
Kevin Moore6d21e902021-01-15 06:41:08 -08003495 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003496 for (var part in query.split('&')) {
3497 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003498 addQueryParam(
3499 core.Uri.decodeQueryComponent(keyValue[0]),
3500 core.Uri.decodeQueryComponent(keyValue[1]),
3501 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003502 }
3503 }
Jonas Finnemann Jensenb223bd52020-10-09 13:02:08 +02003504 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003505 core.int.parse(queryMap["pageSize"]!.first),
3506 unittest.equals(arg_pageSize),
3507 );
3508 unittest.expect(
3509 queryMap["pageToken"]!.first,
3510 unittest.equals(arg_pageToken),
3511 );
3512 unittest.expect(
3513 queryMap["fields"]!.first,
3514 unittest.equals(arg_$fields),
3515 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003516
3517 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003518 'content-type': 'application/json; charset=utf-8',
Martin Kustermann12cdd522018-08-27 10:46:50 +02003519 };
3520 var resp = convert.json.encode(buildListVendorCustomersResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08003521 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermann12cdd522018-08-27 10:46:50 +02003522 }), true);
3523 res
3524 .list(arg_parent,
Martin Kustermann12cdd522018-08-27 10:46:50 +02003525 pageSize: arg_pageSize,
Jonas Finnemann Jensenb223bd52020-10-09 13:02:08 +02003526 pageToken: arg_pageToken,
Martin Kustermann12cdd522018-08-27 10:46:50 +02003527 $fields: arg_$fields)
3528 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003529 checkListVendorCustomersResponse(
3530 response as api.ListVendorCustomersResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02003531 })));
3532 });
3533 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02003534}