blob: 31a355504df9cb6934b5c471706e55f8d32d71af [file] [log] [blame]
Kevin Mooreaf84e102021-02-25 10:29:32 -08001// ignore_for_file: avoid_returning_null
Kevin Moore6d21e902021-01-15 06:41:08 -08002// ignore_for_file: camel_case_types
Kevin Mooreaf84e102021-02-25 10:29:32 -08003// ignore_for_file: cascade_invocations
Kevin Moore6d21e902021-01-15 06:41:08 -08004// ignore_for_file: comment_references
Kevin Moore1ad61ef2021-01-22 17:52:58 -08005// ignore_for_file: file_names
Kevin Moore6d21e902021-01-15 06:41:08 -08006// ignore_for_file: library_names
7// ignore_for_file: lines_longer_than_80_chars
8// ignore_for_file: non_constant_identifier_names
Kevin Moore1ad61ef2021-01-22 17:52:58 -08009// ignore_for_file: prefer_expression_function_bodies
Kevin Mooreaf84e102021-02-25 10:29:32 -080010// ignore_for_file: prefer_final_locals
Kevin Moore6d21e902021-01-15 06:41:08 -080011// ignore_for_file: prefer_interpolation_to_compose_strings
Kevin Mooreaf84e102021-02-25 10:29:32 -080012// ignore_for_file: prefer_single_quotes
Kevin Moore6d21e902021-01-15 06:41:08 -080013// ignore_for_file: unnecessary_brace_in_string_interps
14// ignore_for_file: unnecessary_cast
Kevin Moore1ad61ef2021-01-22 17:52:58 -080015// ignore_for_file: unnecessary_lambdas
Kevin Moore6d21e902021-01-15 06:41:08 -080016// ignore_for_file: unnecessary_parenthesis
17// ignore_for_file: unnecessary_string_interpolations
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
Kevin Moore07f01b72021-04-25 17:33:47 -070024import 'package:googleapis/androiddeviceprovisioning/v1.dart' as api;
Martin Kustermannfa83e312017-07-31 12:48:45 +020025import 'package:http/http.dart' as http;
Martin Kustermannfa83e312017-07-31 12:48:45 +020026import 'package:test/test.dart' as unittest;
Martin Kustermannfa83e312017-07-31 12:48:45 +020027
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 Moorec4e4ec82021-06-18 19:03:35 -070088core.List<api.PartnerClaim> buildUnnamed4419() {
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 Moorec4e4ec82021-06-18 19:03:35 -070095void checkUnnamed4419(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 Moorec4e4ec82021-06-18 19:03:35 -0700106 o.claims = buildUnnamed4419();
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 Moorec4e4ec82021-06-18 19:03:35 -0700115 checkUnnamed4419(o.claims!);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200116 }
117 buildCounterClaimDevicesRequest--;
118}
119
Kevin Moorec4e4ec82021-06-18 19:03:35 -0700120core.List<core.String> buildUnnamed4420() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700127void checkUnnamed4420(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 Moorec4e4ec82021-06-18 19:03:35 -0700139core.List<core.String> buildUnnamed4421() {
Kevin Moore64f78622021-03-01 17:42:54 -0800140 var o = <core.String>[];
141 o.add('foo');
142 o.add('foo');
143 return o;
144}
145
Kevin Moorec4e4ec82021-06-18 19:03:35 -0700146void checkUnnamed4421(core.List<core.String> o) {
Kevin Moore64f78622021-03-01 17:42:54 -0800147 unittest.expect(o, unittest.hasLength(2));
148 unittest.expect(
149 o[0],
150 unittest.equals('foo'),
151 );
152 unittest.expect(
153 o[1],
154 unittest.equals('foo'),
155 );
156}
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 Moorec4e4ec82021-06-18 19:03:35 -0700163 o.adminEmails = buildUnnamed4420();
Kevin Moored0251702021-01-15 06:41:08 -0800164 o.companyId = 'foo';
165 o.companyName = 'foo';
166 o.name = 'foo';
Kevin Moorec4e4ec82021-06-18 19:03:35 -0700167 o.ownerEmails = buildUnnamed4421();
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 Moorec4e4ec82021-06-18 19:03:35 -0700177 checkUnnamed4420(o.adminEmails!);
Kevin Moore58e22332021-02-25 10:11:41 -0800178 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 );
Kevin Moorec4e4ec82021-06-18 19:03:35 -0700190 checkUnnamed4421(o.ownerEmails!);
Kevin Moore58e22332021-02-25 10:11:41 -0800191 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 Moorec4e4ec82021-06-18 19:03:35 -0700307core.List<api.Configuration> buildUnnamed4422() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700314void checkUnnamed4422(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 Moorec4e4ec82021-06-18 19:03:35 -0700326 o.configurations = buildUnnamed4422();
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 Moorec4e4ec82021-06-18 19:03:35 -0700336 checkUnnamed4422(o.configurations!);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100337 }
338 buildCounterCustomerListConfigurationsResponse--;
339}
340
Kevin Moorec4e4ec82021-06-18 19:03:35 -0700341core.List<api.Company> buildUnnamed4423() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700348void checkUnnamed4423(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 Moorec4e4ec82021-06-18 19:03:35 -0700359 o.customers = buildUnnamed4423();
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 Moorec4e4ec82021-06-18 19:03:35 -0700369 checkUnnamed4423(o.customers!);
Kevin Moore58e22332021-02-25 10:11:41 -0800370 unittest.expect(
371 o.nextPageToken!,
372 unittest.equals('foo'),
373 );
Martin Kustermannf9109a82018-01-08 15:24:20 +0100374 }
375 buildCounterCustomerListCustomersResponse--;
376}
377
Kevin Moorec4e4ec82021-06-18 19:03:35 -0700378core.List<api.Device> buildUnnamed4424() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700385void checkUnnamed4424(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 Moorec4e4ec82021-06-18 19:03:35 -0700396 o.devices = buildUnnamed4424();
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 Moorec4e4ec82021-06-18 19:03:35 -0700406 checkUnnamed4424(o.devices!);
Kevin Moore58e22332021-02-25 10:11:41 -0800407 unittest.expect(
408 o.nextPageToken!,
409 unittest.equals('foo'),
410 );
Martin Kustermannf9109a82018-01-08 15:24:20 +0100411 }
412 buildCounterCustomerListDevicesResponse--;
413}
414
Kevin Moorec4e4ec82021-06-18 19:03:35 -0700415core.List<api.Dpc> buildUnnamed4425() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700422void checkUnnamed4425(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 Moorec4e4ec82021-06-18 19:03:35 -0700433 o.dpcs = buildUnnamed4425();
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 Moorec4e4ec82021-06-18 19:03:35 -0700442 checkUnnamed4425(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 Moorec4e4ec82021-06-18 19:03:35 -0700487core.List<api.DeviceClaim> buildUnnamed4426() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700494void checkUnnamed4426(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 Moorec4e4ec82021-06-18 19:03:35 -0700505 o.claims = buildUnnamed4426();
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 Moorec4e4ec82021-06-18 19:03:35 -0700519 checkUnnamed4426(o.claims!);
Kevin Moore58e22332021-02-25 10:11:41 -0800520 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 Moorec4e4ec82021-06-18 19:03:35 -0700622core.Map<core.String, core.String> buildUnnamed4427() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700629void checkUnnamed4427(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 Moorec4e4ec82021-06-18 19:03:35 -0700646 o.entries = buildUnnamed4427();
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 Moorec4e4ec82021-06-18 19:03:35 -0700655 checkUnnamed4427(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 Moorec4e4ec82021-06-18 19:03:35 -0700718core.List<api.OperationPerDevice> buildUnnamed4428() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700725void checkUnnamed4428(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 Moorec4e4ec82021-06-18 19:03:35 -0700737 o.perDeviceStatus = buildUnnamed4428();
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 Moorec4e4ec82021-06-18 19:03:35 -0700748 checkUnnamed4428(o.perDeviceStatus!);
Kevin Moore58e22332021-02-25 10:11:41 -0800749 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 Moorec4e4ec82021-06-18 19:03:35 -0700835core.List<api.Device> buildUnnamed4429() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700842void checkUnnamed4429(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 Moorec4e4ec82021-06-18 19:03:35 -0700854 o.devices = buildUnnamed4429();
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 Moorec4e4ec82021-06-18 19:03:35 -0700866 checkUnnamed4429(o.devices!);
Kevin Moore58e22332021-02-25 10:11:41 -0800867 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 Moorec4e4ec82021-06-18 19:03:35 -0700879core.List<core.String> buildUnnamed4430() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700886void checkUnnamed4430(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 Moorec4e4ec82021-06-18 19:03:35 -0700903 o.customerId = buildUnnamed4430();
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 Moorec4e4ec82021-06-18 19:03:35 -0700915 checkUnnamed4430(o.customerId!);
Kevin Moore58e22332021-02-25 10:11:41 -0800916 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 Moorec4e4ec82021-06-18 19:03:35 -0700932core.List<api.Device> buildUnnamed4431() {
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 Moorec4e4ec82021-06-18 19:03:35 -0700939void checkUnnamed4431(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 Moorec4e4ec82021-06-18 19:03:35 -0700950 o.devices = buildUnnamed4431();
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 Moorec4e4ec82021-06-18 19:03:35 -0700961 checkUnnamed4431(o.devices!);
Kevin Moore58e22332021-02-25 10:11:41 -0800962 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 Moorec4e4ec82021-06-18 19:03:35 -0700974core.List<api.Company> buildUnnamed4432() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800975 var o = <api.Company>[];
Martin Kustermann12cdd522018-08-27 10:46:50 +0200976 o.add(buildCompany());
977 o.add(buildCompany());
978 return o;
979}
980
Kevin Moorec4e4ec82021-06-18 19:03:35 -0700981void checkUnnamed4432(core.List<api.Company> o) {
Martin Kustermann12cdd522018-08-27 10:46:50 +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 Kustermann12cdd522018-08-27 10:46:50 +0200985}
986
Kevin Moore64f78622021-03-01 17:42:54 -0800987core.int buildCounterListCustomersResponse = 0;
988api.ListCustomersResponse buildListCustomersResponse() {
989 var o = api.ListCustomersResponse();
990 buildCounterListCustomersResponse++;
991 if (buildCounterListCustomersResponse < 3) {
Kevin Moorec4e4ec82021-06-18 19:03:35 -0700992 o.customers = buildUnnamed4432();
Kevin Moored0251702021-01-15 06:41:08 -0800993 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100994 o.totalSize = 42;
Martin Kustermann12cdd522018-08-27 10:46:50 +0200995 }
Kevin Moore64f78622021-03-01 17:42:54 -0800996 buildCounterListCustomersResponse--;
Martin Kustermann12cdd522018-08-27 10:46:50 +0200997 return o;
998}
999
Kevin Moore64f78622021-03-01 17:42:54 -08001000void checkListCustomersResponse(api.ListCustomersResponse o) {
1001 buildCounterListCustomersResponse++;
1002 if (buildCounterListCustomersResponse < 3) {
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001003 checkUnnamed4432(o.customers!);
Kevin Moore58e22332021-02-25 10:11:41 -08001004 unittest.expect(
1005 o.nextPageToken!,
1006 unittest.equals('foo'),
1007 );
1008 unittest.expect(
1009 o.totalSize!,
1010 unittest.equals(42),
1011 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02001012 }
Kevin Moore64f78622021-03-01 17:42:54 -08001013 buildCounterListCustomersResponse--;
Martin Kustermann12cdd522018-08-27 10:46:50 +02001014}
1015
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001016core.List<api.Company> buildUnnamed4433() {
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 Moorec4e4ec82021-06-18 19:03:35 -07001023void checkUnnamed4433(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
Kevin Moore64f78622021-03-01 17:42:54 -08001029core.int buildCounterListVendorCustomersResponse = 0;
1030api.ListVendorCustomersResponse buildListVendorCustomersResponse() {
1031 var o = api.ListVendorCustomersResponse();
1032 buildCounterListVendorCustomersResponse++;
1033 if (buildCounterListVendorCustomersResponse < 3) {
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001034 o.customers = buildUnnamed4433();
Kevin Moore64f78622021-03-01 17:42:54 -08001035 o.nextPageToken = 'foo';
1036 o.totalSize = 42;
1037 }
1038 buildCounterListVendorCustomersResponse--;
1039 return o;
1040}
1041
1042void checkListVendorCustomersResponse(api.ListVendorCustomersResponse o) {
1043 buildCounterListVendorCustomersResponse++;
1044 if (buildCounterListVendorCustomersResponse < 3) {
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001045 checkUnnamed4433(o.customers!);
Kevin Moore64f78622021-03-01 17:42:54 -08001046 unittest.expect(
1047 o.nextPageToken!,
1048 unittest.equals('foo'),
1049 );
1050 unittest.expect(
1051 o.totalSize!,
1052 unittest.equals(42),
1053 );
1054 }
1055 buildCounterListVendorCustomersResponse--;
1056}
1057
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001058core.List<api.Company> buildUnnamed4434() {
Kevin Moore64f78622021-03-01 17:42:54 -08001059 var o = <api.Company>[];
1060 o.add(buildCompany());
1061 o.add(buildCompany());
1062 return o;
1063}
1064
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001065void checkUnnamed4434(core.List<api.Company> o) {
Kevin Moore64f78622021-03-01 17:42:54 -08001066 unittest.expect(o, unittest.hasLength(2));
1067 checkCompany(o[0] as api.Company);
1068 checkCompany(o[1] as api.Company);
1069}
1070
Martin Kustermann12cdd522018-08-27 10:46:50 +02001071core.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 Moorec4e4ec82021-06-18 19:03:35 -07001078 o.vendors = buildUnnamed4434();
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 );
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001095 checkUnnamed4434(o.vendors!);
Martin Kustermann12cdd522018-08-27 10:46:50 +02001096 }
1097 buildCounterListVendorsResponse--;
1098}
1099
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001100core.Map<core.String, core.Object> buildUnnamed4435() {
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 Moorec4e4ec82021-06-18 19:03:35 -07001115void checkUnnamed4435(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 Moorec4e4ec82021-06-18 19:03:35 -07001147core.Map<core.String, core.Object> buildUnnamed4436() {
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 Moorec4e4ec82021-06-18 19:03:35 -07001162void checkUnnamed4436(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 Moorec4e4ec82021-06-18 19:03:35 -07001201 o.metadata = buildUnnamed4435();
Kevin Moored0251702021-01-15 06:41:08 -08001202 o.name = 'foo';
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001203 o.response = buildUnnamed4436();
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);
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001214 checkUnnamed4435(o.metadata!);
Kevin Moore58e22332021-02-25 10:11:41 -08001215 unittest.expect(
1216 o.name!,
1217 unittest.equals('foo'),
1218 );
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001219 checkUnnamed4436(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 Moorec4e4ec82021-06-18 19:03:35 -07001357core.Map<core.String, core.Object> buildUnnamed4437() {
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 Moorec4e4ec82021-06-18 19:03:35 -07001372void checkUnnamed4437(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 Moorec4e4ec82021-06-18 19:03:35 -07001404core.List<core.Map<core.String, core.Object>> buildUnnamed4438() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001405 var o = <core.Map<core.String, core.Object>>[];
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001406 o.add(buildUnnamed4437());
1407 o.add(buildUnnamed4437());
Martin Kustermannfa83e312017-07-31 12:48:45 +02001408 return o;
1409}
1410
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001411void checkUnnamed4438(core.List<core.Map<core.String, core.Object>> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001412 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001413 checkUnnamed4437(o[0]);
1414 checkUnnamed4437(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 Moorec4e4ec82021-06-18 19:03:35 -07001423 o.details = buildUnnamed4438();
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 );
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001437 checkUnnamed4438(o.details!);
Kevin Moore58e22332021-02-25 10:11:41 -08001438 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 Moorec4e4ec82021-06-18 19:03:35 -07001485core.List<api.PartnerUnclaim> buildUnnamed4439() {
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 Moorec4e4ec82021-06-18 19:03:35 -07001492void checkUnnamed4439(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 Moorec4e4ec82021-06-18 19:03:35 -07001503 o.unclaims = buildUnnamed4439();
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 Moorec4e4ec82021-06-18 19:03:35 -07001512 checkUnnamed4439(o.unclaims!);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001513 }
1514 buildCounterUnclaimDevicesRequest--;
1515}
1516
Kevin Moorec4e4ec82021-06-18 19:03:35 -07001517core.List<api.UpdateMetadataArguments> buildUnnamed4440() {
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 Moorec4e4ec82021-06-18 19:03:35 -07001524void checkUnnamed4440(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 Moorec4e4ec82021-06-18 19:03:35 -07001536 o.updates = buildUnnamed4440();
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 Moorec4e4ec82021-06-18 19:03:35 -07001546 checkUnnamed4440(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', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001598 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001599 var o = buildClaimDeviceRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001600 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1601 var od = api.ClaimDeviceRequest.fromJson(
1602 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001603 checkClaimDeviceRequest(od as api.ClaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001604 });
1605 });
1606
Kevin Moored0251702021-01-15 06:41:08 -08001607 unittest.group('obj-schema-ClaimDeviceResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001608 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001609 var o = buildClaimDeviceResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001610 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1611 var od = api.ClaimDeviceResponse.fromJson(
1612 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001613 checkClaimDeviceResponse(od as api.ClaimDeviceResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001614 });
1615 });
1616
Kevin Moored0251702021-01-15 06:41:08 -08001617 unittest.group('obj-schema-ClaimDevicesRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001618 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001619 var o = buildClaimDevicesRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001620 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1621 var od = api.ClaimDevicesRequest.fromJson(
1622 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001623 checkClaimDevicesRequest(od as api.ClaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001624 });
1625 });
1626
Kevin Moored0251702021-01-15 06:41:08 -08001627 unittest.group('obj-schema-Company', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001628 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001629 var o = buildCompany();
Kevin Mooreae408692021-02-25 12:00:44 -08001630 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1631 var od =
1632 api.Company.fromJson(oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001633 checkCompany(od as api.Company);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001634 });
1635 });
1636
Kevin Moored0251702021-01-15 06:41:08 -08001637 unittest.group('obj-schema-Configuration', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001638 unittest.test('to-json--from-json', () async {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001639 var o = buildConfiguration();
Kevin Mooreae408692021-02-25 12:00:44 -08001640 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1641 var od = api.Configuration.fromJson(
1642 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001643 checkConfiguration(od as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001644 });
1645 });
1646
Kevin Moored0251702021-01-15 06:41:08 -08001647 unittest.group('obj-schema-CreateCustomerRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001648 unittest.test('to-json--from-json', () async {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001649 var o = buildCreateCustomerRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001650 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1651 var od = api.CreateCustomerRequest.fromJson(
1652 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001653 checkCreateCustomerRequest(od as api.CreateCustomerRequest);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001654 });
1655 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02001656
Kevin Moored0251702021-01-15 06:41:08 -08001657 unittest.group('obj-schema-CustomerApplyConfigurationRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001658 unittest.test('to-json--from-json', () async {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001659 var o = buildCustomerApplyConfigurationRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001660 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1661 var od = api.CustomerApplyConfigurationRequest.fromJson(
1662 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001663 checkCustomerApplyConfigurationRequest(
1664 od as api.CustomerApplyConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001665 });
1666 });
1667
Kevin Moored0251702021-01-15 06:41:08 -08001668 unittest.group('obj-schema-CustomerListConfigurationsResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001669 unittest.test('to-json--from-json', () async {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001670 var o = buildCustomerListConfigurationsResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001671 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1672 var od = api.CustomerListConfigurationsResponse.fromJson(
1673 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001674 checkCustomerListConfigurationsResponse(
1675 od as api.CustomerListConfigurationsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001676 });
1677 });
1678
Kevin Moored0251702021-01-15 06:41:08 -08001679 unittest.group('obj-schema-CustomerListCustomersResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001680 unittest.test('to-json--from-json', () async {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001681 var o = buildCustomerListCustomersResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001682 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1683 var od = api.CustomerListCustomersResponse.fromJson(
1684 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001685 checkCustomerListCustomersResponse(
1686 od as api.CustomerListCustomersResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001687 });
1688 });
1689
Kevin Moored0251702021-01-15 06:41:08 -08001690 unittest.group('obj-schema-CustomerListDevicesResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001691 unittest.test('to-json--from-json', () async {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001692 var o = buildCustomerListDevicesResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001693 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1694 var od = api.CustomerListDevicesResponse.fromJson(
1695 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001696 checkCustomerListDevicesResponse(od as api.CustomerListDevicesResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001697 });
1698 });
1699
Kevin Moored0251702021-01-15 06:41:08 -08001700 unittest.group('obj-schema-CustomerListDpcsResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001701 unittest.test('to-json--from-json', () async {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001702 var o = buildCustomerListDpcsResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001703 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1704 var od = api.CustomerListDpcsResponse.fromJson(
1705 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001706 checkCustomerListDpcsResponse(od as api.CustomerListDpcsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001707 });
1708 });
1709
Kevin Moored0251702021-01-15 06:41:08 -08001710 unittest.group('obj-schema-CustomerRemoveConfigurationRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001711 unittest.test('to-json--from-json', () async {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001712 var o = buildCustomerRemoveConfigurationRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001713 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1714 var od = api.CustomerRemoveConfigurationRequest.fromJson(
1715 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001716 checkCustomerRemoveConfigurationRequest(
1717 od as api.CustomerRemoveConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001718 });
1719 });
1720
Kevin Moored0251702021-01-15 06:41:08 -08001721 unittest.group('obj-schema-CustomerUnclaimDeviceRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001722 unittest.test('to-json--from-json', () async {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001723 var o = buildCustomerUnclaimDeviceRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001724 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1725 var od = api.CustomerUnclaimDeviceRequest.fromJson(
1726 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001727 checkCustomerUnclaimDeviceRequest(od as api.CustomerUnclaimDeviceRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001728 });
1729 });
1730
Kevin Moored0251702021-01-15 06:41:08 -08001731 unittest.group('obj-schema-Device', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001732 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001733 var o = buildDevice();
Kevin Mooreae408692021-02-25 12:00:44 -08001734 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1735 var od =
1736 api.Device.fromJson(oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001737 checkDevice(od as api.Device);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001738 });
1739 });
1740
Kevin Moored0251702021-01-15 06:41:08 -08001741 unittest.group('obj-schema-DeviceClaim', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001742 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001743 var o = buildDeviceClaim();
Kevin Mooreae408692021-02-25 12:00:44 -08001744 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1745 var od = api.DeviceClaim.fromJson(
1746 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001747 checkDeviceClaim(od as api.DeviceClaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001748 });
1749 });
1750
Kevin Moored0251702021-01-15 06:41:08 -08001751 unittest.group('obj-schema-DeviceIdentifier', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001752 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001753 var o = buildDeviceIdentifier();
Kevin Mooreae408692021-02-25 12:00:44 -08001754 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1755 var od = api.DeviceIdentifier.fromJson(
1756 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001757 checkDeviceIdentifier(od as api.DeviceIdentifier);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001758 });
1759 });
1760
Kevin Moored0251702021-01-15 06:41:08 -08001761 unittest.group('obj-schema-DeviceMetadata', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001762 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001763 var o = buildDeviceMetadata();
Kevin Mooreae408692021-02-25 12:00:44 -08001764 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1765 var od = api.DeviceMetadata.fromJson(
1766 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001767 checkDeviceMetadata(od as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001768 });
1769 });
1770
Kevin Moored0251702021-01-15 06:41:08 -08001771 unittest.group('obj-schema-DeviceReference', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001772 unittest.test('to-json--from-json', () async {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001773 var o = buildDeviceReference();
Kevin Mooreae408692021-02-25 12:00:44 -08001774 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1775 var od = api.DeviceReference.fromJson(
1776 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001777 checkDeviceReference(od as api.DeviceReference);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001778 });
1779 });
1780
Kevin Moored0251702021-01-15 06:41:08 -08001781 unittest.group('obj-schema-DevicesLongRunningOperationMetadata', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001782 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001783 var o = buildDevicesLongRunningOperationMetadata();
Kevin Mooreae408692021-02-25 12:00:44 -08001784 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1785 var od = api.DevicesLongRunningOperationMetadata.fromJson(
1786 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001787 checkDevicesLongRunningOperationMetadata(
1788 od as api.DevicesLongRunningOperationMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001789 });
1790 });
1791
Kevin Moored0251702021-01-15 06:41:08 -08001792 unittest.group('obj-schema-DevicesLongRunningOperationResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001793 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001794 var o = buildDevicesLongRunningOperationResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001795 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1796 var od = api.DevicesLongRunningOperationResponse.fromJson(
1797 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001798 checkDevicesLongRunningOperationResponse(
1799 od as api.DevicesLongRunningOperationResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001800 });
1801 });
1802
Kevin Moored0251702021-01-15 06:41:08 -08001803 unittest.group('obj-schema-Dpc', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001804 unittest.test('to-json--from-json', () async {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001805 var o = buildDpc();
Kevin Mooreae408692021-02-25 12:00:44 -08001806 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1807 var od = api.Dpc.fromJson(oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001808 checkDpc(od as api.Dpc);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001809 });
1810 });
1811
Kevin Moored0251702021-01-15 06:41:08 -08001812 unittest.group('obj-schema-Empty', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001813 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001814 var o = buildEmpty();
Kevin Mooreae408692021-02-25 12:00:44 -08001815 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1816 var od = api.Empty.fromJson(oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001817 checkEmpty(od as api.Empty);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001818 });
1819 });
1820
Kevin Moored0251702021-01-15 06:41:08 -08001821 unittest.group('obj-schema-FindDevicesByDeviceIdentifierRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001822 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001823 var o = buildFindDevicesByDeviceIdentifierRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001824 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1825 var od = api.FindDevicesByDeviceIdentifierRequest.fromJson(
1826 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001827 checkFindDevicesByDeviceIdentifierRequest(
1828 od as api.FindDevicesByDeviceIdentifierRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001829 });
1830 });
1831
Kevin Moored0251702021-01-15 06:41:08 -08001832 unittest.group('obj-schema-FindDevicesByDeviceIdentifierResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001833 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001834 var o = buildFindDevicesByDeviceIdentifierResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001835 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1836 var od = api.FindDevicesByDeviceIdentifierResponse.fromJson(
1837 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001838 checkFindDevicesByDeviceIdentifierResponse(
1839 od as api.FindDevicesByDeviceIdentifierResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001840 });
1841 });
1842
Kevin Moored0251702021-01-15 06:41:08 -08001843 unittest.group('obj-schema-FindDevicesByOwnerRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001844 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001845 var o = buildFindDevicesByOwnerRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001846 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1847 var od = api.FindDevicesByOwnerRequest.fromJson(
1848 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001849 checkFindDevicesByOwnerRequest(od as api.FindDevicesByOwnerRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001850 });
1851 });
1852
Kevin Moored0251702021-01-15 06:41:08 -08001853 unittest.group('obj-schema-FindDevicesByOwnerResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001854 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001855 var o = buildFindDevicesByOwnerResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001856 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1857 var od = api.FindDevicesByOwnerResponse.fromJson(
1858 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001859 checkFindDevicesByOwnerResponse(od as api.FindDevicesByOwnerResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001860 });
1861 });
1862
Kevin Moored0251702021-01-15 06:41:08 -08001863 unittest.group('obj-schema-ListCustomersResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001864 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001865 var o = buildListCustomersResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001866 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1867 var od = api.ListCustomersResponse.fromJson(
1868 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001869 checkListCustomersResponse(od as api.ListCustomersResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001870 });
1871 });
1872
Kevin Moored0251702021-01-15 06:41:08 -08001873 unittest.group('obj-schema-ListVendorCustomersResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001874 unittest.test('to-json--from-json', () async {
Martin Kustermann12cdd522018-08-27 10:46:50 +02001875 var o = buildListVendorCustomersResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001876 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1877 var od = api.ListVendorCustomersResponse.fromJson(
1878 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001879 checkListVendorCustomersResponse(od as api.ListVendorCustomersResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02001880 });
1881 });
1882
Kevin Moored0251702021-01-15 06:41:08 -08001883 unittest.group('obj-schema-ListVendorsResponse', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001884 unittest.test('to-json--from-json', () async {
Martin Kustermann12cdd522018-08-27 10:46:50 +02001885 var o = buildListVendorsResponse();
Kevin Mooreae408692021-02-25 12:00:44 -08001886 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1887 var od = api.ListVendorsResponse.fromJson(
1888 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001889 checkListVendorsResponse(od as api.ListVendorsResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02001890 });
1891 });
1892
Kevin Moored0251702021-01-15 06:41:08 -08001893 unittest.group('obj-schema-Operation', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001894 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001895 var o = buildOperation();
Kevin Mooreae408692021-02-25 12:00:44 -08001896 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1897 var od =
1898 api.Operation.fromJson(oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001899 checkOperation(od as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001900 });
1901 });
1902
Kevin Moored0251702021-01-15 06:41:08 -08001903 unittest.group('obj-schema-OperationPerDevice', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001904 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001905 var o = buildOperationPerDevice();
Kevin Mooreae408692021-02-25 12:00:44 -08001906 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1907 var od = api.OperationPerDevice.fromJson(
1908 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001909 checkOperationPerDevice(od as api.OperationPerDevice);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001910 });
1911 });
1912
Kevin Moored0251702021-01-15 06:41:08 -08001913 unittest.group('obj-schema-PartnerClaim', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001914 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001915 var o = buildPartnerClaim();
Kevin Mooreae408692021-02-25 12:00:44 -08001916 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1917 var od = api.PartnerClaim.fromJson(
1918 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001919 checkPartnerClaim(od as api.PartnerClaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001920 });
1921 });
1922
Kevin Moored0251702021-01-15 06:41:08 -08001923 unittest.group('obj-schema-PartnerUnclaim', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001924 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001925 var o = buildPartnerUnclaim();
Kevin Mooreae408692021-02-25 12:00:44 -08001926 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1927 var od = api.PartnerUnclaim.fromJson(
1928 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001929 checkPartnerUnclaim(od as api.PartnerUnclaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001930 });
1931 });
1932
Kevin Moored0251702021-01-15 06:41:08 -08001933 unittest.group('obj-schema-PerDeviceStatusInBatch', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001934 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001935 var o = buildPerDeviceStatusInBatch();
Kevin Mooreae408692021-02-25 12:00:44 -08001936 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1937 var od = api.PerDeviceStatusInBatch.fromJson(
1938 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001939 checkPerDeviceStatusInBatch(od as api.PerDeviceStatusInBatch);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001940 });
1941 });
1942
Kevin Moored0251702021-01-15 06:41:08 -08001943 unittest.group('obj-schema-Status', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001944 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001945 var o = buildStatus();
Kevin Mooreae408692021-02-25 12:00:44 -08001946 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1947 var od =
1948 api.Status.fromJson(oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001949 checkStatus(od as api.Status);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001950 });
1951 });
1952
Kevin Moored0251702021-01-15 06:41:08 -08001953 unittest.group('obj-schema-UnclaimDeviceRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001954 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001955 var o = buildUnclaimDeviceRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001956 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1957 var od = api.UnclaimDeviceRequest.fromJson(
1958 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001959 checkUnclaimDeviceRequest(od as api.UnclaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001960 });
1961 });
1962
Kevin Moored0251702021-01-15 06:41:08 -08001963 unittest.group('obj-schema-UnclaimDevicesRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001964 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001965 var o = buildUnclaimDevicesRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001966 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1967 var od = api.UnclaimDevicesRequest.fromJson(
1968 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001969 checkUnclaimDevicesRequest(od as api.UnclaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001970 });
1971 });
1972
Kevin Moored0251702021-01-15 06:41:08 -08001973 unittest.group('obj-schema-UpdateDeviceMetadataInBatchRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001974 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001975 var o = buildUpdateDeviceMetadataInBatchRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001976 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1977 var od = api.UpdateDeviceMetadataInBatchRequest.fromJson(
1978 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001979 checkUpdateDeviceMetadataInBatchRequest(
1980 od as api.UpdateDeviceMetadataInBatchRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001981 });
1982 });
1983
Kevin Moored0251702021-01-15 06:41:08 -08001984 unittest.group('obj-schema-UpdateDeviceMetadataRequest', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001985 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001986 var o = buildUpdateDeviceMetadataRequest();
Kevin Mooreae408692021-02-25 12:00:44 -08001987 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1988 var od = api.UpdateDeviceMetadataRequest.fromJson(
1989 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001990 checkUpdateDeviceMetadataRequest(od as api.UpdateDeviceMetadataRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001991 });
1992 });
1993
Kevin Moored0251702021-01-15 06:41:08 -08001994 unittest.group('obj-schema-UpdateMetadataArguments', () {
Kevin Moore341348b2021-02-25 11:55:18 -08001995 unittest.test('to-json--from-json', () async {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001996 var o = buildUpdateMetadataArguments();
Kevin Mooreae408692021-02-25 12:00:44 -08001997 var oJson = convert.jsonDecode(convert.jsonEncode(o));
1998 var od = api.UpdateMetadataArguments.fromJson(
1999 oJson as core.Map<core.String, core.dynamic>);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002000 checkUpdateMetadataArguments(od as api.UpdateMetadataArguments);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002001 });
2002 });
2003
Kevin Moore88512712021-01-28 14:43:28 -08002004 unittest.group('resource-CustomersResource', () {
Kevin Moore341348b2021-02-25 11:55:18 -08002005 unittest.test('method--list', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002006 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002007 var res = api.AndroidProvisioningPartnerApi(mock).customers;
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02002008 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08002009 var arg_pageToken = 'foo';
2010 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002011 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2012 var path = (req.url).path;
2013 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002014 core.int index;
2015 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002016 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002017 path.substring(pathOffset, pathOffset + 1),
2018 unittest.equals("/"),
2019 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002020 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08002021 unittest.expect(
2022 path.substring(pathOffset, pathOffset + 12),
2023 unittest.equals("v1/customers"),
2024 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002025 pathOffset += 12;
2026
2027 var query = (req.url).query;
2028 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002029 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002030 void addQueryParam(core.String n, core.String v) =>
2031 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002032
Kevin Moore6d21e902021-01-15 06:41:08 -08002033 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002034 for (var part in query.split('&')) {
2035 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002036 addQueryParam(
2037 core.Uri.decodeQueryComponent(keyValue[0]),
2038 core.Uri.decodeQueryComponent(keyValue[1]),
2039 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002040 }
2041 }
Jonas Finnemann Jensenb223bd52020-10-09 13:02:08 +02002042 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002043 core.int.parse(queryMap["pageSize"]!.first),
2044 unittest.equals(arg_pageSize),
2045 );
2046 unittest.expect(
2047 queryMap["pageToken"]!.first,
2048 unittest.equals(arg_pageToken),
2049 );
2050 unittest.expect(
2051 queryMap["fields"]!.first,
2052 unittest.equals(arg_$fields),
2053 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002054
2055 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002056 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002057 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002058 var resp = convert.json.encode(buildCustomerListCustomersResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002059 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002060 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002061 final response = await res.list(
2062 pageSize: arg_pageSize,
2063 pageToken: arg_pageToken,
2064 $fields: arg_$fields);
2065 checkCustomerListCustomersResponse(
2066 response as api.CustomerListCustomersResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002067 });
2068 });
2069
Kevin Moore88512712021-01-28 14:43:28 -08002070 unittest.group('resource-CustomersConfigurationsResource', () {
Kevin Moore341348b2021-02-25 11:55:18 -08002071 unittest.test('method--create', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002072 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002073 var res =
2074 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002075 var arg_request = buildConfiguration();
Kevin Moored0251702021-01-15 06:41:08 -08002076 var arg_parent = 'foo';
2077 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002078 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002079 var obj = api.Configuration.fromJson(
2080 json as core.Map<core.String, core.dynamic>);
2081 checkConfiguration(obj as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002082
2083 var path = (req.url).path;
2084 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002085 core.int index;
2086 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002087 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002088 path.substring(pathOffset, pathOffset + 1),
2089 unittest.equals("/"),
2090 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002091 pathOffset += 1;
2092 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002093 path.substring(pathOffset, pathOffset + 3),
2094 unittest.equals("v1/"),
2095 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002096 pathOffset += 3;
2097 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2098
2099 var query = (req.url).query;
2100 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002101 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002102 void addQueryParam(core.String n, core.String v) =>
2103 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002104
Kevin Moore6d21e902021-01-15 06:41:08 -08002105 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002106 for (var part in query.split('&')) {
2107 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002108 addQueryParam(
2109 core.Uri.decodeQueryComponent(keyValue[0]),
2110 core.Uri.decodeQueryComponent(keyValue[1]),
2111 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002112 }
2113 }
Kevin Moore58e22332021-02-25 10:11:41 -08002114 unittest.expect(
2115 queryMap["fields"]!.first,
2116 unittest.equals(arg_$fields),
2117 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002118
2119 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002120 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002121 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002122 var resp = convert.json.encode(buildConfiguration());
Kevin Moore6d21e902021-01-15 06:41:08 -08002123 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002124 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002125 final response =
2126 await res.create(arg_request, arg_parent, $fields: arg_$fields);
2127 checkConfiguration(response as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002128 });
2129
Kevin Moore341348b2021-02-25 11:55:18 -08002130 unittest.test('method--delete', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002131 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002132 var res =
2133 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Kevin Moored0251702021-01-15 06:41:08 -08002134 var arg_name = 'foo';
2135 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002136 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2137 var path = (req.url).path;
2138 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002139 core.int index;
2140 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002141 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002142 path.substring(pathOffset, pathOffset + 1),
2143 unittest.equals("/"),
2144 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002145 pathOffset += 1;
2146 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002147 path.substring(pathOffset, pathOffset + 3),
2148 unittest.equals("v1/"),
2149 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002150 pathOffset += 3;
2151 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2152
2153 var query = (req.url).query;
2154 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002155 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002156 void addQueryParam(core.String n, core.String v) =>
2157 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002158
Kevin Moore6d21e902021-01-15 06:41:08 -08002159 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002160 for (var part in query.split('&')) {
2161 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002162 addQueryParam(
2163 core.Uri.decodeQueryComponent(keyValue[0]),
2164 core.Uri.decodeQueryComponent(keyValue[1]),
2165 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002166 }
2167 }
Kevin Moore58e22332021-02-25 10:11:41 -08002168 unittest.expect(
2169 queryMap["fields"]!.first,
2170 unittest.equals(arg_$fields),
2171 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002172
2173 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002174 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002175 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002176 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002177 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002178 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002179 final response = await res.delete(arg_name, $fields: arg_$fields);
2180 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002181 });
2182
Kevin Moore341348b2021-02-25 11:55:18 -08002183 unittest.test('method--get', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002184 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002185 var res =
2186 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Kevin Moored0251702021-01-15 06:41:08 -08002187 var arg_name = 'foo';
2188 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002189 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2190 var path = (req.url).path;
2191 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002192 core.int index;
2193 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002194 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002195 path.substring(pathOffset, pathOffset + 1),
2196 unittest.equals("/"),
2197 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002198 pathOffset += 1;
2199 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002200 path.substring(pathOffset, pathOffset + 3),
2201 unittest.equals("v1/"),
2202 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002203 pathOffset += 3;
2204 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2205
2206 var query = (req.url).query;
2207 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002208 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002209 void addQueryParam(core.String n, core.String v) =>
2210 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002211
Kevin Moore6d21e902021-01-15 06:41:08 -08002212 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002213 for (var part in query.split('&')) {
2214 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002215 addQueryParam(
2216 core.Uri.decodeQueryComponent(keyValue[0]),
2217 core.Uri.decodeQueryComponent(keyValue[1]),
2218 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002219 }
2220 }
Kevin Moore58e22332021-02-25 10:11:41 -08002221 unittest.expect(
2222 queryMap["fields"]!.first,
2223 unittest.equals(arg_$fields),
2224 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002225
2226 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002227 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002228 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002229 var resp = convert.json.encode(buildConfiguration());
Kevin Moore6d21e902021-01-15 06:41:08 -08002230 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002231 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002232 final response = await res.get(arg_name, $fields: arg_$fields);
2233 checkConfiguration(response as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002234 });
2235
Kevin Moore341348b2021-02-25 11:55:18 -08002236 unittest.test('method--list', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002237 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002238 var res =
2239 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Kevin Moored0251702021-01-15 06:41:08 -08002240 var arg_parent = 'foo';
2241 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002242 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2243 var path = (req.url).path;
2244 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002245 core.int index;
2246 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002247 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002248 path.substring(pathOffset, pathOffset + 1),
2249 unittest.equals("/"),
2250 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002251 pathOffset += 1;
2252 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002253 path.substring(pathOffset, pathOffset + 3),
2254 unittest.equals("v1/"),
2255 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002256 pathOffset += 3;
2257 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2258
2259 var query = (req.url).query;
2260 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002261 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002262 void addQueryParam(core.String n, core.String v) =>
2263 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002264
Kevin Moore6d21e902021-01-15 06:41:08 -08002265 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002266 for (var part in query.split('&')) {
2267 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002268 addQueryParam(
2269 core.Uri.decodeQueryComponent(keyValue[0]),
2270 core.Uri.decodeQueryComponent(keyValue[1]),
2271 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002272 }
2273 }
Kevin Moore58e22332021-02-25 10:11:41 -08002274 unittest.expect(
2275 queryMap["fields"]!.first,
2276 unittest.equals(arg_$fields),
2277 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002278
2279 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002280 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002281 };
2282 var resp =
Jakob Andersen52715df2018-05-01 13:58:48 +02002283 convert.json.encode(buildCustomerListConfigurationsResponse());
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);
Kevin Moore341348b2021-02-25 11:55:18 -08002286 final response = await res.list(arg_parent, $fields: arg_$fields);
2287 checkCustomerListConfigurationsResponse(
2288 response as api.CustomerListConfigurationsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002289 });
2290
Kevin Moore341348b2021-02-25 11:55:18 -08002291 unittest.test('method--patch', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002292 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002293 var res =
2294 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002295 var arg_request = buildConfiguration();
Kevin Moored0251702021-01-15 06:41:08 -08002296 var arg_name = 'foo';
2297 var arg_updateMask = 'foo';
2298 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002299 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002300 var obj = api.Configuration.fromJson(
2301 json as core.Map<core.String, core.dynamic>);
2302 checkConfiguration(obj as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002303
2304 var path = (req.url).path;
2305 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002306 core.int index;
2307 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002308 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002309 path.substring(pathOffset, pathOffset + 1),
2310 unittest.equals("/"),
2311 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002312 pathOffset += 1;
2313 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002314 path.substring(pathOffset, pathOffset + 3),
2315 unittest.equals("v1/"),
2316 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002317 pathOffset += 3;
2318 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2319
2320 var query = (req.url).query;
2321 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002322 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002323 void addQueryParam(core.String n, core.String v) =>
2324 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002325
Kevin Moore6d21e902021-01-15 06:41:08 -08002326 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002327 for (var part in query.split('&')) {
2328 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002329 addQueryParam(
2330 core.Uri.decodeQueryComponent(keyValue[0]),
2331 core.Uri.decodeQueryComponent(keyValue[1]),
2332 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002333 }
2334 }
2335 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002336 queryMap["updateMask"]!.first,
2337 unittest.equals(arg_updateMask),
2338 );
2339 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(buildConfiguration());
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);
Kevin Moore341348b2021-02-25 11:55:18 -08002350 final response = await res.patch(arg_request, arg_name,
2351 updateMask: arg_updateMask, $fields: arg_$fields);
2352 checkConfiguration(response as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002353 });
2354 });
2355
Kevin Moore88512712021-01-28 14:43:28 -08002356 unittest.group('resource-CustomersDevicesResource', () {
Kevin Moore341348b2021-02-25 11:55:18 -08002357 unittest.test('method--applyConfiguration', () async {
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;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002360 var arg_request = buildCustomerApplyConfigurationRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002361 var arg_parent = 'foo';
2362 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002363 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002364 var obj = api.CustomerApplyConfigurationRequest.fromJson(
2365 json as core.Map<core.String, core.dynamic>);
2366 checkCustomerApplyConfigurationRequest(
2367 obj as api.CustomerApplyConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002368
2369 var path = (req.url).path;
2370 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002371 core.int index;
2372 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002373 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002374 path.substring(pathOffset, pathOffset + 1),
2375 unittest.equals("/"),
2376 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002377 pathOffset += 1;
2378 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002379 path.substring(pathOffset, pathOffset + 3),
2380 unittest.equals("v1/"),
2381 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002382 pathOffset += 3;
2383 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2384
2385 var query = (req.url).query;
2386 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002387 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002388 void addQueryParam(core.String n, core.String v) =>
2389 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002390
Kevin Moore6d21e902021-01-15 06:41:08 -08002391 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002392 for (var part in query.split('&')) {
2393 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002394 addQueryParam(
2395 core.Uri.decodeQueryComponent(keyValue[0]),
2396 core.Uri.decodeQueryComponent(keyValue[1]),
2397 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002398 }
2399 }
Kevin Moore58e22332021-02-25 10:11:41 -08002400 unittest.expect(
2401 queryMap["fields"]!.first,
2402 unittest.equals(arg_$fields),
2403 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002404
2405 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002406 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002407 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002408 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002409 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002410 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002411 final response = await res.applyConfiguration(arg_request, arg_parent,
2412 $fields: arg_$fields);
2413 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002414 });
2415
Kevin Moore341348b2021-02-25 11:55:18 -08002416 unittest.test('method--get', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002417 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002418 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Kevin Moored0251702021-01-15 06:41:08 -08002419 var arg_name = 'foo';
2420 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002421 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2422 var path = (req.url).path;
2423 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002424 core.int index;
2425 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002426 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002427 path.substring(pathOffset, pathOffset + 1),
2428 unittest.equals("/"),
2429 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002430 pathOffset += 1;
2431 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002432 path.substring(pathOffset, pathOffset + 3),
2433 unittest.equals("v1/"),
2434 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002435 pathOffset += 3;
2436 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2437
2438 var query = (req.url).query;
2439 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002440 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002441 void addQueryParam(core.String n, core.String v) =>
2442 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002443
Kevin Moore6d21e902021-01-15 06:41:08 -08002444 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002445 for (var part in query.split('&')) {
2446 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002447 addQueryParam(
2448 core.Uri.decodeQueryComponent(keyValue[0]),
2449 core.Uri.decodeQueryComponent(keyValue[1]),
2450 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002451 }
2452 }
Kevin Moore58e22332021-02-25 10:11:41 -08002453 unittest.expect(
2454 queryMap["fields"]!.first,
2455 unittest.equals(arg_$fields),
2456 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002457
2458 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002459 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002460 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002461 var resp = convert.json.encode(buildDevice());
Kevin Moore6d21e902021-01-15 06:41:08 -08002462 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002463 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002464 final response = await res.get(arg_name, $fields: arg_$fields);
2465 checkDevice(response as api.Device);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002466 });
2467
Kevin Moore341348b2021-02-25 11:55:18 -08002468 unittest.test('method--list', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002469 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002470 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Kevin Moored0251702021-01-15 06:41:08 -08002471 var arg_parent = 'foo';
Kevin Moored0251702021-01-15 06:41:08 -08002472 var arg_pageSize = 'foo';
Kevin Moore8810e8b2021-01-19 13:22:15 -08002473 var arg_pageToken = 'foo';
Kevin Moored0251702021-01-15 06:41:08 -08002474 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002475 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2476 var path = (req.url).path;
2477 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002478 core.int index;
2479 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002480 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002481 path.substring(pathOffset, pathOffset + 1),
2482 unittest.equals("/"),
2483 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002484 pathOffset += 1;
2485 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002486 path.substring(pathOffset, pathOffset + 3),
2487 unittest.equals("v1/"),
2488 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002489 pathOffset += 3;
2490 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2491
2492 var query = (req.url).query;
2493 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002494 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002495 void addQueryParam(core.String n, core.String v) =>
2496 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002497
Kevin Moore6d21e902021-01-15 06:41:08 -08002498 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002499 for (var part in query.split('&')) {
2500 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002501 addQueryParam(
2502 core.Uri.decodeQueryComponent(keyValue[0]),
2503 core.Uri.decodeQueryComponent(keyValue[1]),
2504 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002505 }
2506 }
2507 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002508 queryMap["pageSize"]!.first,
2509 unittest.equals(arg_pageSize),
2510 );
Kevin Moore8810e8b2021-01-19 13:22:15 -08002511 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002512 queryMap["pageToken"]!.first,
2513 unittest.equals(arg_pageToken),
2514 );
2515 unittest.expect(
2516 queryMap["fields"]!.first,
2517 unittest.equals(arg_$fields),
2518 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002519
2520 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002521 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002522 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002523 var resp = convert.json.encode(buildCustomerListDevicesResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002524 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002525 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002526 final response = await res.list(arg_parent,
2527 pageSize: arg_pageSize,
2528 pageToken: arg_pageToken,
2529 $fields: arg_$fields);
2530 checkCustomerListDevicesResponse(
2531 response as api.CustomerListDevicesResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002532 });
2533
Kevin Moore341348b2021-02-25 11:55:18 -08002534 unittest.test('method--removeConfiguration', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002535 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002536 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002537 var arg_request = buildCustomerRemoveConfigurationRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002538 var arg_parent = 'foo';
2539 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002540 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002541 var obj = api.CustomerRemoveConfigurationRequest.fromJson(
2542 json as core.Map<core.String, core.dynamic>);
2543 checkCustomerRemoveConfigurationRequest(
2544 obj as api.CustomerRemoveConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002545
2546 var path = (req.url).path;
2547 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002548 core.int index;
2549 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002550 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002551 path.substring(pathOffset, pathOffset + 1),
2552 unittest.equals("/"),
2553 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002554 pathOffset += 1;
2555 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002556 path.substring(pathOffset, pathOffset + 3),
2557 unittest.equals("v1/"),
2558 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002559 pathOffset += 3;
2560 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2561
2562 var query = (req.url).query;
2563 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002564 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002565 void addQueryParam(core.String n, core.String v) =>
2566 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002567
Kevin Moore6d21e902021-01-15 06:41:08 -08002568 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002569 for (var part in query.split('&')) {
2570 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002571 addQueryParam(
2572 core.Uri.decodeQueryComponent(keyValue[0]),
2573 core.Uri.decodeQueryComponent(keyValue[1]),
2574 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002575 }
2576 }
Kevin Moore58e22332021-02-25 10:11:41 -08002577 unittest.expect(
2578 queryMap["fields"]!.first,
2579 unittest.equals(arg_$fields),
2580 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002581
2582 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002583 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002584 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002585 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002586 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002587 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002588 final response = await res.removeConfiguration(arg_request, arg_parent,
2589 $fields: arg_$fields);
2590 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002591 });
2592
Kevin Moore341348b2021-02-25 11:55:18 -08002593 unittest.test('method--unclaim', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002594 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002595 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002596 var arg_request = buildCustomerUnclaimDeviceRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002597 var arg_parent = 'foo';
2598 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002599 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002600 var obj = api.CustomerUnclaimDeviceRequest.fromJson(
2601 json as core.Map<core.String, core.dynamic>);
2602 checkCustomerUnclaimDeviceRequest(
2603 obj as api.CustomerUnclaimDeviceRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002604
2605 var path = (req.url).path;
2606 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002607 core.int index;
2608 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002609 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002610 path.substring(pathOffset, pathOffset + 1),
2611 unittest.equals("/"),
2612 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002613 pathOffset += 1;
2614 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002615 path.substring(pathOffset, pathOffset + 3),
2616 unittest.equals("v1/"),
2617 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002618 pathOffset += 3;
2619 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2620
2621 var query = (req.url).query;
2622 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002623 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002624 void addQueryParam(core.String n, core.String v) =>
2625 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002626
Kevin Moore6d21e902021-01-15 06:41:08 -08002627 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002628 for (var part in query.split('&')) {
2629 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002630 addQueryParam(
2631 core.Uri.decodeQueryComponent(keyValue[0]),
2632 core.Uri.decodeQueryComponent(keyValue[1]),
2633 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002634 }
2635 }
Kevin Moore58e22332021-02-25 10:11:41 -08002636 unittest.expect(
2637 queryMap["fields"]!.first,
2638 unittest.equals(arg_$fields),
2639 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002640
2641 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002642 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002643 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002644 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002645 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002646 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002647 final response =
2648 await res.unclaim(arg_request, arg_parent, $fields: arg_$fields);
2649 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002650 });
2651 });
2652
Kevin Moore88512712021-01-28 14:43:28 -08002653 unittest.group('resource-CustomersDpcsResource', () {
Kevin Moore341348b2021-02-25 11:55:18 -08002654 unittest.test('method--list', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002655 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002656 var res = api.AndroidProvisioningPartnerApi(mock).customers.dpcs;
Kevin Moored0251702021-01-15 06:41:08 -08002657 var arg_parent = 'foo';
2658 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002659 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2660 var path = (req.url).path;
2661 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002662 core.int index;
2663 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002664 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002665 path.substring(pathOffset, pathOffset + 1),
2666 unittest.equals("/"),
2667 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002668 pathOffset += 1;
2669 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002670 path.substring(pathOffset, pathOffset + 3),
2671 unittest.equals("v1/"),
2672 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002673 pathOffset += 3;
2674 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2675
2676 var query = (req.url).query;
2677 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002678 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002679 void addQueryParam(core.String n, core.String v) =>
2680 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002681
Kevin Moore6d21e902021-01-15 06:41:08 -08002682 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002683 for (var part in query.split('&')) {
2684 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002685 addQueryParam(
2686 core.Uri.decodeQueryComponent(keyValue[0]),
2687 core.Uri.decodeQueryComponent(keyValue[1]),
2688 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002689 }
2690 }
Kevin Moore58e22332021-02-25 10:11:41 -08002691 unittest.expect(
2692 queryMap["fields"]!.first,
2693 unittest.equals(arg_$fields),
2694 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002695
2696 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002697 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002698 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002699 var resp = convert.json.encode(buildCustomerListDpcsResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002700 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002701 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002702 final response = await res.list(arg_parent, $fields: arg_$fields);
2703 checkCustomerListDpcsResponse(response as api.CustomerListDpcsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002704 });
2705 });
2706
Kevin Moore88512712021-01-28 14:43:28 -08002707 unittest.group('resource-OperationsResource', () {
Kevin Moore341348b2021-02-25 11:55:18 -08002708 unittest.test('method--get', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002709 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002710 var res = api.AndroidProvisioningPartnerApi(mock).operations;
Kevin Moored0251702021-01-15 06:41:08 -08002711 var arg_name = 'foo';
2712 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002713 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2714 var path = (req.url).path;
2715 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002716 core.int index;
2717 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002718 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002719 path.substring(pathOffset, pathOffset + 1),
2720 unittest.equals("/"),
2721 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002722 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002723 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002724 path.substring(pathOffset, pathOffset + 3),
2725 unittest.equals("v1/"),
2726 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002727 pathOffset += 3;
2728 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2729
2730 var query = (req.url).query;
2731 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002732 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002733 void addQueryParam(core.String n, core.String v) =>
2734 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002735
Kevin Moore6d21e902021-01-15 06:41:08 -08002736 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002737 for (var part in query.split('&')) {
2738 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002739 addQueryParam(
2740 core.Uri.decodeQueryComponent(keyValue[0]),
2741 core.Uri.decodeQueryComponent(keyValue[1]),
2742 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002743 }
2744 }
Kevin Moore58e22332021-02-25 10:11:41 -08002745 unittest.expect(
2746 queryMap["fields"]!.first,
2747 unittest.equals(arg_$fields),
2748 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002749
Martin Kustermannfa83e312017-07-31 12:48:45 +02002750 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002751 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002752 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002753 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08002754 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002755 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002756 final response = await res.get(arg_name, $fields: arg_$fields);
2757 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002758 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02002759 });
2760
Kevin Moore88512712021-01-28 14:43:28 -08002761 unittest.group('resource-PartnersCustomersResource', () {
Kevin Moore341348b2021-02-25 11:55:18 -08002762 unittest.test('method--create', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002763 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002764 var res = api.AndroidProvisioningPartnerApi(mock).partners.customers;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002765 var arg_request = buildCreateCustomerRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002766 var arg_parent = 'foo';
2767 var arg_$fields = 'foo';
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002768 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002769 var obj = api.CreateCustomerRequest.fromJson(
2770 json as core.Map<core.String, core.dynamic>);
2771 checkCreateCustomerRequest(obj as api.CreateCustomerRequest);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002772
2773 var path = (req.url).path;
2774 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002775 core.int index;
2776 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002777 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002778 path.substring(pathOffset, pathOffset + 1),
2779 unittest.equals("/"),
2780 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002781 pathOffset += 1;
2782 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002783 path.substring(pathOffset, pathOffset + 3),
2784 unittest.equals("v1/"),
2785 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002786 pathOffset += 3;
2787 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2788
2789 var query = (req.url).query;
2790 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002791 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002792 void addQueryParam(core.String n, core.String v) =>
2793 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002794
Kevin Moore6d21e902021-01-15 06:41:08 -08002795 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002796 for (var part in query.split('&')) {
2797 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002798 addQueryParam(
2799 core.Uri.decodeQueryComponent(keyValue[0]),
2800 core.Uri.decodeQueryComponent(keyValue[1]),
2801 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002802 }
2803 }
Kevin Moore58e22332021-02-25 10:11:41 -08002804 unittest.expect(
2805 queryMap["fields"]!.first,
2806 unittest.equals(arg_$fields),
2807 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002808
2809 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002810 'content-type': 'application/json; charset=utf-8',
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002811 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002812 var resp = convert.json.encode(buildCompany());
Kevin Moore6d21e902021-01-15 06:41:08 -08002813 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002814 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002815 final response =
2816 await res.create(arg_request, arg_parent, $fields: arg_$fields);
2817 checkCompany(response as api.Company);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002818 });
2819
Kevin Moore341348b2021-02-25 11:55:18 -08002820 unittest.test('method--list', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002821 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002822 var res = api.AndroidProvisioningPartnerApi(mock).partners.customers;
Kevin Moored0251702021-01-15 06:41:08 -08002823 var arg_partnerId = 'foo';
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02002824 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08002825 var arg_pageToken = 'foo';
2826 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002827 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2828 var path = (req.url).path;
2829 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002830 core.int index;
2831 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002832 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002833 path.substring(pathOffset, pathOffset + 1),
2834 unittest.equals("/"),
2835 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002836 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08002837 unittest.expect(
2838 path.substring(pathOffset, pathOffset + 12),
2839 unittest.equals("v1/partners/"),
2840 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002841 pathOffset += 12;
2842 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2843
2844 var query = (req.url).query;
2845 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002846 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002847 void addQueryParam(core.String n, core.String v) =>
2848 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002849
Kevin Moore6d21e902021-01-15 06:41:08 -08002850 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002851 for (var part in query.split('&')) {
2852 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002853 addQueryParam(
2854 core.Uri.decodeQueryComponent(keyValue[0]),
2855 core.Uri.decodeQueryComponent(keyValue[1]),
2856 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002857 }
2858 }
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +02002859 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002860 core.int.parse(queryMap["pageSize"]!.first),
2861 unittest.equals(arg_pageSize),
2862 );
2863 unittest.expect(
2864 queryMap["pageToken"]!.first,
2865 unittest.equals(arg_pageToken),
2866 );
2867 unittest.expect(
2868 queryMap["fields"]!.first,
2869 unittest.equals(arg_$fields),
2870 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002871
Martin Kustermannfa83e312017-07-31 12:48:45 +02002872 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002873 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002874 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002875 var resp = convert.json.encode(buildListCustomersResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002876 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002877 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002878 final response = await res.list(arg_partnerId,
2879 pageSize: arg_pageSize,
2880 pageToken: arg_pageToken,
2881 $fields: arg_$fields);
2882 checkListCustomersResponse(response as api.ListCustomersResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002883 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02002884 });
2885
Kevin Moore88512712021-01-28 14:43:28 -08002886 unittest.group('resource-PartnersDevicesResource', () {
Kevin Moore341348b2021-02-25 11:55:18 -08002887 unittest.test('method--claim', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002888 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002889 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002890 var arg_request = buildClaimDeviceRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002891 var arg_partnerId = 'foo';
2892 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002893 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002894 var obj = api.ClaimDeviceRequest.fromJson(
2895 json as core.Map<core.String, core.dynamic>);
2896 checkClaimDeviceRequest(obj as api.ClaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002897
2898 var path = (req.url).path;
2899 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002900 core.int index;
2901 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002902 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002903 path.substring(pathOffset, pathOffset + 1),
2904 unittest.equals("/"),
2905 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002906 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08002907 unittest.expect(
2908 path.substring(pathOffset, pathOffset + 12),
2909 unittest.equals("v1/partners/"),
2910 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002911 pathOffset += 12;
2912 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2913
2914 var query = (req.url).query;
2915 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002916 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002917 void addQueryParam(core.String n, core.String v) =>
2918 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002919
Kevin Moore6d21e902021-01-15 06:41:08 -08002920 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002921 for (var part in query.split('&')) {
2922 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002923 addQueryParam(
2924 core.Uri.decodeQueryComponent(keyValue[0]),
2925 core.Uri.decodeQueryComponent(keyValue[1]),
2926 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002927 }
2928 }
Kevin Moore58e22332021-02-25 10:11:41 -08002929 unittest.expect(
2930 queryMap["fields"]!.first,
2931 unittest.equals(arg_$fields),
2932 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002933
Martin Kustermannfa83e312017-07-31 12:48:45 +02002934 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002935 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002936 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002937 var resp = convert.json.encode(buildClaimDeviceResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002938 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002939 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002940 final response =
2941 await res.claim(arg_request, arg_partnerId, $fields: arg_$fields);
2942 checkClaimDeviceResponse(response as api.ClaimDeviceResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002943 });
2944
Kevin Moore341348b2021-02-25 11:55:18 -08002945 unittest.test('method--claimAsync', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08002946 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002947 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002948 var arg_request = buildClaimDevicesRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002949 var arg_partnerId = 'foo';
2950 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002951 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002952 var obj = api.ClaimDevicesRequest.fromJson(
2953 json as core.Map<core.String, core.dynamic>);
2954 checkClaimDevicesRequest(obj as api.ClaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002955
2956 var path = (req.url).path;
2957 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002958 core.int index;
2959 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002960 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08002961 path.substring(pathOffset, pathOffset + 1),
2962 unittest.equals("/"),
2963 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002964 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08002965 unittest.expect(
2966 path.substring(pathOffset, pathOffset + 12),
2967 unittest.equals("v1/partners/"),
2968 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002969 pathOffset += 12;
2970 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2971
2972 var query = (req.url).query;
2973 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002974 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002975 void addQueryParam(core.String n, core.String v) =>
2976 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002977
Kevin Moore6d21e902021-01-15 06:41:08 -08002978 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002979 for (var part in query.split('&')) {
2980 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002981 addQueryParam(
2982 core.Uri.decodeQueryComponent(keyValue[0]),
2983 core.Uri.decodeQueryComponent(keyValue[1]),
2984 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002985 }
2986 }
Kevin Moore58e22332021-02-25 10:11:41 -08002987 unittest.expect(
2988 queryMap["fields"]!.first,
2989 unittest.equals(arg_$fields),
2990 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002991
Martin Kustermannfa83e312017-07-31 12:48:45 +02002992 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002993 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002994 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002995 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08002996 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002997 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08002998 final response = await res.claimAsync(arg_request, arg_partnerId,
2999 $fields: arg_$fields);
3000 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003001 });
3002
Kevin Moore341348b2021-02-25 11:55:18 -08003003 unittest.test('method--findByIdentifier', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08003004 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003005 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003006 var arg_request = buildFindDevicesByDeviceIdentifierRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003007 var arg_partnerId = 'foo';
3008 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003009 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003010 var obj = api.FindDevicesByDeviceIdentifierRequest.fromJson(
3011 json as core.Map<core.String, core.dynamic>);
3012 checkFindDevicesByDeviceIdentifierRequest(
3013 obj as api.FindDevicesByDeviceIdentifierRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003014
3015 var path = (req.url).path;
3016 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003017 core.int index;
3018 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003019 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003020 path.substring(pathOffset, pathOffset + 1),
3021 unittest.equals("/"),
3022 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003023 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003024 unittest.expect(
3025 path.substring(pathOffset, pathOffset + 12),
3026 unittest.equals("v1/partners/"),
3027 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003028 pathOffset += 12;
3029 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3030
3031 var query = (req.url).query;
3032 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003033 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003034 void addQueryParam(core.String n, core.String v) =>
3035 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003036
Kevin Moore6d21e902021-01-15 06:41:08 -08003037 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003038 for (var part in query.split('&')) {
3039 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003040 addQueryParam(
3041 core.Uri.decodeQueryComponent(keyValue[0]),
3042 core.Uri.decodeQueryComponent(keyValue[1]),
3043 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003044 }
3045 }
Kevin Moore58e22332021-02-25 10:11:41 -08003046 unittest.expect(
3047 queryMap["fields"]!.first,
3048 unittest.equals(arg_$fields),
3049 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003050
Martin Kustermannfa83e312017-07-31 12:48:45 +02003051 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003052 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003053 };
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003054 var resp =
Jakob Andersen52715df2018-05-01 13:58:48 +02003055 convert.json.encode(buildFindDevicesByDeviceIdentifierResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08003056 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003057 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08003058 final response = await res.findByIdentifier(arg_request, arg_partnerId,
3059 $fields: arg_$fields);
3060 checkFindDevicesByDeviceIdentifierResponse(
3061 response as api.FindDevicesByDeviceIdentifierResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003062 });
3063
Kevin Moore341348b2021-02-25 11:55:18 -08003064 unittest.test('method--findByOwner', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08003065 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003066 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003067 var arg_request = buildFindDevicesByOwnerRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003068 var arg_partnerId = 'foo';
3069 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003070 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003071 var obj = api.FindDevicesByOwnerRequest.fromJson(
3072 json as core.Map<core.String, core.dynamic>);
3073 checkFindDevicesByOwnerRequest(obj as api.FindDevicesByOwnerRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003074
3075 var path = (req.url).path;
3076 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003077 core.int index;
3078 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003079 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003080 path.substring(pathOffset, pathOffset + 1),
3081 unittest.equals("/"),
3082 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003083 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003084 unittest.expect(
3085 path.substring(pathOffset, pathOffset + 12),
3086 unittest.equals("v1/partners/"),
3087 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003088 pathOffset += 12;
3089 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3090
3091 var query = (req.url).query;
3092 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003093 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003094 void addQueryParam(core.String n, core.String v) =>
3095 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003096
Kevin Moore6d21e902021-01-15 06:41:08 -08003097 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003098 for (var part in query.split('&')) {
3099 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003100 addQueryParam(
3101 core.Uri.decodeQueryComponent(keyValue[0]),
3102 core.Uri.decodeQueryComponent(keyValue[1]),
3103 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003104 }
3105 }
Kevin Moore58e22332021-02-25 10:11:41 -08003106 unittest.expect(
3107 queryMap["fields"]!.first,
3108 unittest.equals(arg_$fields),
3109 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003110
Martin Kustermannfa83e312017-07-31 12:48:45 +02003111 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003112 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003113 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003114 var resp = convert.json.encode(buildFindDevicesByOwnerResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08003115 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003116 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08003117 final response = await res.findByOwner(arg_request, arg_partnerId,
3118 $fields: arg_$fields);
3119 checkFindDevicesByOwnerResponse(
3120 response as api.FindDevicesByOwnerResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003121 });
3122
Kevin Moore341348b2021-02-25 11:55:18 -08003123 unittest.test('method--get', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08003124 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003125 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Kevin Moored0251702021-01-15 06:41:08 -08003126 var arg_name = 'foo';
3127 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003128 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3129 var path = (req.url).path;
3130 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003131 core.int index;
3132 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003133 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003134 path.substring(pathOffset, pathOffset + 1),
3135 unittest.equals("/"),
3136 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003137 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003138 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003139 path.substring(pathOffset, pathOffset + 3),
3140 unittest.equals("v1/"),
3141 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003142 pathOffset += 3;
3143 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3144
3145 var query = (req.url).query;
3146 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003147 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003148 void addQueryParam(core.String n, core.String v) =>
3149 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003150
Kevin Moore6d21e902021-01-15 06:41:08 -08003151 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003152 for (var part in query.split('&')) {
3153 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003154 addQueryParam(
3155 core.Uri.decodeQueryComponent(keyValue[0]),
3156 core.Uri.decodeQueryComponent(keyValue[1]),
3157 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003158 }
3159 }
Kevin Moore58e22332021-02-25 10:11:41 -08003160 unittest.expect(
3161 queryMap["fields"]!.first,
3162 unittest.equals(arg_$fields),
3163 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003164
Martin Kustermannfa83e312017-07-31 12:48:45 +02003165 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003166 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003167 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003168 var resp = convert.json.encode(buildDevice());
Kevin Moore6d21e902021-01-15 06:41:08 -08003169 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003170 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08003171 final response = await res.get(arg_name, $fields: arg_$fields);
3172 checkDevice(response as api.Device);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003173 });
3174
Kevin Moore341348b2021-02-25 11:55:18 -08003175 unittest.test('method--metadata', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08003176 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003177 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003178 var arg_request = buildUpdateDeviceMetadataRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003179 var arg_metadataOwnerId = 'foo';
3180 var arg_deviceId = 'foo';
3181 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003182 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003183 var obj = api.UpdateDeviceMetadataRequest.fromJson(
3184 json as core.Map<core.String, core.dynamic>);
3185 checkUpdateDeviceMetadataRequest(
3186 obj as api.UpdateDeviceMetadataRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003187
3188 var path = (req.url).path;
3189 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003190 core.int index;
3191 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003192 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003193 path.substring(pathOffset, pathOffset + 1),
3194 unittest.equals("/"),
3195 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003196 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003197 unittest.expect(
3198 path.substring(pathOffset, pathOffset + 12),
3199 unittest.equals("v1/partners/"),
3200 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003201 pathOffset += 12;
3202 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3203
3204 var query = (req.url).query;
3205 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003206 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003207 void addQueryParam(core.String n, core.String v) =>
3208 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003209
Kevin Moore6d21e902021-01-15 06:41:08 -08003210 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003211 for (var part in query.split('&')) {
3212 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003213 addQueryParam(
3214 core.Uri.decodeQueryComponent(keyValue[0]),
3215 core.Uri.decodeQueryComponent(keyValue[1]),
3216 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003217 }
3218 }
Kevin Moore58e22332021-02-25 10:11:41 -08003219 unittest.expect(
3220 queryMap["fields"]!.first,
3221 unittest.equals(arg_$fields),
3222 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003223
Martin Kustermannfa83e312017-07-31 12:48:45 +02003224 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003225 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003226 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003227 var resp = convert.json.encode(buildDeviceMetadata());
Kevin Moore6d21e902021-01-15 06:41:08 -08003228 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003229 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08003230 final response = await res.metadata(
3231 arg_request, arg_metadataOwnerId, arg_deviceId,
3232 $fields: arg_$fields);
3233 checkDeviceMetadata(response as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003234 });
3235
Kevin Moore341348b2021-02-25 11:55:18 -08003236 unittest.test('method--unclaim', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08003237 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003238 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003239 var arg_request = buildUnclaimDeviceRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003240 var arg_partnerId = 'foo';
3241 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003242 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003243 var obj = api.UnclaimDeviceRequest.fromJson(
3244 json as core.Map<core.String, core.dynamic>);
3245 checkUnclaimDeviceRequest(obj as api.UnclaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003246
3247 var path = (req.url).path;
3248 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003249 core.int index;
3250 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003251 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003252 path.substring(pathOffset, pathOffset + 1),
3253 unittest.equals("/"),
3254 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003255 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003256 unittest.expect(
3257 path.substring(pathOffset, pathOffset + 12),
3258 unittest.equals("v1/partners/"),
3259 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003260 pathOffset += 12;
3261 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3262
3263 var query = (req.url).query;
3264 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003265 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003266 void addQueryParam(core.String n, core.String v) =>
3267 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003268
Kevin Moore6d21e902021-01-15 06:41:08 -08003269 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003270 for (var part in query.split('&')) {
3271 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003272 addQueryParam(
3273 core.Uri.decodeQueryComponent(keyValue[0]),
3274 core.Uri.decodeQueryComponent(keyValue[1]),
3275 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003276 }
3277 }
Kevin Moore58e22332021-02-25 10:11:41 -08003278 unittest.expect(
3279 queryMap["fields"]!.first,
3280 unittest.equals(arg_$fields),
3281 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003282
Martin Kustermannfa83e312017-07-31 12:48:45 +02003283 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003284 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003285 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003286 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08003287 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003288 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08003289 final response =
3290 await res.unclaim(arg_request, arg_partnerId, $fields: arg_$fields);
3291 checkEmpty(response as api.Empty);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003292 });
3293
Kevin Moore341348b2021-02-25 11:55:18 -08003294 unittest.test('method--unclaimAsync', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08003295 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003296 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003297 var arg_request = buildUnclaimDevicesRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003298 var arg_partnerId = 'foo';
3299 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003300 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003301 var obj = api.UnclaimDevicesRequest.fromJson(
3302 json as core.Map<core.String, core.dynamic>);
3303 checkUnclaimDevicesRequest(obj as api.UnclaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003304
3305 var path = (req.url).path;
3306 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003307 core.int index;
3308 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003309 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003310 path.substring(pathOffset, pathOffset + 1),
3311 unittest.equals("/"),
3312 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003313 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003314 unittest.expect(
3315 path.substring(pathOffset, pathOffset + 12),
3316 unittest.equals("v1/partners/"),
3317 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003318 pathOffset += 12;
3319 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3320
3321 var query = (req.url).query;
3322 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003323 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003324 void addQueryParam(core.String n, core.String v) =>
3325 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003326
Kevin Moore6d21e902021-01-15 06:41:08 -08003327 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003328 for (var part in query.split('&')) {
3329 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003330 addQueryParam(
3331 core.Uri.decodeQueryComponent(keyValue[0]),
3332 core.Uri.decodeQueryComponent(keyValue[1]),
3333 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003334 }
3335 }
Kevin Moore58e22332021-02-25 10:11:41 -08003336 unittest.expect(
3337 queryMap["fields"]!.first,
3338 unittest.equals(arg_$fields),
3339 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003340
Martin Kustermannfa83e312017-07-31 12:48:45 +02003341 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003342 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003343 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003344 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08003345 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003346 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08003347 final response = await res.unclaimAsync(arg_request, arg_partnerId,
3348 $fields: arg_$fields);
3349 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003350 });
3351
Kevin Moore341348b2021-02-25 11:55:18 -08003352 unittest.test('method--updateMetadataAsync', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08003353 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003354 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02003355 var arg_request = buildUpdateDeviceMetadataInBatchRequest();
Kevin Moored0251702021-01-15 06:41:08 -08003356 var arg_partnerId = 'foo';
3357 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02003358 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003359 var obj = api.UpdateDeviceMetadataInBatchRequest.fromJson(
3360 json as core.Map<core.String, core.dynamic>);
3361 checkUpdateDeviceMetadataInBatchRequest(
3362 obj as api.UpdateDeviceMetadataInBatchRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003363
3364 var path = (req.url).path;
3365 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003366 core.int index;
3367 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003368 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003369 path.substring(pathOffset, pathOffset + 1),
3370 unittest.equals("/"),
3371 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003372 pathOffset += 1;
Kevin Moore58e22332021-02-25 10:11:41 -08003373 unittest.expect(
3374 path.substring(pathOffset, pathOffset + 12),
3375 unittest.equals("v1/partners/"),
3376 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003377 pathOffset += 12;
3378 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3379
3380 var query = (req.url).query;
3381 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02003382 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003383 void addQueryParam(core.String n, core.String v) =>
3384 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02003385
Kevin Moore6d21e902021-01-15 06:41:08 -08003386 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003387 for (var part in query.split('&')) {
3388 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003389 addQueryParam(
3390 core.Uri.decodeQueryComponent(keyValue[0]),
3391 core.Uri.decodeQueryComponent(keyValue[1]),
3392 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003393 }
3394 }
Kevin Moore58e22332021-02-25 10:11:41 -08003395 unittest.expect(
3396 queryMap["fields"]!.first,
3397 unittest.equals(arg_$fields),
3398 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02003399
Martin Kustermannfa83e312017-07-31 12:48:45 +02003400 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003401 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02003402 };
Jakob Andersen52715df2018-05-01 13:58:48 +02003403 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08003404 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02003405 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08003406 final response = await res.updateMetadataAsync(arg_request, arg_partnerId,
3407 $fields: arg_$fields);
3408 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02003409 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02003410 });
Martin Kustermann12cdd522018-08-27 10:46:50 +02003411
Kevin Moore88512712021-01-28 14:43:28 -08003412 unittest.group('resource-PartnersVendorsResource', () {
Kevin Moore341348b2021-02-25 11:55:18 -08003413 unittest.test('method--list', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08003414 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08003415 var res = api.AndroidProvisioningPartnerApi(mock).partners.vendors;
Kevin Moored0251702021-01-15 06:41:08 -08003416 var arg_parent = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02003417 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08003418 var arg_pageToken = 'foo';
3419 var arg_$fields = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02003420 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3421 var path = (req.url).path;
3422 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003423 core.int index;
3424 core.String subPart;
Martin Kustermann12cdd522018-08-27 10:46:50 +02003425 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003426 path.substring(pathOffset, pathOffset + 1),
3427 unittest.equals("/"),
3428 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003429 pathOffset += 1;
3430 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003431 path.substring(pathOffset, pathOffset + 3),
3432 unittest.equals("v1/"),
3433 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003434 pathOffset += 3;
3435 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3436
3437 var query = (req.url).query;
3438 var queryOffset = 0;
3439 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003440 void addQueryParam(core.String n, core.String v) =>
3441 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann12cdd522018-08-27 10:46:50 +02003442
Kevin Moore6d21e902021-01-15 06:41:08 -08003443 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003444 for (var part in query.split('&')) {
3445 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003446 addQueryParam(
3447 core.Uri.decodeQueryComponent(keyValue[0]),
3448 core.Uri.decodeQueryComponent(keyValue[1]),
3449 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003450 }
3451 }
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +02003452 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003453 core.int.parse(queryMap["pageSize"]!.first),
3454 unittest.equals(arg_pageSize),
3455 );
3456 unittest.expect(
3457 queryMap["pageToken"]!.first,
3458 unittest.equals(arg_pageToken),
3459 );
3460 unittest.expect(
3461 queryMap["fields"]!.first,
3462 unittest.equals(arg_$fields),
3463 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003464
3465 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003466 'content-type': 'application/json; charset=utf-8',
Martin Kustermann12cdd522018-08-27 10:46:50 +02003467 };
3468 var resp = convert.json.encode(buildListVendorsResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08003469 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermann12cdd522018-08-27 10:46:50 +02003470 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08003471 final response = await res.list(arg_parent,
3472 pageSize: arg_pageSize,
3473 pageToken: arg_pageToken,
3474 $fields: arg_$fields);
3475 checkListVendorsResponse(response as api.ListVendorsResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02003476 });
3477 });
3478
Kevin Moore88512712021-01-28 14:43:28 -08003479 unittest.group('resource-PartnersVendorsCustomersResource', () {
Kevin Moore341348b2021-02-25 11:55:18 -08003480 unittest.test('method--list', () async {
Kevin Moore6d21e902021-01-15 06:41:08 -08003481 var mock = HttpServerMock();
Kevin Mooref1c03382021-01-22 19:48:10 -08003482 var res =
Kevin Moore5889af72021-01-28 13:31:53 -08003483 api.AndroidProvisioningPartnerApi(mock).partners.vendors.customers;
Kevin Moored0251702021-01-15 06:41:08 -08003484 var arg_parent = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02003485 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08003486 var arg_pageToken = 'foo';
3487 var arg_$fields = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02003488 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3489 var path = (req.url).path;
3490 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08003491 core.int index;
3492 core.String subPart;
Martin Kustermann12cdd522018-08-27 10:46:50 +02003493 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003494 path.substring(pathOffset, pathOffset + 1),
3495 unittest.equals("/"),
3496 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003497 pathOffset += 1;
3498 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003499 path.substring(pathOffset, pathOffset + 3),
3500 unittest.equals("v1/"),
3501 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003502 pathOffset += 3;
3503 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
3504
3505 var query = (req.url).query;
3506 var queryOffset = 0;
3507 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08003508 void addQueryParam(core.String n, core.String v) =>
3509 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann12cdd522018-08-27 10:46:50 +02003510
Kevin Moore6d21e902021-01-15 06:41:08 -08003511 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08003512 for (var part in query.split('&')) {
3513 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003514 addQueryParam(
3515 core.Uri.decodeQueryComponent(keyValue[0]),
3516 core.Uri.decodeQueryComponent(keyValue[1]),
3517 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003518 }
3519 }
Jonas Finnemann Jensenb223bd52020-10-09 13:02:08 +02003520 unittest.expect(
Kevin Moore58e22332021-02-25 10:11:41 -08003521 core.int.parse(queryMap["pageSize"]!.first),
3522 unittest.equals(arg_pageSize),
3523 );
3524 unittest.expect(
3525 queryMap["pageToken"]!.first,
3526 unittest.equals(arg_pageToken),
3527 );
3528 unittest.expect(
3529 queryMap["fields"]!.first,
3530 unittest.equals(arg_$fields),
3531 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003532
3533 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003534 'content-type': 'application/json; charset=utf-8',
Martin Kustermann12cdd522018-08-27 10:46:50 +02003535 };
3536 var resp = convert.json.encode(buildListVendorCustomersResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08003537 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermann12cdd522018-08-27 10:46:50 +02003538 }), true);
Kevin Moore341348b2021-02-25 11:55:18 -08003539 final response = await res.list(arg_parent,
3540 pageSize: arg_pageSize,
3541 pageToken: arg_pageToken,
3542 $fields: arg_$fields);
3543 checkListVendorCustomersResponse(
3544 response as api.ListVendorCustomersResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02003545 });
3546 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02003547}