blob: e1ca50c4a67e4b72fb1b657712f6f27ede1f0251 [file] [log] [blame]
Kevin Moore6d21e902021-01-15 06:41:08 -08001// ignore_for_file: camel_case_types
2// ignore_for_file: comment_references
Kevin Moore1ad61ef2021-01-22 17:52:58 -08003// ignore_for_file: file_names
Kevin Moore6d21e902021-01-15 06:41:08 -08004// ignore_for_file: library_names
5// ignore_for_file: lines_longer_than_80_chars
6// ignore_for_file: non_constant_identifier_names
Kevin Moore1ad61ef2021-01-22 17:52:58 -08007// ignore_for_file: prefer_expression_function_bodies
Kevin Moore6d21e902021-01-15 06:41:08 -08008// ignore_for_file: prefer_interpolation_to_compose_strings
Kevin Moore6d21e902021-01-15 06:41:08 -08009// ignore_for_file: unnecessary_brace_in_string_interps
10// ignore_for_file: unnecessary_cast
Kevin Moore1ad61ef2021-01-22 17:52:58 -080011// ignore_for_file: unnecessary_lambdas
Kevin Moore6d21e902021-01-15 06:41:08 -080012// ignore_for_file: unnecessary_parenthesis
13// ignore_for_file: unnecessary_string_interpolations
Kevin Moore6d21e902021-01-15 06:41:08 -080014// ignore_for_file: avoid_returning_null
15// ignore_for_file: cascade_invocations
Kevin Moorec007ffb2021-02-05 10:06:35 -080016// ignore_for_file: prefer_final_locals
Kevin Moored0251702021-01-15 06:41:08 -080017// ignore_for_file: prefer_single_quotes
Kevin Moore6d21e902021-01-15 06:41:08 -080018// ignore_for_file: unused_local_variable
19
Kevin Moore2282df32021-01-27 19:15:24 -080020import 'dart:async' as async;
21import 'dart:convert' as convert;
22import 'dart:core' as core;
Martin Kustermannfa83e312017-07-31 12:48:45 +020023
24import 'package:http/http.dart' as http;
Martin Kustermannfa83e312017-07-31 12:48:45 +020025import 'package:test/test.dart' as unittest;
Martin Kustermannfa83e312017-07-31 12:48:45 +020026import 'package:googleapis/androiddeviceprovisioning/v1.dart' as api;
27
Kevin Moore2282df32021-01-27 19:15:24 -080028import '../test_shared.dart';
Martin Kustermannfa83e312017-07-31 12:48:45 +020029
30core.int buildCounterClaimDeviceRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -080031api.ClaimDeviceRequest buildClaimDeviceRequest() {
32 var o = api.ClaimDeviceRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +020033 buildCounterClaimDeviceRequest++;
34 if (buildCounterClaimDeviceRequest < 3) {
Kevin Moored0251702021-01-15 06:41:08 -080035 o.customerId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +020036 o.deviceIdentifier = buildDeviceIdentifier();
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +010037 o.deviceMetadata = buildDeviceMetadata();
Kevin Moored0251702021-01-15 06:41:08 -080038 o.sectionType = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +020039 }
40 buildCounterClaimDeviceRequest--;
41 return o;
42}
43
Kevin Moore6d21e902021-01-15 06:41:08 -080044void checkClaimDeviceRequest(api.ClaimDeviceRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +020045 buildCounterClaimDeviceRequest++;
46 if (buildCounterClaimDeviceRequest < 3) {
47 unittest.expect(o.customerId, unittest.equals('foo'));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -080048 checkDeviceIdentifier(o.deviceIdentifier as api.DeviceIdentifier);
49 checkDeviceMetadata(o.deviceMetadata as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +020050 unittest.expect(o.sectionType, unittest.equals('foo'));
51 }
52 buildCounterClaimDeviceRequest--;
53}
54
55core.int buildCounterClaimDeviceResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -080056api.ClaimDeviceResponse buildClaimDeviceResponse() {
57 var o = api.ClaimDeviceResponse();
Martin Kustermannfa83e312017-07-31 12:48:45 +020058 buildCounterClaimDeviceResponse++;
59 if (buildCounterClaimDeviceResponse < 3) {
Kevin Moored0251702021-01-15 06:41:08 -080060 o.deviceId = 'foo';
61 o.deviceName = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +020062 }
63 buildCounterClaimDeviceResponse--;
64 return o;
65}
66
Kevin Moore6d21e902021-01-15 06:41:08 -080067void checkClaimDeviceResponse(api.ClaimDeviceResponse o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +020068 buildCounterClaimDeviceResponse++;
69 if (buildCounterClaimDeviceResponse < 3) {
70 unittest.expect(o.deviceId, unittest.equals('foo'));
71 unittest.expect(o.deviceName, unittest.equals('foo'));
72 }
73 buildCounterClaimDeviceResponse--;
74}
75
Kevin Mooreb3758bc2021-02-25 10:03:59 -080076core.List<api.PartnerClaim> buildUnnamed3656() {
Kevin Moore6d21e902021-01-15 06:41:08 -080077 var o = <api.PartnerClaim>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +020078 o.add(buildPartnerClaim());
79 o.add(buildPartnerClaim());
80 return o;
81}
82
Kevin Mooreb3758bc2021-02-25 10:03:59 -080083void checkUnnamed3656(core.List<api.PartnerClaim> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +020084 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -080085 checkPartnerClaim(o[0] as api.PartnerClaim);
86 checkPartnerClaim(o[1] as api.PartnerClaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +020087}
88
89core.int buildCounterClaimDevicesRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -080090api.ClaimDevicesRequest buildClaimDevicesRequest() {
91 var o = api.ClaimDevicesRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +020092 buildCounterClaimDevicesRequest++;
93 if (buildCounterClaimDevicesRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -080094 o.claims = buildUnnamed3656();
Martin Kustermannfa83e312017-07-31 12:48:45 +020095 }
96 buildCounterClaimDevicesRequest--;
97 return o;
98}
99
Kevin Moore6d21e902021-01-15 06:41:08 -0800100void checkClaimDevicesRequest(api.ClaimDevicesRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200101 buildCounterClaimDevicesRequest++;
102 if (buildCounterClaimDevicesRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800103 checkUnnamed3656(o.claims);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200104 }
105 buildCounterClaimDevicesRequest--;
106}
107
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800108core.List<core.String> buildUnnamed3657() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800109 var o = <core.String>[];
Kevin Moored0251702021-01-15 06:41:08 -0800110 o.add('foo');
111 o.add('foo');
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200112 return o;
113}
114
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800115void checkUnnamed3657(core.List<core.String> o) {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200116 unittest.expect(o, unittest.hasLength(2));
117 unittest.expect(o[0], unittest.equals('foo'));
118 unittest.expect(o[1], unittest.equals('foo'));
119}
120
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800121core.List<core.String> buildUnnamed3658() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800122 var o = <core.String>[];
Kevin Moored0251702021-01-15 06:41:08 -0800123 o.add('foo');
124 o.add('foo');
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200125 return o;
126}
127
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800128void checkUnnamed3658(core.List<core.String> o) {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200129 unittest.expect(o, unittest.hasLength(2));
130 unittest.expect(o[0], unittest.equals('foo'));
131 unittest.expect(o[1], unittest.equals('foo'));
132}
133
Martin Kustermannfa83e312017-07-31 12:48:45 +0200134core.int buildCounterCompany = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800135api.Company buildCompany() {
136 var o = api.Company();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200137 buildCounterCompany++;
138 if (buildCounterCompany < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800139 o.adminEmails = buildUnnamed3657();
Kevin Moored0251702021-01-15 06:41:08 -0800140 o.companyId = 'foo';
141 o.companyName = 'foo';
142 o.name = 'foo';
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800143 o.ownerEmails = buildUnnamed3658();
Kevin Moored0251702021-01-15 06:41:08 -0800144 o.termsStatus = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200145 }
146 buildCounterCompany--;
147 return o;
148}
149
Kevin Moore6d21e902021-01-15 06:41:08 -0800150void checkCompany(api.Company o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200151 buildCounterCompany++;
152 if (buildCounterCompany < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800153 checkUnnamed3657(o.adminEmails);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200154 unittest.expect(o.companyId, unittest.equals('foo'));
155 unittest.expect(o.companyName, unittest.equals('foo'));
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200156 unittest.expect(o.name, unittest.equals('foo'));
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800157 checkUnnamed3658(o.ownerEmails);
Martin Kustermann81eb88b2018-06-04 12:02:00 +0200158 unittest.expect(o.termsStatus, unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200159 }
160 buildCounterCompany--;
161}
162
Martin Kustermannf9109a82018-01-08 15:24:20 +0100163core.int buildCounterConfiguration = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800164api.Configuration buildConfiguration() {
165 var o = api.Configuration();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100166 buildCounterConfiguration++;
167 if (buildCounterConfiguration < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800168 o.companyName = 'foo';
169 o.configurationId = 'foo';
170 o.configurationName = 'foo';
171 o.contactEmail = 'foo';
172 o.contactPhone = 'foo';
173 o.customMessage = 'foo';
174 o.dpcExtras = 'foo';
175 o.dpcResourcePath = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100176 o.isDefault = true;
Kevin Moored0251702021-01-15 06:41:08 -0800177 o.name = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100178 }
179 buildCounterConfiguration--;
180 return o;
181}
182
Kevin Moore6d21e902021-01-15 06:41:08 -0800183void checkConfiguration(api.Configuration o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100184 buildCounterConfiguration++;
185 if (buildCounterConfiguration < 3) {
186 unittest.expect(o.companyName, unittest.equals('foo'));
187 unittest.expect(o.configurationId, unittest.equals('foo'));
188 unittest.expect(o.configurationName, unittest.equals('foo'));
189 unittest.expect(o.contactEmail, unittest.equals('foo'));
190 unittest.expect(o.contactPhone, unittest.equals('foo'));
191 unittest.expect(o.customMessage, unittest.equals('foo'));
192 unittest.expect(o.dpcExtras, unittest.equals('foo'));
193 unittest.expect(o.dpcResourcePath, unittest.equals('foo'));
194 unittest.expect(o.isDefault, unittest.isTrue);
195 unittest.expect(o.name, unittest.equals('foo'));
196 }
197 buildCounterConfiguration--;
198}
199
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200200core.int buildCounterCreateCustomerRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800201api.CreateCustomerRequest buildCreateCustomerRequest() {
202 var o = api.CreateCustomerRequest();
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200203 buildCounterCreateCustomerRequest++;
204 if (buildCounterCreateCustomerRequest < 3) {
205 o.customer = buildCompany();
206 }
207 buildCounterCreateCustomerRequest--;
208 return o;
209}
210
Kevin Moore6d21e902021-01-15 06:41:08 -0800211void checkCreateCustomerRequest(api.CreateCustomerRequest o) {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200212 buildCounterCreateCustomerRequest++;
213 if (buildCounterCreateCustomerRequest < 3) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800214 checkCompany(o.customer as api.Company);
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200215 }
216 buildCounterCreateCustomerRequest--;
217}
218
Martin Kustermannf9109a82018-01-08 15:24:20 +0100219core.int buildCounterCustomerApplyConfigurationRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800220api.CustomerApplyConfigurationRequest buildCustomerApplyConfigurationRequest() {
221 var o = api.CustomerApplyConfigurationRequest();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100222 buildCounterCustomerApplyConfigurationRequest++;
223 if (buildCounterCustomerApplyConfigurationRequest < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800224 o.configuration = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100225 o.device = buildDeviceReference();
226 }
227 buildCounterCustomerApplyConfigurationRequest--;
228 return o;
229}
230
Kevin Moore6d21e902021-01-15 06:41:08 -0800231void checkCustomerApplyConfigurationRequest(
Martin Kustermannf9109a82018-01-08 15:24:20 +0100232 api.CustomerApplyConfigurationRequest o) {
233 buildCounterCustomerApplyConfigurationRequest++;
234 if (buildCounterCustomerApplyConfigurationRequest < 3) {
235 unittest.expect(o.configuration, unittest.equals('foo'));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800236 checkDeviceReference(o.device as api.DeviceReference);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100237 }
238 buildCounterCustomerApplyConfigurationRequest--;
239}
240
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800241core.List<api.Configuration> buildUnnamed3659() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800242 var o = <api.Configuration>[];
Martin Kustermannf9109a82018-01-08 15:24:20 +0100243 o.add(buildConfiguration());
244 o.add(buildConfiguration());
245 return o;
246}
247
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800248void checkUnnamed3659(core.List<api.Configuration> o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100249 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800250 checkConfiguration(o[0] as api.Configuration);
251 checkConfiguration(o[1] as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100252}
253
254core.int buildCounterCustomerListConfigurationsResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800255api.CustomerListConfigurationsResponse
256 buildCustomerListConfigurationsResponse() {
257 var o = api.CustomerListConfigurationsResponse();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100258 buildCounterCustomerListConfigurationsResponse++;
259 if (buildCounterCustomerListConfigurationsResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800260 o.configurations = buildUnnamed3659();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100261 }
262 buildCounterCustomerListConfigurationsResponse--;
263 return o;
264}
265
Kevin Moore6d21e902021-01-15 06:41:08 -0800266void checkCustomerListConfigurationsResponse(
Martin Kustermannf9109a82018-01-08 15:24:20 +0100267 api.CustomerListConfigurationsResponse o) {
268 buildCounterCustomerListConfigurationsResponse++;
269 if (buildCounterCustomerListConfigurationsResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800270 checkUnnamed3659(o.configurations);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100271 }
272 buildCounterCustomerListConfigurationsResponse--;
273}
274
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800275core.List<api.Company> buildUnnamed3660() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800276 var o = <api.Company>[];
Martin Kustermannf9109a82018-01-08 15:24:20 +0100277 o.add(buildCompany());
278 o.add(buildCompany());
279 return o;
280}
281
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800282void checkUnnamed3660(core.List<api.Company> o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100283 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800284 checkCompany(o[0] as api.Company);
285 checkCompany(o[1] as api.Company);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100286}
287
288core.int buildCounterCustomerListCustomersResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800289api.CustomerListCustomersResponse buildCustomerListCustomersResponse() {
290 var o = api.CustomerListCustomersResponse();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100291 buildCounterCustomerListCustomersResponse++;
292 if (buildCounterCustomerListCustomersResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800293 o.customers = buildUnnamed3660();
Kevin Moored0251702021-01-15 06:41:08 -0800294 o.nextPageToken = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100295 }
296 buildCounterCustomerListCustomersResponse--;
297 return o;
298}
299
Kevin Moore6d21e902021-01-15 06:41:08 -0800300void checkCustomerListCustomersResponse(api.CustomerListCustomersResponse o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100301 buildCounterCustomerListCustomersResponse++;
302 if (buildCounterCustomerListCustomersResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800303 checkUnnamed3660(o.customers);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100304 unittest.expect(o.nextPageToken, unittest.equals('foo'));
305 }
306 buildCounterCustomerListCustomersResponse--;
307}
308
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800309core.List<api.Device> buildUnnamed3661() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800310 var o = <api.Device>[];
Martin Kustermannf9109a82018-01-08 15:24:20 +0100311 o.add(buildDevice());
312 o.add(buildDevice());
313 return o;
314}
315
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800316void checkUnnamed3661(core.List<api.Device> o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100317 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800318 checkDevice(o[0] as api.Device);
319 checkDevice(o[1] as api.Device);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100320}
321
322core.int buildCounterCustomerListDevicesResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800323api.CustomerListDevicesResponse buildCustomerListDevicesResponse() {
324 var o = api.CustomerListDevicesResponse();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100325 buildCounterCustomerListDevicesResponse++;
326 if (buildCounterCustomerListDevicesResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800327 o.devices = buildUnnamed3661();
Kevin Moored0251702021-01-15 06:41:08 -0800328 o.nextPageToken = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100329 }
330 buildCounterCustomerListDevicesResponse--;
331 return o;
332}
333
Kevin Moore6d21e902021-01-15 06:41:08 -0800334void checkCustomerListDevicesResponse(api.CustomerListDevicesResponse o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100335 buildCounterCustomerListDevicesResponse++;
336 if (buildCounterCustomerListDevicesResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800337 checkUnnamed3661(o.devices);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100338 unittest.expect(o.nextPageToken, unittest.equals('foo'));
339 }
340 buildCounterCustomerListDevicesResponse--;
341}
342
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800343core.List<api.Dpc> buildUnnamed3662() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800344 var o = <api.Dpc>[];
Martin Kustermannf9109a82018-01-08 15:24:20 +0100345 o.add(buildDpc());
346 o.add(buildDpc());
347 return o;
348}
349
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800350void checkUnnamed3662(core.List<api.Dpc> o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100351 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800352 checkDpc(o[0] as api.Dpc);
353 checkDpc(o[1] as api.Dpc);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100354}
355
356core.int buildCounterCustomerListDpcsResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800357api.CustomerListDpcsResponse buildCustomerListDpcsResponse() {
358 var o = api.CustomerListDpcsResponse();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100359 buildCounterCustomerListDpcsResponse++;
360 if (buildCounterCustomerListDpcsResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800361 o.dpcs = buildUnnamed3662();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100362 }
363 buildCounterCustomerListDpcsResponse--;
364 return o;
365}
366
Kevin Moore6d21e902021-01-15 06:41:08 -0800367void checkCustomerListDpcsResponse(api.CustomerListDpcsResponse o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100368 buildCounterCustomerListDpcsResponse++;
369 if (buildCounterCustomerListDpcsResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800370 checkUnnamed3662(o.dpcs);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100371 }
372 buildCounterCustomerListDpcsResponse--;
373}
374
375core.int buildCounterCustomerRemoveConfigurationRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800376api.CustomerRemoveConfigurationRequest
377 buildCustomerRemoveConfigurationRequest() {
378 var o = api.CustomerRemoveConfigurationRequest();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100379 buildCounterCustomerRemoveConfigurationRequest++;
380 if (buildCounterCustomerRemoveConfigurationRequest < 3) {
381 o.device = buildDeviceReference();
382 }
383 buildCounterCustomerRemoveConfigurationRequest--;
384 return o;
385}
386
Kevin Moore6d21e902021-01-15 06:41:08 -0800387void checkCustomerRemoveConfigurationRequest(
Martin Kustermannf9109a82018-01-08 15:24:20 +0100388 api.CustomerRemoveConfigurationRequest o) {
389 buildCounterCustomerRemoveConfigurationRequest++;
390 if (buildCounterCustomerRemoveConfigurationRequest < 3) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800391 checkDeviceReference(o.device as api.DeviceReference);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100392 }
393 buildCounterCustomerRemoveConfigurationRequest--;
394}
395
396core.int buildCounterCustomerUnclaimDeviceRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800397api.CustomerUnclaimDeviceRequest buildCustomerUnclaimDeviceRequest() {
398 var o = api.CustomerUnclaimDeviceRequest();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100399 buildCounterCustomerUnclaimDeviceRequest++;
400 if (buildCounterCustomerUnclaimDeviceRequest < 3) {
401 o.device = buildDeviceReference();
402 }
403 buildCounterCustomerUnclaimDeviceRequest--;
404 return o;
405}
406
Kevin Moore6d21e902021-01-15 06:41:08 -0800407void checkCustomerUnclaimDeviceRequest(api.CustomerUnclaimDeviceRequest o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100408 buildCounterCustomerUnclaimDeviceRequest++;
409 if (buildCounterCustomerUnclaimDeviceRequest < 3) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800410 checkDeviceReference(o.device as api.DeviceReference);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100411 }
412 buildCounterCustomerUnclaimDeviceRequest--;
413}
414
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800415core.List<api.DeviceClaim> buildUnnamed3663() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800416 var o = <api.DeviceClaim>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +0200417 o.add(buildDeviceClaim());
418 o.add(buildDeviceClaim());
419 return o;
420}
421
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800422void checkUnnamed3663(core.List<api.DeviceClaim> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200423 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800424 checkDeviceClaim(o[0] as api.DeviceClaim);
425 checkDeviceClaim(o[1] as api.DeviceClaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200426}
427
428core.int buildCounterDevice = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800429api.Device buildDevice() {
430 var o = api.Device();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200431 buildCounterDevice++;
432 if (buildCounterDevice < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800433 o.claims = buildUnnamed3663();
Kevin Moored0251702021-01-15 06:41:08 -0800434 o.configuration = 'foo';
435 o.deviceId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200436 o.deviceIdentifier = buildDeviceIdentifier();
437 o.deviceMetadata = buildDeviceMetadata();
Kevin Moored0251702021-01-15 06:41:08 -0800438 o.name = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200439 }
440 buildCounterDevice--;
441 return o;
442}
443
Kevin Moore6d21e902021-01-15 06:41:08 -0800444void checkDevice(api.Device o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200445 buildCounterDevice++;
446 if (buildCounterDevice < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800447 checkUnnamed3663(o.claims);
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200448 unittest.expect(o.configuration, unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200449 unittest.expect(o.deviceId, unittest.equals('foo'));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800450 checkDeviceIdentifier(o.deviceIdentifier as api.DeviceIdentifier);
451 checkDeviceMetadata(o.deviceMetadata as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200452 unittest.expect(o.name, unittest.equals('foo'));
453 }
454 buildCounterDevice--;
455}
456
457core.int buildCounterDeviceClaim = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800458api.DeviceClaim buildDeviceClaim() {
459 var o = api.DeviceClaim();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200460 buildCounterDeviceClaim++;
461 if (buildCounterDeviceClaim < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800462 o.ownerCompanyId = 'foo';
463 o.resellerId = 'foo';
464 o.sectionType = 'foo';
465 o.vacationModeExpireTime = 'foo';
466 o.vacationModeStartTime = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200467 }
468 buildCounterDeviceClaim--;
469 return o;
470}
471
Kevin Moore6d21e902021-01-15 06:41:08 -0800472void checkDeviceClaim(api.DeviceClaim o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200473 buildCounterDeviceClaim++;
474 if (buildCounterDeviceClaim < 3) {
475 unittest.expect(o.ownerCompanyId, unittest.equals('foo'));
Martin Kustermann12cdd522018-08-27 10:46:50 +0200476 unittest.expect(o.resellerId, unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200477 unittest.expect(o.sectionType, unittest.equals('foo'));
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +0200478 unittest.expect(o.vacationModeExpireTime, unittest.equals('foo'));
479 unittest.expect(o.vacationModeStartTime, unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200480 }
481 buildCounterDeviceClaim--;
482}
483
484core.int buildCounterDeviceIdentifier = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800485api.DeviceIdentifier buildDeviceIdentifier() {
486 var o = api.DeviceIdentifier();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200487 buildCounterDeviceIdentifier++;
488 if (buildCounterDeviceIdentifier < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800489 o.imei = 'foo';
490 o.manufacturer = 'foo';
491 o.meid = 'foo';
492 o.model = 'foo';
493 o.serialNumber = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200494 }
495 buildCounterDeviceIdentifier--;
496 return o;
497}
498
Kevin Moore6d21e902021-01-15 06:41:08 -0800499void checkDeviceIdentifier(api.DeviceIdentifier o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200500 buildCounterDeviceIdentifier++;
501 if (buildCounterDeviceIdentifier < 3) {
502 unittest.expect(o.imei, unittest.equals('foo'));
503 unittest.expect(o.manufacturer, unittest.equals('foo'));
504 unittest.expect(o.meid, unittest.equals('foo'));
Martin Kustermann12cdd522018-08-27 10:46:50 +0200505 unittest.expect(o.model, unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200506 unittest.expect(o.serialNumber, unittest.equals('foo'));
507 }
508 buildCounterDeviceIdentifier--;
509}
510
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800511core.Map<core.String, core.String> buildUnnamed3664() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800512 var o = <core.String, core.String>{};
Kevin Moored0251702021-01-15 06:41:08 -0800513 o['x'] = 'foo';
514 o['y'] = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200515 return o;
516}
517
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800518void checkUnnamed3664(core.Map<core.String, core.String> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200519 unittest.expect(o, unittest.hasLength(2));
Kevin Moored0251702021-01-15 06:41:08 -0800520 unittest.expect(o['x'], unittest.equals('foo'));
521 unittest.expect(o['y'], unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200522}
523
524core.int buildCounterDeviceMetadata = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800525api.DeviceMetadata buildDeviceMetadata() {
526 var o = api.DeviceMetadata();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200527 buildCounterDeviceMetadata++;
528 if (buildCounterDeviceMetadata < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800529 o.entries = buildUnnamed3664();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200530 }
531 buildCounterDeviceMetadata--;
532 return o;
533}
534
Kevin Moore6d21e902021-01-15 06:41:08 -0800535void checkDeviceMetadata(api.DeviceMetadata o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200536 buildCounterDeviceMetadata++;
537 if (buildCounterDeviceMetadata < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800538 checkUnnamed3664(o.entries);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200539 }
540 buildCounterDeviceMetadata--;
541}
542
Martin Kustermannf9109a82018-01-08 15:24:20 +0100543core.int buildCounterDeviceReference = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800544api.DeviceReference buildDeviceReference() {
545 var o = api.DeviceReference();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100546 buildCounterDeviceReference++;
547 if (buildCounterDeviceReference < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800548 o.deviceId = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100549 o.deviceIdentifier = buildDeviceIdentifier();
550 }
551 buildCounterDeviceReference--;
552 return o;
553}
554
Kevin Moore6d21e902021-01-15 06:41:08 -0800555void checkDeviceReference(api.DeviceReference o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100556 buildCounterDeviceReference++;
557 if (buildCounterDeviceReference < 3) {
558 unittest.expect(o.deviceId, unittest.equals('foo'));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800559 checkDeviceIdentifier(o.deviceIdentifier as api.DeviceIdentifier);
Martin Kustermannf9109a82018-01-08 15:24:20 +0100560 }
561 buildCounterDeviceReference--;
562}
563
Martin Kustermannfa83e312017-07-31 12:48:45 +0200564core.int buildCounterDevicesLongRunningOperationMetadata = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800565api.DevicesLongRunningOperationMetadata
566 buildDevicesLongRunningOperationMetadata() {
567 var o = api.DevicesLongRunningOperationMetadata();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200568 buildCounterDevicesLongRunningOperationMetadata++;
569 if (buildCounterDevicesLongRunningOperationMetadata < 3) {
570 o.devicesCount = 42;
Kevin Moored0251702021-01-15 06:41:08 -0800571 o.processingStatus = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200572 o.progress = 42;
573 }
574 buildCounterDevicesLongRunningOperationMetadata--;
575 return o;
576}
577
Kevin Moore6d21e902021-01-15 06:41:08 -0800578void checkDevicesLongRunningOperationMetadata(
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200579 api.DevicesLongRunningOperationMetadata o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200580 buildCounterDevicesLongRunningOperationMetadata++;
581 if (buildCounterDevicesLongRunningOperationMetadata < 3) {
582 unittest.expect(o.devicesCount, unittest.equals(42));
583 unittest.expect(o.processingStatus, unittest.equals('foo'));
584 unittest.expect(o.progress, unittest.equals(42));
585 }
586 buildCounterDevicesLongRunningOperationMetadata--;
587}
588
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800589core.List<api.OperationPerDevice> buildUnnamed3665() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800590 var o = <api.OperationPerDevice>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +0200591 o.add(buildOperationPerDevice());
592 o.add(buildOperationPerDevice());
593 return o;
594}
595
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800596void checkUnnamed3665(core.List<api.OperationPerDevice> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200597 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800598 checkOperationPerDevice(o[0] as api.OperationPerDevice);
599 checkOperationPerDevice(o[1] as api.OperationPerDevice);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200600}
601
602core.int buildCounterDevicesLongRunningOperationResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800603api.DevicesLongRunningOperationResponse
604 buildDevicesLongRunningOperationResponse() {
605 var o = api.DevicesLongRunningOperationResponse();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200606 buildCounterDevicesLongRunningOperationResponse++;
607 if (buildCounterDevicesLongRunningOperationResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800608 o.perDeviceStatus = buildUnnamed3665();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200609 o.successCount = 42;
610 }
611 buildCounterDevicesLongRunningOperationResponse--;
612 return o;
613}
614
Kevin Moore6d21e902021-01-15 06:41:08 -0800615void checkDevicesLongRunningOperationResponse(
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200616 api.DevicesLongRunningOperationResponse o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200617 buildCounterDevicesLongRunningOperationResponse++;
618 if (buildCounterDevicesLongRunningOperationResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800619 checkUnnamed3665(o.perDeviceStatus);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200620 unittest.expect(o.successCount, unittest.equals(42));
621 }
622 buildCounterDevicesLongRunningOperationResponse--;
623}
624
Martin Kustermannf9109a82018-01-08 15:24:20 +0100625core.int buildCounterDpc = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800626api.Dpc buildDpc() {
627 var o = api.Dpc();
Martin Kustermannf9109a82018-01-08 15:24:20 +0100628 buildCounterDpc++;
629 if (buildCounterDpc < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800630 o.dpcName = 'foo';
631 o.name = 'foo';
632 o.packageName = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +0100633 }
634 buildCounterDpc--;
635 return o;
636}
637
Kevin Moore6d21e902021-01-15 06:41:08 -0800638void checkDpc(api.Dpc o) {
Martin Kustermannf9109a82018-01-08 15:24:20 +0100639 buildCounterDpc++;
640 if (buildCounterDpc < 3) {
641 unittest.expect(o.dpcName, unittest.equals('foo'));
642 unittest.expect(o.name, unittest.equals('foo'));
643 unittest.expect(o.packageName, unittest.equals('foo'));
644 }
645 buildCounterDpc--;
646}
647
Martin Kustermannfa83e312017-07-31 12:48:45 +0200648core.int buildCounterEmpty = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800649api.Empty buildEmpty() {
650 var o = api.Empty();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200651 buildCounterEmpty++;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200652 if (buildCounterEmpty < 3) {}
Martin Kustermannfa83e312017-07-31 12:48:45 +0200653 buildCounterEmpty--;
654 return o;
655}
656
Kevin Moore6d21e902021-01-15 06:41:08 -0800657void checkEmpty(api.Empty o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200658 buildCounterEmpty++;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200659 if (buildCounterEmpty < 3) {}
Martin Kustermannfa83e312017-07-31 12:48:45 +0200660 buildCounterEmpty--;
661}
662
663core.int buildCounterFindDevicesByDeviceIdentifierRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800664api.FindDevicesByDeviceIdentifierRequest
665 buildFindDevicesByDeviceIdentifierRequest() {
666 var o = api.FindDevicesByDeviceIdentifierRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200667 buildCounterFindDevicesByDeviceIdentifierRequest++;
668 if (buildCounterFindDevicesByDeviceIdentifierRequest < 3) {
669 o.deviceIdentifier = buildDeviceIdentifier();
Kevin Moored0251702021-01-15 06:41:08 -0800670 o.limit = 'foo';
671 o.pageToken = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200672 }
673 buildCounterFindDevicesByDeviceIdentifierRequest--;
674 return o;
675}
676
Kevin Moore6d21e902021-01-15 06:41:08 -0800677void checkFindDevicesByDeviceIdentifierRequest(
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200678 api.FindDevicesByDeviceIdentifierRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200679 buildCounterFindDevicesByDeviceIdentifierRequest++;
680 if (buildCounterFindDevicesByDeviceIdentifierRequest < 3) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800681 checkDeviceIdentifier(o.deviceIdentifier as api.DeviceIdentifier);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200682 unittest.expect(o.limit, unittest.equals('foo'));
683 unittest.expect(o.pageToken, unittest.equals('foo'));
684 }
685 buildCounterFindDevicesByDeviceIdentifierRequest--;
686}
687
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800688core.List<api.Device> buildUnnamed3666() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800689 var o = <api.Device>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +0200690 o.add(buildDevice());
691 o.add(buildDevice());
692 return o;
693}
694
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800695void checkUnnamed3666(core.List<api.Device> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200696 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800697 checkDevice(o[0] as api.Device);
698 checkDevice(o[1] as api.Device);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200699}
700
701core.int buildCounterFindDevicesByDeviceIdentifierResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800702api.FindDevicesByDeviceIdentifierResponse
703 buildFindDevicesByDeviceIdentifierResponse() {
704 var o = api.FindDevicesByDeviceIdentifierResponse();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200705 buildCounterFindDevicesByDeviceIdentifierResponse++;
706 if (buildCounterFindDevicesByDeviceIdentifierResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800707 o.devices = buildUnnamed3666();
Kevin Moored0251702021-01-15 06:41:08 -0800708 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100709 o.totalSize = 42;
Martin Kustermannfa83e312017-07-31 12:48:45 +0200710 }
711 buildCounterFindDevicesByDeviceIdentifierResponse--;
712 return o;
713}
714
Kevin Moore6d21e902021-01-15 06:41:08 -0800715void checkFindDevicesByDeviceIdentifierResponse(
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200716 api.FindDevicesByDeviceIdentifierResponse o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200717 buildCounterFindDevicesByDeviceIdentifierResponse++;
718 if (buildCounterFindDevicesByDeviceIdentifierResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800719 checkUnnamed3666(o.devices);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200720 unittest.expect(o.nextPageToken, unittest.equals('foo'));
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100721 unittest.expect(o.totalSize, unittest.equals(42));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200722 }
723 buildCounterFindDevicesByDeviceIdentifierResponse--;
724}
725
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800726core.List<core.String> buildUnnamed3667() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800727 var o = <core.String>[];
Kevin Moored0251702021-01-15 06:41:08 -0800728 o.add('foo');
729 o.add('foo');
Martin Kustermannfa83e312017-07-31 12:48:45 +0200730 return o;
731}
732
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800733void checkUnnamed3667(core.List<core.String> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200734 unittest.expect(o, unittest.hasLength(2));
735 unittest.expect(o[0], unittest.equals('foo'));
736 unittest.expect(o[1], unittest.equals('foo'));
737}
738
739core.int buildCounterFindDevicesByOwnerRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800740api.FindDevicesByOwnerRequest buildFindDevicesByOwnerRequest() {
741 var o = api.FindDevicesByOwnerRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200742 buildCounterFindDevicesByOwnerRequest++;
743 if (buildCounterFindDevicesByOwnerRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800744 o.customerId = buildUnnamed3667();
Kevin Moored0251702021-01-15 06:41:08 -0800745 o.limit = 'foo';
746 o.pageToken = 'foo';
747 o.sectionType = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +0200748 }
749 buildCounterFindDevicesByOwnerRequest--;
750 return o;
751}
752
Kevin Moore6d21e902021-01-15 06:41:08 -0800753void checkFindDevicesByOwnerRequest(api.FindDevicesByOwnerRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200754 buildCounterFindDevicesByOwnerRequest++;
755 if (buildCounterFindDevicesByOwnerRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800756 checkUnnamed3667(o.customerId);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200757 unittest.expect(o.limit, unittest.equals('foo'));
758 unittest.expect(o.pageToken, unittest.equals('foo'));
759 unittest.expect(o.sectionType, unittest.equals('foo'));
760 }
761 buildCounterFindDevicesByOwnerRequest--;
762}
763
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800764core.List<api.Device> buildUnnamed3668() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800765 var o = <api.Device>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +0200766 o.add(buildDevice());
767 o.add(buildDevice());
768 return o;
769}
770
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800771void checkUnnamed3668(core.List<api.Device> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200772 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800773 checkDevice(o[0] as api.Device);
774 checkDevice(o[1] as api.Device);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200775}
776
777core.int buildCounterFindDevicesByOwnerResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800778api.FindDevicesByOwnerResponse buildFindDevicesByOwnerResponse() {
779 var o = api.FindDevicesByOwnerResponse();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200780 buildCounterFindDevicesByOwnerResponse++;
781 if (buildCounterFindDevicesByOwnerResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800782 o.devices = buildUnnamed3668();
Kevin Moored0251702021-01-15 06:41:08 -0800783 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100784 o.totalSize = 42;
Martin Kustermannfa83e312017-07-31 12:48:45 +0200785 }
786 buildCounterFindDevicesByOwnerResponse--;
787 return o;
788}
789
Kevin Moore6d21e902021-01-15 06:41:08 -0800790void checkFindDevicesByOwnerResponse(api.FindDevicesByOwnerResponse o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200791 buildCounterFindDevicesByOwnerResponse++;
792 if (buildCounterFindDevicesByOwnerResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800793 checkUnnamed3668(o.devices);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200794 unittest.expect(o.nextPageToken, unittest.equals('foo'));
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100795 unittest.expect(o.totalSize, unittest.equals(42));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200796 }
797 buildCounterFindDevicesByOwnerResponse--;
798}
799
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800800core.List<api.Company> buildUnnamed3669() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800801 var o = <api.Company>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +0200802 o.add(buildCompany());
803 o.add(buildCompany());
804 return o;
805}
806
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800807void checkUnnamed3669(core.List<api.Company> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200808 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800809 checkCompany(o[0] as api.Company);
810 checkCompany(o[1] as api.Company);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200811}
812
813core.int buildCounterListCustomersResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800814api.ListCustomersResponse buildListCustomersResponse() {
815 var o = api.ListCustomersResponse();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200816 buildCounterListCustomersResponse++;
817 if (buildCounterListCustomersResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800818 o.customers = buildUnnamed3669();
Kevin Moored0251702021-01-15 06:41:08 -0800819 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100820 o.totalSize = 42;
Martin Kustermannfa83e312017-07-31 12:48:45 +0200821 }
822 buildCounterListCustomersResponse--;
823 return o;
824}
825
Kevin Moore6d21e902021-01-15 06:41:08 -0800826void checkListCustomersResponse(api.ListCustomersResponse o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200827 buildCounterListCustomersResponse++;
828 if (buildCounterListCustomersResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800829 checkUnnamed3669(o.customers);
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100830 unittest.expect(o.nextPageToken, unittest.equals('foo'));
831 unittest.expect(o.totalSize, unittest.equals(42));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200832 }
833 buildCounterListCustomersResponse--;
834}
835
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800836core.List<api.Company> buildUnnamed3670() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800837 var o = <api.Company>[];
Martin Kustermann12cdd522018-08-27 10:46:50 +0200838 o.add(buildCompany());
839 o.add(buildCompany());
840 return o;
841}
842
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800843void checkUnnamed3670(core.List<api.Company> o) {
Martin Kustermann12cdd522018-08-27 10:46:50 +0200844 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800845 checkCompany(o[0] as api.Company);
846 checkCompany(o[1] as api.Company);
Martin Kustermann12cdd522018-08-27 10:46:50 +0200847}
848
849core.int buildCounterListVendorCustomersResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800850api.ListVendorCustomersResponse buildListVendorCustomersResponse() {
851 var o = api.ListVendorCustomersResponse();
Martin Kustermann12cdd522018-08-27 10:46:50 +0200852 buildCounterListVendorCustomersResponse++;
853 if (buildCounterListVendorCustomersResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800854 o.customers = buildUnnamed3670();
Kevin Moored0251702021-01-15 06:41:08 -0800855 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100856 o.totalSize = 42;
Martin Kustermann12cdd522018-08-27 10:46:50 +0200857 }
858 buildCounterListVendorCustomersResponse--;
859 return o;
860}
861
Kevin Moore6d21e902021-01-15 06:41:08 -0800862void checkListVendorCustomersResponse(api.ListVendorCustomersResponse o) {
Martin Kustermann12cdd522018-08-27 10:46:50 +0200863 buildCounterListVendorCustomersResponse++;
864 if (buildCounterListVendorCustomersResponse < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800865 checkUnnamed3670(o.customers);
Martin Kustermann12cdd522018-08-27 10:46:50 +0200866 unittest.expect(o.nextPageToken, unittest.equals('foo'));
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100867 unittest.expect(o.totalSize, unittest.equals(42));
Martin Kustermann12cdd522018-08-27 10:46:50 +0200868 }
869 buildCounterListVendorCustomersResponse--;
870}
871
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800872core.List<api.Company> buildUnnamed3671() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800873 var o = <api.Company>[];
Martin Kustermann12cdd522018-08-27 10:46:50 +0200874 o.add(buildCompany());
875 o.add(buildCompany());
876 return o;
877}
878
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800879void checkUnnamed3671(core.List<api.Company> o) {
Martin Kustermann12cdd522018-08-27 10:46:50 +0200880 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800881 checkCompany(o[0] as api.Company);
882 checkCompany(o[1] as api.Company);
Martin Kustermann12cdd522018-08-27 10:46:50 +0200883}
884
885core.int buildCounterListVendorsResponse = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800886api.ListVendorsResponse buildListVendorsResponse() {
887 var o = api.ListVendorsResponse();
Martin Kustermann12cdd522018-08-27 10:46:50 +0200888 buildCounterListVendorsResponse++;
889 if (buildCounterListVendorsResponse < 3) {
Kevin Moored0251702021-01-15 06:41:08 -0800890 o.nextPageToken = 'foo';
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100891 o.totalSize = 42;
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800892 o.vendors = buildUnnamed3671();
Martin Kustermann12cdd522018-08-27 10:46:50 +0200893 }
894 buildCounterListVendorsResponse--;
895 return o;
896}
897
Kevin Moore6d21e902021-01-15 06:41:08 -0800898void checkListVendorsResponse(api.ListVendorsResponse o) {
Martin Kustermann12cdd522018-08-27 10:46:50 +0200899 buildCounterListVendorsResponse++;
900 if (buildCounterListVendorsResponse < 3) {
901 unittest.expect(o.nextPageToken, unittest.equals('foo'));
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +0100902 unittest.expect(o.totalSize, unittest.equals(42));
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800903 checkUnnamed3671(o.vendors);
Martin Kustermann12cdd522018-08-27 10:46:50 +0200904 }
905 buildCounterListVendorsResponse--;
906}
907
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800908core.Map<core.String, core.Object> buildUnnamed3672() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800909 var o = <core.String, core.Object>{};
Kevin Moored0251702021-01-15 06:41:08 -0800910 o['x'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200911 'list': [1, 2, 3],
912 'bool': true,
913 'string': 'foo'
914 };
Kevin Moored0251702021-01-15 06:41:08 -0800915 o['y'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200916 'list': [1, 2, 3],
917 'bool': true,
918 'string': 'foo'
919 };
Martin Kustermannfa83e312017-07-31 12:48:45 +0200920 return o;
921}
922
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800923void checkUnnamed3672(core.Map<core.String, core.Object> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200924 unittest.expect(o, unittest.hasLength(2));
Kevin Moored0251702021-01-15 06:41:08 -0800925 var casted1 = (o['x']) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200926 unittest.expect(casted1, unittest.hasLength(3));
Kevin Moored0251702021-01-15 06:41:08 -0800927 unittest.expect(casted1['list'], unittest.equals([1, 2, 3]));
928 unittest.expect(casted1['bool'], unittest.equals(true));
929 unittest.expect(casted1['string'], unittest.equals('foo'));
930 var casted2 = (o['y']) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200931 unittest.expect(casted2, unittest.hasLength(3));
Kevin Moored0251702021-01-15 06:41:08 -0800932 unittest.expect(casted2['list'], unittest.equals([1, 2, 3]));
933 unittest.expect(casted2['bool'], unittest.equals(true));
934 unittest.expect(casted2['string'], unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200935}
936
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800937core.Map<core.String, core.Object> buildUnnamed3673() {
Kevin Moore6d21e902021-01-15 06:41:08 -0800938 var o = <core.String, core.Object>{};
Kevin Moored0251702021-01-15 06:41:08 -0800939 o['x'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200940 'list': [1, 2, 3],
941 'bool': true,
942 'string': 'foo'
943 };
Kevin Moored0251702021-01-15 06:41:08 -0800944 o['y'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200945 'list': [1, 2, 3],
946 'bool': true,
947 'string': 'foo'
948 };
Martin Kustermannfa83e312017-07-31 12:48:45 +0200949 return o;
950}
951
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800952void checkUnnamed3673(core.Map<core.String, core.Object> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200953 unittest.expect(o, unittest.hasLength(2));
Kevin Moored0251702021-01-15 06:41:08 -0800954 var casted3 = (o['x']) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200955 unittest.expect(casted3, unittest.hasLength(3));
Kevin Moored0251702021-01-15 06:41:08 -0800956 unittest.expect(casted3['list'], unittest.equals([1, 2, 3]));
957 unittest.expect(casted3['bool'], unittest.equals(true));
958 unittest.expect(casted3['string'], unittest.equals('foo'));
959 var casted4 = (o['y']) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200960 unittest.expect(casted4, unittest.hasLength(3));
Kevin Moored0251702021-01-15 06:41:08 -0800961 unittest.expect(casted4['list'], unittest.equals([1, 2, 3]));
962 unittest.expect(casted4['bool'], unittest.equals(true));
963 unittest.expect(casted4['string'], unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +0200964}
965
966core.int buildCounterOperation = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800967api.Operation buildOperation() {
968 var o = api.Operation();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200969 buildCounterOperation++;
970 if (buildCounterOperation < 3) {
971 o.done = true;
972 o.error = buildStatus();
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800973 o.metadata = buildUnnamed3672();
Kevin Moored0251702021-01-15 06:41:08 -0800974 o.name = 'foo';
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800975 o.response = buildUnnamed3673();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200976 }
977 buildCounterOperation--;
978 return o;
979}
980
Kevin Moore6d21e902021-01-15 06:41:08 -0800981void checkOperation(api.Operation o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +0200982 buildCounterOperation++;
983 if (buildCounterOperation < 3) {
984 unittest.expect(o.done, unittest.isTrue);
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800985 checkStatus(o.error as api.Status);
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800986 checkUnnamed3672(o.metadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200987 unittest.expect(o.name, unittest.equals('foo'));
Kevin Mooreb3758bc2021-02-25 10:03:59 -0800988 checkUnnamed3673(o.response);
Martin Kustermannfa83e312017-07-31 12:48:45 +0200989 }
990 buildCounterOperation--;
991}
992
993core.int buildCounterOperationPerDevice = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -0800994api.OperationPerDevice buildOperationPerDevice() {
995 var o = api.OperationPerDevice();
Martin Kustermannfa83e312017-07-31 12:48:45 +0200996 buildCounterOperationPerDevice++;
997 if (buildCounterOperationPerDevice < 3) {
998 o.claim = buildPartnerClaim();
999 o.result = buildPerDeviceStatusInBatch();
1000 o.unclaim = buildPartnerUnclaim();
1001 o.updateMetadata = buildUpdateMetadataArguments();
1002 }
1003 buildCounterOperationPerDevice--;
1004 return o;
1005}
1006
Kevin Moore6d21e902021-01-15 06:41:08 -08001007void checkOperationPerDevice(api.OperationPerDevice o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001008 buildCounterOperationPerDevice++;
1009 if (buildCounterOperationPerDevice < 3) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001010 checkPartnerClaim(o.claim as api.PartnerClaim);
1011 checkPerDeviceStatusInBatch(o.result as api.PerDeviceStatusInBatch);
1012 checkPartnerUnclaim(o.unclaim as api.PartnerUnclaim);
1013 checkUpdateMetadataArguments(
1014 o.updateMetadata as api.UpdateMetadataArguments);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001015 }
1016 buildCounterOperationPerDevice--;
1017}
1018
1019core.int buildCounterPartnerClaim = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001020api.PartnerClaim buildPartnerClaim() {
1021 var o = api.PartnerClaim();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001022 buildCounterPartnerClaim++;
1023 if (buildCounterPartnerClaim < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001024 o.customerId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001025 o.deviceIdentifier = buildDeviceIdentifier();
1026 o.deviceMetadata = buildDeviceMetadata();
Kevin Moored0251702021-01-15 06:41:08 -08001027 o.sectionType = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001028 }
1029 buildCounterPartnerClaim--;
1030 return o;
1031}
1032
Kevin Moore6d21e902021-01-15 06:41:08 -08001033void checkPartnerClaim(api.PartnerClaim o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001034 buildCounterPartnerClaim++;
1035 if (buildCounterPartnerClaim < 3) {
1036 unittest.expect(o.customerId, unittest.equals('foo'));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001037 checkDeviceIdentifier(o.deviceIdentifier as api.DeviceIdentifier);
1038 checkDeviceMetadata(o.deviceMetadata as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001039 unittest.expect(o.sectionType, unittest.equals('foo'));
1040 }
1041 buildCounterPartnerClaim--;
1042}
1043
1044core.int buildCounterPartnerUnclaim = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001045api.PartnerUnclaim buildPartnerUnclaim() {
1046 var o = api.PartnerUnclaim();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001047 buildCounterPartnerUnclaim++;
1048 if (buildCounterPartnerUnclaim < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001049 o.deviceId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001050 o.deviceIdentifier = buildDeviceIdentifier();
Kevin Moored0251702021-01-15 06:41:08 -08001051 o.sectionType = 'foo';
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001052 o.vacationModeDays = 42;
Kevin Moored0251702021-01-15 06:41:08 -08001053 o.vacationModeExpireTime = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001054 }
1055 buildCounterPartnerUnclaim--;
1056 return o;
1057}
1058
Kevin Moore6d21e902021-01-15 06:41:08 -08001059void checkPartnerUnclaim(api.PartnerUnclaim o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001060 buildCounterPartnerUnclaim++;
1061 if (buildCounterPartnerUnclaim < 3) {
1062 unittest.expect(o.deviceId, unittest.equals('foo'));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001063 checkDeviceIdentifier(o.deviceIdentifier as api.DeviceIdentifier);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001064 unittest.expect(o.sectionType, unittest.equals('foo'));
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001065 unittest.expect(o.vacationModeDays, unittest.equals(42));
1066 unittest.expect(o.vacationModeExpireTime, unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +02001067 }
1068 buildCounterPartnerUnclaim--;
1069}
1070
1071core.int buildCounterPerDeviceStatusInBatch = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001072api.PerDeviceStatusInBatch buildPerDeviceStatusInBatch() {
1073 var o = api.PerDeviceStatusInBatch();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001074 buildCounterPerDeviceStatusInBatch++;
1075 if (buildCounterPerDeviceStatusInBatch < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001076 o.deviceId = 'foo';
1077 o.errorIdentifier = 'foo';
1078 o.errorMessage = 'foo';
1079 o.status = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001080 }
1081 buildCounterPerDeviceStatusInBatch--;
1082 return o;
1083}
1084
Kevin Moore6d21e902021-01-15 06:41:08 -08001085void checkPerDeviceStatusInBatch(api.PerDeviceStatusInBatch o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001086 buildCounterPerDeviceStatusInBatch++;
1087 if (buildCounterPerDeviceStatusInBatch < 3) {
1088 unittest.expect(o.deviceId, unittest.equals('foo'));
1089 unittest.expect(o.errorIdentifier, unittest.equals('foo'));
1090 unittest.expect(o.errorMessage, unittest.equals('foo'));
1091 unittest.expect(o.status, unittest.equals('foo'));
1092 }
1093 buildCounterPerDeviceStatusInBatch--;
1094}
1095
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001096core.Map<core.String, core.Object> buildUnnamed3674() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001097 var o = <core.String, core.Object>{};
Kevin Moored0251702021-01-15 06:41:08 -08001098 o['x'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001099 'list': [1, 2, 3],
1100 'bool': true,
1101 'string': 'foo'
1102 };
Kevin Moored0251702021-01-15 06:41:08 -08001103 o['y'] = {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001104 'list': [1, 2, 3],
1105 'bool': true,
1106 'string': 'foo'
1107 };
Martin Kustermannfa83e312017-07-31 12:48:45 +02001108 return o;
1109}
1110
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001111void checkUnnamed3674(core.Map<core.String, core.Object> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001112 unittest.expect(o, unittest.hasLength(2));
Kevin Moored0251702021-01-15 06:41:08 -08001113 var casted5 = (o['x']) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001114 unittest.expect(casted5, unittest.hasLength(3));
Kevin Moored0251702021-01-15 06:41:08 -08001115 unittest.expect(casted5['list'], unittest.equals([1, 2, 3]));
1116 unittest.expect(casted5['bool'], unittest.equals(true));
1117 unittest.expect(casted5['string'], unittest.equals('foo'));
1118 var casted6 = (o['y']) as core.Map;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001119 unittest.expect(casted6, unittest.hasLength(3));
Kevin Moored0251702021-01-15 06:41:08 -08001120 unittest.expect(casted6['list'], unittest.equals([1, 2, 3]));
1121 unittest.expect(casted6['bool'], unittest.equals(true));
1122 unittest.expect(casted6['string'], unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +02001123}
1124
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001125core.List<core.Map<core.String, core.Object>> buildUnnamed3675() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001126 var o = <core.Map<core.String, core.Object>>[];
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001127 o.add(buildUnnamed3674());
1128 o.add(buildUnnamed3674());
Martin Kustermannfa83e312017-07-31 12:48:45 +02001129 return o;
1130}
1131
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001132void checkUnnamed3675(core.List<core.Map<core.String, core.Object>> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001133 unittest.expect(o, unittest.hasLength(2));
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001134 checkUnnamed3674(o[0]);
1135 checkUnnamed3674(o[1]);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001136}
1137
1138core.int buildCounterStatus = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001139api.Status buildStatus() {
1140 var o = api.Status();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001141 buildCounterStatus++;
1142 if (buildCounterStatus < 3) {
1143 o.code = 42;
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001144 o.details = buildUnnamed3675();
Kevin Moored0251702021-01-15 06:41:08 -08001145 o.message = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001146 }
1147 buildCounterStatus--;
1148 return o;
1149}
1150
Kevin Moore6d21e902021-01-15 06:41:08 -08001151void checkStatus(api.Status o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001152 buildCounterStatus++;
1153 if (buildCounterStatus < 3) {
1154 unittest.expect(o.code, unittest.equals(42));
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001155 checkUnnamed3675(o.details);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001156 unittest.expect(o.message, unittest.equals('foo'));
1157 }
1158 buildCounterStatus--;
1159}
1160
1161core.int buildCounterUnclaimDeviceRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001162api.UnclaimDeviceRequest buildUnclaimDeviceRequest() {
1163 var o = api.UnclaimDeviceRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001164 buildCounterUnclaimDeviceRequest++;
1165 if (buildCounterUnclaimDeviceRequest < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001166 o.deviceId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001167 o.deviceIdentifier = buildDeviceIdentifier();
Kevin Moored0251702021-01-15 06:41:08 -08001168 o.sectionType = 'foo';
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001169 o.vacationModeDays = 42;
Kevin Moored0251702021-01-15 06:41:08 -08001170 o.vacationModeExpireTime = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001171 }
1172 buildCounterUnclaimDeviceRequest--;
1173 return o;
1174}
1175
Kevin Moore6d21e902021-01-15 06:41:08 -08001176void checkUnclaimDeviceRequest(api.UnclaimDeviceRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001177 buildCounterUnclaimDeviceRequest++;
1178 if (buildCounterUnclaimDeviceRequest < 3) {
1179 unittest.expect(o.deviceId, unittest.equals('foo'));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001180 checkDeviceIdentifier(o.deviceIdentifier as api.DeviceIdentifier);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001181 unittest.expect(o.sectionType, unittest.equals('foo'));
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001182 unittest.expect(o.vacationModeDays, unittest.equals(42));
1183 unittest.expect(o.vacationModeExpireTime, unittest.equals('foo'));
Martin Kustermannfa83e312017-07-31 12:48:45 +02001184 }
1185 buildCounterUnclaimDeviceRequest--;
1186}
1187
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001188core.List<api.PartnerUnclaim> buildUnnamed3676() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001189 var o = <api.PartnerUnclaim>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +02001190 o.add(buildPartnerUnclaim());
1191 o.add(buildPartnerUnclaim());
1192 return o;
1193}
1194
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001195void checkUnnamed3676(core.List<api.PartnerUnclaim> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001196 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001197 checkPartnerUnclaim(o[0] as api.PartnerUnclaim);
1198 checkPartnerUnclaim(o[1] as api.PartnerUnclaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001199}
1200
1201core.int buildCounterUnclaimDevicesRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001202api.UnclaimDevicesRequest buildUnclaimDevicesRequest() {
1203 var o = api.UnclaimDevicesRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001204 buildCounterUnclaimDevicesRequest++;
1205 if (buildCounterUnclaimDevicesRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001206 o.unclaims = buildUnnamed3676();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001207 }
1208 buildCounterUnclaimDevicesRequest--;
1209 return o;
1210}
1211
Kevin Moore6d21e902021-01-15 06:41:08 -08001212void checkUnclaimDevicesRequest(api.UnclaimDevicesRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001213 buildCounterUnclaimDevicesRequest++;
1214 if (buildCounterUnclaimDevicesRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001215 checkUnnamed3676(o.unclaims);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001216 }
1217 buildCounterUnclaimDevicesRequest--;
1218}
1219
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001220core.List<api.UpdateMetadataArguments> buildUnnamed3677() {
Kevin Moore6d21e902021-01-15 06:41:08 -08001221 var o = <api.UpdateMetadataArguments>[];
Martin Kustermannfa83e312017-07-31 12:48:45 +02001222 o.add(buildUpdateMetadataArguments());
1223 o.add(buildUpdateMetadataArguments());
1224 return o;
1225}
1226
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001227void checkUnnamed3677(core.List<api.UpdateMetadataArguments> o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001228 unittest.expect(o, unittest.hasLength(2));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001229 checkUpdateMetadataArguments(o[0] as api.UpdateMetadataArguments);
1230 checkUpdateMetadataArguments(o[1] as api.UpdateMetadataArguments);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001231}
1232
1233core.int buildCounterUpdateDeviceMetadataInBatchRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001234api.UpdateDeviceMetadataInBatchRequest
1235 buildUpdateDeviceMetadataInBatchRequest() {
1236 var o = api.UpdateDeviceMetadataInBatchRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001237 buildCounterUpdateDeviceMetadataInBatchRequest++;
1238 if (buildCounterUpdateDeviceMetadataInBatchRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001239 o.updates = buildUnnamed3677();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001240 }
1241 buildCounterUpdateDeviceMetadataInBatchRequest--;
1242 return o;
1243}
1244
Kevin Moore6d21e902021-01-15 06:41:08 -08001245void checkUpdateDeviceMetadataInBatchRequest(
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001246 api.UpdateDeviceMetadataInBatchRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001247 buildCounterUpdateDeviceMetadataInBatchRequest++;
1248 if (buildCounterUpdateDeviceMetadataInBatchRequest < 3) {
Kevin Mooreb3758bc2021-02-25 10:03:59 -08001249 checkUnnamed3677(o.updates);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001250 }
1251 buildCounterUpdateDeviceMetadataInBatchRequest--;
1252}
1253
1254core.int buildCounterUpdateDeviceMetadataRequest = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001255api.UpdateDeviceMetadataRequest buildUpdateDeviceMetadataRequest() {
1256 var o = api.UpdateDeviceMetadataRequest();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001257 buildCounterUpdateDeviceMetadataRequest++;
1258 if (buildCounterUpdateDeviceMetadataRequest < 3) {
1259 o.deviceMetadata = buildDeviceMetadata();
1260 }
1261 buildCounterUpdateDeviceMetadataRequest--;
1262 return o;
1263}
1264
Kevin Moore6d21e902021-01-15 06:41:08 -08001265void checkUpdateDeviceMetadataRequest(api.UpdateDeviceMetadataRequest o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001266 buildCounterUpdateDeviceMetadataRequest++;
1267 if (buildCounterUpdateDeviceMetadataRequest < 3) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001268 checkDeviceMetadata(o.deviceMetadata as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001269 }
1270 buildCounterUpdateDeviceMetadataRequest--;
1271}
1272
1273core.int buildCounterUpdateMetadataArguments = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001274api.UpdateMetadataArguments buildUpdateMetadataArguments() {
1275 var o = api.UpdateMetadataArguments();
Martin Kustermannfa83e312017-07-31 12:48:45 +02001276 buildCounterUpdateMetadataArguments++;
1277 if (buildCounterUpdateMetadataArguments < 3) {
Kevin Moored0251702021-01-15 06:41:08 -08001278 o.deviceId = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02001279 o.deviceIdentifier = buildDeviceIdentifier();
1280 o.deviceMetadata = buildDeviceMetadata();
1281 }
1282 buildCounterUpdateMetadataArguments--;
1283 return o;
1284}
1285
Kevin Moore6d21e902021-01-15 06:41:08 -08001286void checkUpdateMetadataArguments(api.UpdateMetadataArguments o) {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001287 buildCounterUpdateMetadataArguments++;
1288 if (buildCounterUpdateMetadataArguments < 3) {
1289 unittest.expect(o.deviceId, unittest.equals('foo'));
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001290 checkDeviceIdentifier(o.deviceIdentifier as api.DeviceIdentifier);
1291 checkDeviceMetadata(o.deviceMetadata as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001292 }
1293 buildCounterUpdateMetadataArguments--;
1294}
1295
Kevin Moore6d21e902021-01-15 06:41:08 -08001296void main() {
Kevin Moored0251702021-01-15 06:41:08 -08001297 unittest.group('obj-schema-ClaimDeviceRequest', () {
1298 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001299 var o = buildClaimDeviceRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001300 var od = api.ClaimDeviceRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001301 checkClaimDeviceRequest(od as api.ClaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001302 });
1303 });
1304
Kevin Moored0251702021-01-15 06:41:08 -08001305 unittest.group('obj-schema-ClaimDeviceResponse', () {
1306 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001307 var o = buildClaimDeviceResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001308 var od = api.ClaimDeviceResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001309 checkClaimDeviceResponse(od as api.ClaimDeviceResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001310 });
1311 });
1312
Kevin Moored0251702021-01-15 06:41:08 -08001313 unittest.group('obj-schema-ClaimDevicesRequest', () {
1314 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001315 var o = buildClaimDevicesRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001316 var od = api.ClaimDevicesRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001317 checkClaimDevicesRequest(od as api.ClaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001318 });
1319 });
1320
Kevin Moored0251702021-01-15 06:41:08 -08001321 unittest.group('obj-schema-Company', () {
1322 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001323 var o = buildCompany();
Kevin Moore6d21e902021-01-15 06:41:08 -08001324 var od = api.Company.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001325 checkCompany(od as api.Company);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001326 });
1327 });
1328
Kevin Moored0251702021-01-15 06:41:08 -08001329 unittest.group('obj-schema-Configuration', () {
1330 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001331 var o = buildConfiguration();
Kevin Moore6d21e902021-01-15 06:41:08 -08001332 var od = api.Configuration.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001333 checkConfiguration(od as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001334 });
1335 });
1336
Kevin Moored0251702021-01-15 06:41:08 -08001337 unittest.group('obj-schema-CreateCustomerRequest', () {
1338 unittest.test('to-json--from-json', () {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001339 var o = buildCreateCustomerRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001340 var od = api.CreateCustomerRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001341 checkCreateCustomerRequest(od as api.CreateCustomerRequest);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001342 });
1343 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02001344
Kevin Moored0251702021-01-15 06:41:08 -08001345 unittest.group('obj-schema-CustomerApplyConfigurationRequest', () {
1346 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001347 var o = buildCustomerApplyConfigurationRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001348 var od = api.CustomerApplyConfigurationRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001349 checkCustomerApplyConfigurationRequest(
1350 od as api.CustomerApplyConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001351 });
1352 });
1353
Kevin Moored0251702021-01-15 06:41:08 -08001354 unittest.group('obj-schema-CustomerListConfigurationsResponse', () {
1355 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001356 var o = buildCustomerListConfigurationsResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001357 var od = api.CustomerListConfigurationsResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001358 checkCustomerListConfigurationsResponse(
1359 od as api.CustomerListConfigurationsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001360 });
1361 });
1362
Kevin Moored0251702021-01-15 06:41:08 -08001363 unittest.group('obj-schema-CustomerListCustomersResponse', () {
1364 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001365 var o = buildCustomerListCustomersResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001366 var od = api.CustomerListCustomersResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001367 checkCustomerListCustomersResponse(
1368 od as api.CustomerListCustomersResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001369 });
1370 });
1371
Kevin Moored0251702021-01-15 06:41:08 -08001372 unittest.group('obj-schema-CustomerListDevicesResponse', () {
1373 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001374 var o = buildCustomerListDevicesResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001375 var od = api.CustomerListDevicesResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001376 checkCustomerListDevicesResponse(od as api.CustomerListDevicesResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001377 });
1378 });
1379
Kevin Moored0251702021-01-15 06:41:08 -08001380 unittest.group('obj-schema-CustomerListDpcsResponse', () {
1381 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001382 var o = buildCustomerListDpcsResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001383 var od = api.CustomerListDpcsResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001384 checkCustomerListDpcsResponse(od as api.CustomerListDpcsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001385 });
1386 });
1387
Kevin Moored0251702021-01-15 06:41:08 -08001388 unittest.group('obj-schema-CustomerRemoveConfigurationRequest', () {
1389 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001390 var o = buildCustomerRemoveConfigurationRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001391 var od = api.CustomerRemoveConfigurationRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001392 checkCustomerRemoveConfigurationRequest(
1393 od as api.CustomerRemoveConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001394 });
1395 });
1396
Kevin Moored0251702021-01-15 06:41:08 -08001397 unittest.group('obj-schema-CustomerUnclaimDeviceRequest', () {
1398 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001399 var o = buildCustomerUnclaimDeviceRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001400 var od = api.CustomerUnclaimDeviceRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001401 checkCustomerUnclaimDeviceRequest(od as api.CustomerUnclaimDeviceRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001402 });
1403 });
1404
Kevin Moored0251702021-01-15 06:41:08 -08001405 unittest.group('obj-schema-Device', () {
1406 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001407 var o = buildDevice();
Kevin Moore6d21e902021-01-15 06:41:08 -08001408 var od = api.Device.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001409 checkDevice(od as api.Device);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001410 });
1411 });
1412
Kevin Moored0251702021-01-15 06:41:08 -08001413 unittest.group('obj-schema-DeviceClaim', () {
1414 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001415 var o = buildDeviceClaim();
Kevin Moore6d21e902021-01-15 06:41:08 -08001416 var od = api.DeviceClaim.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001417 checkDeviceClaim(od as api.DeviceClaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001418 });
1419 });
1420
Kevin Moored0251702021-01-15 06:41:08 -08001421 unittest.group('obj-schema-DeviceIdentifier', () {
1422 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001423 var o = buildDeviceIdentifier();
Kevin Moore6d21e902021-01-15 06:41:08 -08001424 var od = api.DeviceIdentifier.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001425 checkDeviceIdentifier(od as api.DeviceIdentifier);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001426 });
1427 });
1428
Kevin Moored0251702021-01-15 06:41:08 -08001429 unittest.group('obj-schema-DeviceMetadata', () {
1430 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001431 var o = buildDeviceMetadata();
Kevin Moore6d21e902021-01-15 06:41:08 -08001432 var od = api.DeviceMetadata.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001433 checkDeviceMetadata(od as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001434 });
1435 });
1436
Kevin Moored0251702021-01-15 06:41:08 -08001437 unittest.group('obj-schema-DeviceReference', () {
1438 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001439 var o = buildDeviceReference();
Kevin Moore6d21e902021-01-15 06:41:08 -08001440 var od = api.DeviceReference.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001441 checkDeviceReference(od as api.DeviceReference);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001442 });
1443 });
1444
Kevin Moored0251702021-01-15 06:41:08 -08001445 unittest.group('obj-schema-DevicesLongRunningOperationMetadata', () {
1446 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001447 var o = buildDevicesLongRunningOperationMetadata();
Kevin Moore6d21e902021-01-15 06:41:08 -08001448 var od = api.DevicesLongRunningOperationMetadata.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001449 checkDevicesLongRunningOperationMetadata(
1450 od as api.DevicesLongRunningOperationMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001451 });
1452 });
1453
Kevin Moored0251702021-01-15 06:41:08 -08001454 unittest.group('obj-schema-DevicesLongRunningOperationResponse', () {
1455 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001456 var o = buildDevicesLongRunningOperationResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001457 var od = api.DevicesLongRunningOperationResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001458 checkDevicesLongRunningOperationResponse(
1459 od as api.DevicesLongRunningOperationResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001460 });
1461 });
1462
Kevin Moored0251702021-01-15 06:41:08 -08001463 unittest.group('obj-schema-Dpc', () {
1464 unittest.test('to-json--from-json', () {
Martin Kustermannf9109a82018-01-08 15:24:20 +01001465 var o = buildDpc();
Kevin Moore6d21e902021-01-15 06:41:08 -08001466 var od = api.Dpc.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001467 checkDpc(od as api.Dpc);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001468 });
1469 });
1470
Kevin Moored0251702021-01-15 06:41:08 -08001471 unittest.group('obj-schema-Empty', () {
1472 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001473 var o = buildEmpty();
Kevin Moore6d21e902021-01-15 06:41:08 -08001474 var od = api.Empty.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001475 checkEmpty(od as api.Empty);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001476 });
1477 });
1478
Kevin Moored0251702021-01-15 06:41:08 -08001479 unittest.group('obj-schema-FindDevicesByDeviceIdentifierRequest', () {
1480 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001481 var o = buildFindDevicesByDeviceIdentifierRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001482 var od = api.FindDevicesByDeviceIdentifierRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001483 checkFindDevicesByDeviceIdentifierRequest(
1484 od as api.FindDevicesByDeviceIdentifierRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001485 });
1486 });
1487
Kevin Moored0251702021-01-15 06:41:08 -08001488 unittest.group('obj-schema-FindDevicesByDeviceIdentifierResponse', () {
1489 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001490 var o = buildFindDevicesByDeviceIdentifierResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001491 var od = api.FindDevicesByDeviceIdentifierResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001492 checkFindDevicesByDeviceIdentifierResponse(
1493 od as api.FindDevicesByDeviceIdentifierResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001494 });
1495 });
1496
Kevin Moored0251702021-01-15 06:41:08 -08001497 unittest.group('obj-schema-FindDevicesByOwnerRequest', () {
1498 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001499 var o = buildFindDevicesByOwnerRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001500 var od = api.FindDevicesByOwnerRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001501 checkFindDevicesByOwnerRequest(od as api.FindDevicesByOwnerRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001502 });
1503 });
1504
Kevin Moored0251702021-01-15 06:41:08 -08001505 unittest.group('obj-schema-FindDevicesByOwnerResponse', () {
1506 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001507 var o = buildFindDevicesByOwnerResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001508 var od = api.FindDevicesByOwnerResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001509 checkFindDevicesByOwnerResponse(od as api.FindDevicesByOwnerResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001510 });
1511 });
1512
Kevin Moored0251702021-01-15 06:41:08 -08001513 unittest.group('obj-schema-ListCustomersResponse', () {
1514 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001515 var o = buildListCustomersResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001516 var od = api.ListCustomersResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001517 checkListCustomersResponse(od as api.ListCustomersResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001518 });
1519 });
1520
Kevin Moored0251702021-01-15 06:41:08 -08001521 unittest.group('obj-schema-ListVendorCustomersResponse', () {
1522 unittest.test('to-json--from-json', () {
Martin Kustermann12cdd522018-08-27 10:46:50 +02001523 var o = buildListVendorCustomersResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001524 var od = api.ListVendorCustomersResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001525 checkListVendorCustomersResponse(od as api.ListVendorCustomersResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02001526 });
1527 });
1528
Kevin Moored0251702021-01-15 06:41:08 -08001529 unittest.group('obj-schema-ListVendorsResponse', () {
1530 unittest.test('to-json--from-json', () {
Martin Kustermann12cdd522018-08-27 10:46:50 +02001531 var o = buildListVendorsResponse();
Kevin Moore6d21e902021-01-15 06:41:08 -08001532 var od = api.ListVendorsResponse.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001533 checkListVendorsResponse(od as api.ListVendorsResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02001534 });
1535 });
1536
Kevin Moored0251702021-01-15 06:41:08 -08001537 unittest.group('obj-schema-Operation', () {
1538 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001539 var o = buildOperation();
Kevin Moore6d21e902021-01-15 06:41:08 -08001540 var od = api.Operation.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001541 checkOperation(od as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001542 });
1543 });
1544
Kevin Moored0251702021-01-15 06:41:08 -08001545 unittest.group('obj-schema-OperationPerDevice', () {
1546 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001547 var o = buildOperationPerDevice();
Kevin Moore6d21e902021-01-15 06:41:08 -08001548 var od = api.OperationPerDevice.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001549 checkOperationPerDevice(od as api.OperationPerDevice);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001550 });
1551 });
1552
Kevin Moored0251702021-01-15 06:41:08 -08001553 unittest.group('obj-schema-PartnerClaim', () {
1554 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001555 var o = buildPartnerClaim();
Kevin Moore6d21e902021-01-15 06:41:08 -08001556 var od = api.PartnerClaim.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001557 checkPartnerClaim(od as api.PartnerClaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001558 });
1559 });
1560
Kevin Moored0251702021-01-15 06:41:08 -08001561 unittest.group('obj-schema-PartnerUnclaim', () {
1562 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001563 var o = buildPartnerUnclaim();
Kevin Moore6d21e902021-01-15 06:41:08 -08001564 var od = api.PartnerUnclaim.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001565 checkPartnerUnclaim(od as api.PartnerUnclaim);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001566 });
1567 });
1568
Kevin Moored0251702021-01-15 06:41:08 -08001569 unittest.group('obj-schema-PerDeviceStatusInBatch', () {
1570 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001571 var o = buildPerDeviceStatusInBatch();
Kevin Moore6d21e902021-01-15 06:41:08 -08001572 var od = api.PerDeviceStatusInBatch.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001573 checkPerDeviceStatusInBatch(od as api.PerDeviceStatusInBatch);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001574 });
1575 });
1576
Kevin Moored0251702021-01-15 06:41:08 -08001577 unittest.group('obj-schema-Status', () {
1578 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001579 var o = buildStatus();
Kevin Moore6d21e902021-01-15 06:41:08 -08001580 var od = api.Status.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001581 checkStatus(od as api.Status);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001582 });
1583 });
1584
Kevin Moored0251702021-01-15 06:41:08 -08001585 unittest.group('obj-schema-UnclaimDeviceRequest', () {
1586 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001587 var o = buildUnclaimDeviceRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001588 var od = api.UnclaimDeviceRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001589 checkUnclaimDeviceRequest(od as api.UnclaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001590 });
1591 });
1592
Kevin Moored0251702021-01-15 06:41:08 -08001593 unittest.group('obj-schema-UnclaimDevicesRequest', () {
1594 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001595 var o = buildUnclaimDevicesRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001596 var od = api.UnclaimDevicesRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001597 checkUnclaimDevicesRequest(od as api.UnclaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001598 });
1599 });
1600
Kevin Moored0251702021-01-15 06:41:08 -08001601 unittest.group('obj-schema-UpdateDeviceMetadataInBatchRequest', () {
1602 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001603 var o = buildUpdateDeviceMetadataInBatchRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001604 var od = api.UpdateDeviceMetadataInBatchRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001605 checkUpdateDeviceMetadataInBatchRequest(
1606 od as api.UpdateDeviceMetadataInBatchRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001607 });
1608 });
1609
Kevin Moored0251702021-01-15 06:41:08 -08001610 unittest.group('obj-schema-UpdateDeviceMetadataRequest', () {
1611 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001612 var o = buildUpdateDeviceMetadataRequest();
Kevin Moore6d21e902021-01-15 06:41:08 -08001613 var od = api.UpdateDeviceMetadataRequest.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001614 checkUpdateDeviceMetadataRequest(od as api.UpdateDeviceMetadataRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001615 });
1616 });
1617
Kevin Moored0251702021-01-15 06:41:08 -08001618 unittest.group('obj-schema-UpdateMetadataArguments', () {
1619 unittest.test('to-json--from-json', () {
Martin Kustermannfa83e312017-07-31 12:48:45 +02001620 var o = buildUpdateMetadataArguments();
Kevin Moore6d21e902021-01-15 06:41:08 -08001621 var od = api.UpdateMetadataArguments.fromJson(o.toJson());
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001622 checkUpdateMetadataArguments(od as api.UpdateMetadataArguments);
Martin Kustermannfa83e312017-07-31 12:48:45 +02001623 });
1624 });
1625
Kevin Moore88512712021-01-28 14:43:28 -08001626 unittest.group('resource-CustomersResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08001627 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08001628 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08001629 var res = api.AndroidProvisioningPartnerApi(mock).customers;
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001630 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08001631 var arg_pageToken = 'foo';
1632 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01001633 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1634 var path = (req.url).path;
1635 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001636 core.int index;
1637 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001638 unittest.expect(
1639 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1640 pathOffset += 1;
1641 unittest.expect(path.substring(pathOffset, pathOffset + 12),
1642 unittest.equals("v1/customers"));
1643 pathOffset += 12;
1644
1645 var query = (req.url).query;
1646 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02001647 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08001648 void addQueryParam(core.String n, core.String v) =>
1649 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001650
Kevin Moore6d21e902021-01-15 06:41:08 -08001651 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08001652 for (var part in query.split('&')) {
1653 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08001654 addQueryParam(
1655 core.Uri.decodeQueryComponent(keyValue[0]),
1656 core.Uri.decodeQueryComponent(keyValue[1]),
1657 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001658 }
1659 }
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001660 unittest.expect(core.int.parse(queryMap["pageSize"].first),
1661 unittest.equals(arg_pageSize));
Jonas Finnemann Jensenb223bd52020-10-09 13:02:08 +02001662 unittest.expect(
1663 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
Martin Kustermannf9109a82018-01-08 15:24:20 +01001664 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
1665
1666 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08001667 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01001668 };
Jakob Andersen52715df2018-05-01 13:58:48 +02001669 var resp = convert.json.encode(buildCustomerListCustomersResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08001670 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01001671 }), true);
1672 res
1673 .list(
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02001674 pageSize: arg_pageSize,
Jonas Finnemann Jensenb223bd52020-10-09 13:02:08 +02001675 pageToken: arg_pageToken,
Martin Kustermannf9109a82018-01-08 15:24:20 +01001676 $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02001677 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001678 checkCustomerListCustomersResponse(
1679 response as api.CustomerListCustomersResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001680 })));
1681 });
1682 });
1683
Kevin Moore88512712021-01-28 14:43:28 -08001684 unittest.group('resource-CustomersConfigurationsResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08001685 unittest.test('method--create', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08001686 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08001687 var res =
1688 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001689 var arg_request = buildConfiguration();
Kevin Moored0251702021-01-15 06:41:08 -08001690 var arg_parent = 'foo';
1691 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01001692 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001693 var obj = api.Configuration.fromJson(
1694 json as core.Map<core.String, core.dynamic>);
1695 checkConfiguration(obj as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001696
1697 var path = (req.url).path;
1698 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001699 core.int index;
1700 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001701 unittest.expect(
1702 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1703 pathOffset += 1;
1704 unittest.expect(
1705 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1706 pathOffset += 3;
1707 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
1708
1709 var query = (req.url).query;
1710 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02001711 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08001712 void addQueryParam(core.String n, core.String v) =>
1713 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001714
Kevin Moore6d21e902021-01-15 06:41:08 -08001715 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08001716 for (var part in query.split('&')) {
1717 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08001718 addQueryParam(
1719 core.Uri.decodeQueryComponent(keyValue[0]),
1720 core.Uri.decodeQueryComponent(keyValue[1]),
1721 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001722 }
1723 }
1724 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
1725
1726 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08001727 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01001728 };
Jakob Andersen52715df2018-05-01 13:58:48 +02001729 var resp = convert.json.encode(buildConfiguration());
Kevin Moore6d21e902021-01-15 06:41:08 -08001730 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01001731 }), true);
1732 res
1733 .create(arg_request, arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02001734 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001735 checkConfiguration(response as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001736 })));
1737 });
1738
Kevin Moored0251702021-01-15 06:41:08 -08001739 unittest.test('method--delete', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08001740 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08001741 var res =
1742 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Kevin Moored0251702021-01-15 06:41:08 -08001743 var arg_name = 'foo';
1744 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01001745 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1746 var path = (req.url).path;
1747 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001748 core.int index;
1749 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001750 unittest.expect(
1751 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1752 pathOffset += 1;
1753 unittest.expect(
1754 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1755 pathOffset += 3;
1756 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
1757
1758 var query = (req.url).query;
1759 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02001760 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08001761 void addQueryParam(core.String n, core.String v) =>
1762 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001763
Kevin Moore6d21e902021-01-15 06:41:08 -08001764 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08001765 for (var part in query.split('&')) {
1766 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08001767 addQueryParam(
1768 core.Uri.decodeQueryComponent(keyValue[0]),
1769 core.Uri.decodeQueryComponent(keyValue[1]),
1770 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001771 }
1772 }
1773 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
1774
1775 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08001776 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01001777 };
Jakob Andersen52715df2018-05-01 13:58:48 +02001778 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08001779 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01001780 }), true);
1781 res
1782 .delete(arg_name, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02001783 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001784 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001785 })));
1786 });
1787
Kevin Moored0251702021-01-15 06:41:08 -08001788 unittest.test('method--get', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08001789 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08001790 var res =
1791 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Kevin Moored0251702021-01-15 06:41:08 -08001792 var arg_name = 'foo';
1793 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01001794 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1795 var path = (req.url).path;
1796 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001797 core.int index;
1798 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001799 unittest.expect(
1800 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1801 pathOffset += 1;
1802 unittest.expect(
1803 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1804 pathOffset += 3;
1805 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
1806
1807 var query = (req.url).query;
1808 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02001809 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08001810 void addQueryParam(core.String n, core.String v) =>
1811 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001812
Kevin Moore6d21e902021-01-15 06:41:08 -08001813 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08001814 for (var part in query.split('&')) {
1815 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08001816 addQueryParam(
1817 core.Uri.decodeQueryComponent(keyValue[0]),
1818 core.Uri.decodeQueryComponent(keyValue[1]),
1819 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001820 }
1821 }
1822 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
1823
1824 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08001825 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01001826 };
Jakob Andersen52715df2018-05-01 13:58:48 +02001827 var resp = convert.json.encode(buildConfiguration());
Kevin Moore6d21e902021-01-15 06:41:08 -08001828 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01001829 }), true);
1830 res
1831 .get(arg_name, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02001832 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001833 checkConfiguration(response as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001834 })));
1835 });
1836
Kevin Moored0251702021-01-15 06:41:08 -08001837 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08001838 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08001839 var res =
1840 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Kevin Moored0251702021-01-15 06:41:08 -08001841 var arg_parent = 'foo';
1842 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01001843 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1844 var path = (req.url).path;
1845 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001846 core.int index;
1847 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001848 unittest.expect(
1849 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1850 pathOffset += 1;
1851 unittest.expect(
1852 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1853 pathOffset += 3;
1854 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
1855
1856 var query = (req.url).query;
1857 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02001858 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08001859 void addQueryParam(core.String n, core.String v) =>
1860 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001861
Kevin Moore6d21e902021-01-15 06:41:08 -08001862 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08001863 for (var part in query.split('&')) {
1864 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08001865 addQueryParam(
1866 core.Uri.decodeQueryComponent(keyValue[0]),
1867 core.Uri.decodeQueryComponent(keyValue[1]),
1868 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001869 }
1870 }
1871 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
1872
1873 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08001874 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01001875 };
1876 var resp =
Jakob Andersen52715df2018-05-01 13:58:48 +02001877 convert.json.encode(buildCustomerListConfigurationsResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08001878 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01001879 }), true);
Jakob Andersen4ce761d2018-04-19 11:19:11 +02001880 res
1881 .list(arg_parent, $fields: arg_$fields)
1882 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001883 checkCustomerListConfigurationsResponse(
1884 response as api.CustomerListConfigurationsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001885 })));
1886 });
1887
Kevin Moored0251702021-01-15 06:41:08 -08001888 unittest.test('method--patch', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08001889 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08001890 var res =
1891 api.AndroidProvisioningPartnerApi(mock).customers.configurations;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001892 var arg_request = buildConfiguration();
Kevin Moored0251702021-01-15 06:41:08 -08001893 var arg_name = 'foo';
1894 var arg_updateMask = 'foo';
1895 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01001896 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001897 var obj = api.Configuration.fromJson(
1898 json as core.Map<core.String, core.dynamic>);
1899 checkConfiguration(obj as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001900
1901 var path = (req.url).path;
1902 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001903 core.int index;
1904 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001905 unittest.expect(
1906 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1907 pathOffset += 1;
1908 unittest.expect(
1909 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1910 pathOffset += 3;
1911 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
1912
1913 var query = (req.url).query;
1914 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02001915 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08001916 void addQueryParam(core.String n, core.String v) =>
1917 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001918
Kevin Moore6d21e902021-01-15 06:41:08 -08001919 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08001920 for (var part in query.split('&')) {
1921 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08001922 addQueryParam(
1923 core.Uri.decodeQueryComponent(keyValue[0]),
1924 core.Uri.decodeQueryComponent(keyValue[1]),
1925 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001926 }
1927 }
1928 unittest.expect(
1929 queryMap["updateMask"].first, unittest.equals(arg_updateMask));
1930 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
1931
1932 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08001933 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01001934 };
Jakob Andersen52715df2018-05-01 13:58:48 +02001935 var resp = convert.json.encode(buildConfiguration());
Kevin Moore6d21e902021-01-15 06:41:08 -08001936 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01001937 }), true);
1938 res
1939 .patch(arg_request, arg_name,
1940 updateMask: arg_updateMask, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02001941 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001942 checkConfiguration(response as api.Configuration);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001943 })));
1944 });
1945 });
1946
Kevin Moore88512712021-01-28 14:43:28 -08001947 unittest.group('resource-CustomersDevicesResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08001948 unittest.test('method--applyConfiguration', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08001949 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08001950 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001951 var arg_request = buildCustomerApplyConfigurationRequest();
Kevin Moored0251702021-01-15 06:41:08 -08001952 var arg_parent = 'foo';
1953 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01001954 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001955 var obj = api.CustomerApplyConfigurationRequest.fromJson(
1956 json as core.Map<core.String, core.dynamic>);
1957 checkCustomerApplyConfigurationRequest(
1958 obj as api.CustomerApplyConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001959
1960 var path = (req.url).path;
1961 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08001962 core.int index;
1963 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01001964 unittest.expect(
1965 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1966 pathOffset += 1;
1967 unittest.expect(
1968 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1969 pathOffset += 3;
1970 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
1971
1972 var query = (req.url).query;
1973 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02001974 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08001975 void addQueryParam(core.String n, core.String v) =>
1976 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001977
Kevin Moore6d21e902021-01-15 06:41:08 -08001978 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08001979 for (var part in query.split('&')) {
1980 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08001981 addQueryParam(
1982 core.Uri.decodeQueryComponent(keyValue[0]),
1983 core.Uri.decodeQueryComponent(keyValue[1]),
1984 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01001985 }
1986 }
1987 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
1988
1989 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08001990 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01001991 };
Jakob Andersen52715df2018-05-01 13:58:48 +02001992 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08001993 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01001994 }), true);
1995 res
1996 .applyConfiguration(arg_request, arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02001997 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001998 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01001999 })));
2000 });
2001
Kevin Moored0251702021-01-15 06:41:08 -08002002 unittest.test('method--get', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002003 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002004 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Kevin Moored0251702021-01-15 06:41:08 -08002005 var arg_name = 'foo';
2006 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002007 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2008 var path = (req.url).path;
2009 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002010 core.int index;
2011 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002012 unittest.expect(
2013 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2014 pathOffset += 1;
2015 unittest.expect(
2016 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2017 pathOffset += 3;
2018 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2019
2020 var query = (req.url).query;
2021 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002022 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002023 void addQueryParam(core.String n, core.String v) =>
2024 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002025
Kevin Moore6d21e902021-01-15 06:41:08 -08002026 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002027 for (var part in query.split('&')) {
2028 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002029 addQueryParam(
2030 core.Uri.decodeQueryComponent(keyValue[0]),
2031 core.Uri.decodeQueryComponent(keyValue[1]),
2032 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002033 }
2034 }
2035 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
2036
2037 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002038 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002039 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002040 var resp = convert.json.encode(buildDevice());
Kevin Moore6d21e902021-01-15 06:41:08 -08002041 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002042 }), true);
2043 res
2044 .get(arg_name, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002045 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002046 checkDevice(response as api.Device);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002047 })));
2048 });
2049
Kevin Moored0251702021-01-15 06:41:08 -08002050 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002051 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002052 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Kevin Moored0251702021-01-15 06:41:08 -08002053 var arg_parent = 'foo';
Kevin Moored0251702021-01-15 06:41:08 -08002054 var arg_pageSize = 'foo';
Kevin Moore8810e8b2021-01-19 13:22:15 -08002055 var arg_pageToken = 'foo';
Kevin Moored0251702021-01-15 06:41:08 -08002056 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002057 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2058 var path = (req.url).path;
2059 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002060 core.int index;
2061 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002062 unittest.expect(
2063 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2064 pathOffset += 1;
2065 unittest.expect(
2066 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2067 pathOffset += 3;
2068 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2069
2070 var query = (req.url).query;
2071 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002072 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002073 void addQueryParam(core.String n, core.String v) =>
2074 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002075
Kevin Moore6d21e902021-01-15 06:41:08 -08002076 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002077 for (var part in query.split('&')) {
2078 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002079 addQueryParam(
2080 core.Uri.decodeQueryComponent(keyValue[0]),
2081 core.Uri.decodeQueryComponent(keyValue[1]),
2082 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002083 }
2084 }
2085 unittest.expect(
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02002086 queryMap["pageSize"].first, unittest.equals(arg_pageSize));
Kevin Moore8810e8b2021-01-19 13:22:15 -08002087 unittest.expect(
2088 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002089 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
2090
2091 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002092 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002093 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002094 var resp = convert.json.encode(buildCustomerListDevicesResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002095 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002096 }), true);
2097 res
2098 .list(arg_parent,
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02002099 pageSize: arg_pageSize,
Kevin Moore8810e8b2021-01-19 13:22:15 -08002100 pageToken: arg_pageToken,
Martin Kustermannf9109a82018-01-08 15:24:20 +01002101 $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002102 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002103 checkCustomerListDevicesResponse(
2104 response as api.CustomerListDevicesResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002105 })));
2106 });
2107
Kevin Moored0251702021-01-15 06:41:08 -08002108 unittest.test('method--removeConfiguration', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002109 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002110 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002111 var arg_request = buildCustomerRemoveConfigurationRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002112 var arg_parent = 'foo';
2113 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002114 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002115 var obj = api.CustomerRemoveConfigurationRequest.fromJson(
2116 json as core.Map<core.String, core.dynamic>);
2117 checkCustomerRemoveConfigurationRequest(
2118 obj as api.CustomerRemoveConfigurationRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002119
2120 var path = (req.url).path;
2121 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002122 core.int index;
2123 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002124 unittest.expect(
2125 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2126 pathOffset += 1;
2127 unittest.expect(
2128 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2129 pathOffset += 3;
2130 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2131
2132 var query = (req.url).query;
2133 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002134 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002135 void addQueryParam(core.String n, core.String v) =>
2136 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002137
Kevin Moore6d21e902021-01-15 06:41:08 -08002138 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002139 for (var part in query.split('&')) {
2140 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002141 addQueryParam(
2142 core.Uri.decodeQueryComponent(keyValue[0]),
2143 core.Uri.decodeQueryComponent(keyValue[1]),
2144 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002145 }
2146 }
2147 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
2148
2149 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002150 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002151 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002152 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002153 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002154 }), true);
2155 res
2156 .removeConfiguration(arg_request, arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002157 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002158 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002159 })));
2160 });
2161
Kevin Moored0251702021-01-15 06:41:08 -08002162 unittest.test('method--unclaim', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002163 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002164 var res = api.AndroidProvisioningPartnerApi(mock).customers.devices;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002165 var arg_request = buildCustomerUnclaimDeviceRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002166 var arg_parent = 'foo';
2167 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002168 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002169 var obj = api.CustomerUnclaimDeviceRequest.fromJson(
2170 json as core.Map<core.String, core.dynamic>);
2171 checkCustomerUnclaimDeviceRequest(
2172 obj as api.CustomerUnclaimDeviceRequest);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002173
2174 var path = (req.url).path;
2175 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002176 core.int index;
2177 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002178 unittest.expect(
2179 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2180 pathOffset += 1;
2181 unittest.expect(
2182 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2183 pathOffset += 3;
2184 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2185
2186 var query = (req.url).query;
2187 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002188 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002189 void addQueryParam(core.String n, core.String v) =>
2190 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002191
Kevin Moore6d21e902021-01-15 06:41:08 -08002192 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002193 for (var part in query.split('&')) {
2194 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002195 addQueryParam(
2196 core.Uri.decodeQueryComponent(keyValue[0]),
2197 core.Uri.decodeQueryComponent(keyValue[1]),
2198 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002199 }
2200 }
2201 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
2202
2203 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002204 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002205 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002206 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002207 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002208 }), true);
2209 res
2210 .unclaim(arg_request, arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002211 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002212 checkEmpty(response as api.Empty);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002213 })));
2214 });
2215 });
2216
Kevin Moore88512712021-01-28 14:43:28 -08002217 unittest.group('resource-CustomersDpcsResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002218 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002219 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002220 var res = api.AndroidProvisioningPartnerApi(mock).customers.dpcs;
Kevin Moored0251702021-01-15 06:41:08 -08002221 var arg_parent = 'foo';
2222 var arg_$fields = 'foo';
Martin Kustermannf9109a82018-01-08 15:24:20 +01002223 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2224 var path = (req.url).path;
2225 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002226 core.int index;
2227 core.String subPart;
Martin Kustermannf9109a82018-01-08 15:24:20 +01002228 unittest.expect(
2229 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2230 pathOffset += 1;
2231 unittest.expect(
2232 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2233 pathOffset += 3;
2234 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2235
2236 var query = (req.url).query;
2237 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002238 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002239 void addQueryParam(core.String n, core.String v) =>
2240 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002241
Kevin Moore6d21e902021-01-15 06:41:08 -08002242 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002243 for (var part in query.split('&')) {
2244 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002245 addQueryParam(
2246 core.Uri.decodeQueryComponent(keyValue[0]),
2247 core.Uri.decodeQueryComponent(keyValue[1]),
2248 );
Martin Kustermannf9109a82018-01-08 15:24:20 +01002249 }
2250 }
2251 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
2252
2253 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002254 'content-type': 'application/json; charset=utf-8',
Martin Kustermannf9109a82018-01-08 15:24:20 +01002255 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002256 var resp = convert.json.encode(buildCustomerListDpcsResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002257 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannf9109a82018-01-08 15:24:20 +01002258 }), true);
2259 res
2260 .list(arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002261 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002262 checkCustomerListDpcsResponse(response as api.CustomerListDpcsResponse);
Martin Kustermannf9109a82018-01-08 15:24:20 +01002263 })));
2264 });
2265 });
2266
Kevin Moore88512712021-01-28 14:43:28 -08002267 unittest.group('resource-OperationsResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002268 unittest.test('method--get', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002269 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002270 var res = api.AndroidProvisioningPartnerApi(mock).operations;
Kevin Moored0251702021-01-15 06:41:08 -08002271 var arg_name = 'foo';
2272 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002273 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2274 var path = (req.url).path;
2275 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002276 core.int index;
2277 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002278 unittest.expect(
2279 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002280 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002281 unittest.expect(
2282 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002283 pathOffset += 3;
2284 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2285
2286 var query = (req.url).query;
2287 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002288 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002289 void addQueryParam(core.String n, core.String v) =>
2290 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002291
Kevin Moore6d21e902021-01-15 06:41:08 -08002292 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002293 for (var part in query.split('&')) {
2294 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002295 addQueryParam(
2296 core.Uri.decodeQueryComponent(keyValue[0]),
2297 core.Uri.decodeQueryComponent(keyValue[1]),
2298 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002299 }
2300 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002301 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002302
Martin Kustermannfa83e312017-07-31 12:48:45 +02002303 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002304 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002305 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002306 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08002307 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002308 }), true);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002309 res
2310 .get(arg_name, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002311 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002312 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002313 })));
2314 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02002315 });
2316
Kevin Moore88512712021-01-28 14:43:28 -08002317 unittest.group('resource-PartnersCustomersResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002318 unittest.test('method--create', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002319 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002320 var res = api.AndroidProvisioningPartnerApi(mock).partners.customers;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002321 var arg_request = buildCreateCustomerRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002322 var arg_parent = 'foo';
2323 var arg_$fields = 'foo';
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002324 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002325 var obj = api.CreateCustomerRequest.fromJson(
2326 json as core.Map<core.String, core.dynamic>);
2327 checkCreateCustomerRequest(obj as api.CreateCustomerRequest);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002328
2329 var path = (req.url).path;
2330 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002331 core.int index;
2332 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002333 unittest.expect(
2334 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2335 pathOffset += 1;
2336 unittest.expect(
2337 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2338 pathOffset += 3;
2339 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2340
2341 var query = (req.url).query;
2342 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002343 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002344 void addQueryParam(core.String n, core.String v) =>
2345 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002346
Kevin Moore6d21e902021-01-15 06:41:08 -08002347 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002348 for (var part in query.split('&')) {
2349 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002350 addQueryParam(
2351 core.Uri.decodeQueryComponent(keyValue[0]),
2352 core.Uri.decodeQueryComponent(keyValue[1]),
2353 );
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002354 }
2355 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002356 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002357
2358 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002359 'content-type': 'application/json; charset=utf-8',
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002360 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002361 var resp = convert.json.encode(buildCompany());
Kevin Moore6d21e902021-01-15 06:41:08 -08002362 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002363 }), true);
2364 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002365 .create(arg_request, arg_parent, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002366 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002367 checkCompany(response as api.Company);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002368 })));
2369 });
2370
Kevin Moored0251702021-01-15 06:41:08 -08002371 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002372 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002373 var res = api.AndroidProvisioningPartnerApi(mock).partners.customers;
Kevin Moored0251702021-01-15 06:41:08 -08002374 var arg_partnerId = 'foo';
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02002375 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08002376 var arg_pageToken = 'foo';
2377 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002378 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2379 var path = (req.url).path;
2380 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002381 core.int index;
2382 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002383 unittest.expect(
2384 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002385 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002386 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2387 unittest.equals("v1/partners/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002388 pathOffset += 12;
2389 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2390
2391 var query = (req.url).query;
2392 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002393 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002394 void addQueryParam(core.String n, core.String v) =>
2395 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002396
Kevin Moore6d21e902021-01-15 06:41:08 -08002397 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002398 for (var part in query.split('&')) {
2399 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002400 addQueryParam(
2401 core.Uri.decodeQueryComponent(keyValue[0]),
2402 core.Uri.decodeQueryComponent(keyValue[1]),
2403 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002404 }
2405 }
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02002406 unittest.expect(core.int.parse(queryMap["pageSize"].first),
2407 unittest.equals(arg_pageSize));
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +02002408 unittest.expect(
2409 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002410 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002411
Martin Kustermannfa83e312017-07-31 12:48:45 +02002412 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002413 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002414 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002415 var resp = convert.json.encode(buildListCustomersResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002416 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002417 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002418 res
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +01002419 .list(arg_partnerId,
Jonas Finnemann Jensenee696b12019-07-04 15:07:25 +02002420 pageSize: arg_pageSize,
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +02002421 pageToken: arg_pageToken,
Jonas Finnemann Jensendda12e42019-02-09 12:37:20 +01002422 $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002423 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002424 checkListCustomersResponse(response as api.ListCustomersResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002425 })));
2426 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02002427 });
2428
Kevin Moore88512712021-01-28 14:43:28 -08002429 unittest.group('resource-PartnersDevicesResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002430 unittest.test('method--claim', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002431 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002432 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002433 var arg_request = buildClaimDeviceRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002434 var arg_partnerId = 'foo';
2435 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002436 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002437 var obj = api.ClaimDeviceRequest.fromJson(
2438 json as core.Map<core.String, core.dynamic>);
2439 checkClaimDeviceRequest(obj as api.ClaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002440
2441 var path = (req.url).path;
2442 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002443 core.int index;
2444 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002445 unittest.expect(
2446 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002447 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002448 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2449 unittest.equals("v1/partners/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002450 pathOffset += 12;
2451 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2452
2453 var query = (req.url).query;
2454 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002455 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002456 void addQueryParam(core.String n, core.String v) =>
2457 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002458
Kevin Moore6d21e902021-01-15 06:41:08 -08002459 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002460 for (var part in query.split('&')) {
2461 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002462 addQueryParam(
2463 core.Uri.decodeQueryComponent(keyValue[0]),
2464 core.Uri.decodeQueryComponent(keyValue[1]),
2465 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002466 }
2467 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002468 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002469
Martin Kustermannfa83e312017-07-31 12:48:45 +02002470 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002471 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002472 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002473 var resp = convert.json.encode(buildClaimDeviceResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002474 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002475 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002476 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002477 .claim(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002478 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002479 checkClaimDeviceResponse(response as api.ClaimDeviceResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002480 })));
2481 });
2482
Kevin Moored0251702021-01-15 06:41:08 -08002483 unittest.test('method--claimAsync', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002484 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002485 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002486 var arg_request = buildClaimDevicesRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002487 var arg_partnerId = 'foo';
2488 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002489 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002490 var obj = api.ClaimDevicesRequest.fromJson(
2491 json as core.Map<core.String, core.dynamic>);
2492 checkClaimDevicesRequest(obj as api.ClaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002493
2494 var path = (req.url).path;
2495 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002496 core.int index;
2497 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002498 unittest.expect(
2499 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002500 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002501 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2502 unittest.equals("v1/partners/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002503 pathOffset += 12;
2504 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2505
2506 var query = (req.url).query;
2507 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002508 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002509 void addQueryParam(core.String n, core.String v) =>
2510 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002511
Kevin Moore6d21e902021-01-15 06:41:08 -08002512 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002513 for (var part in query.split('&')) {
2514 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002515 addQueryParam(
2516 core.Uri.decodeQueryComponent(keyValue[0]),
2517 core.Uri.decodeQueryComponent(keyValue[1]),
2518 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002519 }
2520 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002521 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002522
Martin Kustermannfa83e312017-07-31 12:48:45 +02002523 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002524 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002525 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002526 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08002527 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002528 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002529 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002530 .claimAsync(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002531 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002532 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002533 })));
2534 });
2535
Kevin Moored0251702021-01-15 06:41:08 -08002536 unittest.test('method--findByIdentifier', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002537 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002538 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002539 var arg_request = buildFindDevicesByDeviceIdentifierRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002540 var arg_partnerId = 'foo';
2541 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002542 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002543 var obj = api.FindDevicesByDeviceIdentifierRequest.fromJson(
2544 json as core.Map<core.String, core.dynamic>);
2545 checkFindDevicesByDeviceIdentifierRequest(
2546 obj as api.FindDevicesByDeviceIdentifierRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002547
2548 var path = (req.url).path;
2549 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002550 core.int index;
2551 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002552 unittest.expect(
2553 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002554 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002555 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2556 unittest.equals("v1/partners/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002557 pathOffset += 12;
2558 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2559
2560 var query = (req.url).query;
2561 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002562 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002563 void addQueryParam(core.String n, core.String v) =>
2564 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002565
Kevin Moore6d21e902021-01-15 06:41:08 -08002566 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002567 for (var part in query.split('&')) {
2568 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002569 addQueryParam(
2570 core.Uri.decodeQueryComponent(keyValue[0]),
2571 core.Uri.decodeQueryComponent(keyValue[1]),
2572 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002573 }
2574 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002575 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002576
Martin Kustermannfa83e312017-07-31 12:48:45 +02002577 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002578 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002579 };
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002580 var resp =
Jakob Andersen52715df2018-05-01 13:58:48 +02002581 convert.json.encode(buildFindDevicesByDeviceIdentifierResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002582 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002583 }), true);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002584 res
2585 .findByIdentifier(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002586 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002587 checkFindDevicesByDeviceIdentifierResponse(
2588 response as api.FindDevicesByDeviceIdentifierResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002589 })));
2590 });
2591
Kevin Moored0251702021-01-15 06:41:08 -08002592 unittest.test('method--findByOwner', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002593 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002594 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002595 var arg_request = buildFindDevicesByOwnerRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002596 var arg_partnerId = 'foo';
2597 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002598 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002599 var obj = api.FindDevicesByOwnerRequest.fromJson(
2600 json as core.Map<core.String, core.dynamic>);
2601 checkFindDevicesByOwnerRequest(obj as api.FindDevicesByOwnerRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002602
2603 var path = (req.url).path;
2604 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002605 core.int index;
2606 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002607 unittest.expect(
2608 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002609 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002610 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2611 unittest.equals("v1/partners/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002612 pathOffset += 12;
2613 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2614
2615 var query = (req.url).query;
2616 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002617 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002618 void addQueryParam(core.String n, core.String v) =>
2619 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002620
Kevin Moore6d21e902021-01-15 06:41:08 -08002621 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002622 for (var part in query.split('&')) {
2623 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002624 addQueryParam(
2625 core.Uri.decodeQueryComponent(keyValue[0]),
2626 core.Uri.decodeQueryComponent(keyValue[1]),
2627 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002628 }
2629 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002630 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002631
Martin Kustermannfa83e312017-07-31 12:48:45 +02002632 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002633 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002634 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002635 var resp = convert.json.encode(buildFindDevicesByOwnerResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002636 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002637 }), true);
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002638 res
2639 .findByOwner(arg_request, arg_partnerId, $fields: arg_$fields)
2640 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002641 checkFindDevicesByOwnerResponse(
2642 response as api.FindDevicesByOwnerResponse);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002643 })));
2644 });
2645
Kevin Moored0251702021-01-15 06:41:08 -08002646 unittest.test('method--get', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002647 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002648 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Kevin Moored0251702021-01-15 06:41:08 -08002649 var arg_name = 'foo';
2650 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002651 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2652 var path = (req.url).path;
2653 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002654 core.int index;
2655 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002656 unittest.expect(
2657 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002658 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002659 unittest.expect(
2660 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002661 pathOffset += 3;
2662 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2663
2664 var query = (req.url).query;
2665 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002666 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002667 void addQueryParam(core.String n, core.String v) =>
2668 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002669
Kevin Moore6d21e902021-01-15 06:41:08 -08002670 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002671 for (var part in query.split('&')) {
2672 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002673 addQueryParam(
2674 core.Uri.decodeQueryComponent(keyValue[0]),
2675 core.Uri.decodeQueryComponent(keyValue[1]),
2676 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002677 }
2678 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002679 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002680
Martin Kustermannfa83e312017-07-31 12:48:45 +02002681 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002682 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002683 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002684 var resp = convert.json.encode(buildDevice());
Kevin Moore6d21e902021-01-15 06:41:08 -08002685 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002686 }), true);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002687 res
2688 .get(arg_name, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002689 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002690 checkDevice(response as api.Device);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002691 })));
2692 });
2693
Kevin Moored0251702021-01-15 06:41:08 -08002694 unittest.test('method--metadata', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002695 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002696 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002697 var arg_request = buildUpdateDeviceMetadataRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002698 var arg_metadataOwnerId = 'foo';
2699 var arg_deviceId = 'foo';
2700 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002701 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002702 var obj = api.UpdateDeviceMetadataRequest.fromJson(
2703 json as core.Map<core.String, core.dynamic>);
2704 checkUpdateDeviceMetadataRequest(
2705 obj as api.UpdateDeviceMetadataRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002706
2707 var path = (req.url).path;
2708 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002709 core.int index;
2710 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002711 unittest.expect(
2712 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002713 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002714 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2715 unittest.equals("v1/partners/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002716 pathOffset += 12;
2717 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2718
2719 var query = (req.url).query;
2720 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002721 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002722 void addQueryParam(core.String n, core.String v) =>
2723 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002724
Kevin Moore6d21e902021-01-15 06:41:08 -08002725 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002726 for (var part in query.split('&')) {
2727 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002728 addQueryParam(
2729 core.Uri.decodeQueryComponent(keyValue[0]),
2730 core.Uri.decodeQueryComponent(keyValue[1]),
2731 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002732 }
2733 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002734 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002735
Martin Kustermannfa83e312017-07-31 12:48:45 +02002736 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002737 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002738 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002739 var resp = convert.json.encode(buildDeviceMetadata());
Kevin Moore6d21e902021-01-15 06:41:08 -08002740 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002741 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002742 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002743 .metadata(arg_request, arg_metadataOwnerId, arg_deviceId,
2744 $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002745 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002746 checkDeviceMetadata(response as api.DeviceMetadata);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002747 })));
2748 });
2749
Kevin Moored0251702021-01-15 06:41:08 -08002750 unittest.test('method--unclaim', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002751 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002752 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002753 var arg_request = buildUnclaimDeviceRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002754 var arg_partnerId = 'foo';
2755 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002756 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002757 var obj = api.UnclaimDeviceRequest.fromJson(
2758 json as core.Map<core.String, core.dynamic>);
2759 checkUnclaimDeviceRequest(obj as api.UnclaimDeviceRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002760
2761 var path = (req.url).path;
2762 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002763 core.int index;
2764 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002765 unittest.expect(
2766 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002767 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002768 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2769 unittest.equals("v1/partners/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002770 pathOffset += 12;
2771 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2772
2773 var query = (req.url).query;
2774 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002775 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002776 void addQueryParam(core.String n, core.String v) =>
2777 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002778
Kevin Moore6d21e902021-01-15 06:41:08 -08002779 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002780 for (var part in query.split('&')) {
2781 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002782 addQueryParam(
2783 core.Uri.decodeQueryComponent(keyValue[0]),
2784 core.Uri.decodeQueryComponent(keyValue[1]),
2785 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002786 }
2787 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002788 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002789
Martin Kustermannfa83e312017-07-31 12:48:45 +02002790 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002791 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002792 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002793 var resp = convert.json.encode(buildEmpty());
Kevin Moore6d21e902021-01-15 06:41:08 -08002794 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002795 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002796 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002797 .unclaim(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002798 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002799 checkEmpty(response as api.Empty);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002800 })));
2801 });
2802
Kevin Moored0251702021-01-15 06:41:08 -08002803 unittest.test('method--unclaimAsync', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002804 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002805 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002806 var arg_request = buildUnclaimDevicesRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002807 var arg_partnerId = 'foo';
2808 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002809 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002810 var obj = api.UnclaimDevicesRequest.fromJson(
2811 json as core.Map<core.String, core.dynamic>);
2812 checkUnclaimDevicesRequest(obj as api.UnclaimDevicesRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002813
2814 var path = (req.url).path;
2815 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002816 core.int index;
2817 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002818 unittest.expect(
2819 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002820 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002821 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2822 unittest.equals("v1/partners/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002823 pathOffset += 12;
2824 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2825
2826 var query = (req.url).query;
2827 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002828 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002829 void addQueryParam(core.String n, core.String v) =>
2830 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002831
Kevin Moore6d21e902021-01-15 06:41:08 -08002832 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002833 for (var part in query.split('&')) {
2834 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002835 addQueryParam(
2836 core.Uri.decodeQueryComponent(keyValue[0]),
2837 core.Uri.decodeQueryComponent(keyValue[1]),
2838 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002839 }
2840 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002841 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002842
Martin Kustermannfa83e312017-07-31 12:48:45 +02002843 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002844 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002845 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002846 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08002847 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002848 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002849 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002850 .unclaimAsync(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002851 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002852 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002853 })));
2854 });
2855
Kevin Moored0251702021-01-15 06:41:08 -08002856 unittest.test('method--updateMetadataAsync', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002857 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002858 var res = api.AndroidProvisioningPartnerApi(mock).partners.devices;
Martin Kustermannfa83e312017-07-31 12:48:45 +02002859 var arg_request = buildUpdateDeviceMetadataInBatchRequest();
Kevin Moored0251702021-01-15 06:41:08 -08002860 var arg_partnerId = 'foo';
2861 var arg_$fields = 'foo';
Martin Kustermannfa83e312017-07-31 12:48:45 +02002862 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002863 var obj = api.UpdateDeviceMetadataInBatchRequest.fromJson(
2864 json as core.Map<core.String, core.dynamic>);
2865 checkUpdateDeviceMetadataInBatchRequest(
2866 obj as api.UpdateDeviceMetadataInBatchRequest);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002867
2868 var path = (req.url).path;
2869 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002870 core.int index;
2871 core.String subPart;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002872 unittest.expect(
2873 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002874 pathOffset += 1;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002875 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2876 unittest.equals("v1/partners/"));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002877 pathOffset += 12;
2878 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2879
2880 var query = (req.url).query;
2881 var queryOffset = 0;
Jakob Andersen52715df2018-05-01 13:58:48 +02002882 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002883 void addQueryParam(core.String n, core.String v) =>
2884 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002885
Kevin Moore6d21e902021-01-15 06:41:08 -08002886 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002887 for (var part in query.split('&')) {
2888 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002889 addQueryParam(
2890 core.Uri.decodeQueryComponent(keyValue[0]),
2891 core.Uri.decodeQueryComponent(keyValue[1]),
2892 );
Martin Kustermannfa83e312017-07-31 12:48:45 +02002893 }
2894 }
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002895 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002896
Martin Kustermannfa83e312017-07-31 12:48:45 +02002897 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002898 'content-type': 'application/json; charset=utf-8',
Martin Kustermannfa83e312017-07-31 12:48:45 +02002899 };
Jakob Andersen52715df2018-05-01 13:58:48 +02002900 var resp = convert.json.encode(buildOperation());
Kevin Moore6d21e902021-01-15 06:41:08 -08002901 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermannfa83e312017-07-31 12:48:45 +02002902 }), true);
Martin Kustermann5eb85c12017-09-11 12:35:54 +02002903 res
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002904 .updateMetadataAsync(arg_request, arg_partnerId, $fields: arg_$fields)
Jakob Andersen4ce761d2018-04-19 11:19:11 +02002905 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002906 checkOperation(response as api.Operation);
Martin Kustermannfa83e312017-07-31 12:48:45 +02002907 })));
2908 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02002909 });
Martin Kustermann12cdd522018-08-27 10:46:50 +02002910
Kevin Moore88512712021-01-28 14:43:28 -08002911 unittest.group('resource-PartnersVendorsResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002912 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002913 var mock = HttpServerMock();
Kevin Moore5889af72021-01-28 13:31:53 -08002914 var res = api.AndroidProvisioningPartnerApi(mock).partners.vendors;
Kevin Moored0251702021-01-15 06:41:08 -08002915 var arg_parent = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02002916 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08002917 var arg_pageToken = 'foo';
2918 var arg_$fields = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02002919 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2920 var path = (req.url).path;
2921 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002922 core.int index;
2923 core.String subPart;
Martin Kustermann12cdd522018-08-27 10:46:50 +02002924 unittest.expect(
2925 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2926 pathOffset += 1;
2927 unittest.expect(
2928 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2929 pathOffset += 3;
2930 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2931
2932 var query = (req.url).query;
2933 var queryOffset = 0;
2934 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002935 void addQueryParam(core.String n, core.String v) =>
2936 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann12cdd522018-08-27 10:46:50 +02002937
Kevin Moore6d21e902021-01-15 06:41:08 -08002938 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002939 for (var part in query.split('&')) {
2940 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08002941 addQueryParam(
2942 core.Uri.decodeQueryComponent(keyValue[0]),
2943 core.Uri.decodeQueryComponent(keyValue[1]),
2944 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02002945 }
2946 }
Martin Kustermann12cdd522018-08-27 10:46:50 +02002947 unittest.expect(core.int.parse(queryMap["pageSize"].first),
2948 unittest.equals(arg_pageSize));
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +02002949 unittest.expect(
2950 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
Martin Kustermann12cdd522018-08-27 10:46:50 +02002951 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
2952
2953 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08002954 'content-type': 'application/json; charset=utf-8',
Martin Kustermann12cdd522018-08-27 10:46:50 +02002955 };
2956 var resp = convert.json.encode(buildListVendorsResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08002957 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermann12cdd522018-08-27 10:46:50 +02002958 }), true);
2959 res
2960 .list(arg_parent,
Martin Kustermann12cdd522018-08-27 10:46:50 +02002961 pageSize: arg_pageSize,
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +02002962 pageToken: arg_pageToken,
Martin Kustermann12cdd522018-08-27 10:46:50 +02002963 $fields: arg_$fields)
2964 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08002965 checkListVendorsResponse(response as api.ListVendorsResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02002966 })));
2967 });
2968 });
2969
Kevin Moore88512712021-01-28 14:43:28 -08002970 unittest.group('resource-PartnersVendorsCustomersResource', () {
Kevin Moored0251702021-01-15 06:41:08 -08002971 unittest.test('method--list', () {
Kevin Moore6d21e902021-01-15 06:41:08 -08002972 var mock = HttpServerMock();
Kevin Mooref1c03382021-01-22 19:48:10 -08002973 var res =
Kevin Moore5889af72021-01-28 13:31:53 -08002974 api.AndroidProvisioningPartnerApi(mock).partners.vendors.customers;
Kevin Moored0251702021-01-15 06:41:08 -08002975 var arg_parent = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02002976 var arg_pageSize = 42;
Kevin Moored0251702021-01-15 06:41:08 -08002977 var arg_pageToken = 'foo';
2978 var arg_$fields = 'foo';
Martin Kustermann12cdd522018-08-27 10:46:50 +02002979 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2980 var path = (req.url).path;
2981 var pathOffset = 0;
Kevin Moore6d21e902021-01-15 06:41:08 -08002982 core.int index;
2983 core.String subPart;
Martin Kustermann12cdd522018-08-27 10:46:50 +02002984 unittest.expect(
2985 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2986 pathOffset += 1;
2987 unittest.expect(
2988 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
2989 pathOffset += 3;
2990 // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
2991
2992 var query = (req.url).query;
2993 var queryOffset = 0;
2994 var queryMap = <core.String, core.List<core.String>>{};
Kevin Moore91f7e3e2021-01-26 07:51:20 -08002995 void addQueryParam(core.String n, core.String v) =>
2996 queryMap.putIfAbsent(n, () => []).add(v);
Martin Kustermann12cdd522018-08-27 10:46:50 +02002997
Kevin Moore6d21e902021-01-15 06:41:08 -08002998 if (query.isNotEmpty) {
Kevin Moored0251702021-01-15 06:41:08 -08002999 for (var part in query.split('&')) {
3000 var keyValue = part.split('=');
Kevin Moore6d21e902021-01-15 06:41:08 -08003001 addQueryParam(
3002 core.Uri.decodeQueryComponent(keyValue[0]),
3003 core.Uri.decodeQueryComponent(keyValue[1]),
3004 );
Martin Kustermann12cdd522018-08-27 10:46:50 +02003005 }
3006 }
Martin Kustermann12cdd522018-08-27 10:46:50 +02003007 unittest.expect(core.int.parse(queryMap["pageSize"].first),
3008 unittest.equals(arg_pageSize));
Jonas Finnemann Jensenb223bd52020-10-09 13:02:08 +02003009 unittest.expect(
3010 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
Martin Kustermann12cdd522018-08-27 10:46:50 +02003011 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3012
3013 var h = {
Kevin Moored0251702021-01-15 06:41:08 -08003014 'content-type': 'application/json; charset=utf-8',
Martin Kustermann12cdd522018-08-27 10:46:50 +02003015 };
3016 var resp = convert.json.encode(buildListVendorCustomersResponse());
Kevin Moore6d21e902021-01-15 06:41:08 -08003017 return async.Future.value(stringResponse(200, h, resp));
Martin Kustermann12cdd522018-08-27 10:46:50 +02003018 }), true);
3019 res
3020 .list(arg_parent,
Martin Kustermann12cdd522018-08-27 10:46:50 +02003021 pageSize: arg_pageSize,
Jonas Finnemann Jensenb223bd52020-10-09 13:02:08 +02003022 pageToken: arg_pageToken,
Martin Kustermann12cdd522018-08-27 10:46:50 +02003023 $fields: arg_$fields)
3024 .then(unittest.expectAsync1(((response) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08003025 checkListVendorCustomersResponse(
3026 response as api.ListVendorCustomersResponse);
Martin Kustermann12cdd522018-08-27 10:46:50 +02003027 })));
3028 });
3029 });
Martin Kustermannfa83e312017-07-31 12:48:45 +02003030}