| // ignore_for_file: camel_case_types |
| // ignore_for_file: cascade_invocations |
| // ignore_for_file: comment_references |
| // ignore_for_file: file_names |
| // ignore_for_file: library_names |
| // ignore_for_file: lines_longer_than_80_chars |
| // ignore_for_file: non_constant_identifier_names |
| // ignore_for_file: prefer_const_declarations |
| // ignore_for_file: prefer_expression_function_bodies |
| // ignore_for_file: prefer_final_locals |
| // ignore_for_file: prefer_interpolation_to_compose_strings |
| // ignore_for_file: unnecessary_brace_in_string_interps |
| // ignore_for_file: unnecessary_cast |
| // ignore_for_file: unnecessary_lambdas |
| // ignore_for_file: unnecessary_parenthesis |
| // ignore_for_file: unnecessary_string_interpolations |
| // ignore_for_file: unused_local_variable |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert; |
| import 'dart:core' as core; |
| |
| import 'package:googleapis/memcache/v1.dart' as api; |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import '../test_shared.dart'; |
| |
| core.List<core.String> buildUnnamed4397() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed4397(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o[0], |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o[1], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterApplyParametersRequest = 0; |
| api.ApplyParametersRequest buildApplyParametersRequest() { |
| final o = api.ApplyParametersRequest(); |
| buildCounterApplyParametersRequest++; |
| if (buildCounterApplyParametersRequest < 3) { |
| o.applyAll = true; |
| o.nodeIds = buildUnnamed4397(); |
| } |
| buildCounterApplyParametersRequest--; |
| return o; |
| } |
| |
| void checkApplyParametersRequest(api.ApplyParametersRequest o) { |
| buildCounterApplyParametersRequest++; |
| if (buildCounterApplyParametersRequest < 3) { |
| unittest.expect(o.applyAll!, unittest.isTrue); |
| checkUnnamed4397(o.nodeIds!); |
| } |
| buildCounterApplyParametersRequest--; |
| } |
| |
| core.int buildCounterCancelOperationRequest = 0; |
| api.CancelOperationRequest buildCancelOperationRequest() { |
| final o = api.CancelOperationRequest(); |
| buildCounterCancelOperationRequest++; |
| if (buildCounterCancelOperationRequest < 3) {} |
| buildCounterCancelOperationRequest--; |
| return o; |
| } |
| |
| void checkCancelOperationRequest(api.CancelOperationRequest o) { |
| buildCounterCancelOperationRequest++; |
| if (buildCounterCancelOperationRequest < 3) {} |
| buildCounterCancelOperationRequest--; |
| } |
| |
| core.int buildCounterDailyCycle = 0; |
| api.DailyCycle buildDailyCycle() { |
| final o = api.DailyCycle(); |
| buildCounterDailyCycle++; |
| if (buildCounterDailyCycle < 3) { |
| o.duration = 'foo'; |
| o.startTime = buildTimeOfDay(); |
| } |
| buildCounterDailyCycle--; |
| return o; |
| } |
| |
| void checkDailyCycle(api.DailyCycle o) { |
| buildCounterDailyCycle++; |
| if (buildCounterDailyCycle < 3) { |
| unittest.expect( |
| o.duration!, |
| unittest.equals('foo'), |
| ); |
| checkTimeOfDay(o.startTime!); |
| } |
| buildCounterDailyCycle--; |
| } |
| |
| core.int buildCounterDate = 0; |
| api.Date buildDate() { |
| final o = api.Date(); |
| buildCounterDate++; |
| if (buildCounterDate < 3) { |
| o.day = 42; |
| o.month = 42; |
| o.year = 42; |
| } |
| buildCounterDate--; |
| return o; |
| } |
| |
| void checkDate(api.Date o) { |
| buildCounterDate++; |
| if (buildCounterDate < 3) { |
| unittest.expect( |
| o.day!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.month!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.year!, |
| unittest.equals(42), |
| ); |
| } |
| buildCounterDate--; |
| } |
| |
| core.int buildCounterDenyMaintenancePeriod = 0; |
| api.DenyMaintenancePeriod buildDenyMaintenancePeriod() { |
| final o = api.DenyMaintenancePeriod(); |
| buildCounterDenyMaintenancePeriod++; |
| if (buildCounterDenyMaintenancePeriod < 3) { |
| o.endDate = buildDate(); |
| o.startDate = buildDate(); |
| o.time = buildTimeOfDay(); |
| } |
| buildCounterDenyMaintenancePeriod--; |
| return o; |
| } |
| |
| void checkDenyMaintenancePeriod(api.DenyMaintenancePeriod o) { |
| buildCounterDenyMaintenancePeriod++; |
| if (buildCounterDenyMaintenancePeriod < 3) { |
| checkDate(o.endDate!); |
| checkDate(o.startDate!); |
| checkTimeOfDay(o.time!); |
| } |
| buildCounterDenyMaintenancePeriod--; |
| } |
| |
| core.int buildCounterEmpty = 0; |
| api.Empty buildEmpty() { |
| final o = api.Empty(); |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| return o; |
| } |
| |
| void checkEmpty(api.Empty o) { |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| } |
| |
| core.Map<core.String, api.GoogleCloudMemcacheV1ZoneMetadata> |
| buildUnnamed4398() => { |
| 'x': buildGoogleCloudMemcacheV1ZoneMetadata(), |
| 'y': buildGoogleCloudMemcacheV1ZoneMetadata(), |
| }; |
| |
| void checkUnnamed4398( |
| core.Map<core.String, api.GoogleCloudMemcacheV1ZoneMetadata> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudMemcacheV1ZoneMetadata(o['x']!); |
| checkGoogleCloudMemcacheV1ZoneMetadata(o['y']!); |
| } |
| |
| core.int buildCounterGoogleCloudMemcacheV1LocationMetadata = 0; |
| api.GoogleCloudMemcacheV1LocationMetadata |
| buildGoogleCloudMemcacheV1LocationMetadata() { |
| final o = api.GoogleCloudMemcacheV1LocationMetadata(); |
| buildCounterGoogleCloudMemcacheV1LocationMetadata++; |
| if (buildCounterGoogleCloudMemcacheV1LocationMetadata < 3) { |
| o.availableZones = buildUnnamed4398(); |
| } |
| buildCounterGoogleCloudMemcacheV1LocationMetadata--; |
| return o; |
| } |
| |
| void checkGoogleCloudMemcacheV1LocationMetadata( |
| api.GoogleCloudMemcacheV1LocationMetadata o) { |
| buildCounterGoogleCloudMemcacheV1LocationMetadata++; |
| if (buildCounterGoogleCloudMemcacheV1LocationMetadata < 3) { |
| checkUnnamed4398(o.availableZones!); |
| } |
| buildCounterGoogleCloudMemcacheV1LocationMetadata--; |
| } |
| |
| core.int buildCounterGoogleCloudMemcacheV1OperationMetadata = 0; |
| api.GoogleCloudMemcacheV1OperationMetadata |
| buildGoogleCloudMemcacheV1OperationMetadata() { |
| final o = api.GoogleCloudMemcacheV1OperationMetadata(); |
| buildCounterGoogleCloudMemcacheV1OperationMetadata++; |
| if (buildCounterGoogleCloudMemcacheV1OperationMetadata < 3) { |
| o.apiVersion = 'foo'; |
| o.cancelRequested = true; |
| o.createTime = 'foo'; |
| o.endTime = 'foo'; |
| o.statusDetail = 'foo'; |
| o.target = 'foo'; |
| o.verb = 'foo'; |
| } |
| buildCounterGoogleCloudMemcacheV1OperationMetadata--; |
| return o; |
| } |
| |
| void checkGoogleCloudMemcacheV1OperationMetadata( |
| api.GoogleCloudMemcacheV1OperationMetadata o) { |
| buildCounterGoogleCloudMemcacheV1OperationMetadata++; |
| if (buildCounterGoogleCloudMemcacheV1OperationMetadata < 3) { |
| unittest.expect( |
| o.apiVersion!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.cancelRequested!, unittest.isTrue); |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.endTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.statusDetail!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.target!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.verb!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudMemcacheV1OperationMetadata--; |
| } |
| |
| core.int buildCounterGoogleCloudMemcacheV1ZoneMetadata = 0; |
| api.GoogleCloudMemcacheV1ZoneMetadata buildGoogleCloudMemcacheV1ZoneMetadata() { |
| final o = api.GoogleCloudMemcacheV1ZoneMetadata(); |
| buildCounterGoogleCloudMemcacheV1ZoneMetadata++; |
| if (buildCounterGoogleCloudMemcacheV1ZoneMetadata < 3) {} |
| buildCounterGoogleCloudMemcacheV1ZoneMetadata--; |
| return o; |
| } |
| |
| void checkGoogleCloudMemcacheV1ZoneMetadata( |
| api.GoogleCloudMemcacheV1ZoneMetadata o) { |
| buildCounterGoogleCloudMemcacheV1ZoneMetadata++; |
| if (buildCounterGoogleCloudMemcacheV1ZoneMetadata < 3) {} |
| buildCounterGoogleCloudMemcacheV1ZoneMetadata--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed4399() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed4399(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o['x']!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o['y']!, |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed4400() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed4400(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o['x']!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o['y']!, |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.Map<core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule> |
| buildUnnamed4401() => { |
| 'x': |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(), |
| 'y': |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(), |
| }; |
| |
| void checkUnnamed4401( |
| core.Map<core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule( |
| o['x']!); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule( |
| o['y']!); |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed4402() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed4402(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o['x']!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o['y']!, |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.List< |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource> |
| buildUnnamed4403() => [ |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(), |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(), |
| ]; |
| |
| void checkUnnamed4403( |
| core.List< |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(o[0]); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(o[1]); |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed4404() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed4404(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o['x']!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o['y']!, |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1Instance |
| buildGoogleCloudSaasacceleratorManagementProvidersV1Instance() { |
| final o = api.GoogleCloudSaasacceleratorManagementProvidersV1Instance(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance < 3) { |
| o.consumerDefinedName = 'foo'; |
| o.createTime = 'foo'; |
| o.labels = buildUnnamed4399(); |
| o.maintenancePolicyNames = buildUnnamed4400(); |
| o.maintenanceSchedules = buildUnnamed4401(); |
| o.maintenanceSettings = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(); |
| o.name = 'foo'; |
| o.producerMetadata = buildUnnamed4402(); |
| o.provisionedResources = buildUnnamed4403(); |
| o.slmInstanceTemplate = 'foo'; |
| o.sloMetadata = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(); |
| o.softwareVersions = buildUnnamed4404(); |
| o.state = 'foo'; |
| o.tenantProjectId = 'foo'; |
| o.updateTime = 'foo'; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1Instance( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1Instance o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance < 3) { |
| unittest.expect( |
| o.consumerDefinedName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4399(o.labels!); |
| checkUnnamed4400(o.maintenancePolicyNames!); |
| checkUnnamed4401(o.maintenanceSchedules!); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings( |
| o.maintenanceSettings!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4402(o.producerMetadata!); |
| checkUnnamed4403(o.provisionedResources!); |
| unittest.expect( |
| o.slmInstanceTemplate!, |
| unittest.equals('foo'), |
| ); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata( |
| o.sloMetadata!); |
| checkUnnamed4404(o.softwareVersions!); |
| unittest.expect( |
| o.state!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.tenantProjectId!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule() { |
| final o = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule < |
| 3) { |
| o.canReschedule = true; |
| o.endTime = 'foo'; |
| o.rolloutManagementPolicy = 'foo'; |
| o.scheduleDeadlineTime = 'foo'; |
| o.startTime = 'foo'; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule < |
| 3) { |
| unittest.expect(o.canReschedule!, unittest.isTrue); |
| unittest.expect( |
| o.endTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.rolloutManagementPolicy!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.scheduleDeadlineTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.startTime!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule--; |
| } |
| |
| core.Map<core.String, api.MaintenancePolicy> buildUnnamed4405() => { |
| 'x': buildMaintenancePolicy(), |
| 'y': buildMaintenancePolicy(), |
| }; |
| |
| void checkUnnamed4405(core.Map<core.String, api.MaintenancePolicy> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMaintenancePolicy(o['x']!); |
| checkMaintenancePolicy(o['y']!); |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings() { |
| final o = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings < |
| 3) { |
| o.exclude = true; |
| o.isRollback = true; |
| o.maintenancePolicies = buildUnnamed4405(); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings < |
| 3) { |
| unittest.expect(o.exclude!, unittest.isTrue); |
| unittest.expect(o.isRollback!, unittest.isTrue); |
| checkUnnamed4405(o.maintenancePolicies!); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings--; |
| } |
| |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> |
| buildUnnamed4406() => [ |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(), |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(), |
| ]; |
| |
| void checkUnnamed4406( |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(o[0]); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(o[1]); |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata |
| buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata() { |
| final o = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata < |
| 3) { |
| o.exclusions = buildUnnamed4406(); |
| o.location = 'foo'; |
| o.nodeId = 'foo'; |
| o.perSliEligibility = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility(); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata < |
| 3) { |
| checkUnnamed4406(o.exclusions!); |
| unittest.expect( |
| o.location!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.nodeId!, |
| unittest.equals('foo'), |
| ); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility( |
| o.perSliEligibility!); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata--; |
| } |
| |
| core.Map<core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility> |
| buildUnnamed4407() => { |
| 'x': |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(), |
| 'y': |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(), |
| }; |
| |
| void checkUnnamed4407( |
| core.Map<core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(o['x']!); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(o['y']!); |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility |
| buildGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility() { |
| final o = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility < |
| 3) { |
| o.eligibilities = buildUnnamed4407(); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility < |
| 3) { |
| checkUnnamed4407(o.eligibilities!); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource() { |
| final o = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource < |
| 3) { |
| o.resourceType = 'foo'; |
| o.resourceUrl = 'foo'; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource < |
| 3) { |
| unittest.expect( |
| o.resourceType!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.resourceUrl!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility() { |
| final o = api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility < |
| 3) { |
| o.eligible = true; |
| o.reason = 'foo'; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility < |
| 3) { |
| unittest.expect(o.eligible!, unittest.isTrue); |
| unittest.expect( |
| o.reason!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion = 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion() { |
| final o = api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion < |
| 3) { |
| o.duration = 'foo'; |
| o.reason = 'foo'; |
| o.sliName = 'foo'; |
| o.startTime = 'foo'; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion < |
| 3) { |
| unittest.expect( |
| o.duration!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.reason!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.sliName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.startTime!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion--; |
| } |
| |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> |
| buildUnnamed4408() => [ |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(), |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(), |
| ]; |
| |
| void checkUnnamed4408( |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(o[0]); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(o[1]); |
| } |
| |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata> |
| buildUnnamed4409() => [ |
| buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(), |
| buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(), |
| ]; |
| |
| void checkUnnamed4409( |
| core.List< |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(o[0]); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(o[1]); |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata = 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata() { |
| final o = api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata < |
| 3) { |
| o.exclusions = buildUnnamed4408(); |
| o.nodes = buildUnnamed4409(); |
| o.perSliEligibility = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility(); |
| o.tier = 'foo'; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata < |
| 3) { |
| checkUnnamed4408(o.exclusions!); |
| checkUnnamed4409(o.nodes!); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility( |
| o.perSliEligibility!); |
| unittest.expect( |
| o.tier!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata--; |
| } |
| |
| core.List<api.InstanceMessage> buildUnnamed4410() => [ |
| buildInstanceMessage(), |
| buildInstanceMessage(), |
| ]; |
| |
| void checkUnnamed4410(core.List<api.InstanceMessage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkInstanceMessage(o[0]); |
| checkInstanceMessage(o[1]); |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed4411() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed4411(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o['x']!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o['y']!, |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.List<api.Node> buildUnnamed4412() => [ |
| buildNode(), |
| buildNode(), |
| ]; |
| |
| void checkUnnamed4412(core.List<api.Node> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkNode(o[0]); |
| checkNode(o[1]); |
| } |
| |
| core.List<core.String> buildUnnamed4413() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed4413(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o[0], |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o[1], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterInstance = 0; |
| api.Instance buildInstance() { |
| final o = api.Instance(); |
| buildCounterInstance++; |
| if (buildCounterInstance < 3) { |
| o.authorizedNetwork = 'foo'; |
| o.createTime = 'foo'; |
| o.discoveryEndpoint = 'foo'; |
| o.displayName = 'foo'; |
| o.instanceMessages = buildUnnamed4410(); |
| o.labels = buildUnnamed4411(); |
| o.memcacheFullVersion = 'foo'; |
| o.memcacheNodes = buildUnnamed4412(); |
| o.memcacheVersion = 'foo'; |
| o.name = 'foo'; |
| o.nodeConfig = buildNodeConfig(); |
| o.nodeCount = 42; |
| o.parameters = buildMemcacheParameters(); |
| o.state = 'foo'; |
| o.updateTime = 'foo'; |
| o.zones = buildUnnamed4413(); |
| } |
| buildCounterInstance--; |
| return o; |
| } |
| |
| void checkInstance(api.Instance o) { |
| buildCounterInstance++; |
| if (buildCounterInstance < 3) { |
| unittest.expect( |
| o.authorizedNetwork!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.discoveryEndpoint!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4410(o.instanceMessages!); |
| checkUnnamed4411(o.labels!); |
| unittest.expect( |
| o.memcacheFullVersion!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4412(o.memcacheNodes!); |
| unittest.expect( |
| o.memcacheVersion!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkNodeConfig(o.nodeConfig!); |
| unittest.expect( |
| o.nodeCount!, |
| unittest.equals(42), |
| ); |
| checkMemcacheParameters(o.parameters!); |
| unittest.expect( |
| o.state!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4413(o.zones!); |
| } |
| buildCounterInstance--; |
| } |
| |
| core.int buildCounterInstanceMessage = 0; |
| api.InstanceMessage buildInstanceMessage() { |
| final o = api.InstanceMessage(); |
| buildCounterInstanceMessage++; |
| if (buildCounterInstanceMessage < 3) { |
| o.code = 'foo'; |
| o.message = 'foo'; |
| } |
| buildCounterInstanceMessage--; |
| return o; |
| } |
| |
| void checkInstanceMessage(api.InstanceMessage o) { |
| buildCounterInstanceMessage++; |
| if (buildCounterInstanceMessage < 3) { |
| unittest.expect( |
| o.code!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.message!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterInstanceMessage--; |
| } |
| |
| core.List<api.Instance> buildUnnamed4414() => [ |
| buildInstance(), |
| buildInstance(), |
| ]; |
| |
| void checkUnnamed4414(core.List<api.Instance> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkInstance(o[0]); |
| checkInstance(o[1]); |
| } |
| |
| core.List<core.String> buildUnnamed4415() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed4415(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o[0], |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o[1], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterListInstancesResponse = 0; |
| api.ListInstancesResponse buildListInstancesResponse() { |
| final o = api.ListInstancesResponse(); |
| buildCounterListInstancesResponse++; |
| if (buildCounterListInstancesResponse < 3) { |
| o.instances = buildUnnamed4414(); |
| o.nextPageToken = 'foo'; |
| o.unreachable = buildUnnamed4415(); |
| } |
| buildCounterListInstancesResponse--; |
| return o; |
| } |
| |
| void checkListInstancesResponse(api.ListInstancesResponse o) { |
| buildCounterListInstancesResponse++; |
| if (buildCounterListInstancesResponse < 3) { |
| checkUnnamed4414(o.instances!); |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4415(o.unreachable!); |
| } |
| buildCounterListInstancesResponse--; |
| } |
| |
| core.List<api.Location> buildUnnamed4416() => [ |
| buildLocation(), |
| buildLocation(), |
| ]; |
| |
| void checkUnnamed4416(core.List<api.Location> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLocation(o[0]); |
| checkLocation(o[1]); |
| } |
| |
| core.int buildCounterListLocationsResponse = 0; |
| api.ListLocationsResponse buildListLocationsResponse() { |
| final o = api.ListLocationsResponse(); |
| buildCounterListLocationsResponse++; |
| if (buildCounterListLocationsResponse < 3) { |
| o.locations = buildUnnamed4416(); |
| o.nextPageToken = 'foo'; |
| } |
| buildCounterListLocationsResponse--; |
| return o; |
| } |
| |
| void checkListLocationsResponse(api.ListLocationsResponse o) { |
| buildCounterListLocationsResponse++; |
| if (buildCounterListLocationsResponse < 3) { |
| checkUnnamed4416(o.locations!); |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterListLocationsResponse--; |
| } |
| |
| core.List<api.Operation> buildUnnamed4417() => [ |
| buildOperation(), |
| buildOperation(), |
| ]; |
| |
| void checkUnnamed4417(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.int buildCounterListOperationsResponse = 0; |
| api.ListOperationsResponse buildListOperationsResponse() { |
| final o = api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed4417(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| void checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4417(o.operations!); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed4418() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed4418(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o['x']!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o['y']!, |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed4419() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed4419(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted1 = (o['x']!) as core.Map; |
| unittest.expect(casted1, unittest.hasLength(3)); |
| unittest.expect( |
| casted1['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted1['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted1['string'], |
| unittest.equals('foo'), |
| ); |
| var casted2 = (o['y']!) as core.Map; |
| unittest.expect(casted2, unittest.hasLength(3)); |
| unittest.expect( |
| casted2['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted2['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted2['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterLocation = 0; |
| api.Location buildLocation() { |
| final o = api.Location(); |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| o.displayName = 'foo'; |
| o.labels = buildUnnamed4418(); |
| o.locationId = 'foo'; |
| o.metadata = buildUnnamed4419(); |
| o.name = 'foo'; |
| } |
| buildCounterLocation--; |
| return o; |
| } |
| |
| void checkLocation(api.Location o) { |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4418(o.labels!); |
| unittest.expect( |
| o.locationId!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4419(o.metadata!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterLocation--; |
| } |
| |
| core.Map<core.String, api.ZoneMetadata> buildUnnamed4420() => { |
| 'x': buildZoneMetadata(), |
| 'y': buildZoneMetadata(), |
| }; |
| |
| void checkUnnamed4420(core.Map<core.String, api.ZoneMetadata> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkZoneMetadata(o['x']!); |
| checkZoneMetadata(o['y']!); |
| } |
| |
| core.int buildCounterLocationMetadata = 0; |
| api.LocationMetadata buildLocationMetadata() { |
| final o = api.LocationMetadata(); |
| buildCounterLocationMetadata++; |
| if (buildCounterLocationMetadata < 3) { |
| o.availableZones = buildUnnamed4420(); |
| } |
| buildCounterLocationMetadata--; |
| return o; |
| } |
| |
| void checkLocationMetadata(api.LocationMetadata o) { |
| buildCounterLocationMetadata++; |
| if (buildCounterLocationMetadata < 3) { |
| checkUnnamed4420(o.availableZones!); |
| } |
| buildCounterLocationMetadata--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed4421() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed4421(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o['x']!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o['y']!, |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterMaintenancePolicy = 0; |
| api.MaintenancePolicy buildMaintenancePolicy() { |
| final o = api.MaintenancePolicy(); |
| buildCounterMaintenancePolicy++; |
| if (buildCounterMaintenancePolicy < 3) { |
| o.createTime = 'foo'; |
| o.description = 'foo'; |
| o.labels = buildUnnamed4421(); |
| o.name = 'foo'; |
| o.state = 'foo'; |
| o.updatePolicy = buildUpdatePolicy(); |
| o.updateTime = 'foo'; |
| } |
| buildCounterMaintenancePolicy--; |
| return o; |
| } |
| |
| void checkMaintenancePolicy(api.MaintenancePolicy o) { |
| buildCounterMaintenancePolicy++; |
| if (buildCounterMaintenancePolicy < 3) { |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4421(o.labels!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.state!, |
| unittest.equals('foo'), |
| ); |
| checkUpdatePolicy(o.updatePolicy!); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterMaintenancePolicy--; |
| } |
| |
| core.int buildCounterMaintenanceWindow = 0; |
| api.MaintenanceWindow buildMaintenanceWindow() { |
| final o = api.MaintenanceWindow(); |
| buildCounterMaintenanceWindow++; |
| if (buildCounterMaintenanceWindow < 3) { |
| o.dailyCycle = buildDailyCycle(); |
| o.weeklyCycle = buildWeeklyCycle(); |
| } |
| buildCounterMaintenanceWindow--; |
| return o; |
| } |
| |
| void checkMaintenanceWindow(api.MaintenanceWindow o) { |
| buildCounterMaintenanceWindow++; |
| if (buildCounterMaintenanceWindow < 3) { |
| checkDailyCycle(o.dailyCycle!); |
| checkWeeklyCycle(o.weeklyCycle!); |
| } |
| buildCounterMaintenanceWindow--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed4422() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed4422(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o['x']!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o['y']!, |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterMemcacheParameters = 0; |
| api.MemcacheParameters buildMemcacheParameters() { |
| final o = api.MemcacheParameters(); |
| buildCounterMemcacheParameters++; |
| if (buildCounterMemcacheParameters < 3) { |
| o.id = 'foo'; |
| o.params = buildUnnamed4422(); |
| } |
| buildCounterMemcacheParameters--; |
| return o; |
| } |
| |
| void checkMemcacheParameters(api.MemcacheParameters o) { |
| buildCounterMemcacheParameters++; |
| if (buildCounterMemcacheParameters < 3) { |
| unittest.expect( |
| o.id!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4422(o.params!); |
| } |
| buildCounterMemcacheParameters--; |
| } |
| |
| core.int buildCounterNode = 0; |
| api.Node buildNode() { |
| final o = api.Node(); |
| buildCounterNode++; |
| if (buildCounterNode < 3) { |
| o.host = 'foo'; |
| o.nodeId = 'foo'; |
| o.parameters = buildMemcacheParameters(); |
| o.port = 42; |
| o.state = 'foo'; |
| o.zone = 'foo'; |
| } |
| buildCounterNode--; |
| return o; |
| } |
| |
| void checkNode(api.Node o) { |
| buildCounterNode++; |
| if (buildCounterNode < 3) { |
| unittest.expect( |
| o.host!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.nodeId!, |
| unittest.equals('foo'), |
| ); |
| checkMemcacheParameters(o.parameters!); |
| unittest.expect( |
| o.port!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.state!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.zone!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterNode--; |
| } |
| |
| core.int buildCounterNodeConfig = 0; |
| api.NodeConfig buildNodeConfig() { |
| final o = api.NodeConfig(); |
| buildCounterNodeConfig++; |
| if (buildCounterNodeConfig < 3) { |
| o.cpuCount = 42; |
| o.memorySizeMb = 42; |
| } |
| buildCounterNodeConfig--; |
| return o; |
| } |
| |
| void checkNodeConfig(api.NodeConfig o) { |
| buildCounterNodeConfig++; |
| if (buildCounterNodeConfig < 3) { |
| unittest.expect( |
| o.cpuCount!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.memorySizeMb!, |
| unittest.equals(42), |
| ); |
| } |
| buildCounterNodeConfig--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed4423() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed4423(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted3 = (o['x']!) as core.Map; |
| unittest.expect(casted3, unittest.hasLength(3)); |
| unittest.expect( |
| casted3['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted3['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted3['string'], |
| unittest.equals('foo'), |
| ); |
| var casted4 = (o['y']!) as core.Map; |
| unittest.expect(casted4, unittest.hasLength(3)); |
| unittest.expect( |
| casted4['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted4['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted4['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed4424() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed4424(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted5 = (o['x']!) as core.Map; |
| unittest.expect(casted5, unittest.hasLength(3)); |
| unittest.expect( |
| casted5['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted5['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted5['string'], |
| unittest.equals('foo'), |
| ); |
| var casted6 = (o['y']!) as core.Map; |
| unittest.expect(casted6, unittest.hasLength(3)); |
| unittest.expect( |
| casted6['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted6['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted6['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterOperation = 0; |
| api.Operation buildOperation() { |
| final o = api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed4423(); |
| o.name = 'foo'; |
| o.response = buildUnnamed4424(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| void checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done!, unittest.isTrue); |
| checkStatus(o.error!); |
| checkUnnamed4423(o.metadata!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4424(o.response!); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.int buildCounterOperationMetadata = 0; |
| api.OperationMetadata buildOperationMetadata() { |
| final o = api.OperationMetadata(); |
| buildCounterOperationMetadata++; |
| if (buildCounterOperationMetadata < 3) { |
| o.apiVersion = 'foo'; |
| o.cancelRequested = true; |
| o.createTime = 'foo'; |
| o.endTime = 'foo'; |
| o.statusDetail = 'foo'; |
| o.target = 'foo'; |
| o.verb = 'foo'; |
| } |
| buildCounterOperationMetadata--; |
| return o; |
| } |
| |
| void checkOperationMetadata(api.OperationMetadata o) { |
| buildCounterOperationMetadata++; |
| if (buildCounterOperationMetadata < 3) { |
| unittest.expect( |
| o.apiVersion!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.cancelRequested!, unittest.isTrue); |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.endTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.statusDetail!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.target!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.verb!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterOperationMetadata--; |
| } |
| |
| core.int buildCounterSchedule = 0; |
| api.Schedule buildSchedule() { |
| final o = api.Schedule(); |
| buildCounterSchedule++; |
| if (buildCounterSchedule < 3) { |
| o.day = 'foo'; |
| o.duration = 'foo'; |
| o.startTime = buildTimeOfDay(); |
| } |
| buildCounterSchedule--; |
| return o; |
| } |
| |
| void checkSchedule(api.Schedule o) { |
| buildCounterSchedule++; |
| if (buildCounterSchedule < 3) { |
| unittest.expect( |
| o.day!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.duration!, |
| unittest.equals('foo'), |
| ); |
| checkTimeOfDay(o.startTime!); |
| } |
| buildCounterSchedule--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed4425() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed4425(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted7 = (o['x']!) as core.Map; |
| unittest.expect(casted7, unittest.hasLength(3)); |
| unittest.expect( |
| casted7['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted7['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted7['string'], |
| unittest.equals('foo'), |
| ); |
| var casted8 = (o['y']!) as core.Map; |
| unittest.expect(casted8, unittest.hasLength(3)); |
| unittest.expect( |
| casted8['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted8['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted8['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.List<core.Map<core.String, core.Object>> buildUnnamed4426() => [ |
| buildUnnamed4425(), |
| buildUnnamed4425(), |
| ]; |
| |
| void checkUnnamed4426(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed4425(o[0]); |
| checkUnnamed4425(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| api.Status buildStatus() { |
| final o = api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed4426(); |
| o.message = 'foo'; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| void checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect( |
| o.code!, |
| unittest.equals(42), |
| ); |
| checkUnnamed4426(o.details!); |
| unittest.expect( |
| o.message!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.int buildCounterTimeOfDay = 0; |
| api.TimeOfDay buildTimeOfDay() { |
| final o = api.TimeOfDay(); |
| buildCounterTimeOfDay++; |
| if (buildCounterTimeOfDay < 3) { |
| o.hours = 42; |
| o.minutes = 42; |
| o.nanos = 42; |
| o.seconds = 42; |
| } |
| buildCounterTimeOfDay--; |
| return o; |
| } |
| |
| void checkTimeOfDay(api.TimeOfDay o) { |
| buildCounterTimeOfDay++; |
| if (buildCounterTimeOfDay < 3) { |
| unittest.expect( |
| o.hours!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.minutes!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.nanos!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.seconds!, |
| unittest.equals(42), |
| ); |
| } |
| buildCounterTimeOfDay--; |
| } |
| |
| core.int buildCounterUpdateParametersRequest = 0; |
| api.UpdateParametersRequest buildUpdateParametersRequest() { |
| final o = api.UpdateParametersRequest(); |
| buildCounterUpdateParametersRequest++; |
| if (buildCounterUpdateParametersRequest < 3) { |
| o.parameters = buildMemcacheParameters(); |
| o.updateMask = 'foo'; |
| } |
| buildCounterUpdateParametersRequest--; |
| return o; |
| } |
| |
| void checkUpdateParametersRequest(api.UpdateParametersRequest o) { |
| buildCounterUpdateParametersRequest++; |
| if (buildCounterUpdateParametersRequest < 3) { |
| checkMemcacheParameters(o.parameters!); |
| unittest.expect( |
| o.updateMask!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterUpdateParametersRequest--; |
| } |
| |
| core.List<api.DenyMaintenancePeriod> buildUnnamed4427() => [ |
| buildDenyMaintenancePeriod(), |
| buildDenyMaintenancePeriod(), |
| ]; |
| |
| void checkUnnamed4427(core.List<api.DenyMaintenancePeriod> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkDenyMaintenancePeriod(o[0]); |
| checkDenyMaintenancePeriod(o[1]); |
| } |
| |
| core.int buildCounterUpdatePolicy = 0; |
| api.UpdatePolicy buildUpdatePolicy() { |
| final o = api.UpdatePolicy(); |
| buildCounterUpdatePolicy++; |
| if (buildCounterUpdatePolicy < 3) { |
| o.channel = 'foo'; |
| o.denyMaintenancePeriods = buildUnnamed4427(); |
| o.window = buildMaintenanceWindow(); |
| } |
| buildCounterUpdatePolicy--; |
| return o; |
| } |
| |
| void checkUpdatePolicy(api.UpdatePolicy o) { |
| buildCounterUpdatePolicy++; |
| if (buildCounterUpdatePolicy < 3) { |
| unittest.expect( |
| o.channel!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4427(o.denyMaintenancePeriods!); |
| checkMaintenanceWindow(o.window!); |
| } |
| buildCounterUpdatePolicy--; |
| } |
| |
| core.List<api.Schedule> buildUnnamed4428() => [ |
| buildSchedule(), |
| buildSchedule(), |
| ]; |
| |
| void checkUnnamed4428(core.List<api.Schedule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSchedule(o[0]); |
| checkSchedule(o[1]); |
| } |
| |
| core.int buildCounterWeeklyCycle = 0; |
| api.WeeklyCycle buildWeeklyCycle() { |
| final o = api.WeeklyCycle(); |
| buildCounterWeeklyCycle++; |
| if (buildCounterWeeklyCycle < 3) { |
| o.schedule = buildUnnamed4428(); |
| } |
| buildCounterWeeklyCycle--; |
| return o; |
| } |
| |
| void checkWeeklyCycle(api.WeeklyCycle o) { |
| buildCounterWeeklyCycle++; |
| if (buildCounterWeeklyCycle < 3) { |
| checkUnnamed4428(o.schedule!); |
| } |
| buildCounterWeeklyCycle--; |
| } |
| |
| core.int buildCounterZoneMetadata = 0; |
| api.ZoneMetadata buildZoneMetadata() { |
| final o = api.ZoneMetadata(); |
| buildCounterZoneMetadata++; |
| if (buildCounterZoneMetadata < 3) {} |
| buildCounterZoneMetadata--; |
| return o; |
| } |
| |
| void checkZoneMetadata(api.ZoneMetadata o) { |
| buildCounterZoneMetadata++; |
| if (buildCounterZoneMetadata < 3) {} |
| buildCounterZoneMetadata--; |
| } |
| |
| void main() { |
| unittest.group('obj-schema-ApplyParametersRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildApplyParametersRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ApplyParametersRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkApplyParametersRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CancelOperationRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildCancelOperationRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.CancelOperationRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkCancelOperationRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DailyCycle', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDailyCycle(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.DailyCycle.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkDailyCycle(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Date', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDate(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Date.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkDate(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DenyMaintenancePeriod', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDenyMaintenancePeriod(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.DenyMaintenancePeriod.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkDenyMaintenancePeriod(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Empty', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildEmpty(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Empty.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkEmpty(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudMemcacheV1LocationMetadata', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGoogleCloudMemcacheV1LocationMetadata(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GoogleCloudMemcacheV1LocationMetadata.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudMemcacheV1LocationMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudMemcacheV1OperationMetadata', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGoogleCloudMemcacheV1OperationMetadata(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GoogleCloudMemcacheV1OperationMetadata.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudMemcacheV1OperationMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudMemcacheV1ZoneMetadata', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGoogleCloudMemcacheV1ZoneMetadata(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GoogleCloudMemcacheV1ZoneMetadata.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudMemcacheV1ZoneMetadata(od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1Instance', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGoogleCloudSaasacceleratorManagementProvidersV1Instance(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1Instance.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1Instance(od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule', |
| () { |
| unittest.test('to-json--from-json', () async { |
| final o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule |
| .fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule( |
| od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings', |
| () { |
| unittest.test('to-json--from-json', () async { |
| final o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings |
| .fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings( |
| od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata', |
| () { |
| unittest.test('to-json--from-json', () async { |
| final o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata |
| .fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility', |
| () { |
| unittest.test('to-json--from-json', () async { |
| final o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility |
| .fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility( |
| od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource', |
| () { |
| unittest.test('to-json--from-json', () async { |
| final o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource |
| .fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource( |
| od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility', |
| () { |
| unittest.test('to-json--from-json', () async { |
| final o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility |
| .fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion', |
| () { |
| unittest.test('to-json--from-json', () async { |
| final o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion |
| .fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata', |
| () { |
| unittest.test('to-json--from-json', () async { |
| final o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata |
| .fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Instance', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildInstance(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Instance.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkInstance(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-InstanceMessage', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildInstanceMessage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.InstanceMessage.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkInstanceMessage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListInstancesResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListInstancesResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListInstancesResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListInstancesResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListLocationsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListLocationsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListLocationsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListLocationsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListOperationsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListOperationsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListOperationsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListOperationsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Location', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildLocation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Location.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkLocation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-LocationMetadata', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildLocationMetadata(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.LocationMetadata.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkLocationMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MaintenancePolicy', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildMaintenancePolicy(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.MaintenancePolicy.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkMaintenancePolicy(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MaintenanceWindow', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildMaintenanceWindow(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.MaintenanceWindow.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkMaintenanceWindow(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MemcacheParameters', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildMemcacheParameters(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.MemcacheParameters.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkMemcacheParameters(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Node', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildNode(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Node.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkNode(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-NodeConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildNodeConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.NodeConfig.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkNodeConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Operation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOperation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Operation.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkOperation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OperationMetadata', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOperationMetadata(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.OperationMetadata.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkOperationMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Schedule', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSchedule(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Schedule.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkSchedule(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Status', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildStatus(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Status.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkStatus(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TimeOfDay', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildTimeOfDay(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.TimeOfDay.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkTimeOfDay(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-UpdateParametersRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildUpdateParametersRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.UpdateParametersRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkUpdateParametersRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-UpdatePolicy', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildUpdatePolicy(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.UpdatePolicy.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkUpdatePolicy(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-WeeklyCycle', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildWeeklyCycle(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.WeeklyCycle.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkWeeklyCycle(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ZoneMetadata', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildZoneMetadata(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ZoneMetadata.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkZoneMetadata(od); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsResource', () { |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock).projects.locations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildLocation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkLocation(response as api.Location); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock).projects.locations; |
| final arg_name = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['filter']!.first, |
| unittest.equals(arg_filter), |
| ); |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListLocationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListLocationsResponse(response as api.ListLocationsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsInstancesResource', () { |
| unittest.test('method--applyParameters', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .instances; |
| final arg_request = buildApplyParametersRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.ApplyParametersRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkApplyParametersRequest(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.applyParameters(arg_request, arg_name, |
| $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--create', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .instances; |
| final arg_request = buildInstance(); |
| final arg_parent = 'foo'; |
| final arg_instanceId = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = |
| api.Instance.fromJson(json as core.Map<core.String, core.dynamic>); |
| checkInstance(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['instanceId']!.first, |
| unittest.equals(arg_instanceId), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.create(arg_request, arg_parent, |
| instanceId: arg_instanceId, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--delete', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .instances; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.delete(arg_name, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .instances; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildInstance()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkInstance(response as api.Instance); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .instances; |
| final arg_parent = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_orderBy = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['filter']!.first, |
| unittest.equals(arg_filter), |
| ); |
| unittest.expect( |
| queryMap['orderBy']!.first, |
| unittest.equals(arg_orderBy), |
| ); |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListInstancesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_parent, |
| filter: arg_filter, |
| orderBy: arg_orderBy, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListInstancesResponse(response as api.ListInstancesResponse); |
| }); |
| |
| unittest.test('method--patch', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .instances; |
| final arg_request = buildInstance(); |
| final arg_name = 'foo'; |
| final arg_updateMask = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = |
| api.Instance.fromJson(json as core.Map<core.String, core.dynamic>); |
| checkInstance(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['updateMask']!.first, |
| unittest.equals(arg_updateMask), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.patch(arg_request, arg_name, |
| updateMask: arg_updateMask, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--updateParameters', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .instances; |
| final arg_request = buildUpdateParametersRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.UpdateParametersRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkUpdateParametersRequest(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.updateParameters(arg_request, arg_name, |
| $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsOperationsResource', () { |
| unittest.test('method--cancel', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .operations; |
| final arg_request = buildCancelOperationRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.CancelOperationRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkCancelOperationRequest(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = |
| await res.cancel(arg_request, arg_name, $fields: arg_$fields); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--delete', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .operations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.delete(arg_name, $fields: arg_$fields); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .operations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudMemorystoreForMemcachedApi(mock) |
| .projects |
| .locations |
| .operations; |
| final arg_name = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['filter']!.first, |
| unittest.equals(arg_filter), |
| ); |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListOperationsResponse(response as api.ListOperationsResponse); |
| }); |
| }); |
| } |