| // ignore_for_file: camel_case_types |
| // 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_expression_function_bodies |
| // 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: avoid_returning_null |
| // ignore_for_file: cascade_invocations |
| // ignore_for_file: prefer_final_locals |
| // ignore_for_file: prefer_single_quotes |
| // ignore_for_file: unused_local_variable |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert; |
| import 'dart:core' as core; |
| |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| import 'package:googleapis/managedidentities/v1.dart' as api; |
| |
| import '../test_shared.dart'; |
| |
| core.int buildCounterAttachTrustRequest = 0; |
| api.AttachTrustRequest buildAttachTrustRequest() { |
| var o = api.AttachTrustRequest(); |
| buildCounterAttachTrustRequest++; |
| if (buildCounterAttachTrustRequest < 3) { |
| o.trust = buildTrust(); |
| } |
| buildCounterAttachTrustRequest--; |
| return o; |
| } |
| |
| void checkAttachTrustRequest(api.AttachTrustRequest o) { |
| buildCounterAttachTrustRequest++; |
| if (buildCounterAttachTrustRequest < 3) { |
| checkTrust(o.trust! as api.Trust); |
| } |
| buildCounterAttachTrustRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed6765() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6765(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 buildCounterBinding = 0; |
| api.Binding buildBinding() { |
| var o = api.Binding(); |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| o.condition = buildExpr(); |
| o.members = buildUnnamed6765(); |
| o.role = 'foo'; |
| } |
| buildCounterBinding--; |
| return o; |
| } |
| |
| void checkBinding(api.Binding o) { |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| checkExpr(o.condition! as api.Expr); |
| checkUnnamed6765(o.members!); |
| unittest.expect( |
| o.role!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterBinding--; |
| } |
| |
| core.int buildCounterCancelOperationRequest = 0; |
| api.CancelOperationRequest buildCancelOperationRequest() { |
| var 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() { |
| var 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! as api.TimeOfDay); |
| } |
| buildCounterDailyCycle--; |
| } |
| |
| core.int buildCounterDate = 0; |
| api.Date buildDate() { |
| var 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() { |
| var 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! as api.Date); |
| checkDate(o.startDate! as api.Date); |
| checkTimeOfDay(o.time! as api.TimeOfDay); |
| } |
| buildCounterDenyMaintenancePeriod--; |
| } |
| |
| core.int buildCounterDetachTrustRequest = 0; |
| api.DetachTrustRequest buildDetachTrustRequest() { |
| var o = api.DetachTrustRequest(); |
| buildCounterDetachTrustRequest++; |
| if (buildCounterDetachTrustRequest < 3) { |
| o.trust = buildTrust(); |
| } |
| buildCounterDetachTrustRequest--; |
| return o; |
| } |
| |
| void checkDetachTrustRequest(api.DetachTrustRequest o) { |
| buildCounterDetachTrustRequest++; |
| if (buildCounterDetachTrustRequest < 3) { |
| checkTrust(o.trust! as api.Trust); |
| } |
| buildCounterDetachTrustRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed6766() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6766(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.Map<core.String, core.String> buildUnnamed6767() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6767(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<core.String> buildUnnamed6768() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6768(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.List<api.Trust> buildUnnamed6769() { |
| var o = <api.Trust>[]; |
| o.add(buildTrust()); |
| o.add(buildTrust()); |
| return o; |
| } |
| |
| void checkUnnamed6769(core.List<api.Trust> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkTrust(o[0] as api.Trust); |
| checkTrust(o[1] as api.Trust); |
| } |
| |
| core.int buildCounterDomain = 0; |
| api.Domain buildDomain() { |
| var o = api.Domain(); |
| buildCounterDomain++; |
| if (buildCounterDomain < 3) { |
| o.admin = 'foo'; |
| o.authorizedNetworks = buildUnnamed6766(); |
| o.createTime = 'foo'; |
| o.fqdn = 'foo'; |
| o.labels = buildUnnamed6767(); |
| o.locations = buildUnnamed6768(); |
| o.name = 'foo'; |
| o.reservedIpRange = 'foo'; |
| o.state = 'foo'; |
| o.statusMessage = 'foo'; |
| o.trusts = buildUnnamed6769(); |
| o.updateTime = 'foo'; |
| } |
| buildCounterDomain--; |
| return o; |
| } |
| |
| void checkDomain(api.Domain o) { |
| buildCounterDomain++; |
| if (buildCounterDomain < 3) { |
| unittest.expect( |
| o.admin!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6766(o.authorizedNetworks!); |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.fqdn!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6767(o.labels!); |
| checkUnnamed6768(o.locations!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.reservedIpRange!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.state!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.statusMessage!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6769(o.trusts!); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterDomain--; |
| } |
| |
| core.int buildCounterEmpty = 0; |
| api.Empty buildEmpty() { |
| var o = api.Empty(); |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| return o; |
| } |
| |
| void checkEmpty(api.Empty o) { |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| } |
| |
| core.int buildCounterExpr = 0; |
| api.Expr buildExpr() { |
| var o = api.Expr(); |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| o.description = 'foo'; |
| o.expression = 'foo'; |
| o.location = 'foo'; |
| o.title = 'foo'; |
| } |
| buildCounterExpr--; |
| return o; |
| } |
| |
| void checkExpr(api.Expr o) { |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.expression!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.location!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.title!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterExpr--; |
| } |
| |
| core.int buildCounterGoogleCloudManagedidentitiesV1OpMetadata = 0; |
| api.GoogleCloudManagedidentitiesV1OpMetadata |
| buildGoogleCloudManagedidentitiesV1OpMetadata() { |
| var o = api.GoogleCloudManagedidentitiesV1OpMetadata(); |
| buildCounterGoogleCloudManagedidentitiesV1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1OpMetadata < 3) { |
| o.apiVersion = 'foo'; |
| o.createTime = 'foo'; |
| o.endTime = 'foo'; |
| o.requestedCancellation = true; |
| o.target = 'foo'; |
| o.verb = 'foo'; |
| } |
| buildCounterGoogleCloudManagedidentitiesV1OpMetadata--; |
| return o; |
| } |
| |
| void checkGoogleCloudManagedidentitiesV1OpMetadata( |
| api.GoogleCloudManagedidentitiesV1OpMetadata o) { |
| buildCounterGoogleCloudManagedidentitiesV1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1OpMetadata < 3) { |
| unittest.expect( |
| o.apiVersion!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.endTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.requestedCancellation!, unittest.isTrue); |
| unittest.expect( |
| o.target!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.verb!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudManagedidentitiesV1OpMetadata--; |
| } |
| |
| core.int buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata = 0; |
| api.GoogleCloudManagedidentitiesV1alpha1OpMetadata |
| buildGoogleCloudManagedidentitiesV1alpha1OpMetadata() { |
| var o = api.GoogleCloudManagedidentitiesV1alpha1OpMetadata(); |
| buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata < 3) { |
| o.apiVersion = 'foo'; |
| o.createTime = 'foo'; |
| o.endTime = 'foo'; |
| o.requestedCancellation = true; |
| o.target = 'foo'; |
| o.verb = 'foo'; |
| } |
| buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata--; |
| return o; |
| } |
| |
| void checkGoogleCloudManagedidentitiesV1alpha1OpMetadata( |
| api.GoogleCloudManagedidentitiesV1alpha1OpMetadata o) { |
| buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata < 3) { |
| unittest.expect( |
| o.apiVersion!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.endTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.requestedCancellation!, unittest.isTrue); |
| unittest.expect( |
| o.target!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.verb!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata--; |
| } |
| |
| core.int buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata = 0; |
| api.GoogleCloudManagedidentitiesV1beta1OpMetadata |
| buildGoogleCloudManagedidentitiesV1beta1OpMetadata() { |
| var o = api.GoogleCloudManagedidentitiesV1beta1OpMetadata(); |
| buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata < 3) { |
| o.apiVersion = 'foo'; |
| o.createTime = 'foo'; |
| o.endTime = 'foo'; |
| o.requestedCancellation = true; |
| o.target = 'foo'; |
| o.verb = 'foo'; |
| } |
| buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata--; |
| return o; |
| } |
| |
| void checkGoogleCloudManagedidentitiesV1beta1OpMetadata( |
| api.GoogleCloudManagedidentitiesV1beta1OpMetadata o) { |
| buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata < 3) { |
| unittest.expect( |
| o.apiVersion!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.endTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.requestedCancellation!, unittest.isTrue); |
| unittest.expect( |
| o.target!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.verb!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed6770() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6770(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> buildUnnamed6771() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6771(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> |
| buildUnnamed6772() { |
| var o = <core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule>{}; |
| o['x'] = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(); |
| o['y'] = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(); |
| return o; |
| } |
| |
| void checkUnnamed6772( |
| core.Map<core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule( |
| o['x']! as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule( |
| o['y']! as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule); |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed6773() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6773(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> |
| buildUnnamed6774() { |
| var o = < |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource>[]; |
| o.add( |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource()); |
| o.add( |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource()); |
| return o; |
| } |
| |
| void checkUnnamed6774( |
| core.List< |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(o[0] |
| as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(o[1] |
| as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource); |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed6775() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6775(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() { |
| var o = api.GoogleCloudSaasacceleratorManagementProvidersV1Instance(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance < 3) { |
| o.consumerDefinedName = 'foo'; |
| o.createTime = 'foo'; |
| o.labels = buildUnnamed6770(); |
| o.maintenancePolicyNames = buildUnnamed6771(); |
| o.maintenanceSchedules = buildUnnamed6772(); |
| o.maintenanceSettings = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(); |
| o.name = 'foo'; |
| o.producerMetadata = buildUnnamed6773(); |
| o.provisionedResources = buildUnnamed6774(); |
| o.slmInstanceTemplate = 'foo'; |
| o.sloMetadata = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(); |
| o.softwareVersions = buildUnnamed6775(); |
| 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'), |
| ); |
| checkUnnamed6770(o.labels!); |
| checkUnnamed6771(o.maintenancePolicyNames!); |
| checkUnnamed6772(o.maintenanceSchedules!); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings( |
| o.maintenanceSettings! as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6773(o.producerMetadata!); |
| checkUnnamed6774(o.provisionedResources!); |
| unittest.expect( |
| o.slmInstanceTemplate!, |
| unittest.equals('foo'), |
| ); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata( |
| o.sloMetadata! |
| as api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata); |
| checkUnnamed6775(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() { |
| var 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> buildUnnamed6776() { |
| var o = <core.String, api.MaintenancePolicy>{}; |
| o['x'] = buildMaintenancePolicy(); |
| o['y'] = buildMaintenancePolicy(); |
| return o; |
| } |
| |
| void checkUnnamed6776(core.Map<core.String, api.MaintenancePolicy> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMaintenancePolicy(o['x']! as api.MaintenancePolicy); |
| checkMaintenancePolicy(o['y']! as api.MaintenancePolicy); |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings() { |
| var o = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings < |
| 3) { |
| o.exclude = true; |
| o.isRollback = true; |
| o.maintenancePolicies = buildUnnamed6776(); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings < |
| 3) { |
| unittest.expect(o.exclude!, unittest.isTrue); |
| unittest.expect(o.isRollback!, unittest.isTrue); |
| checkUnnamed6776(o.maintenancePolicies!); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings--; |
| } |
| |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> |
| buildUnnamed6777() { |
| var o = <api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion>[]; |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion()); |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion()); |
| return o; |
| } |
| |
| void checkUnnamed6777( |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion( |
| o[0] as api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion( |
| o[1] as api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion); |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata |
| buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata() { |
| var o = api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata < |
| 3) { |
| o.exclusions = buildUnnamed6777(); |
| o.location = 'foo'; |
| o.nodeId = 'foo'; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata < |
| 3) { |
| checkUnnamed6777(o.exclusions!); |
| unittest.expect( |
| o.location!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.nodeId!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata--; |
| } |
| |
| core.Map<core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility> |
| buildUnnamed6778() { |
| var o = <core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility>{}; |
| o['x'] = buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(); |
| o['y'] = buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(); |
| return o; |
| } |
| |
| void checkUnnamed6778( |
| core.Map<core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(o['x']! |
| as api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(o['y']! |
| as api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility); |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility |
| buildGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility() { |
| var o = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility < |
| 3) { |
| o.eligibilities = buildUnnamed6778(); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility < |
| 3) { |
| checkUnnamed6778(o.eligibilities!); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource = |
| 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource() { |
| var 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() { |
| var 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() { |
| var 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> |
| buildUnnamed6779() { |
| var o = <api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion>[]; |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion()); |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion()); |
| return o; |
| } |
| |
| void checkUnnamed6779( |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion( |
| o[0] as api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion( |
| o[1] as api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion); |
| } |
| |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata> |
| buildUnnamed6780() { |
| var o = |
| <api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata>[]; |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata()); |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata()); |
| return o; |
| } |
| |
| void checkUnnamed6780( |
| core.List< |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(o[0] |
| as api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(o[1] |
| as api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata); |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata = 0; |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata() { |
| var o = api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata < |
| 3) { |
| o.eligibility = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(); |
| o.exclusions = buildUnnamed6779(); |
| o.nodes = buildUnnamed6780(); |
| o.perSliEligibility = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility(); |
| o.tier = 'foo'; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata--; |
| return o; |
| } |
| |
| void checkGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata < |
| 3) { |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(o |
| .eligibility! |
| as api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility); |
| checkUnnamed6779(o.exclusions!); |
| checkUnnamed6780(o.nodes!); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility( |
| o.perSliEligibility! as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility); |
| unittest.expect( |
| o.tier!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata--; |
| } |
| |
| core.List<api.Domain> buildUnnamed6781() { |
| var o = <api.Domain>[]; |
| o.add(buildDomain()); |
| o.add(buildDomain()); |
| return o; |
| } |
| |
| void checkUnnamed6781(core.List<api.Domain> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkDomain(o[0] as api.Domain); |
| checkDomain(o[1] as api.Domain); |
| } |
| |
| core.List<core.String> buildUnnamed6782() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6782(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 buildCounterListDomainsResponse = 0; |
| api.ListDomainsResponse buildListDomainsResponse() { |
| var o = api.ListDomainsResponse(); |
| buildCounterListDomainsResponse++; |
| if (buildCounterListDomainsResponse < 3) { |
| o.domains = buildUnnamed6781(); |
| o.nextPageToken = 'foo'; |
| o.unreachable = buildUnnamed6782(); |
| } |
| buildCounterListDomainsResponse--; |
| return o; |
| } |
| |
| void checkListDomainsResponse(api.ListDomainsResponse o) { |
| buildCounterListDomainsResponse++; |
| if (buildCounterListDomainsResponse < 3) { |
| checkUnnamed6781(o.domains!); |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6782(o.unreachable!); |
| } |
| buildCounterListDomainsResponse--; |
| } |
| |
| core.List<api.Location> buildUnnamed6783() { |
| var o = <api.Location>[]; |
| o.add(buildLocation()); |
| o.add(buildLocation()); |
| return o; |
| } |
| |
| void checkUnnamed6783(core.List<api.Location> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLocation(o[0] as api.Location); |
| checkLocation(o[1] as api.Location); |
| } |
| |
| core.int buildCounterListLocationsResponse = 0; |
| api.ListLocationsResponse buildListLocationsResponse() { |
| var o = api.ListLocationsResponse(); |
| buildCounterListLocationsResponse++; |
| if (buildCounterListLocationsResponse < 3) { |
| o.locations = buildUnnamed6783(); |
| o.nextPageToken = 'foo'; |
| } |
| buildCounterListLocationsResponse--; |
| return o; |
| } |
| |
| void checkListLocationsResponse(api.ListLocationsResponse o) { |
| buildCounterListLocationsResponse++; |
| if (buildCounterListLocationsResponse < 3) { |
| checkUnnamed6783(o.locations!); |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterListLocationsResponse--; |
| } |
| |
| core.List<api.Operation> buildUnnamed6784() { |
| var o = <api.Operation>[]; |
| o.add(buildOperation()); |
| o.add(buildOperation()); |
| return o; |
| } |
| |
| void checkUnnamed6784(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0] as api.Operation); |
| checkOperation(o[1] as api.Operation); |
| } |
| |
| core.int buildCounterListOperationsResponse = 0; |
| api.ListOperationsResponse buildListOperationsResponse() { |
| var o = api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed6784(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| void checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6784(o.operations!); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed6785() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6785(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> buildUnnamed6786() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed6786(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() { |
| var o = api.Location(); |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| o.displayName = 'foo'; |
| o.labels = buildUnnamed6785(); |
| o.locationId = 'foo'; |
| o.metadata = buildUnnamed6786(); |
| o.name = 'foo'; |
| } |
| buildCounterLocation--; |
| return o; |
| } |
| |
| void checkLocation(api.Location o) { |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6785(o.labels!); |
| unittest.expect( |
| o.locationId!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6786(o.metadata!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterLocation--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed6787() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6787(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() { |
| var o = api.MaintenancePolicy(); |
| buildCounterMaintenancePolicy++; |
| if (buildCounterMaintenancePolicy < 3) { |
| o.createTime = 'foo'; |
| o.description = 'foo'; |
| o.labels = buildUnnamed6787(); |
| 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'), |
| ); |
| checkUnnamed6787(o.labels!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.state!, |
| unittest.equals('foo'), |
| ); |
| checkUpdatePolicy(o.updatePolicy! as api.UpdatePolicy); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterMaintenancePolicy--; |
| } |
| |
| core.int buildCounterMaintenanceWindow = 0; |
| api.MaintenanceWindow buildMaintenanceWindow() { |
| var 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! as api.DailyCycle); |
| checkWeeklyCycle(o.weeklyCycle! as api.WeeklyCycle); |
| } |
| buildCounterMaintenanceWindow--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed6788() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed6788(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> buildUnnamed6789() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed6789(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() { |
| var o = api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed6788(); |
| o.name = 'foo'; |
| o.response = buildUnnamed6789(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| void checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done!, unittest.isTrue); |
| checkStatus(o.error! as api.Status); |
| checkUnnamed6788(o.metadata!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6789(o.response!); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.int buildCounterOperationMetadata = 0; |
| api.OperationMetadata buildOperationMetadata() { |
| var 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.List<api.Binding> buildUnnamed6790() { |
| var o = <api.Binding>[]; |
| o.add(buildBinding()); |
| o.add(buildBinding()); |
| return o; |
| } |
| |
| void checkUnnamed6790(core.List<api.Binding> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBinding(o[0] as api.Binding); |
| checkBinding(o[1] as api.Binding); |
| } |
| |
| core.int buildCounterPolicy = 0; |
| api.Policy buildPolicy() { |
| var o = api.Policy(); |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| o.bindings = buildUnnamed6790(); |
| o.etag = 'foo'; |
| o.version = 42; |
| } |
| buildCounterPolicy--; |
| return o; |
| } |
| |
| void checkPolicy(api.Policy o) { |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| checkUnnamed6790(o.bindings!); |
| unittest.expect( |
| o.etag!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.version!, |
| unittest.equals(42), |
| ); |
| } |
| buildCounterPolicy--; |
| } |
| |
| core.List<core.String> buildUnnamed6791() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6791(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 buildCounterReconfigureTrustRequest = 0; |
| api.ReconfigureTrustRequest buildReconfigureTrustRequest() { |
| var o = api.ReconfigureTrustRequest(); |
| buildCounterReconfigureTrustRequest++; |
| if (buildCounterReconfigureTrustRequest < 3) { |
| o.targetDnsIpAddresses = buildUnnamed6791(); |
| o.targetDomainName = 'foo'; |
| } |
| buildCounterReconfigureTrustRequest--; |
| return o; |
| } |
| |
| void checkReconfigureTrustRequest(api.ReconfigureTrustRequest o) { |
| buildCounterReconfigureTrustRequest++; |
| if (buildCounterReconfigureTrustRequest < 3) { |
| checkUnnamed6791(o.targetDnsIpAddresses!); |
| unittest.expect( |
| o.targetDomainName!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterReconfigureTrustRequest--; |
| } |
| |
| core.int buildCounterResetAdminPasswordRequest = 0; |
| api.ResetAdminPasswordRequest buildResetAdminPasswordRequest() { |
| var o = api.ResetAdminPasswordRequest(); |
| buildCounterResetAdminPasswordRequest++; |
| if (buildCounterResetAdminPasswordRequest < 3) {} |
| buildCounterResetAdminPasswordRequest--; |
| return o; |
| } |
| |
| void checkResetAdminPasswordRequest(api.ResetAdminPasswordRequest o) { |
| buildCounterResetAdminPasswordRequest++; |
| if (buildCounterResetAdminPasswordRequest < 3) {} |
| buildCounterResetAdminPasswordRequest--; |
| } |
| |
| core.int buildCounterResetAdminPasswordResponse = 0; |
| api.ResetAdminPasswordResponse buildResetAdminPasswordResponse() { |
| var o = api.ResetAdminPasswordResponse(); |
| buildCounterResetAdminPasswordResponse++; |
| if (buildCounterResetAdminPasswordResponse < 3) { |
| o.password = 'foo'; |
| } |
| buildCounterResetAdminPasswordResponse--; |
| return o; |
| } |
| |
| void checkResetAdminPasswordResponse(api.ResetAdminPasswordResponse o) { |
| buildCounterResetAdminPasswordResponse++; |
| if (buildCounterResetAdminPasswordResponse < 3) { |
| unittest.expect( |
| o.password!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterResetAdminPasswordResponse--; |
| } |
| |
| core.int buildCounterSchedule = 0; |
| api.Schedule buildSchedule() { |
| var 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! as api.TimeOfDay); |
| } |
| buildCounterSchedule--; |
| } |
| |
| core.int buildCounterSetIamPolicyRequest = 0; |
| api.SetIamPolicyRequest buildSetIamPolicyRequest() { |
| var o = api.SetIamPolicyRequest(); |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| o.policy = buildPolicy(); |
| } |
| buildCounterSetIamPolicyRequest--; |
| return o; |
| } |
| |
| void checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| checkPolicy(o.policy! as api.Policy); |
| } |
| buildCounterSetIamPolicyRequest--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed6792() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed6792(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>> buildUnnamed6793() { |
| var o = <core.Map<core.String, core.Object>>[]; |
| o.add(buildUnnamed6792()); |
| o.add(buildUnnamed6792()); |
| return o; |
| } |
| |
| void checkUnnamed6793(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed6792(o[0]); |
| checkUnnamed6792(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| api.Status buildStatus() { |
| var o = api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed6793(); |
| o.message = 'foo'; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| void checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect( |
| o.code!, |
| unittest.equals(42), |
| ); |
| checkUnnamed6793(o.details!); |
| unittest.expect( |
| o.message!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.List<core.String> buildUnnamed6794() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6794(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 buildCounterTestIamPermissionsRequest = 0; |
| api.TestIamPermissionsRequest buildTestIamPermissionsRequest() { |
| var o = api.TestIamPermissionsRequest(); |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| o.permissions = buildUnnamed6794(); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| checkUnnamed6794(o.permissions!); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed6795() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6795(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 buildCounterTestIamPermissionsResponse = 0; |
| api.TestIamPermissionsResponse buildTestIamPermissionsResponse() { |
| var o = api.TestIamPermissionsResponse(); |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| o.permissions = buildUnnamed6795(); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| checkUnnamed6795(o.permissions!); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| } |
| |
| core.int buildCounterTimeOfDay = 0; |
| api.TimeOfDay buildTimeOfDay() { |
| var 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.List<core.String> buildUnnamed6796() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6796(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 buildCounterTrust = 0; |
| api.Trust buildTrust() { |
| var o = api.Trust(); |
| buildCounterTrust++; |
| if (buildCounterTrust < 3) { |
| o.createTime = 'foo'; |
| o.lastTrustHeartbeatTime = 'foo'; |
| o.selectiveAuthentication = true; |
| o.state = 'foo'; |
| o.stateDescription = 'foo'; |
| o.targetDnsIpAddresses = buildUnnamed6796(); |
| o.targetDomainName = 'foo'; |
| o.trustDirection = 'foo'; |
| o.trustHandshakeSecret = 'foo'; |
| o.trustType = 'foo'; |
| o.updateTime = 'foo'; |
| } |
| buildCounterTrust--; |
| return o; |
| } |
| |
| void checkTrust(api.Trust o) { |
| buildCounterTrust++; |
| if (buildCounterTrust < 3) { |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.lastTrustHeartbeatTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.selectiveAuthentication!, unittest.isTrue); |
| unittest.expect( |
| o.state!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.stateDescription!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6796(o.targetDnsIpAddresses!); |
| unittest.expect( |
| o.targetDomainName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.trustDirection!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.trustHandshakeSecret!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.trustType!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterTrust--; |
| } |
| |
| core.List<api.DenyMaintenancePeriod> buildUnnamed6797() { |
| var o = <api.DenyMaintenancePeriod>[]; |
| o.add(buildDenyMaintenancePeriod()); |
| o.add(buildDenyMaintenancePeriod()); |
| return o; |
| } |
| |
| void checkUnnamed6797(core.List<api.DenyMaintenancePeriod> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkDenyMaintenancePeriod(o[0] as api.DenyMaintenancePeriod); |
| checkDenyMaintenancePeriod(o[1] as api.DenyMaintenancePeriod); |
| } |
| |
| core.int buildCounterUpdatePolicy = 0; |
| api.UpdatePolicy buildUpdatePolicy() { |
| var o = api.UpdatePolicy(); |
| buildCounterUpdatePolicy++; |
| if (buildCounterUpdatePolicy < 3) { |
| o.channel = 'foo'; |
| o.denyMaintenancePeriods = buildUnnamed6797(); |
| o.window = buildMaintenanceWindow(); |
| } |
| buildCounterUpdatePolicy--; |
| return o; |
| } |
| |
| void checkUpdatePolicy(api.UpdatePolicy o) { |
| buildCounterUpdatePolicy++; |
| if (buildCounterUpdatePolicy < 3) { |
| unittest.expect( |
| o.channel!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6797(o.denyMaintenancePeriods!); |
| checkMaintenanceWindow(o.window! as api.MaintenanceWindow); |
| } |
| buildCounterUpdatePolicy--; |
| } |
| |
| core.int buildCounterValidateTrustRequest = 0; |
| api.ValidateTrustRequest buildValidateTrustRequest() { |
| var o = api.ValidateTrustRequest(); |
| buildCounterValidateTrustRequest++; |
| if (buildCounterValidateTrustRequest < 3) { |
| o.trust = buildTrust(); |
| } |
| buildCounterValidateTrustRequest--; |
| return o; |
| } |
| |
| void checkValidateTrustRequest(api.ValidateTrustRequest o) { |
| buildCounterValidateTrustRequest++; |
| if (buildCounterValidateTrustRequest < 3) { |
| checkTrust(o.trust! as api.Trust); |
| } |
| buildCounterValidateTrustRequest--; |
| } |
| |
| core.List<api.Schedule> buildUnnamed6798() { |
| var o = <api.Schedule>[]; |
| o.add(buildSchedule()); |
| o.add(buildSchedule()); |
| return o; |
| } |
| |
| void checkUnnamed6798(core.List<api.Schedule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSchedule(o[0] as api.Schedule); |
| checkSchedule(o[1] as api.Schedule); |
| } |
| |
| core.int buildCounterWeeklyCycle = 0; |
| api.WeeklyCycle buildWeeklyCycle() { |
| var o = api.WeeklyCycle(); |
| buildCounterWeeklyCycle++; |
| if (buildCounterWeeklyCycle < 3) { |
| o.schedule = buildUnnamed6798(); |
| } |
| buildCounterWeeklyCycle--; |
| return o; |
| } |
| |
| void checkWeeklyCycle(api.WeeklyCycle o) { |
| buildCounterWeeklyCycle++; |
| if (buildCounterWeeklyCycle < 3) { |
| checkUnnamed6798(o.schedule!); |
| } |
| buildCounterWeeklyCycle--; |
| } |
| |
| void main() { |
| unittest.group('obj-schema-AttachTrustRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildAttachTrustRequest(); |
| var od = api.AttachTrustRequest.fromJson(o.toJson()); |
| checkAttachTrustRequest(od as api.AttachTrustRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Binding', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildBinding(); |
| var od = api.Binding.fromJson(o.toJson()); |
| checkBinding(od as api.Binding); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CancelOperationRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildCancelOperationRequest(); |
| var od = api.CancelOperationRequest.fromJson(o.toJson()); |
| checkCancelOperationRequest(od as api.CancelOperationRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DailyCycle', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildDailyCycle(); |
| var od = api.DailyCycle.fromJson(o.toJson()); |
| checkDailyCycle(od as api.DailyCycle); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Date', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildDate(); |
| var od = api.Date.fromJson(o.toJson()); |
| checkDate(od as api.Date); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DenyMaintenancePeriod', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildDenyMaintenancePeriod(); |
| var od = api.DenyMaintenancePeriod.fromJson(o.toJson()); |
| checkDenyMaintenancePeriod(od as api.DenyMaintenancePeriod); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DetachTrustRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildDetachTrustRequest(); |
| var od = api.DetachTrustRequest.fromJson(o.toJson()); |
| checkDetachTrustRequest(od as api.DetachTrustRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Domain', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildDomain(); |
| var od = api.Domain.fromJson(o.toJson()); |
| checkDomain(od as api.Domain); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Empty', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildEmpty(); |
| var od = api.Empty.fromJson(o.toJson()); |
| checkEmpty(od as api.Empty); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Expr', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildExpr(); |
| var od = api.Expr.fromJson(o.toJson()); |
| checkExpr(od as api.Expr); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudManagedidentitiesV1OpMetadata', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudManagedidentitiesV1OpMetadata(); |
| var od = |
| api.GoogleCloudManagedidentitiesV1OpMetadata.fromJson(o.toJson()); |
| checkGoogleCloudManagedidentitiesV1OpMetadata( |
| od as api.GoogleCloudManagedidentitiesV1OpMetadata); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudManagedidentitiesV1alpha1OpMetadata', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudManagedidentitiesV1alpha1OpMetadata(); |
| var od = api.GoogleCloudManagedidentitiesV1alpha1OpMetadata.fromJson( |
| o.toJson()); |
| checkGoogleCloudManagedidentitiesV1alpha1OpMetadata( |
| od as api.GoogleCloudManagedidentitiesV1alpha1OpMetadata); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudManagedidentitiesV1beta1OpMetadata', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudManagedidentitiesV1beta1OpMetadata(); |
| var od = api.GoogleCloudManagedidentitiesV1beta1OpMetadata.fromJson( |
| o.toJson()); |
| checkGoogleCloudManagedidentitiesV1beta1OpMetadata( |
| od as api.GoogleCloudManagedidentitiesV1beta1OpMetadata); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1Instance', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudSaasacceleratorManagementProvidersV1Instance(); |
| var od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1Instance.fromJson( |
| o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1Instance( |
| od as api.GoogleCloudSaasacceleratorManagementProvidersV1Instance); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(); |
| var od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule |
| .fromJson(o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(od |
| as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(); |
| var od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings |
| .fromJson(o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(od |
| as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(); |
| var od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata |
| .fromJson(o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(od |
| as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility(); |
| var od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility |
| .fromJson(o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility( |
| od as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(); |
| var od = |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource |
| .fromJson(o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(od |
| as api |
| .GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(); |
| var od = api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility |
| .fromJson(o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(od |
| as api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(); |
| var od = api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion |
| .fromJson(o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(od |
| as api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(); |
| var od = api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata |
| .fromJson(o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata( |
| od as api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListDomainsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListDomainsResponse(); |
| var od = api.ListDomainsResponse.fromJson(o.toJson()); |
| checkListDomainsResponse(od as api.ListDomainsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListLocationsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListLocationsResponse(); |
| var od = api.ListLocationsResponse.fromJson(o.toJson()); |
| checkListLocationsResponse(od as api.ListLocationsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListOperationsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListOperationsResponse(); |
| var od = api.ListOperationsResponse.fromJson(o.toJson()); |
| checkListOperationsResponse(od as api.ListOperationsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Location', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildLocation(); |
| var od = api.Location.fromJson(o.toJson()); |
| checkLocation(od as api.Location); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MaintenancePolicy', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildMaintenancePolicy(); |
| var od = api.MaintenancePolicy.fromJson(o.toJson()); |
| checkMaintenancePolicy(od as api.MaintenancePolicy); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MaintenanceWindow', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildMaintenanceWindow(); |
| var od = api.MaintenanceWindow.fromJson(o.toJson()); |
| checkMaintenanceWindow(od as api.MaintenanceWindow); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Operation', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildOperation(); |
| var od = api.Operation.fromJson(o.toJson()); |
| checkOperation(od as api.Operation); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OperationMetadata', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildOperationMetadata(); |
| var od = api.OperationMetadata.fromJson(o.toJson()); |
| checkOperationMetadata(od as api.OperationMetadata); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Policy', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPolicy(); |
| var od = api.Policy.fromJson(o.toJson()); |
| checkPolicy(od as api.Policy); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ReconfigureTrustRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildReconfigureTrustRequest(); |
| var od = api.ReconfigureTrustRequest.fromJson(o.toJson()); |
| checkReconfigureTrustRequest(od as api.ReconfigureTrustRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ResetAdminPasswordRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildResetAdminPasswordRequest(); |
| var od = api.ResetAdminPasswordRequest.fromJson(o.toJson()); |
| checkResetAdminPasswordRequest(od as api.ResetAdminPasswordRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ResetAdminPasswordResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildResetAdminPasswordResponse(); |
| var od = api.ResetAdminPasswordResponse.fromJson(o.toJson()); |
| checkResetAdminPasswordResponse(od as api.ResetAdminPasswordResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Schedule', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSchedule(); |
| var od = api.Schedule.fromJson(o.toJson()); |
| checkSchedule(od as api.Schedule); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SetIamPolicyRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSetIamPolicyRequest(); |
| var od = api.SetIamPolicyRequest.fromJson(o.toJson()); |
| checkSetIamPolicyRequest(od as api.SetIamPolicyRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Status', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildStatus(); |
| var od = api.Status.fromJson(o.toJson()); |
| checkStatus(od as api.Status); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTestIamPermissionsRequest(); |
| var od = api.TestIamPermissionsRequest.fromJson(o.toJson()); |
| checkTestIamPermissionsRequest(od as api.TestIamPermissionsRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTestIamPermissionsResponse(); |
| var od = api.TestIamPermissionsResponse.fromJson(o.toJson()); |
| checkTestIamPermissionsResponse(od as api.TestIamPermissionsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TimeOfDay', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTimeOfDay(); |
| var od = api.TimeOfDay.fromJson(o.toJson()); |
| checkTimeOfDay(od as api.TimeOfDay); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Trust', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTrust(); |
| var od = api.Trust.fromJson(o.toJson()); |
| checkTrust(od as api.Trust); |
| }); |
| }); |
| |
| unittest.group('obj-schema-UpdatePolicy', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildUpdatePolicy(); |
| var od = api.UpdatePolicy.fromJson(o.toJson()); |
| checkUpdatePolicy(od as api.UpdatePolicy); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ValidateTrustRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildValidateTrustRequest(); |
| var od = api.ValidateTrustRequest.fromJson(o.toJson()); |
| checkValidateTrustRequest(od as api.ValidateTrustRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-WeeklyCycle', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildWeeklyCycle(); |
| var od = api.WeeklyCycle.fromJson(o.toJson()); |
| checkWeeklyCycle(od as api.WeeklyCycle); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsResource', () { |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildLocation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkLocation(response as api.Location); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations; |
| var arg_name = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var 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), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListLocationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListLocationsResponse(response as api.ListLocationsResponse); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsGlobalDomainsResource', () { |
| unittest.test('method--attachTrust', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_request = buildAttachTrustRequest(); |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.AttachTrustRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkAttachTrustRequest(obj as api.AttachTrustRequest); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .attachTrust(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response as api.Operation); |
| }))); |
| }); |
| |
| unittest.test('method--create', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_request = buildDomain(); |
| var arg_parent = 'foo'; |
| var arg_domainName = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = |
| api.Domain.fromJson(json as core.Map<core.String, core.dynamic>); |
| checkDomain(obj as api.Domain); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["domainName"]!.first, |
| unittest.equals(arg_domainName), |
| ); |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, |
| domainName: arg_domainName, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response as api.Operation); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response as api.Operation); |
| }))); |
| }); |
| |
| unittest.test('method--detachTrust', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_request = buildDetachTrustRequest(); |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.DetachTrustRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkDetachTrustRequest(obj as api.DetachTrustRequest); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .detachTrust(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response as api.Operation); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildDomain()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkDomain(response as api.Domain); |
| }))); |
| }); |
| |
| unittest.test('method--getIamPolicy', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_resource = 'foo'; |
| var arg_options_requestedPolicyVersion = 42; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| core.int.parse(queryMap["options.requestedPolicyVersion"]!.first), |
| unittest.equals(arg_options_requestedPolicyVersion), |
| ); |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_resource, |
| options_requestedPolicyVersion: |
| arg_options_requestedPolicyVersion, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response as api.Policy); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_parent = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_orderBy = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var 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), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListDomainsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| filter: arg_filter, |
| orderBy: arg_orderBy, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListDomainsResponse(response as api.ListDomainsResponse); |
| }))); |
| }); |
| |
| unittest.test('method--patch', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_request = buildDomain(); |
| var arg_name = 'foo'; |
| var arg_updateMask = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = |
| api.Domain.fromJson(json as core.Map<core.String, core.dynamic>); |
| checkDomain(obj as api.Domain); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var 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), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .patch(arg_request, arg_name, |
| updateMask: arg_updateMask, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response as api.Operation); |
| }))); |
| }); |
| |
| unittest.test('method--reconfigureTrust', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_request = buildReconfigureTrustRequest(); |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ReconfigureTrustRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkReconfigureTrustRequest(obj as api.ReconfigureTrustRequest); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .reconfigureTrust(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response as api.Operation); |
| }))); |
| }); |
| |
| unittest.test('method--resetAdminPassword', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_request = buildResetAdminPasswordRequest(); |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ResetAdminPasswordRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkResetAdminPasswordRequest(obj as api.ResetAdminPasswordRequest); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildResetAdminPasswordResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .resetAdminPassword(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkResetAdminPasswordResponse( |
| response as api.ResetAdminPasswordResponse); |
| }))); |
| }); |
| |
| unittest.test('method--setIamPolicy', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.SetIamPolicyRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkSetIamPolicyRequest(obj as api.SetIamPolicyRequest); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response as api.Policy); |
| }))); |
| }); |
| |
| unittest.test('method--testIamPermissions', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.TestIamPermissionsRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkTestIamPermissionsRequest(obj as api.TestIamPermissionsRequest); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse( |
| response as api.TestIamPermissionsResponse); |
| }))); |
| }); |
| |
| unittest.test('method--validateTrust', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .domains; |
| var arg_request = buildValidateTrustRequest(); |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ValidateTrustRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkValidateTrustRequest(obj as api.ValidateTrustRequest); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .validateTrust(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response as api.Operation); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsGlobalOperationsResource', () { |
| unittest.test('method--cancel', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .operations; |
| var arg_request = buildCancelOperationRequest(); |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.CancelOperationRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkCancelOperationRequest(obj as api.CancelOperationRequest); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .cancel(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response as api.Empty); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response as api.Empty); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response as api.Operation); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.ManagedServiceForMicrosoftActiveDirectoryConsumerApi(mock) |
| .projects |
| .locations |
| .global |
| .operations; |
| var arg_name = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var 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), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListOperationsResponse(response as api.ListOperationsResponse); |
| }))); |
| }); |
| }); |
| } |