| // ignore_for_file: avoid_returning_null |
| // ignore_for_file: camel_case_types |
| // ignore_for_file: cascade_invocations |
| // ignore_for_file: comment_references |
| // ignore_for_file: file_names |
| // ignore_for_file: library_names |
| // ignore_for_file: lines_longer_than_80_chars |
| // ignore_for_file: non_constant_identifier_names |
| // ignore_for_file: prefer_expression_function_bodies |
| // ignore_for_file: prefer_final_locals |
| // ignore_for_file: prefer_interpolation_to_compose_strings |
| // ignore_for_file: prefer_single_quotes |
| // ignore_for_file: unnecessary_brace_in_string_interps |
| // ignore_for_file: unnecessary_cast |
| // ignore_for_file: unnecessary_lambdas |
| // ignore_for_file: unnecessary_parenthesis |
| // ignore_for_file: unnecessary_string_interpolations |
| // ignore_for_file: unused_local_variable |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert; |
| import 'dart:core' as core; |
| |
| import 'package:googleapis/servicemanagement/v1.dart' as api; |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import '../test_shared.dart'; |
| |
| core.int buildCounterAdvice = 0; |
| api.Advice buildAdvice() { |
| var o = api.Advice(); |
| buildCounterAdvice++; |
| if (buildCounterAdvice < 3) { |
| o.description = 'foo'; |
| } |
| buildCounterAdvice--; |
| return o; |
| } |
| |
| void checkAdvice(api.Advice o) { |
| buildCounterAdvice++; |
| if (buildCounterAdvice < 3) { |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterAdvice--; |
| } |
| |
| core.List<api.Method> buildUnnamed6080() { |
| var o = <api.Method>[]; |
| o.add(buildMethod()); |
| o.add(buildMethod()); |
| return o; |
| } |
| |
| void checkUnnamed6080(core.List<api.Method> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMethod(o[0] as api.Method); |
| checkMethod(o[1] as api.Method); |
| } |
| |
| core.List<api.Mixin> buildUnnamed6081() { |
| var o = <api.Mixin>[]; |
| o.add(buildMixin()); |
| o.add(buildMixin()); |
| return o; |
| } |
| |
| void checkUnnamed6081(core.List<api.Mixin> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMixin(o[0] as api.Mixin); |
| checkMixin(o[1] as api.Mixin); |
| } |
| |
| core.List<api.Option> buildUnnamed6082() { |
| var o = <api.Option>[]; |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| void checkUnnamed6082(core.List<api.Option> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOption(o[0] as api.Option); |
| checkOption(o[1] as api.Option); |
| } |
| |
| core.int buildCounterApi = 0; |
| api.Api buildApi() { |
| var o = api.Api(); |
| buildCounterApi++; |
| if (buildCounterApi < 3) { |
| o.methods = buildUnnamed6080(); |
| o.mixins = buildUnnamed6081(); |
| o.name = 'foo'; |
| o.options = buildUnnamed6082(); |
| o.sourceContext = buildSourceContext(); |
| o.syntax = 'foo'; |
| o.version = 'foo'; |
| } |
| buildCounterApi--; |
| return o; |
| } |
| |
| void checkApi(api.Api o) { |
| buildCounterApi++; |
| if (buildCounterApi < 3) { |
| checkUnnamed6080(o.methods!); |
| checkUnnamed6081(o.mixins!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6082(o.options!); |
| checkSourceContext(o.sourceContext! as api.SourceContext); |
| unittest.expect( |
| o.syntax!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.version!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterApi--; |
| } |
| |
| core.List<api.AuditLogConfig> buildUnnamed6083() { |
| var o = <api.AuditLogConfig>[]; |
| o.add(buildAuditLogConfig()); |
| o.add(buildAuditLogConfig()); |
| return o; |
| } |
| |
| void checkUnnamed6083(core.List<api.AuditLogConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuditLogConfig(o[0] as api.AuditLogConfig); |
| checkAuditLogConfig(o[1] as api.AuditLogConfig); |
| } |
| |
| core.int buildCounterAuditConfig = 0; |
| api.AuditConfig buildAuditConfig() { |
| var o = api.AuditConfig(); |
| buildCounterAuditConfig++; |
| if (buildCounterAuditConfig < 3) { |
| o.auditLogConfigs = buildUnnamed6083(); |
| o.service = 'foo'; |
| } |
| buildCounterAuditConfig--; |
| return o; |
| } |
| |
| void checkAuditConfig(api.AuditConfig o) { |
| buildCounterAuditConfig++; |
| if (buildCounterAuditConfig < 3) { |
| checkUnnamed6083(o.auditLogConfigs!); |
| unittest.expect( |
| o.service!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterAuditConfig--; |
| } |
| |
| core.List<core.String> buildUnnamed6084() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6084(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 buildCounterAuditLogConfig = 0; |
| api.AuditLogConfig buildAuditLogConfig() { |
| var o = api.AuditLogConfig(); |
| buildCounterAuditLogConfig++; |
| if (buildCounterAuditLogConfig < 3) { |
| o.exemptedMembers = buildUnnamed6084(); |
| o.logType = 'foo'; |
| } |
| buildCounterAuditLogConfig--; |
| return o; |
| } |
| |
| void checkAuditLogConfig(api.AuditLogConfig o) { |
| buildCounterAuditLogConfig++; |
| if (buildCounterAuditLogConfig < 3) { |
| checkUnnamed6084(o.exemptedMembers!); |
| unittest.expect( |
| o.logType!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterAuditLogConfig--; |
| } |
| |
| core.List<api.JwtLocation> buildUnnamed6085() { |
| var o = <api.JwtLocation>[]; |
| o.add(buildJwtLocation()); |
| o.add(buildJwtLocation()); |
| return o; |
| } |
| |
| void checkUnnamed6085(core.List<api.JwtLocation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkJwtLocation(o[0] as api.JwtLocation); |
| checkJwtLocation(o[1] as api.JwtLocation); |
| } |
| |
| core.int buildCounterAuthProvider = 0; |
| api.AuthProvider buildAuthProvider() { |
| var o = api.AuthProvider(); |
| buildCounterAuthProvider++; |
| if (buildCounterAuthProvider < 3) { |
| o.audiences = 'foo'; |
| o.authorizationUrl = 'foo'; |
| o.id = 'foo'; |
| o.issuer = 'foo'; |
| o.jwksUri = 'foo'; |
| o.jwtLocations = buildUnnamed6085(); |
| } |
| buildCounterAuthProvider--; |
| return o; |
| } |
| |
| void checkAuthProvider(api.AuthProvider o) { |
| buildCounterAuthProvider++; |
| if (buildCounterAuthProvider < 3) { |
| unittest.expect( |
| o.audiences!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.authorizationUrl!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.id!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.issuer!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.jwksUri!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6085(o.jwtLocations!); |
| } |
| buildCounterAuthProvider--; |
| } |
| |
| core.int buildCounterAuthRequirement = 0; |
| api.AuthRequirement buildAuthRequirement() { |
| var o = api.AuthRequirement(); |
| buildCounterAuthRequirement++; |
| if (buildCounterAuthRequirement < 3) { |
| o.audiences = 'foo'; |
| o.providerId = 'foo'; |
| } |
| buildCounterAuthRequirement--; |
| return o; |
| } |
| |
| void checkAuthRequirement(api.AuthRequirement o) { |
| buildCounterAuthRequirement++; |
| if (buildCounterAuthRequirement < 3) { |
| unittest.expect( |
| o.audiences!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.providerId!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterAuthRequirement--; |
| } |
| |
| core.List<api.AuthProvider> buildUnnamed6086() { |
| var o = <api.AuthProvider>[]; |
| o.add(buildAuthProvider()); |
| o.add(buildAuthProvider()); |
| return o; |
| } |
| |
| void checkUnnamed6086(core.List<api.AuthProvider> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuthProvider(o[0] as api.AuthProvider); |
| checkAuthProvider(o[1] as api.AuthProvider); |
| } |
| |
| core.List<api.AuthenticationRule> buildUnnamed6087() { |
| var o = <api.AuthenticationRule>[]; |
| o.add(buildAuthenticationRule()); |
| o.add(buildAuthenticationRule()); |
| return o; |
| } |
| |
| void checkUnnamed6087(core.List<api.AuthenticationRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuthenticationRule(o[0] as api.AuthenticationRule); |
| checkAuthenticationRule(o[1] as api.AuthenticationRule); |
| } |
| |
| core.int buildCounterAuthentication = 0; |
| api.Authentication buildAuthentication() { |
| var o = api.Authentication(); |
| buildCounterAuthentication++; |
| if (buildCounterAuthentication < 3) { |
| o.providers = buildUnnamed6086(); |
| o.rules = buildUnnamed6087(); |
| } |
| buildCounterAuthentication--; |
| return o; |
| } |
| |
| void checkAuthentication(api.Authentication o) { |
| buildCounterAuthentication++; |
| if (buildCounterAuthentication < 3) { |
| checkUnnamed6086(o.providers!); |
| checkUnnamed6087(o.rules!); |
| } |
| buildCounterAuthentication--; |
| } |
| |
| core.List<api.AuthRequirement> buildUnnamed6088() { |
| var o = <api.AuthRequirement>[]; |
| o.add(buildAuthRequirement()); |
| o.add(buildAuthRequirement()); |
| return o; |
| } |
| |
| void checkUnnamed6088(core.List<api.AuthRequirement> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuthRequirement(o[0] as api.AuthRequirement); |
| checkAuthRequirement(o[1] as api.AuthRequirement); |
| } |
| |
| core.int buildCounterAuthenticationRule = 0; |
| api.AuthenticationRule buildAuthenticationRule() { |
| var o = api.AuthenticationRule(); |
| buildCounterAuthenticationRule++; |
| if (buildCounterAuthenticationRule < 3) { |
| o.allowWithoutCredential = true; |
| o.oauth = buildOAuthRequirements(); |
| o.requirements = buildUnnamed6088(); |
| o.selector = 'foo'; |
| } |
| buildCounterAuthenticationRule--; |
| return o; |
| } |
| |
| void checkAuthenticationRule(api.AuthenticationRule o) { |
| buildCounterAuthenticationRule++; |
| if (buildCounterAuthenticationRule < 3) { |
| unittest.expect(o.allowWithoutCredential!, unittest.isTrue); |
| checkOAuthRequirements(o.oauth! as api.OAuthRequirements); |
| checkUnnamed6088(o.requirements!); |
| unittest.expect( |
| o.selector!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterAuthenticationRule--; |
| } |
| |
| core.List<api.BackendRule> buildUnnamed6089() { |
| var o = <api.BackendRule>[]; |
| o.add(buildBackendRule()); |
| o.add(buildBackendRule()); |
| return o; |
| } |
| |
| void checkUnnamed6089(core.List<api.BackendRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBackendRule(o[0] as api.BackendRule); |
| checkBackendRule(o[1] as api.BackendRule); |
| } |
| |
| core.int buildCounterBackend = 0; |
| api.Backend buildBackend() { |
| var o = api.Backend(); |
| buildCounterBackend++; |
| if (buildCounterBackend < 3) { |
| o.rules = buildUnnamed6089(); |
| } |
| buildCounterBackend--; |
| return o; |
| } |
| |
| void checkBackend(api.Backend o) { |
| buildCounterBackend++; |
| if (buildCounterBackend < 3) { |
| checkUnnamed6089(o.rules!); |
| } |
| buildCounterBackend--; |
| } |
| |
| core.int buildCounterBackendRule = 0; |
| api.BackendRule buildBackendRule() { |
| var o = api.BackendRule(); |
| buildCounterBackendRule++; |
| if (buildCounterBackendRule < 3) { |
| o.address = 'foo'; |
| o.deadline = 42.0; |
| o.disableAuth = true; |
| o.jwtAudience = 'foo'; |
| o.operationDeadline = 42.0; |
| o.pathTranslation = 'foo'; |
| o.protocol = 'foo'; |
| o.selector = 'foo'; |
| } |
| buildCounterBackendRule--; |
| return o; |
| } |
| |
| void checkBackendRule(api.BackendRule o) { |
| buildCounterBackendRule++; |
| if (buildCounterBackendRule < 3) { |
| unittest.expect( |
| o.address!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.deadline!, |
| unittest.equals(42.0), |
| ); |
| unittest.expect(o.disableAuth!, unittest.isTrue); |
| unittest.expect( |
| o.jwtAudience!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.operationDeadline!, |
| unittest.equals(42.0), |
| ); |
| unittest.expect( |
| o.pathTranslation!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.protocol!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.selector!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterBackendRule--; |
| } |
| |
| core.List<api.BillingDestination> buildUnnamed6090() { |
| var o = <api.BillingDestination>[]; |
| o.add(buildBillingDestination()); |
| o.add(buildBillingDestination()); |
| return o; |
| } |
| |
| void checkUnnamed6090(core.List<api.BillingDestination> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBillingDestination(o[0] as api.BillingDestination); |
| checkBillingDestination(o[1] as api.BillingDestination); |
| } |
| |
| core.int buildCounterBilling = 0; |
| api.Billing buildBilling() { |
| var o = api.Billing(); |
| buildCounterBilling++; |
| if (buildCounterBilling < 3) { |
| o.consumerDestinations = buildUnnamed6090(); |
| } |
| buildCounterBilling--; |
| return o; |
| } |
| |
| void checkBilling(api.Billing o) { |
| buildCounterBilling++; |
| if (buildCounterBilling < 3) { |
| checkUnnamed6090(o.consumerDestinations!); |
| } |
| buildCounterBilling--; |
| } |
| |
| core.List<core.String> buildUnnamed6091() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6091(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 buildCounterBillingDestination = 0; |
| api.BillingDestination buildBillingDestination() { |
| var o = api.BillingDestination(); |
| buildCounterBillingDestination++; |
| if (buildCounterBillingDestination < 3) { |
| o.metrics = buildUnnamed6091(); |
| o.monitoredResource = 'foo'; |
| } |
| buildCounterBillingDestination--; |
| return o; |
| } |
| |
| void checkBillingDestination(api.BillingDestination o) { |
| buildCounterBillingDestination++; |
| if (buildCounterBillingDestination < 3) { |
| checkUnnamed6091(o.metrics!); |
| unittest.expect( |
| o.monitoredResource!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterBillingDestination--; |
| } |
| |
| core.List<core.String> buildUnnamed6092() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6092(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 = buildUnnamed6092(); |
| o.role = 'foo'; |
| } |
| buildCounterBinding--; |
| return o; |
| } |
| |
| void checkBinding(api.Binding o) { |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| checkExpr(o.condition! as api.Expr); |
| checkUnnamed6092(o.members!); |
| unittest.expect( |
| o.role!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterBinding--; |
| } |
| |
| core.List<api.ConfigChange> buildUnnamed6093() { |
| var o = <api.ConfigChange>[]; |
| o.add(buildConfigChange()); |
| o.add(buildConfigChange()); |
| return o; |
| } |
| |
| void checkUnnamed6093(core.List<api.ConfigChange> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkConfigChange(o[0] as api.ConfigChange); |
| checkConfigChange(o[1] as api.ConfigChange); |
| } |
| |
| core.int buildCounterChangeReport = 0; |
| api.ChangeReport buildChangeReport() { |
| var o = api.ChangeReport(); |
| buildCounterChangeReport++; |
| if (buildCounterChangeReport < 3) { |
| o.configChanges = buildUnnamed6093(); |
| } |
| buildCounterChangeReport--; |
| return o; |
| } |
| |
| void checkChangeReport(api.ChangeReport o) { |
| buildCounterChangeReport++; |
| if (buildCounterChangeReport < 3) { |
| checkUnnamed6093(o.configChanges!); |
| } |
| buildCounterChangeReport--; |
| } |
| |
| core.List<api.Advice> buildUnnamed6094() { |
| var o = <api.Advice>[]; |
| o.add(buildAdvice()); |
| o.add(buildAdvice()); |
| return o; |
| } |
| |
| void checkUnnamed6094(core.List<api.Advice> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAdvice(o[0] as api.Advice); |
| checkAdvice(o[1] as api.Advice); |
| } |
| |
| core.int buildCounterConfigChange = 0; |
| api.ConfigChange buildConfigChange() { |
| var o = api.ConfigChange(); |
| buildCounterConfigChange++; |
| if (buildCounterConfigChange < 3) { |
| o.advices = buildUnnamed6094(); |
| o.changeType = 'foo'; |
| o.element = 'foo'; |
| o.newValue = 'foo'; |
| o.oldValue = 'foo'; |
| } |
| buildCounterConfigChange--; |
| return o; |
| } |
| |
| void checkConfigChange(api.ConfigChange o) { |
| buildCounterConfigChange++; |
| if (buildCounterConfigChange < 3) { |
| checkUnnamed6094(o.advices!); |
| unittest.expect( |
| o.changeType!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.element!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.newValue!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.oldValue!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterConfigChange--; |
| } |
| |
| core.int buildCounterConfigFile = 0; |
| api.ConfigFile buildConfigFile() { |
| var o = api.ConfigFile(); |
| buildCounterConfigFile++; |
| if (buildCounterConfigFile < 3) { |
| o.fileContents = 'foo'; |
| o.filePath = 'foo'; |
| o.fileType = 'foo'; |
| } |
| buildCounterConfigFile--; |
| return o; |
| } |
| |
| void checkConfigFile(api.ConfigFile o) { |
| buildCounterConfigFile++; |
| if (buildCounterConfigFile < 3) { |
| unittest.expect( |
| o.fileContents!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.filePath!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.fileType!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterConfigFile--; |
| } |
| |
| core.int buildCounterConfigRef = 0; |
| api.ConfigRef buildConfigRef() { |
| var o = api.ConfigRef(); |
| buildCounterConfigRef++; |
| if (buildCounterConfigRef < 3) { |
| o.name = 'foo'; |
| } |
| buildCounterConfigRef--; |
| return o; |
| } |
| |
| void checkConfigRef(api.ConfigRef o) { |
| buildCounterConfigRef++; |
| if (buildCounterConfigRef < 3) { |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterConfigRef--; |
| } |
| |
| core.List<api.ConfigFile> buildUnnamed6095() { |
| var o = <api.ConfigFile>[]; |
| o.add(buildConfigFile()); |
| o.add(buildConfigFile()); |
| return o; |
| } |
| |
| void checkUnnamed6095(core.List<api.ConfigFile> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkConfigFile(o[0] as api.ConfigFile); |
| checkConfigFile(o[1] as api.ConfigFile); |
| } |
| |
| core.int buildCounterConfigSource = 0; |
| api.ConfigSource buildConfigSource() { |
| var o = api.ConfigSource(); |
| buildCounterConfigSource++; |
| if (buildCounterConfigSource < 3) { |
| o.files = buildUnnamed6095(); |
| o.id = 'foo'; |
| } |
| buildCounterConfigSource--; |
| return o; |
| } |
| |
| void checkConfigSource(api.ConfigSource o) { |
| buildCounterConfigSource++; |
| if (buildCounterConfigSource < 3) { |
| checkUnnamed6095(o.files!); |
| unittest.expect( |
| o.id!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterConfigSource--; |
| } |
| |
| core.List<api.ContextRule> buildUnnamed6096() { |
| var o = <api.ContextRule>[]; |
| o.add(buildContextRule()); |
| o.add(buildContextRule()); |
| return o; |
| } |
| |
| void checkUnnamed6096(core.List<api.ContextRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkContextRule(o[0] as api.ContextRule); |
| checkContextRule(o[1] as api.ContextRule); |
| } |
| |
| core.int buildCounterContext = 0; |
| api.Context buildContext() { |
| var o = api.Context(); |
| buildCounterContext++; |
| if (buildCounterContext < 3) { |
| o.rules = buildUnnamed6096(); |
| } |
| buildCounterContext--; |
| return o; |
| } |
| |
| void checkContext(api.Context o) { |
| buildCounterContext++; |
| if (buildCounterContext < 3) { |
| checkUnnamed6096(o.rules!); |
| } |
| buildCounterContext--; |
| } |
| |
| core.List<core.String> buildUnnamed6097() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6097(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<core.String> buildUnnamed6098() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6098(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<core.String> buildUnnamed6099() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6099(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<core.String> buildUnnamed6100() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6100(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 buildCounterContextRule = 0; |
| api.ContextRule buildContextRule() { |
| var o = api.ContextRule(); |
| buildCounterContextRule++; |
| if (buildCounterContextRule < 3) { |
| o.allowedRequestExtensions = buildUnnamed6097(); |
| o.allowedResponseExtensions = buildUnnamed6098(); |
| o.provided = buildUnnamed6099(); |
| o.requested = buildUnnamed6100(); |
| o.selector = 'foo'; |
| } |
| buildCounterContextRule--; |
| return o; |
| } |
| |
| void checkContextRule(api.ContextRule o) { |
| buildCounterContextRule++; |
| if (buildCounterContextRule < 3) { |
| checkUnnamed6097(o.allowedRequestExtensions!); |
| checkUnnamed6098(o.allowedResponseExtensions!); |
| checkUnnamed6099(o.provided!); |
| checkUnnamed6100(o.requested!); |
| unittest.expect( |
| o.selector!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterContextRule--; |
| } |
| |
| core.int buildCounterControl = 0; |
| api.Control buildControl() { |
| var o = api.Control(); |
| buildCounterControl++; |
| if (buildCounterControl < 3) { |
| o.environment = 'foo'; |
| } |
| buildCounterControl--; |
| return o; |
| } |
| |
| void checkControl(api.Control o) { |
| buildCounterControl++; |
| if (buildCounterControl < 3) { |
| unittest.expect( |
| o.environment!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterControl--; |
| } |
| |
| core.List<api.CustomErrorRule> buildUnnamed6101() { |
| var o = <api.CustomErrorRule>[]; |
| o.add(buildCustomErrorRule()); |
| o.add(buildCustomErrorRule()); |
| return o; |
| } |
| |
| void checkUnnamed6101(core.List<api.CustomErrorRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkCustomErrorRule(o[0] as api.CustomErrorRule); |
| checkCustomErrorRule(o[1] as api.CustomErrorRule); |
| } |
| |
| core.List<core.String> buildUnnamed6102() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6102(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 buildCounterCustomError = 0; |
| api.CustomError buildCustomError() { |
| var o = api.CustomError(); |
| buildCounterCustomError++; |
| if (buildCounterCustomError < 3) { |
| o.rules = buildUnnamed6101(); |
| o.types = buildUnnamed6102(); |
| } |
| buildCounterCustomError--; |
| return o; |
| } |
| |
| void checkCustomError(api.CustomError o) { |
| buildCounterCustomError++; |
| if (buildCounterCustomError < 3) { |
| checkUnnamed6101(o.rules!); |
| checkUnnamed6102(o.types!); |
| } |
| buildCounterCustomError--; |
| } |
| |
| core.int buildCounterCustomErrorRule = 0; |
| api.CustomErrorRule buildCustomErrorRule() { |
| var o = api.CustomErrorRule(); |
| buildCounterCustomErrorRule++; |
| if (buildCounterCustomErrorRule < 3) { |
| o.isErrorType = true; |
| o.selector = 'foo'; |
| } |
| buildCounterCustomErrorRule--; |
| return o; |
| } |
| |
| void checkCustomErrorRule(api.CustomErrorRule o) { |
| buildCounterCustomErrorRule++; |
| if (buildCounterCustomErrorRule < 3) { |
| unittest.expect(o.isErrorType!, unittest.isTrue); |
| unittest.expect( |
| o.selector!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterCustomErrorRule--; |
| } |
| |
| core.int buildCounterCustomHttpPattern = 0; |
| api.CustomHttpPattern buildCustomHttpPattern() { |
| var o = api.CustomHttpPattern(); |
| buildCounterCustomHttpPattern++; |
| if (buildCounterCustomHttpPattern < 3) { |
| o.kind = 'foo'; |
| o.path = 'foo'; |
| } |
| buildCounterCustomHttpPattern--; |
| return o; |
| } |
| |
| void checkCustomHttpPattern(api.CustomHttpPattern o) { |
| buildCounterCustomHttpPattern++; |
| if (buildCounterCustomHttpPattern < 3) { |
| unittest.expect( |
| o.kind!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.path!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterCustomHttpPattern--; |
| } |
| |
| core.int buildCounterDeleteServiceStrategy = 0; |
| api.DeleteServiceStrategy buildDeleteServiceStrategy() { |
| var o = api.DeleteServiceStrategy(); |
| buildCounterDeleteServiceStrategy++; |
| if (buildCounterDeleteServiceStrategy < 3) {} |
| buildCounterDeleteServiceStrategy--; |
| return o; |
| } |
| |
| void checkDeleteServiceStrategy(api.DeleteServiceStrategy o) { |
| buildCounterDeleteServiceStrategy++; |
| if (buildCounterDeleteServiceStrategy < 3) {} |
| buildCounterDeleteServiceStrategy--; |
| } |
| |
| core.int buildCounterDiagnostic = 0; |
| api.Diagnostic buildDiagnostic() { |
| var o = api.Diagnostic(); |
| buildCounterDiagnostic++; |
| if (buildCounterDiagnostic < 3) { |
| o.kind = 'foo'; |
| o.location = 'foo'; |
| o.message = 'foo'; |
| } |
| buildCounterDiagnostic--; |
| return o; |
| } |
| |
| void checkDiagnostic(api.Diagnostic o) { |
| buildCounterDiagnostic++; |
| if (buildCounterDiagnostic < 3) { |
| unittest.expect( |
| o.kind!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.location!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.message!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterDiagnostic--; |
| } |
| |
| core.List<api.Page> buildUnnamed6103() { |
| var o = <api.Page>[]; |
| o.add(buildPage()); |
| o.add(buildPage()); |
| return o; |
| } |
| |
| void checkUnnamed6103(core.List<api.Page> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPage(o[0] as api.Page); |
| checkPage(o[1] as api.Page); |
| } |
| |
| core.List<api.DocumentationRule> buildUnnamed6104() { |
| var o = <api.DocumentationRule>[]; |
| o.add(buildDocumentationRule()); |
| o.add(buildDocumentationRule()); |
| return o; |
| } |
| |
| void checkUnnamed6104(core.List<api.DocumentationRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkDocumentationRule(o[0] as api.DocumentationRule); |
| checkDocumentationRule(o[1] as api.DocumentationRule); |
| } |
| |
| core.int buildCounterDocumentation = 0; |
| api.Documentation buildDocumentation() { |
| var o = api.Documentation(); |
| buildCounterDocumentation++; |
| if (buildCounterDocumentation < 3) { |
| o.documentationRootUrl = 'foo'; |
| o.overview = 'foo'; |
| o.pages = buildUnnamed6103(); |
| o.rules = buildUnnamed6104(); |
| o.serviceRootUrl = 'foo'; |
| o.summary = 'foo'; |
| } |
| buildCounterDocumentation--; |
| return o; |
| } |
| |
| void checkDocumentation(api.Documentation o) { |
| buildCounterDocumentation++; |
| if (buildCounterDocumentation < 3) { |
| unittest.expect( |
| o.documentationRootUrl!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.overview!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6103(o.pages!); |
| checkUnnamed6104(o.rules!); |
| unittest.expect( |
| o.serviceRootUrl!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.summary!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterDocumentation--; |
| } |
| |
| core.int buildCounterDocumentationRule = 0; |
| api.DocumentationRule buildDocumentationRule() { |
| var o = api.DocumentationRule(); |
| buildCounterDocumentationRule++; |
| if (buildCounterDocumentationRule < 3) { |
| o.deprecationDescription = 'foo'; |
| o.description = 'foo'; |
| o.selector = 'foo'; |
| } |
| buildCounterDocumentationRule--; |
| return o; |
| } |
| |
| void checkDocumentationRule(api.DocumentationRule o) { |
| buildCounterDocumentationRule++; |
| if (buildCounterDocumentationRule < 3) { |
| unittest.expect( |
| o.deprecationDescription!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.selector!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterDocumentationRule--; |
| } |
| |
| core.int buildCounterEnableServiceResponse = 0; |
| api.EnableServiceResponse buildEnableServiceResponse() { |
| var o = api.EnableServiceResponse(); |
| buildCounterEnableServiceResponse++; |
| if (buildCounterEnableServiceResponse < 3) {} |
| buildCounterEnableServiceResponse--; |
| return o; |
| } |
| |
| void checkEnableServiceResponse(api.EnableServiceResponse o) { |
| buildCounterEnableServiceResponse++; |
| if (buildCounterEnableServiceResponse < 3) {} |
| buildCounterEnableServiceResponse--; |
| } |
| |
| core.int buildCounterEndpoint = 0; |
| api.Endpoint buildEndpoint() { |
| var o = api.Endpoint(); |
| buildCounterEndpoint++; |
| if (buildCounterEndpoint < 3) { |
| o.allowCors = true; |
| o.name = 'foo'; |
| o.target = 'foo'; |
| } |
| buildCounterEndpoint--; |
| return o; |
| } |
| |
| void checkEndpoint(api.Endpoint o) { |
| buildCounterEndpoint++; |
| if (buildCounterEndpoint < 3) { |
| unittest.expect(o.allowCors!, unittest.isTrue); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.target!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterEndpoint--; |
| } |
| |
| core.List<api.EnumValue> buildUnnamed6105() { |
| var o = <api.EnumValue>[]; |
| o.add(buildEnumValue()); |
| o.add(buildEnumValue()); |
| return o; |
| } |
| |
| void checkUnnamed6105(core.List<api.EnumValue> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEnumValue(o[0] as api.EnumValue); |
| checkEnumValue(o[1] as api.EnumValue); |
| } |
| |
| core.List<api.Option> buildUnnamed6106() { |
| var o = <api.Option>[]; |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| void checkUnnamed6106(core.List<api.Option> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOption(o[0] as api.Option); |
| checkOption(o[1] as api.Option); |
| } |
| |
| core.int buildCounterEnum = 0; |
| api.Enum buildEnum() { |
| var o = api.Enum(); |
| buildCounterEnum++; |
| if (buildCounterEnum < 3) { |
| o.enumvalue = buildUnnamed6105(); |
| o.name = 'foo'; |
| o.options = buildUnnamed6106(); |
| o.sourceContext = buildSourceContext(); |
| o.syntax = 'foo'; |
| } |
| buildCounterEnum--; |
| return o; |
| } |
| |
| void checkEnum(api.Enum o) { |
| buildCounterEnum++; |
| if (buildCounterEnum < 3) { |
| checkUnnamed6105(o.enumvalue!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6106(o.options!); |
| checkSourceContext(o.sourceContext! as api.SourceContext); |
| unittest.expect( |
| o.syntax!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterEnum--; |
| } |
| |
| core.List<api.Option> buildUnnamed6107() { |
| var o = <api.Option>[]; |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| void checkUnnamed6107(core.List<api.Option> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOption(o[0] as api.Option); |
| checkOption(o[1] as api.Option); |
| } |
| |
| core.int buildCounterEnumValue = 0; |
| api.EnumValue buildEnumValue() { |
| var o = api.EnumValue(); |
| buildCounterEnumValue++; |
| if (buildCounterEnumValue < 3) { |
| o.name = 'foo'; |
| o.number = 42; |
| o.options = buildUnnamed6107(); |
| } |
| buildCounterEnumValue--; |
| return o; |
| } |
| |
| void checkEnumValue(api.EnumValue o) { |
| buildCounterEnumValue++; |
| if (buildCounterEnumValue < 3) { |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.number!, |
| unittest.equals(42), |
| ); |
| checkUnnamed6107(o.options!); |
| } |
| buildCounterEnumValue--; |
| } |
| |
| 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.List<api.Option> buildUnnamed6108() { |
| var o = <api.Option>[]; |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| void checkUnnamed6108(core.List<api.Option> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOption(o[0] as api.Option); |
| checkOption(o[1] as api.Option); |
| } |
| |
| core.int buildCounterField = 0; |
| api.Field buildField() { |
| var o = api.Field(); |
| buildCounterField++; |
| if (buildCounterField < 3) { |
| o.cardinality = 'foo'; |
| o.defaultValue = 'foo'; |
| o.jsonName = 'foo'; |
| o.kind = 'foo'; |
| o.name = 'foo'; |
| o.number = 42; |
| o.oneofIndex = 42; |
| o.options = buildUnnamed6108(); |
| o.packed = true; |
| o.typeUrl = 'foo'; |
| } |
| buildCounterField--; |
| return o; |
| } |
| |
| void checkField(api.Field o) { |
| buildCounterField++; |
| if (buildCounterField < 3) { |
| unittest.expect( |
| o.cardinality!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.defaultValue!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.jsonName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.kind!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.number!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.oneofIndex!, |
| unittest.equals(42), |
| ); |
| checkUnnamed6108(o.options!); |
| unittest.expect(o.packed!, unittest.isTrue); |
| unittest.expect( |
| o.typeUrl!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterField--; |
| } |
| |
| core.int buildCounterFlowErrorDetails = 0; |
| api.FlowErrorDetails buildFlowErrorDetails() { |
| var o = api.FlowErrorDetails(); |
| buildCounterFlowErrorDetails++; |
| if (buildCounterFlowErrorDetails < 3) { |
| o.exceptionType = 'foo'; |
| o.flowStepId = 'foo'; |
| } |
| buildCounterFlowErrorDetails--; |
| return o; |
| } |
| |
| void checkFlowErrorDetails(api.FlowErrorDetails o) { |
| buildCounterFlowErrorDetails++; |
| if (buildCounterFlowErrorDetails < 3) { |
| unittest.expect( |
| o.exceptionType!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.flowStepId!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterFlowErrorDetails--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed6109() { |
| 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 checkUnnamed6109(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.Map<core.String, core.Object> buildUnnamed6110() { |
| 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 checkUnnamed6110(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.int buildCounterGenerateConfigReportRequest = 0; |
| api.GenerateConfigReportRequest buildGenerateConfigReportRequest() { |
| var o = api.GenerateConfigReportRequest(); |
| buildCounterGenerateConfigReportRequest++; |
| if (buildCounterGenerateConfigReportRequest < 3) { |
| o.newConfig = buildUnnamed6109(); |
| o.oldConfig = buildUnnamed6110(); |
| } |
| buildCounterGenerateConfigReportRequest--; |
| return o; |
| } |
| |
| void checkGenerateConfigReportRequest(api.GenerateConfigReportRequest o) { |
| buildCounterGenerateConfigReportRequest++; |
| if (buildCounterGenerateConfigReportRequest < 3) { |
| checkUnnamed6109(o.newConfig!); |
| checkUnnamed6110(o.oldConfig!); |
| } |
| buildCounterGenerateConfigReportRequest--; |
| } |
| |
| core.List<api.ChangeReport> buildUnnamed6111() { |
| var o = <api.ChangeReport>[]; |
| o.add(buildChangeReport()); |
| o.add(buildChangeReport()); |
| return o; |
| } |
| |
| void checkUnnamed6111(core.List<api.ChangeReport> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkChangeReport(o[0] as api.ChangeReport); |
| checkChangeReport(o[1] as api.ChangeReport); |
| } |
| |
| core.List<api.Diagnostic> buildUnnamed6112() { |
| var o = <api.Diagnostic>[]; |
| o.add(buildDiagnostic()); |
| o.add(buildDiagnostic()); |
| return o; |
| } |
| |
| void checkUnnamed6112(core.List<api.Diagnostic> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkDiagnostic(o[0] as api.Diagnostic); |
| checkDiagnostic(o[1] as api.Diagnostic); |
| } |
| |
| core.int buildCounterGenerateConfigReportResponse = 0; |
| api.GenerateConfigReportResponse buildGenerateConfigReportResponse() { |
| var o = api.GenerateConfigReportResponse(); |
| buildCounterGenerateConfigReportResponse++; |
| if (buildCounterGenerateConfigReportResponse < 3) { |
| o.changeReports = buildUnnamed6111(); |
| o.diagnostics = buildUnnamed6112(); |
| o.id = 'foo'; |
| o.serviceName = 'foo'; |
| } |
| buildCounterGenerateConfigReportResponse--; |
| return o; |
| } |
| |
| void checkGenerateConfigReportResponse(api.GenerateConfigReportResponse o) { |
| buildCounterGenerateConfigReportResponse++; |
| if (buildCounterGenerateConfigReportResponse < 3) { |
| checkUnnamed6111(o.changeReports!); |
| checkUnnamed6112(o.diagnostics!); |
| unittest.expect( |
| o.id!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.serviceName!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGenerateConfigReportResponse--; |
| } |
| |
| core.int buildCounterGetIamPolicyRequest = 0; |
| api.GetIamPolicyRequest buildGetIamPolicyRequest() { |
| var o = api.GetIamPolicyRequest(); |
| buildCounterGetIamPolicyRequest++; |
| if (buildCounterGetIamPolicyRequest < 3) { |
| o.options = buildGetPolicyOptions(); |
| } |
| buildCounterGetIamPolicyRequest--; |
| return o; |
| } |
| |
| void checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { |
| buildCounterGetIamPolicyRequest++; |
| if (buildCounterGetIamPolicyRequest < 3) { |
| checkGetPolicyOptions(o.options! as api.GetPolicyOptions); |
| } |
| buildCounterGetIamPolicyRequest--; |
| } |
| |
| core.int buildCounterGetPolicyOptions = 0; |
| api.GetPolicyOptions buildGetPolicyOptions() { |
| var o = api.GetPolicyOptions(); |
| buildCounterGetPolicyOptions++; |
| if (buildCounterGetPolicyOptions < 3) { |
| o.requestedPolicyVersion = 42; |
| } |
| buildCounterGetPolicyOptions--; |
| return o; |
| } |
| |
| void checkGetPolicyOptions(api.GetPolicyOptions o) { |
| buildCounterGetPolicyOptions++; |
| if (buildCounterGetPolicyOptions < 3) { |
| unittest.expect( |
| o.requestedPolicyVersion!, |
| unittest.equals(42), |
| ); |
| } |
| buildCounterGetPolicyOptions--; |
| } |
| |
| core.List<api.HttpRule> buildUnnamed6113() { |
| var o = <api.HttpRule>[]; |
| o.add(buildHttpRule()); |
| o.add(buildHttpRule()); |
| return o; |
| } |
| |
| void checkUnnamed6113(core.List<api.HttpRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkHttpRule(o[0] as api.HttpRule); |
| checkHttpRule(o[1] as api.HttpRule); |
| } |
| |
| core.int buildCounterHttp = 0; |
| api.Http buildHttp() { |
| var o = api.Http(); |
| buildCounterHttp++; |
| if (buildCounterHttp < 3) { |
| o.fullyDecodeReservedExpansion = true; |
| o.rules = buildUnnamed6113(); |
| } |
| buildCounterHttp--; |
| return o; |
| } |
| |
| void checkHttp(api.Http o) { |
| buildCounterHttp++; |
| if (buildCounterHttp < 3) { |
| unittest.expect(o.fullyDecodeReservedExpansion!, unittest.isTrue); |
| checkUnnamed6113(o.rules!); |
| } |
| buildCounterHttp--; |
| } |
| |
| core.List<api.HttpRule> buildUnnamed6114() { |
| var o = <api.HttpRule>[]; |
| o.add(buildHttpRule()); |
| o.add(buildHttpRule()); |
| return o; |
| } |
| |
| void checkUnnamed6114(core.List<api.HttpRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkHttpRule(o[0] as api.HttpRule); |
| checkHttpRule(o[1] as api.HttpRule); |
| } |
| |
| core.int buildCounterHttpRule = 0; |
| api.HttpRule buildHttpRule() { |
| var o = api.HttpRule(); |
| buildCounterHttpRule++; |
| if (buildCounterHttpRule < 3) { |
| o.additionalBindings = buildUnnamed6114(); |
| o.body = 'foo'; |
| o.custom = buildCustomHttpPattern(); |
| o.delete = 'foo'; |
| o.get = 'foo'; |
| o.patch = 'foo'; |
| o.post = 'foo'; |
| o.put = 'foo'; |
| o.responseBody = 'foo'; |
| o.selector = 'foo'; |
| } |
| buildCounterHttpRule--; |
| return o; |
| } |
| |
| void checkHttpRule(api.HttpRule o) { |
| buildCounterHttpRule++; |
| if (buildCounterHttpRule < 3) { |
| checkUnnamed6114(o.additionalBindings!); |
| unittest.expect( |
| o.body!, |
| unittest.equals('foo'), |
| ); |
| checkCustomHttpPattern(o.custom! as api.CustomHttpPattern); |
| unittest.expect( |
| o.delete!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.get!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.patch!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.post!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.put!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.responseBody!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.selector!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterHttpRule--; |
| } |
| |
| core.int buildCounterJwtLocation = 0; |
| api.JwtLocation buildJwtLocation() { |
| var o = api.JwtLocation(); |
| buildCounterJwtLocation++; |
| if (buildCounterJwtLocation < 3) { |
| o.header = 'foo'; |
| o.query = 'foo'; |
| o.valuePrefix = 'foo'; |
| } |
| buildCounterJwtLocation--; |
| return o; |
| } |
| |
| void checkJwtLocation(api.JwtLocation o) { |
| buildCounterJwtLocation++; |
| if (buildCounterJwtLocation < 3) { |
| unittest.expect( |
| o.header!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.query!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.valuePrefix!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterJwtLocation--; |
| } |
| |
| core.int buildCounterLabelDescriptor = 0; |
| api.LabelDescriptor buildLabelDescriptor() { |
| var o = api.LabelDescriptor(); |
| buildCounterLabelDescriptor++; |
| if (buildCounterLabelDescriptor < 3) { |
| o.description = 'foo'; |
| o.key = 'foo'; |
| o.valueType = 'foo'; |
| } |
| buildCounterLabelDescriptor--; |
| return o; |
| } |
| |
| void checkLabelDescriptor(api.LabelDescriptor o) { |
| buildCounterLabelDescriptor++; |
| if (buildCounterLabelDescriptor < 3) { |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.key!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.valueType!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterLabelDescriptor--; |
| } |
| |
| core.List<api.Operation> buildUnnamed6115() { |
| var o = <api.Operation>[]; |
| o.add(buildOperation()); |
| o.add(buildOperation()); |
| return o; |
| } |
| |
| void checkUnnamed6115(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 = buildUnnamed6115(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| void checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6115(o.operations!); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| core.List<api.Service> buildUnnamed6116() { |
| var o = <api.Service>[]; |
| o.add(buildService()); |
| o.add(buildService()); |
| return o; |
| } |
| |
| void checkUnnamed6116(core.List<api.Service> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkService(o[0] as api.Service); |
| checkService(o[1] as api.Service); |
| } |
| |
| core.int buildCounterListServiceConfigsResponse = 0; |
| api.ListServiceConfigsResponse buildListServiceConfigsResponse() { |
| var o = api.ListServiceConfigsResponse(); |
| buildCounterListServiceConfigsResponse++; |
| if (buildCounterListServiceConfigsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.serviceConfigs = buildUnnamed6116(); |
| } |
| buildCounterListServiceConfigsResponse--; |
| return o; |
| } |
| |
| void checkListServiceConfigsResponse(api.ListServiceConfigsResponse o) { |
| buildCounterListServiceConfigsResponse++; |
| if (buildCounterListServiceConfigsResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6116(o.serviceConfigs!); |
| } |
| buildCounterListServiceConfigsResponse--; |
| } |
| |
| core.List<api.Rollout> buildUnnamed6117() { |
| var o = <api.Rollout>[]; |
| o.add(buildRollout()); |
| o.add(buildRollout()); |
| return o; |
| } |
| |
| void checkUnnamed6117(core.List<api.Rollout> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkRollout(o[0] as api.Rollout); |
| checkRollout(o[1] as api.Rollout); |
| } |
| |
| core.int buildCounterListServiceRolloutsResponse = 0; |
| api.ListServiceRolloutsResponse buildListServiceRolloutsResponse() { |
| var o = api.ListServiceRolloutsResponse(); |
| buildCounterListServiceRolloutsResponse++; |
| if (buildCounterListServiceRolloutsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.rollouts = buildUnnamed6117(); |
| } |
| buildCounterListServiceRolloutsResponse--; |
| return o; |
| } |
| |
| void checkListServiceRolloutsResponse(api.ListServiceRolloutsResponse o) { |
| buildCounterListServiceRolloutsResponse++; |
| if (buildCounterListServiceRolloutsResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6117(o.rollouts!); |
| } |
| buildCounterListServiceRolloutsResponse--; |
| } |
| |
| core.List<api.ManagedService> buildUnnamed6118() { |
| var o = <api.ManagedService>[]; |
| o.add(buildManagedService()); |
| o.add(buildManagedService()); |
| return o; |
| } |
| |
| void checkUnnamed6118(core.List<api.ManagedService> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkManagedService(o[0] as api.ManagedService); |
| checkManagedService(o[1] as api.ManagedService); |
| } |
| |
| core.int buildCounterListServicesResponse = 0; |
| api.ListServicesResponse buildListServicesResponse() { |
| var o = api.ListServicesResponse(); |
| buildCounterListServicesResponse++; |
| if (buildCounterListServicesResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.services = buildUnnamed6118(); |
| } |
| buildCounterListServicesResponse--; |
| return o; |
| } |
| |
| void checkListServicesResponse(api.ListServicesResponse o) { |
| buildCounterListServicesResponse++; |
| if (buildCounterListServicesResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6118(o.services!); |
| } |
| buildCounterListServicesResponse--; |
| } |
| |
| core.List<api.LabelDescriptor> buildUnnamed6119() { |
| var o = <api.LabelDescriptor>[]; |
| o.add(buildLabelDescriptor()); |
| o.add(buildLabelDescriptor()); |
| return o; |
| } |
| |
| void checkUnnamed6119(core.List<api.LabelDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLabelDescriptor(o[0] as api.LabelDescriptor); |
| checkLabelDescriptor(o[1] as api.LabelDescriptor); |
| } |
| |
| core.int buildCounterLogDescriptor = 0; |
| api.LogDescriptor buildLogDescriptor() { |
| var o = api.LogDescriptor(); |
| buildCounterLogDescriptor++; |
| if (buildCounterLogDescriptor < 3) { |
| o.description = 'foo'; |
| o.displayName = 'foo'; |
| o.labels = buildUnnamed6119(); |
| o.name = 'foo'; |
| } |
| buildCounterLogDescriptor--; |
| return o; |
| } |
| |
| void checkLogDescriptor(api.LogDescriptor o) { |
| buildCounterLogDescriptor++; |
| if (buildCounterLogDescriptor < 3) { |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6119(o.labels!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterLogDescriptor--; |
| } |
| |
| core.List<api.LoggingDestination> buildUnnamed6120() { |
| var o = <api.LoggingDestination>[]; |
| o.add(buildLoggingDestination()); |
| o.add(buildLoggingDestination()); |
| return o; |
| } |
| |
| void checkUnnamed6120(core.List<api.LoggingDestination> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLoggingDestination(o[0] as api.LoggingDestination); |
| checkLoggingDestination(o[1] as api.LoggingDestination); |
| } |
| |
| core.List<api.LoggingDestination> buildUnnamed6121() { |
| var o = <api.LoggingDestination>[]; |
| o.add(buildLoggingDestination()); |
| o.add(buildLoggingDestination()); |
| return o; |
| } |
| |
| void checkUnnamed6121(core.List<api.LoggingDestination> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLoggingDestination(o[0] as api.LoggingDestination); |
| checkLoggingDestination(o[1] as api.LoggingDestination); |
| } |
| |
| core.int buildCounterLogging = 0; |
| api.Logging buildLogging() { |
| var o = api.Logging(); |
| buildCounterLogging++; |
| if (buildCounterLogging < 3) { |
| o.consumerDestinations = buildUnnamed6120(); |
| o.producerDestinations = buildUnnamed6121(); |
| } |
| buildCounterLogging--; |
| return o; |
| } |
| |
| void checkLogging(api.Logging o) { |
| buildCounterLogging++; |
| if (buildCounterLogging < 3) { |
| checkUnnamed6120(o.consumerDestinations!); |
| checkUnnamed6121(o.producerDestinations!); |
| } |
| buildCounterLogging--; |
| } |
| |
| core.List<core.String> buildUnnamed6122() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6122(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 buildCounterLoggingDestination = 0; |
| api.LoggingDestination buildLoggingDestination() { |
| var o = api.LoggingDestination(); |
| buildCounterLoggingDestination++; |
| if (buildCounterLoggingDestination < 3) { |
| o.logs = buildUnnamed6122(); |
| o.monitoredResource = 'foo'; |
| } |
| buildCounterLoggingDestination--; |
| return o; |
| } |
| |
| void checkLoggingDestination(api.LoggingDestination o) { |
| buildCounterLoggingDestination++; |
| if (buildCounterLoggingDestination < 3) { |
| checkUnnamed6122(o.logs!); |
| unittest.expect( |
| o.monitoredResource!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterLoggingDestination--; |
| } |
| |
| core.int buildCounterManagedService = 0; |
| api.ManagedService buildManagedService() { |
| var o = api.ManagedService(); |
| buildCounterManagedService++; |
| if (buildCounterManagedService < 3) { |
| o.producerProjectId = 'foo'; |
| o.serviceName = 'foo'; |
| } |
| buildCounterManagedService--; |
| return o; |
| } |
| |
| void checkManagedService(api.ManagedService o) { |
| buildCounterManagedService++; |
| if (buildCounterManagedService < 3) { |
| unittest.expect( |
| o.producerProjectId!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.serviceName!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterManagedService--; |
| } |
| |
| core.List<api.Option> buildUnnamed6123() { |
| var o = <api.Option>[]; |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| void checkUnnamed6123(core.List<api.Option> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOption(o[0] as api.Option); |
| checkOption(o[1] as api.Option); |
| } |
| |
| core.int buildCounterMethod = 0; |
| api.Method buildMethod() { |
| var o = api.Method(); |
| buildCounterMethod++; |
| if (buildCounterMethod < 3) { |
| o.name = 'foo'; |
| o.options = buildUnnamed6123(); |
| o.requestStreaming = true; |
| o.requestTypeUrl = 'foo'; |
| o.responseStreaming = true; |
| o.responseTypeUrl = 'foo'; |
| o.syntax = 'foo'; |
| } |
| buildCounterMethod--; |
| return o; |
| } |
| |
| void checkMethod(api.Method o) { |
| buildCounterMethod++; |
| if (buildCounterMethod < 3) { |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6123(o.options!); |
| unittest.expect(o.requestStreaming!, unittest.isTrue); |
| unittest.expect( |
| o.requestTypeUrl!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.responseStreaming!, unittest.isTrue); |
| unittest.expect( |
| o.responseTypeUrl!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.syntax!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterMethod--; |
| } |
| |
| core.List<api.LabelDescriptor> buildUnnamed6124() { |
| var o = <api.LabelDescriptor>[]; |
| o.add(buildLabelDescriptor()); |
| o.add(buildLabelDescriptor()); |
| return o; |
| } |
| |
| void checkUnnamed6124(core.List<api.LabelDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLabelDescriptor(o[0] as api.LabelDescriptor); |
| checkLabelDescriptor(o[1] as api.LabelDescriptor); |
| } |
| |
| core.List<core.String> buildUnnamed6125() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6125(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 buildCounterMetricDescriptor = 0; |
| api.MetricDescriptor buildMetricDescriptor() { |
| var o = api.MetricDescriptor(); |
| buildCounterMetricDescriptor++; |
| if (buildCounterMetricDescriptor < 3) { |
| o.description = 'foo'; |
| o.displayName = 'foo'; |
| o.labels = buildUnnamed6124(); |
| o.launchStage = 'foo'; |
| o.metadata = buildMetricDescriptorMetadata(); |
| o.metricKind = 'foo'; |
| o.monitoredResourceTypes = buildUnnamed6125(); |
| o.name = 'foo'; |
| o.type = 'foo'; |
| o.unit = 'foo'; |
| o.valueType = 'foo'; |
| } |
| buildCounterMetricDescriptor--; |
| return o; |
| } |
| |
| void checkMetricDescriptor(api.MetricDescriptor o) { |
| buildCounterMetricDescriptor++; |
| if (buildCounterMetricDescriptor < 3) { |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6124(o.labels!); |
| unittest.expect( |
| o.launchStage!, |
| unittest.equals('foo'), |
| ); |
| checkMetricDescriptorMetadata(o.metadata! as api.MetricDescriptorMetadata); |
| unittest.expect( |
| o.metricKind!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6125(o.monitoredResourceTypes!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.type!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.unit!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.valueType!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterMetricDescriptor--; |
| } |
| |
| core.int buildCounterMetricDescriptorMetadata = 0; |
| api.MetricDescriptorMetadata buildMetricDescriptorMetadata() { |
| var o = api.MetricDescriptorMetadata(); |
| buildCounterMetricDescriptorMetadata++; |
| if (buildCounterMetricDescriptorMetadata < 3) { |
| o.ingestDelay = 'foo'; |
| o.launchStage = 'foo'; |
| o.samplePeriod = 'foo'; |
| } |
| buildCounterMetricDescriptorMetadata--; |
| return o; |
| } |
| |
| void checkMetricDescriptorMetadata(api.MetricDescriptorMetadata o) { |
| buildCounterMetricDescriptorMetadata++; |
| if (buildCounterMetricDescriptorMetadata < 3) { |
| unittest.expect( |
| o.ingestDelay!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.launchStage!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.samplePeriod!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterMetricDescriptorMetadata--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed6126() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6126(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 buildCounterMetricRule = 0; |
| api.MetricRule buildMetricRule() { |
| var o = api.MetricRule(); |
| buildCounterMetricRule++; |
| if (buildCounterMetricRule < 3) { |
| o.metricCosts = buildUnnamed6126(); |
| o.selector = 'foo'; |
| } |
| buildCounterMetricRule--; |
| return o; |
| } |
| |
| void checkMetricRule(api.MetricRule o) { |
| buildCounterMetricRule++; |
| if (buildCounterMetricRule < 3) { |
| checkUnnamed6126(o.metricCosts!); |
| unittest.expect( |
| o.selector!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterMetricRule--; |
| } |
| |
| core.int buildCounterMixin = 0; |
| api.Mixin buildMixin() { |
| var o = api.Mixin(); |
| buildCounterMixin++; |
| if (buildCounterMixin < 3) { |
| o.name = 'foo'; |
| o.root = 'foo'; |
| } |
| buildCounterMixin--; |
| return o; |
| } |
| |
| void checkMixin(api.Mixin o) { |
| buildCounterMixin++; |
| if (buildCounterMixin < 3) { |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.root!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterMixin--; |
| } |
| |
| core.List<api.LabelDescriptor> buildUnnamed6127() { |
| var o = <api.LabelDescriptor>[]; |
| o.add(buildLabelDescriptor()); |
| o.add(buildLabelDescriptor()); |
| return o; |
| } |
| |
| void checkUnnamed6127(core.List<api.LabelDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLabelDescriptor(o[0] as api.LabelDescriptor); |
| checkLabelDescriptor(o[1] as api.LabelDescriptor); |
| } |
| |
| core.int buildCounterMonitoredResourceDescriptor = 0; |
| api.MonitoredResourceDescriptor buildMonitoredResourceDescriptor() { |
| var o = api.MonitoredResourceDescriptor(); |
| buildCounterMonitoredResourceDescriptor++; |
| if (buildCounterMonitoredResourceDescriptor < 3) { |
| o.description = 'foo'; |
| o.displayName = 'foo'; |
| o.labels = buildUnnamed6127(); |
| o.launchStage = 'foo'; |
| o.name = 'foo'; |
| o.type = 'foo'; |
| } |
| buildCounterMonitoredResourceDescriptor--; |
| return o; |
| } |
| |
| void checkMonitoredResourceDescriptor(api.MonitoredResourceDescriptor o) { |
| buildCounterMonitoredResourceDescriptor++; |
| if (buildCounterMonitoredResourceDescriptor < 3) { |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6127(o.labels!); |
| unittest.expect( |
| o.launchStage!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.type!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterMonitoredResourceDescriptor--; |
| } |
| |
| core.List<api.MonitoringDestination> buildUnnamed6128() { |
| var o = <api.MonitoringDestination>[]; |
| o.add(buildMonitoringDestination()); |
| o.add(buildMonitoringDestination()); |
| return o; |
| } |
| |
| void checkUnnamed6128(core.List<api.MonitoringDestination> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMonitoringDestination(o[0] as api.MonitoringDestination); |
| checkMonitoringDestination(o[1] as api.MonitoringDestination); |
| } |
| |
| core.List<api.MonitoringDestination> buildUnnamed6129() { |
| var o = <api.MonitoringDestination>[]; |
| o.add(buildMonitoringDestination()); |
| o.add(buildMonitoringDestination()); |
| return o; |
| } |
| |
| void checkUnnamed6129(core.List<api.MonitoringDestination> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMonitoringDestination(o[0] as api.MonitoringDestination); |
| checkMonitoringDestination(o[1] as api.MonitoringDestination); |
| } |
| |
| core.int buildCounterMonitoring = 0; |
| api.Monitoring buildMonitoring() { |
| var o = api.Monitoring(); |
| buildCounterMonitoring++; |
| if (buildCounterMonitoring < 3) { |
| o.consumerDestinations = buildUnnamed6128(); |
| o.producerDestinations = buildUnnamed6129(); |
| } |
| buildCounterMonitoring--; |
| return o; |
| } |
| |
| void checkMonitoring(api.Monitoring o) { |
| buildCounterMonitoring++; |
| if (buildCounterMonitoring < 3) { |
| checkUnnamed6128(o.consumerDestinations!); |
| checkUnnamed6129(o.producerDestinations!); |
| } |
| buildCounterMonitoring--; |
| } |
| |
| core.List<core.String> buildUnnamed6130() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6130(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 buildCounterMonitoringDestination = 0; |
| api.MonitoringDestination buildMonitoringDestination() { |
| var o = api.MonitoringDestination(); |
| buildCounterMonitoringDestination++; |
| if (buildCounterMonitoringDestination < 3) { |
| o.metrics = buildUnnamed6130(); |
| o.monitoredResource = 'foo'; |
| } |
| buildCounterMonitoringDestination--; |
| return o; |
| } |
| |
| void checkMonitoringDestination(api.MonitoringDestination o) { |
| buildCounterMonitoringDestination++; |
| if (buildCounterMonitoringDestination < 3) { |
| checkUnnamed6130(o.metrics!); |
| unittest.expect( |
| o.monitoredResource!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterMonitoringDestination--; |
| } |
| |
| core.int buildCounterOAuthRequirements = 0; |
| api.OAuthRequirements buildOAuthRequirements() { |
| var o = api.OAuthRequirements(); |
| buildCounterOAuthRequirements++; |
| if (buildCounterOAuthRequirements < 3) { |
| o.canonicalScopes = 'foo'; |
| } |
| buildCounterOAuthRequirements--; |
| return o; |
| } |
| |
| void checkOAuthRequirements(api.OAuthRequirements o) { |
| buildCounterOAuthRequirements++; |
| if (buildCounterOAuthRequirements < 3) { |
| unittest.expect( |
| o.canonicalScopes!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterOAuthRequirements--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed6131() { |
| 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 checkUnnamed6131(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.Map<core.String, core.Object> buildUnnamed6132() { |
| 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 checkUnnamed6132(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.int buildCounterOperation = 0; |
| api.Operation buildOperation() { |
| var o = api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed6131(); |
| o.name = 'foo'; |
| o.response = buildUnnamed6132(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| void checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done!, unittest.isTrue); |
| checkStatus(o.error! as api.Status); |
| checkUnnamed6131(o.metadata!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6132(o.response!); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.int buildCounterOperationInfo = 0; |
| api.OperationInfo buildOperationInfo() { |
| var o = api.OperationInfo(); |
| buildCounterOperationInfo++; |
| if (buildCounterOperationInfo < 3) { |
| o.metadataType = 'foo'; |
| o.responseType = 'foo'; |
| } |
| buildCounterOperationInfo--; |
| return o; |
| } |
| |
| void checkOperationInfo(api.OperationInfo o) { |
| buildCounterOperationInfo++; |
| if (buildCounterOperationInfo < 3) { |
| unittest.expect( |
| o.metadataType!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.responseType!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterOperationInfo--; |
| } |
| |
| core.List<core.String> buildUnnamed6133() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6133(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.Step> buildUnnamed6134() { |
| var o = <api.Step>[]; |
| o.add(buildStep()); |
| o.add(buildStep()); |
| return o; |
| } |
| |
| void checkUnnamed6134(core.List<api.Step> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkStep(o[0] as api.Step); |
| checkStep(o[1] as api.Step); |
| } |
| |
| core.int buildCounterOperationMetadata = 0; |
| api.OperationMetadata buildOperationMetadata() { |
| var o = api.OperationMetadata(); |
| buildCounterOperationMetadata++; |
| if (buildCounterOperationMetadata < 3) { |
| o.progressPercentage = 42; |
| o.resourceNames = buildUnnamed6133(); |
| o.startTime = 'foo'; |
| o.steps = buildUnnamed6134(); |
| } |
| buildCounterOperationMetadata--; |
| return o; |
| } |
| |
| void checkOperationMetadata(api.OperationMetadata o) { |
| buildCounterOperationMetadata++; |
| if (buildCounterOperationMetadata < 3) { |
| unittest.expect( |
| o.progressPercentage!, |
| unittest.equals(42), |
| ); |
| checkUnnamed6133(o.resourceNames!); |
| unittest.expect( |
| o.startTime!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6134(o.steps!); |
| } |
| buildCounterOperationMetadata--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed6135() { |
| 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 checkUnnamed6135(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted9 = (o['x']!) as core.Map; |
| unittest.expect(casted9, unittest.hasLength(3)); |
| unittest.expect( |
| casted9['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted9['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted9['string'], |
| unittest.equals('foo'), |
| ); |
| var casted10 = (o['y']!) as core.Map; |
| unittest.expect(casted10, unittest.hasLength(3)); |
| unittest.expect( |
| casted10['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted10['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted10['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterOption = 0; |
| api.Option buildOption() { |
| var o = api.Option(); |
| buildCounterOption++; |
| if (buildCounterOption < 3) { |
| o.name = 'foo'; |
| o.value = buildUnnamed6135(); |
| } |
| buildCounterOption--; |
| return o; |
| } |
| |
| void checkOption(api.Option o) { |
| buildCounterOption++; |
| if (buildCounterOption < 3) { |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6135(o.value!); |
| } |
| buildCounterOption--; |
| } |
| |
| core.List<api.Page> buildUnnamed6136() { |
| var o = <api.Page>[]; |
| o.add(buildPage()); |
| o.add(buildPage()); |
| return o; |
| } |
| |
| void checkUnnamed6136(core.List<api.Page> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPage(o[0] as api.Page); |
| checkPage(o[1] as api.Page); |
| } |
| |
| core.int buildCounterPage = 0; |
| api.Page buildPage() { |
| var o = api.Page(); |
| buildCounterPage++; |
| if (buildCounterPage < 3) { |
| o.content = 'foo'; |
| o.name = 'foo'; |
| o.subpages = buildUnnamed6136(); |
| } |
| buildCounterPage--; |
| return o; |
| } |
| |
| void checkPage(api.Page o) { |
| buildCounterPage++; |
| if (buildCounterPage < 3) { |
| unittest.expect( |
| o.content!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6136(o.subpages!); |
| } |
| buildCounterPage--; |
| } |
| |
| core.List<api.AuditConfig> buildUnnamed6137() { |
| var o = <api.AuditConfig>[]; |
| o.add(buildAuditConfig()); |
| o.add(buildAuditConfig()); |
| return o; |
| } |
| |
| void checkUnnamed6137(core.List<api.AuditConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuditConfig(o[0] as api.AuditConfig); |
| checkAuditConfig(o[1] as api.AuditConfig); |
| } |
| |
| core.List<api.Binding> buildUnnamed6138() { |
| var o = <api.Binding>[]; |
| o.add(buildBinding()); |
| o.add(buildBinding()); |
| return o; |
| } |
| |
| void checkUnnamed6138(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.auditConfigs = buildUnnamed6137(); |
| o.bindings = buildUnnamed6138(); |
| o.etag = 'foo'; |
| o.version = 42; |
| } |
| buildCounterPolicy--; |
| return o; |
| } |
| |
| void checkPolicy(api.Policy o) { |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| checkUnnamed6137(o.auditConfigs!); |
| checkUnnamed6138(o.bindings!); |
| unittest.expect( |
| o.etag!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.version!, |
| unittest.equals(42), |
| ); |
| } |
| buildCounterPolicy--; |
| } |
| |
| core.List<api.QuotaLimit> buildUnnamed6139() { |
| var o = <api.QuotaLimit>[]; |
| o.add(buildQuotaLimit()); |
| o.add(buildQuotaLimit()); |
| return o; |
| } |
| |
| void checkUnnamed6139(core.List<api.QuotaLimit> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkQuotaLimit(o[0] as api.QuotaLimit); |
| checkQuotaLimit(o[1] as api.QuotaLimit); |
| } |
| |
| core.List<api.MetricRule> buildUnnamed6140() { |
| var o = <api.MetricRule>[]; |
| o.add(buildMetricRule()); |
| o.add(buildMetricRule()); |
| return o; |
| } |
| |
| void checkUnnamed6140(core.List<api.MetricRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMetricRule(o[0] as api.MetricRule); |
| checkMetricRule(o[1] as api.MetricRule); |
| } |
| |
| core.int buildCounterQuota = 0; |
| api.Quota buildQuota() { |
| var o = api.Quota(); |
| buildCounterQuota++; |
| if (buildCounterQuota < 3) { |
| o.limits = buildUnnamed6139(); |
| o.metricRules = buildUnnamed6140(); |
| } |
| buildCounterQuota--; |
| return o; |
| } |
| |
| void checkQuota(api.Quota o) { |
| buildCounterQuota++; |
| if (buildCounterQuota < 3) { |
| checkUnnamed6139(o.limits!); |
| checkUnnamed6140(o.metricRules!); |
| } |
| buildCounterQuota--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed6141() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6141(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 buildCounterQuotaLimit = 0; |
| api.QuotaLimit buildQuotaLimit() { |
| var o = api.QuotaLimit(); |
| buildCounterQuotaLimit++; |
| if (buildCounterQuotaLimit < 3) { |
| o.defaultLimit = 'foo'; |
| o.description = 'foo'; |
| o.displayName = 'foo'; |
| o.duration = 'foo'; |
| o.freeTier = 'foo'; |
| o.maxLimit = 'foo'; |
| o.metric = 'foo'; |
| o.name = 'foo'; |
| o.unit = 'foo'; |
| o.values = buildUnnamed6141(); |
| } |
| buildCounterQuotaLimit--; |
| return o; |
| } |
| |
| void checkQuotaLimit(api.QuotaLimit o) { |
| buildCounterQuotaLimit++; |
| if (buildCounterQuotaLimit < 3) { |
| unittest.expect( |
| o.defaultLimit!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.duration!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.freeTier!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.maxLimit!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.metric!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.unit!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6141(o.values!); |
| } |
| buildCounterQuotaLimit--; |
| } |
| |
| core.int buildCounterResourceReference = 0; |
| api.ResourceReference buildResourceReference() { |
| var o = api.ResourceReference(); |
| buildCounterResourceReference++; |
| if (buildCounterResourceReference < 3) { |
| o.childType = 'foo'; |
| o.type = 'foo'; |
| } |
| buildCounterResourceReference--; |
| return o; |
| } |
| |
| void checkResourceReference(api.ResourceReference o) { |
| buildCounterResourceReference++; |
| if (buildCounterResourceReference < 3) { |
| unittest.expect( |
| o.childType!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.type!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterResourceReference--; |
| } |
| |
| core.int buildCounterRollout = 0; |
| api.Rollout buildRollout() { |
| var o = api.Rollout(); |
| buildCounterRollout++; |
| if (buildCounterRollout < 3) { |
| o.createTime = 'foo'; |
| o.createdBy = 'foo'; |
| o.deleteServiceStrategy = buildDeleteServiceStrategy(); |
| o.rolloutId = 'foo'; |
| o.serviceName = 'foo'; |
| o.status = 'foo'; |
| o.trafficPercentStrategy = buildTrafficPercentStrategy(); |
| } |
| buildCounterRollout--; |
| return o; |
| } |
| |
| void checkRollout(api.Rollout o) { |
| buildCounterRollout++; |
| if (buildCounterRollout < 3) { |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.createdBy!, |
| unittest.equals('foo'), |
| ); |
| checkDeleteServiceStrategy( |
| o.deleteServiceStrategy! as api.DeleteServiceStrategy); |
| unittest.expect( |
| o.rolloutId!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.serviceName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.status!, |
| unittest.equals('foo'), |
| ); |
| checkTrafficPercentStrategy( |
| o.trafficPercentStrategy! as api.TrafficPercentStrategy); |
| } |
| buildCounterRollout--; |
| } |
| |
| core.List<api.Api> buildUnnamed6142() { |
| var o = <api.Api>[]; |
| o.add(buildApi()); |
| o.add(buildApi()); |
| return o; |
| } |
| |
| void checkUnnamed6142(core.List<api.Api> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkApi(o[0] as api.Api); |
| checkApi(o[1] as api.Api); |
| } |
| |
| core.List<api.Endpoint> buildUnnamed6143() { |
| var o = <api.Endpoint>[]; |
| o.add(buildEndpoint()); |
| o.add(buildEndpoint()); |
| return o; |
| } |
| |
| void checkUnnamed6143(core.List<api.Endpoint> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEndpoint(o[0] as api.Endpoint); |
| checkEndpoint(o[1] as api.Endpoint); |
| } |
| |
| core.List<api.Enum> buildUnnamed6144() { |
| var o = <api.Enum>[]; |
| o.add(buildEnum()); |
| o.add(buildEnum()); |
| return o; |
| } |
| |
| void checkUnnamed6144(core.List<api.Enum> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEnum(o[0] as api.Enum); |
| checkEnum(o[1] as api.Enum); |
| } |
| |
| core.List<api.LogDescriptor> buildUnnamed6145() { |
| var o = <api.LogDescriptor>[]; |
| o.add(buildLogDescriptor()); |
| o.add(buildLogDescriptor()); |
| return o; |
| } |
| |
| void checkUnnamed6145(core.List<api.LogDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLogDescriptor(o[0] as api.LogDescriptor); |
| checkLogDescriptor(o[1] as api.LogDescriptor); |
| } |
| |
| core.List<api.MetricDescriptor> buildUnnamed6146() { |
| var o = <api.MetricDescriptor>[]; |
| o.add(buildMetricDescriptor()); |
| o.add(buildMetricDescriptor()); |
| return o; |
| } |
| |
| void checkUnnamed6146(core.List<api.MetricDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMetricDescriptor(o[0] as api.MetricDescriptor); |
| checkMetricDescriptor(o[1] as api.MetricDescriptor); |
| } |
| |
| core.List<api.MonitoredResourceDescriptor> buildUnnamed6147() { |
| var o = <api.MonitoredResourceDescriptor>[]; |
| o.add(buildMonitoredResourceDescriptor()); |
| o.add(buildMonitoredResourceDescriptor()); |
| return o; |
| } |
| |
| void checkUnnamed6147(core.List<api.MonitoredResourceDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMonitoredResourceDescriptor(o[0] as api.MonitoredResourceDescriptor); |
| checkMonitoredResourceDescriptor(o[1] as api.MonitoredResourceDescriptor); |
| } |
| |
| core.List<api.Type> buildUnnamed6148() { |
| var o = <api.Type>[]; |
| o.add(buildType()); |
| o.add(buildType()); |
| return o; |
| } |
| |
| void checkUnnamed6148(core.List<api.Type> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkType(o[0] as api.Type); |
| checkType(o[1] as api.Type); |
| } |
| |
| core.List<api.Type> buildUnnamed6149() { |
| var o = <api.Type>[]; |
| o.add(buildType()); |
| o.add(buildType()); |
| return o; |
| } |
| |
| void checkUnnamed6149(core.List<api.Type> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkType(o[0] as api.Type); |
| checkType(o[1] as api.Type); |
| } |
| |
| core.int buildCounterService = 0; |
| api.Service buildService() { |
| var o = api.Service(); |
| buildCounterService++; |
| if (buildCounterService < 3) { |
| o.apis = buildUnnamed6142(); |
| o.authentication = buildAuthentication(); |
| o.backend = buildBackend(); |
| o.billing = buildBilling(); |
| o.configVersion = 42; |
| o.context = buildContext(); |
| o.control = buildControl(); |
| o.customError = buildCustomError(); |
| o.documentation = buildDocumentation(); |
| o.endpoints = buildUnnamed6143(); |
| o.enums = buildUnnamed6144(); |
| o.http = buildHttp(); |
| o.id = 'foo'; |
| o.logging = buildLogging(); |
| o.logs = buildUnnamed6145(); |
| o.metrics = buildUnnamed6146(); |
| o.monitoredResources = buildUnnamed6147(); |
| o.monitoring = buildMonitoring(); |
| o.name = 'foo'; |
| o.producerProjectId = 'foo'; |
| o.quota = buildQuota(); |
| o.sourceInfo = buildSourceInfo(); |
| o.systemParameters = buildSystemParameters(); |
| o.systemTypes = buildUnnamed6148(); |
| o.title = 'foo'; |
| o.types = buildUnnamed6149(); |
| o.usage = buildUsage(); |
| } |
| buildCounterService--; |
| return o; |
| } |
| |
| void checkService(api.Service o) { |
| buildCounterService++; |
| if (buildCounterService < 3) { |
| checkUnnamed6142(o.apis!); |
| checkAuthentication(o.authentication! as api.Authentication); |
| checkBackend(o.backend! as api.Backend); |
| checkBilling(o.billing! as api.Billing); |
| unittest.expect( |
| o.configVersion!, |
| unittest.equals(42), |
| ); |
| checkContext(o.context! as api.Context); |
| checkControl(o.control! as api.Control); |
| checkCustomError(o.customError! as api.CustomError); |
| checkDocumentation(o.documentation! as api.Documentation); |
| checkUnnamed6143(o.endpoints!); |
| checkUnnamed6144(o.enums!); |
| checkHttp(o.http! as api.Http); |
| unittest.expect( |
| o.id!, |
| unittest.equals('foo'), |
| ); |
| checkLogging(o.logging! as api.Logging); |
| checkUnnamed6145(o.logs!); |
| checkUnnamed6146(o.metrics!); |
| checkUnnamed6147(o.monitoredResources!); |
| checkMonitoring(o.monitoring! as api.Monitoring); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.producerProjectId!, |
| unittest.equals('foo'), |
| ); |
| checkQuota(o.quota! as api.Quota); |
| checkSourceInfo(o.sourceInfo! as api.SourceInfo); |
| checkSystemParameters(o.systemParameters! as api.SystemParameters); |
| checkUnnamed6148(o.systemTypes!); |
| unittest.expect( |
| o.title!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6149(o.types!); |
| checkUsage(o.usage! as api.Usage); |
| } |
| buildCounterService--; |
| } |
| |
| core.int buildCounterSetIamPolicyRequest = 0; |
| api.SetIamPolicyRequest buildSetIamPolicyRequest() { |
| var o = api.SetIamPolicyRequest(); |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| o.policy = buildPolicy(); |
| o.updateMask = 'foo'; |
| } |
| buildCounterSetIamPolicyRequest--; |
| return o; |
| } |
| |
| void checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| checkPolicy(o.policy! as api.Policy); |
| unittest.expect( |
| o.updateMask!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterSetIamPolicyRequest--; |
| } |
| |
| core.int buildCounterSourceContext = 0; |
| api.SourceContext buildSourceContext() { |
| var o = api.SourceContext(); |
| buildCounterSourceContext++; |
| if (buildCounterSourceContext < 3) { |
| o.fileName = 'foo'; |
| } |
| buildCounterSourceContext--; |
| return o; |
| } |
| |
| void checkSourceContext(api.SourceContext o) { |
| buildCounterSourceContext++; |
| if (buildCounterSourceContext < 3) { |
| unittest.expect( |
| o.fileName!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterSourceContext--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed6150() { |
| 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 checkUnnamed6150(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted11 = (o['x']!) as core.Map; |
| unittest.expect(casted11, unittest.hasLength(3)); |
| unittest.expect( |
| casted11['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted11['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted11['string'], |
| unittest.equals('foo'), |
| ); |
| var casted12 = (o['y']!) as core.Map; |
| unittest.expect(casted12, unittest.hasLength(3)); |
| unittest.expect( |
| casted12['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted12['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted12['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.List<core.Map<core.String, core.Object>> buildUnnamed6151() { |
| var o = <core.Map<core.String, core.Object>>[]; |
| o.add(buildUnnamed6150()); |
| o.add(buildUnnamed6150()); |
| return o; |
| } |
| |
| void checkUnnamed6151(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed6150(o[0]); |
| checkUnnamed6150(o[1]); |
| } |
| |
| core.int buildCounterSourceInfo = 0; |
| api.SourceInfo buildSourceInfo() { |
| var o = api.SourceInfo(); |
| buildCounterSourceInfo++; |
| if (buildCounterSourceInfo < 3) { |
| o.sourceFiles = buildUnnamed6151(); |
| } |
| buildCounterSourceInfo--; |
| return o; |
| } |
| |
| void checkSourceInfo(api.SourceInfo o) { |
| buildCounterSourceInfo++; |
| if (buildCounterSourceInfo < 3) { |
| checkUnnamed6151(o.sourceFiles!); |
| } |
| buildCounterSourceInfo--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed6152() { |
| 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 checkUnnamed6152(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted13 = (o['x']!) as core.Map; |
| unittest.expect(casted13, unittest.hasLength(3)); |
| unittest.expect( |
| casted13['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted13['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted13['string'], |
| unittest.equals('foo'), |
| ); |
| var casted14 = (o['y']!) as core.Map; |
| unittest.expect(casted14, unittest.hasLength(3)); |
| unittest.expect( |
| casted14['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted14['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted14['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.List<core.Map<core.String, core.Object>> buildUnnamed6153() { |
| var o = <core.Map<core.String, core.Object>>[]; |
| o.add(buildUnnamed6152()); |
| o.add(buildUnnamed6152()); |
| return o; |
| } |
| |
| void checkUnnamed6153(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed6152(o[0]); |
| checkUnnamed6152(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| api.Status buildStatus() { |
| var o = api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed6153(); |
| o.message = 'foo'; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| void checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect( |
| o.code!, |
| unittest.equals(42), |
| ); |
| checkUnnamed6153(o.details!); |
| unittest.expect( |
| o.message!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.int buildCounterStep = 0; |
| api.Step buildStep() { |
| var o = api.Step(); |
| buildCounterStep++; |
| if (buildCounterStep < 3) { |
| o.description = 'foo'; |
| o.status = 'foo'; |
| } |
| buildCounterStep--; |
| return o; |
| } |
| |
| void checkStep(api.Step o) { |
| buildCounterStep++; |
| if (buildCounterStep < 3) { |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.status!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterStep--; |
| } |
| |
| core.int buildCounterSubmitConfigSourceRequest = 0; |
| api.SubmitConfigSourceRequest buildSubmitConfigSourceRequest() { |
| var o = api.SubmitConfigSourceRequest(); |
| buildCounterSubmitConfigSourceRequest++; |
| if (buildCounterSubmitConfigSourceRequest < 3) { |
| o.configSource = buildConfigSource(); |
| o.validateOnly = true; |
| } |
| buildCounterSubmitConfigSourceRequest--; |
| return o; |
| } |
| |
| void checkSubmitConfigSourceRequest(api.SubmitConfigSourceRequest o) { |
| buildCounterSubmitConfigSourceRequest++; |
| if (buildCounterSubmitConfigSourceRequest < 3) { |
| checkConfigSource(o.configSource! as api.ConfigSource); |
| unittest.expect(o.validateOnly!, unittest.isTrue); |
| } |
| buildCounterSubmitConfigSourceRequest--; |
| } |
| |
| core.int buildCounterSubmitConfigSourceResponse = 0; |
| api.SubmitConfigSourceResponse buildSubmitConfigSourceResponse() { |
| var o = api.SubmitConfigSourceResponse(); |
| buildCounterSubmitConfigSourceResponse++; |
| if (buildCounterSubmitConfigSourceResponse < 3) { |
| o.serviceConfig = buildService(); |
| } |
| buildCounterSubmitConfigSourceResponse--; |
| return o; |
| } |
| |
| void checkSubmitConfigSourceResponse(api.SubmitConfigSourceResponse o) { |
| buildCounterSubmitConfigSourceResponse++; |
| if (buildCounterSubmitConfigSourceResponse < 3) { |
| checkService(o.serviceConfig! as api.Service); |
| } |
| buildCounterSubmitConfigSourceResponse--; |
| } |
| |
| core.int buildCounterSystemParameter = 0; |
| api.SystemParameter buildSystemParameter() { |
| var o = api.SystemParameter(); |
| buildCounterSystemParameter++; |
| if (buildCounterSystemParameter < 3) { |
| o.httpHeader = 'foo'; |
| o.name = 'foo'; |
| o.urlQueryParameter = 'foo'; |
| } |
| buildCounterSystemParameter--; |
| return o; |
| } |
| |
| void checkSystemParameter(api.SystemParameter o) { |
| buildCounterSystemParameter++; |
| if (buildCounterSystemParameter < 3) { |
| unittest.expect( |
| o.httpHeader!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.urlQueryParameter!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterSystemParameter--; |
| } |
| |
| core.List<api.SystemParameter> buildUnnamed6154() { |
| var o = <api.SystemParameter>[]; |
| o.add(buildSystemParameter()); |
| o.add(buildSystemParameter()); |
| return o; |
| } |
| |
| void checkUnnamed6154(core.List<api.SystemParameter> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSystemParameter(o[0] as api.SystemParameter); |
| checkSystemParameter(o[1] as api.SystemParameter); |
| } |
| |
| core.int buildCounterSystemParameterRule = 0; |
| api.SystemParameterRule buildSystemParameterRule() { |
| var o = api.SystemParameterRule(); |
| buildCounterSystemParameterRule++; |
| if (buildCounterSystemParameterRule < 3) { |
| o.parameters = buildUnnamed6154(); |
| o.selector = 'foo'; |
| } |
| buildCounterSystemParameterRule--; |
| return o; |
| } |
| |
| void checkSystemParameterRule(api.SystemParameterRule o) { |
| buildCounterSystemParameterRule++; |
| if (buildCounterSystemParameterRule < 3) { |
| checkUnnamed6154(o.parameters!); |
| unittest.expect( |
| o.selector!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterSystemParameterRule--; |
| } |
| |
| core.List<api.SystemParameterRule> buildUnnamed6155() { |
| var o = <api.SystemParameterRule>[]; |
| o.add(buildSystemParameterRule()); |
| o.add(buildSystemParameterRule()); |
| return o; |
| } |
| |
| void checkUnnamed6155(core.List<api.SystemParameterRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSystemParameterRule(o[0] as api.SystemParameterRule); |
| checkSystemParameterRule(o[1] as api.SystemParameterRule); |
| } |
| |
| core.int buildCounterSystemParameters = 0; |
| api.SystemParameters buildSystemParameters() { |
| var o = api.SystemParameters(); |
| buildCounterSystemParameters++; |
| if (buildCounterSystemParameters < 3) { |
| o.rules = buildUnnamed6155(); |
| } |
| buildCounterSystemParameters--; |
| return o; |
| } |
| |
| void checkSystemParameters(api.SystemParameters o) { |
| buildCounterSystemParameters++; |
| if (buildCounterSystemParameters < 3) { |
| checkUnnamed6155(o.rules!); |
| } |
| buildCounterSystemParameters--; |
| } |
| |
| core.List<core.String> buildUnnamed6156() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6156(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 = buildUnnamed6156(); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| checkUnnamed6156(o.permissions!); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed6157() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6157(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 = buildUnnamed6157(); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| checkUnnamed6157(o.permissions!); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| } |
| |
| core.Map<core.String, core.double> buildUnnamed6158() { |
| var o = <core.String, core.double>{}; |
| o['x'] = 42.0; |
| o['y'] = 42.0; |
| return o; |
| } |
| |
| void checkUnnamed6158(core.Map<core.String, core.double> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o['x']!, |
| unittest.equals(42.0), |
| ); |
| unittest.expect( |
| o['y']!, |
| unittest.equals(42.0), |
| ); |
| } |
| |
| core.int buildCounterTrafficPercentStrategy = 0; |
| api.TrafficPercentStrategy buildTrafficPercentStrategy() { |
| var o = api.TrafficPercentStrategy(); |
| buildCounterTrafficPercentStrategy++; |
| if (buildCounterTrafficPercentStrategy < 3) { |
| o.percentages = buildUnnamed6158(); |
| } |
| buildCounterTrafficPercentStrategy--; |
| return o; |
| } |
| |
| void checkTrafficPercentStrategy(api.TrafficPercentStrategy o) { |
| buildCounterTrafficPercentStrategy++; |
| if (buildCounterTrafficPercentStrategy < 3) { |
| checkUnnamed6158(o.percentages!); |
| } |
| buildCounterTrafficPercentStrategy--; |
| } |
| |
| core.List<api.Field> buildUnnamed6159() { |
| var o = <api.Field>[]; |
| o.add(buildField()); |
| o.add(buildField()); |
| return o; |
| } |
| |
| void checkUnnamed6159(core.List<api.Field> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkField(o[0] as api.Field); |
| checkField(o[1] as api.Field); |
| } |
| |
| core.List<core.String> buildUnnamed6160() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6160(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.Option> buildUnnamed6161() { |
| var o = <api.Option>[]; |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| void checkUnnamed6161(core.List<api.Option> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOption(o[0] as api.Option); |
| checkOption(o[1] as api.Option); |
| } |
| |
| core.int buildCounterType = 0; |
| api.Type buildType() { |
| var o = api.Type(); |
| buildCounterType++; |
| if (buildCounterType < 3) { |
| o.fields = buildUnnamed6159(); |
| o.name = 'foo'; |
| o.oneofs = buildUnnamed6160(); |
| o.options = buildUnnamed6161(); |
| o.sourceContext = buildSourceContext(); |
| o.syntax = 'foo'; |
| } |
| buildCounterType--; |
| return o; |
| } |
| |
| void checkType(api.Type o) { |
| buildCounterType++; |
| if (buildCounterType < 3) { |
| checkUnnamed6159(o.fields!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6160(o.oneofs!); |
| checkUnnamed6161(o.options!); |
| checkSourceContext(o.sourceContext! as api.SourceContext); |
| unittest.expect( |
| o.syntax!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterType--; |
| } |
| |
| core.int buildCounterUndeleteServiceResponse = 0; |
| api.UndeleteServiceResponse buildUndeleteServiceResponse() { |
| var o = api.UndeleteServiceResponse(); |
| buildCounterUndeleteServiceResponse++; |
| if (buildCounterUndeleteServiceResponse < 3) { |
| o.service = buildManagedService(); |
| } |
| buildCounterUndeleteServiceResponse--; |
| return o; |
| } |
| |
| void checkUndeleteServiceResponse(api.UndeleteServiceResponse o) { |
| buildCounterUndeleteServiceResponse++; |
| if (buildCounterUndeleteServiceResponse < 3) { |
| checkManagedService(o.service! as api.ManagedService); |
| } |
| buildCounterUndeleteServiceResponse--; |
| } |
| |
| core.List<core.String> buildUnnamed6162() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6162(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.UsageRule> buildUnnamed6163() { |
| var o = <api.UsageRule>[]; |
| o.add(buildUsageRule()); |
| o.add(buildUsageRule()); |
| return o; |
| } |
| |
| void checkUnnamed6163(core.List<api.UsageRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUsageRule(o[0] as api.UsageRule); |
| checkUsageRule(o[1] as api.UsageRule); |
| } |
| |
| core.int buildCounterUsage = 0; |
| api.Usage buildUsage() { |
| var o = api.Usage(); |
| buildCounterUsage++; |
| if (buildCounterUsage < 3) { |
| o.producerNotificationChannel = 'foo'; |
| o.requirements = buildUnnamed6162(); |
| o.rules = buildUnnamed6163(); |
| } |
| buildCounterUsage--; |
| return o; |
| } |
| |
| void checkUsage(api.Usage o) { |
| buildCounterUsage++; |
| if (buildCounterUsage < 3) { |
| unittest.expect( |
| o.producerNotificationChannel!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6162(o.requirements!); |
| checkUnnamed6163(o.rules!); |
| } |
| buildCounterUsage--; |
| } |
| |
| core.int buildCounterUsageRule = 0; |
| api.UsageRule buildUsageRule() { |
| var o = api.UsageRule(); |
| buildCounterUsageRule++; |
| if (buildCounterUsageRule < 3) { |
| o.allowUnregisteredCalls = true; |
| o.selector = 'foo'; |
| o.skipServiceControl = true; |
| } |
| buildCounterUsageRule--; |
| return o; |
| } |
| |
| void checkUsageRule(api.UsageRule o) { |
| buildCounterUsageRule++; |
| if (buildCounterUsageRule < 3) { |
| unittest.expect(o.allowUnregisteredCalls!, unittest.isTrue); |
| unittest.expect( |
| o.selector!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.skipServiceControl!, unittest.isTrue); |
| } |
| buildCounterUsageRule--; |
| } |
| |
| void main() { |
| unittest.group('obj-schema-Advice', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildAdvice(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Advice.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkAdvice(od as api.Advice); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Api', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildApi(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Api.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkApi(od as api.Api); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuditConfig', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildAuditConfig(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.AuditConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuditConfig(od as api.AuditConfig); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuditLogConfig', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildAuditLogConfig(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.AuditLogConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuditLogConfig(od as api.AuditLogConfig); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuthProvider', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildAuthProvider(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.AuthProvider.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuthProvider(od as api.AuthProvider); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuthRequirement', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildAuthRequirement(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.AuthRequirement.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuthRequirement(od as api.AuthRequirement); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Authentication', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildAuthentication(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Authentication.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuthentication(od as api.Authentication); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuthenticationRule', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildAuthenticationRule(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.AuthenticationRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuthenticationRule(od as api.AuthenticationRule); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Backend', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildBackend(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Backend.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkBackend(od as api.Backend); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BackendRule', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildBackendRule(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.BackendRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkBackendRule(od as api.BackendRule); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Billing', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildBilling(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Billing.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkBilling(od as api.Billing); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BillingDestination', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildBillingDestination(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.BillingDestination.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkBillingDestination(od as api.BillingDestination); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Binding', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildBinding(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Binding.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkBinding(od as api.Binding); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ChangeReport', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildChangeReport(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.ChangeReport.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkChangeReport(od as api.ChangeReport); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ConfigChange', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildConfigChange(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.ConfigChange.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkConfigChange(od as api.ConfigChange); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ConfigFile', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildConfigFile(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.ConfigFile.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkConfigFile(od as api.ConfigFile); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ConfigRef', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildConfigRef(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.ConfigRef.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkConfigRef(od as api.ConfigRef); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ConfigSource', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildConfigSource(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.ConfigSource.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkConfigSource(od as api.ConfigSource); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Context', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildContext(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Context.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkContext(od as api.Context); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ContextRule', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildContextRule(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.ContextRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkContextRule(od as api.ContextRule); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Control', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildControl(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Control.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkControl(od as api.Control); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CustomError', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildCustomError(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.CustomError.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkCustomError(od as api.CustomError); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CustomErrorRule', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildCustomErrorRule(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.CustomErrorRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkCustomErrorRule(od as api.CustomErrorRule); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CustomHttpPattern', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildCustomHttpPattern(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.CustomHttpPattern.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkCustomHttpPattern(od as api.CustomHttpPattern); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DeleteServiceStrategy', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildDeleteServiceStrategy(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.DeleteServiceStrategy.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkDeleteServiceStrategy(od as api.DeleteServiceStrategy); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Diagnostic', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildDiagnostic(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Diagnostic.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkDiagnostic(od as api.Diagnostic); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Documentation', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildDocumentation(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Documentation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkDocumentation(od as api.Documentation); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DocumentationRule', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildDocumentationRule(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.DocumentationRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkDocumentationRule(od as api.DocumentationRule); |
| }); |
| }); |
| |
| unittest.group('obj-schema-EnableServiceResponse', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildEnableServiceResponse(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.EnableServiceResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkEnableServiceResponse(od as api.EnableServiceResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Endpoint', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildEndpoint(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Endpoint.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkEndpoint(od as api.Endpoint); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Enum', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildEnum(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Enum.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkEnum(od as api.Enum); |
| }); |
| }); |
| |
| unittest.group('obj-schema-EnumValue', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildEnumValue(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.EnumValue.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkEnumValue(od as api.EnumValue); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Expr', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildExpr(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Expr.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkExpr(od as api.Expr); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Field', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildField(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Field.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkField(od as api.Field); |
| }); |
| }); |
| |
| unittest.group('obj-schema-FlowErrorDetails', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildFlowErrorDetails(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.FlowErrorDetails.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkFlowErrorDetails(od as api.FlowErrorDetails); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GenerateConfigReportRequest', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildGenerateConfigReportRequest(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.GenerateConfigReportRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGenerateConfigReportRequest(od as api.GenerateConfigReportRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GenerateConfigReportResponse', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildGenerateConfigReportResponse(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.GenerateConfigReportResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGenerateConfigReportResponse(od as api.GenerateConfigReportResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GetIamPolicyRequest', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildGetIamPolicyRequest(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.GetIamPolicyRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGetIamPolicyRequest(od as api.GetIamPolicyRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GetPolicyOptions', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildGetPolicyOptions(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.GetPolicyOptions.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGetPolicyOptions(od as api.GetPolicyOptions); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Http', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildHttp(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Http.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkHttp(od as api.Http); |
| }); |
| }); |
| |
| unittest.group('obj-schema-HttpRule', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildHttpRule(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.HttpRule.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkHttpRule(od as api.HttpRule); |
| }); |
| }); |
| |
| unittest.group('obj-schema-JwtLocation', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildJwtLocation(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.JwtLocation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkJwtLocation(od as api.JwtLocation); |
| }); |
| }); |
| |
| unittest.group('obj-schema-LabelDescriptor', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildLabelDescriptor(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.LabelDescriptor.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkLabelDescriptor(od as api.LabelDescriptor); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListOperationsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildListOperationsResponse(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.ListOperationsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListOperationsResponse(od as api.ListOperationsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListServiceConfigsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildListServiceConfigsResponse(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.ListServiceConfigsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListServiceConfigsResponse(od as api.ListServiceConfigsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListServiceRolloutsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildListServiceRolloutsResponse(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.ListServiceRolloutsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListServiceRolloutsResponse(od as api.ListServiceRolloutsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListServicesResponse', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildListServicesResponse(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.ListServicesResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListServicesResponse(od as api.ListServicesResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-LogDescriptor', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildLogDescriptor(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.LogDescriptor.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkLogDescriptor(od as api.LogDescriptor); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Logging', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildLogging(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Logging.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkLogging(od as api.Logging); |
| }); |
| }); |
| |
| unittest.group('obj-schema-LoggingDestination', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildLoggingDestination(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.LoggingDestination.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkLoggingDestination(od as api.LoggingDestination); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ManagedService', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildManagedService(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.ManagedService.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkManagedService(od as api.ManagedService); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Method', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildMethod(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Method.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkMethod(od as api.Method); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MetricDescriptor', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildMetricDescriptor(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.MetricDescriptor.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkMetricDescriptor(od as api.MetricDescriptor); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MetricDescriptorMetadata', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildMetricDescriptorMetadata(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.MetricDescriptorMetadata.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkMetricDescriptorMetadata(od as api.MetricDescriptorMetadata); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MetricRule', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildMetricRule(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.MetricRule.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkMetricRule(od as api.MetricRule); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Mixin', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildMixin(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Mixin.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkMixin(od as api.Mixin); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MonitoredResourceDescriptor', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildMonitoredResourceDescriptor(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.MonitoredResourceDescriptor.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkMonitoredResourceDescriptor(od as api.MonitoredResourceDescriptor); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Monitoring', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildMonitoring(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Monitoring.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkMonitoring(od as api.Monitoring); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MonitoringDestination', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildMonitoringDestination(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.MonitoringDestination.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkMonitoringDestination(od as api.MonitoringDestination); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OAuthRequirements', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildOAuthRequirements(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.OAuthRequirements.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkOAuthRequirements(od as api.OAuthRequirements); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Operation', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildOperation(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Operation.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkOperation(od as api.Operation); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OperationInfo', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildOperationInfo(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.OperationInfo.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkOperationInfo(od as api.OperationInfo); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OperationMetadata', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildOperationMetadata(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.OperationMetadata.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkOperationMetadata(od as api.OperationMetadata); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Option', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildOption(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Option.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkOption(od as api.Option); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Page', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildPage(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Page.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkPage(od as api.Page); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Policy', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildPolicy(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Policy.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkPolicy(od as api.Policy); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Quota', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildQuota(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Quota.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkQuota(od as api.Quota); |
| }); |
| }); |
| |
| unittest.group('obj-schema-QuotaLimit', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildQuotaLimit(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.QuotaLimit.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkQuotaLimit(od as api.QuotaLimit); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ResourceReference', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildResourceReference(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.ResourceReference.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkResourceReference(od as api.ResourceReference); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Rollout', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildRollout(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Rollout.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkRollout(od as api.Rollout); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Service', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildService(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Service.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkService(od as api.Service); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SetIamPolicyRequest', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildSetIamPolicyRequest(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.SetIamPolicyRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSetIamPolicyRequest(od as api.SetIamPolicyRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SourceContext', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildSourceContext(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.SourceContext.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSourceContext(od as api.SourceContext); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SourceInfo', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildSourceInfo(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.SourceInfo.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkSourceInfo(od as api.SourceInfo); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Status', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildStatus(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.Status.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkStatus(od as api.Status); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Step', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildStep(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Step.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkStep(od as api.Step); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SubmitConfigSourceRequest', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildSubmitConfigSourceRequest(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.SubmitConfigSourceRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSubmitConfigSourceRequest(od as api.SubmitConfigSourceRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SubmitConfigSourceResponse', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildSubmitConfigSourceResponse(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.SubmitConfigSourceResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSubmitConfigSourceResponse(od as api.SubmitConfigSourceResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SystemParameter', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildSystemParameter(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.SystemParameter.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSystemParameter(od as api.SystemParameter); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SystemParameterRule', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildSystemParameterRule(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.SystemParameterRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSystemParameterRule(od as api.SystemParameterRule); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SystemParameters', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildSystemParameters(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.SystemParameters.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSystemParameters(od as api.SystemParameters); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsRequest', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildTestIamPermissionsRequest(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.TestIamPermissionsRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkTestIamPermissionsRequest(od as api.TestIamPermissionsRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildTestIamPermissionsResponse(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.TestIamPermissionsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkTestIamPermissionsResponse(od as api.TestIamPermissionsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TrafficPercentStrategy', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildTrafficPercentStrategy(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.TrafficPercentStrategy.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkTrafficPercentStrategy(od as api.TrafficPercentStrategy); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Type', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildType(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Type.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkType(od as api.Type); |
| }); |
| }); |
| |
| unittest.group('obj-schema-UndeleteServiceResponse', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildUndeleteServiceResponse(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.UndeleteServiceResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkUndeleteServiceResponse(od as api.UndeleteServiceResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Usage', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildUsage(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = api.Usage.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkUsage(od as api.Usage); |
| }); |
| }); |
| |
| unittest.group('obj-schema-UsageRule', () { |
| unittest.test('to-json--from-json', () async { |
| var o = buildUsageRule(); |
| var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| var od = |
| api.UsageRule.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkUsageRule(od as api.UsageRule); |
| }); |
| }); |
| |
| unittest.group('resource-OperationsResource', () { |
| unittest.test('method--get', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).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); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--list', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).operations; |
| var arg_filter = 'foo'; |
| var arg_name = '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 + 13), |
| unittest.equals("v1/operations"), |
| ); |
| pathOffset += 13; |
| |
| 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["name"]!.first, |
| unittest.equals(arg_name), |
| ); |
| 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); |
| final response = await res.list( |
| filter: arg_filter, |
| name: arg_name, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListOperationsResponse(response as api.ListOperationsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ServicesResource', () { |
| unittest.test('method--create', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services; |
| var arg_request = buildManagedService(); |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ManagedService.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkManagedService(obj as api.ManagedService); |
| |
| 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 + 11), |
| unittest.equals("v1/services"), |
| ); |
| pathOffset += 11; |
| |
| 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); |
| final response = await res.create(arg_request, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--delete', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services; |
| var arg_serviceName = '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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| |
| 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); |
| final response = await res.delete(arg_serviceName, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--generateConfigReport', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services; |
| var arg_request = buildGenerateConfigReportRequest(); |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.GenerateConfigReportRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkGenerateConfigReportRequest( |
| obj as api.GenerateConfigReportRequest); |
| |
| 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 + 32), |
| unittest.equals("v1/services:generateConfigReport"), |
| ); |
| pathOffset += 32; |
| |
| 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(buildGenerateConfigReportResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = |
| await res.generateConfigReport(arg_request, $fields: arg_$fields); |
| checkGenerateConfigReportResponse( |
| response as api.GenerateConfigReportResponse); |
| }); |
| |
| unittest.test('method--get', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services; |
| var arg_serviceName = '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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| |
| 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(buildManagedService()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.get(arg_serviceName, $fields: arg_$fields); |
| checkManagedService(response as api.ManagedService); |
| }); |
| |
| unittest.test('method--getConfig', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services; |
| var arg_serviceName = 'foo'; |
| var arg_configId = 'foo'; |
| var arg_view = '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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| index = path.indexOf('/config', pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals("/config"), |
| ); |
| pathOffset += 7; |
| |
| 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["configId"]!.first, |
| unittest.equals(arg_configId), |
| ); |
| unittest.expect( |
| queryMap["view"]!.first, |
| unittest.equals(arg_view), |
| ); |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildService()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.getConfig(arg_serviceName, |
| configId: arg_configId, view: arg_view, $fields: arg_$fields); |
| checkService(response as api.Service); |
| }); |
| |
| unittest.test('method--getIamPolicy', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.GetIamPolicyRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkGetIamPolicyRequest(obj as api.GetIamPolicyRequest); |
| |
| 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); |
| final response = await res.getIamPolicy(arg_request, arg_resource, |
| $fields: arg_$fields); |
| checkPolicy(response as api.Policy); |
| }); |
| |
| unittest.test('method--list', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services; |
| var arg_consumerId = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_producerProjectId = '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 + 11), |
| unittest.equals("v1/services"), |
| ); |
| pathOffset += 11; |
| |
| 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["consumerId"]!.first, |
| unittest.equals(arg_consumerId), |
| ); |
| unittest.expect( |
| core.int.parse(queryMap["pageSize"]!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap["pageToken"]!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap["producerProjectId"]!.first, |
| unittest.equals(arg_producerProjectId), |
| ); |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListServicesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list( |
| consumerId: arg_consumerId, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| producerProjectId: arg_producerProjectId, |
| $fields: arg_$fields); |
| checkListServicesResponse(response as api.ListServicesResponse); |
| }); |
| |
| unittest.test('method--setIamPolicy', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services; |
| 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); |
| final response = await res.setIamPolicy(arg_request, arg_resource, |
| $fields: arg_$fields); |
| checkPolicy(response as api.Policy); |
| }); |
| |
| unittest.test('method--testIamPermissions', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services; |
| 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); |
| final response = await res.testIamPermissions(arg_request, arg_resource, |
| $fields: arg_$fields); |
| checkTestIamPermissionsResponse( |
| response as api.TestIamPermissionsResponse); |
| }); |
| |
| unittest.test('method--undelete', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services; |
| var arg_serviceName = '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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| index = path.indexOf(':undelete', pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 9), |
| unittest.equals(":undelete"), |
| ); |
| pathOffset += 9; |
| |
| 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); |
| final response = |
| await res.undelete(arg_serviceName, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-ServicesConfigsResource', () { |
| unittest.test('method--create', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services.configs; |
| var arg_request = buildService(); |
| var arg_serviceName = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = |
| api.Service.fromJson(json as core.Map<core.String, core.dynamic>); |
| checkService(obj as api.Service); |
| |
| 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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| index = path.indexOf('/configs', pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 8), |
| unittest.equals("/configs"), |
| ); |
| pathOffset += 8; |
| |
| 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(buildService()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = |
| await res.create(arg_request, arg_serviceName, $fields: arg_$fields); |
| checkService(response as api.Service); |
| }); |
| |
| unittest.test('method--get', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services.configs; |
| var arg_serviceName = 'foo'; |
| var arg_configId = 'foo'; |
| var arg_view = '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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| index = path.indexOf('/configs/', pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/configs/"), |
| ); |
| pathOffset += 9; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_configId'), |
| ); |
| |
| 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["view"]!.first, |
| unittest.equals(arg_view), |
| ); |
| unittest.expect( |
| queryMap["fields"]!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildService()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.get(arg_serviceName, arg_configId, |
| view: arg_view, $fields: arg_$fields); |
| checkService(response as api.Service); |
| }); |
| |
| unittest.test('method--list', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services.configs; |
| var arg_serviceName = '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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| index = path.indexOf('/configs', pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 8), |
| unittest.equals("/configs"), |
| ); |
| pathOffset += 8; |
| |
| 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["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(buildListServiceConfigsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_serviceName, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListServiceConfigsResponse( |
| response as api.ListServiceConfigsResponse); |
| }); |
| |
| unittest.test('method--submit', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services.configs; |
| var arg_request = buildSubmitConfigSourceRequest(); |
| var arg_serviceName = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.SubmitConfigSourceRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkSubmitConfigSourceRequest(obj as api.SubmitConfigSourceRequest); |
| |
| 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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| index = path.indexOf('/configs:submit', pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 15), |
| unittest.equals("/configs:submit"), |
| ); |
| pathOffset += 15; |
| |
| 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); |
| final response = |
| await res.submit(arg_request, arg_serviceName, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-ServicesConsumersResource', () { |
| unittest.test('method--getIamPolicy', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services.consumers; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.GetIamPolicyRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkGetIamPolicyRequest(obj as api.GetIamPolicyRequest); |
| |
| 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); |
| final response = await res.getIamPolicy(arg_request, arg_resource, |
| $fields: arg_$fields); |
| checkPolicy(response as api.Policy); |
| }); |
| |
| unittest.test('method--setIamPolicy', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services.consumers; |
| 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); |
| final response = await res.setIamPolicy(arg_request, arg_resource, |
| $fields: arg_$fields); |
| checkPolicy(response as api.Policy); |
| }); |
| |
| unittest.test('method--testIamPermissions', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services.consumers; |
| 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); |
| final response = await res.testIamPermissions(arg_request, arg_resource, |
| $fields: arg_$fields); |
| checkTestIamPermissionsResponse( |
| response as api.TestIamPermissionsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ServicesRolloutsResource', () { |
| unittest.test('method--create', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services.rollouts; |
| var arg_request = buildRollout(); |
| var arg_serviceName = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = |
| api.Rollout.fromJson(json as core.Map<core.String, core.dynamic>); |
| checkRollout(obj as api.Rollout); |
| |
| 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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| index = path.indexOf('/rollouts', pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/rollouts"), |
| ); |
| pathOffset += 9; |
| |
| 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); |
| final response = |
| await res.create(arg_request, arg_serviceName, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--get', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services.rollouts; |
| var arg_serviceName = 'foo'; |
| var arg_rolloutId = '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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| index = path.indexOf('/rollouts/', pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 10), |
| unittest.equals("/rollouts/"), |
| ); |
| pathOffset += 10; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_rolloutId'), |
| ); |
| |
| 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(buildRollout()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = |
| await res.get(arg_serviceName, arg_rolloutId, $fields: arg_$fields); |
| checkRollout(response as api.Rollout); |
| }); |
| |
| unittest.test('method--list', () async { |
| var mock = HttpServerMock(); |
| var res = api.ServiceManagementApi(mock).services.rollouts; |
| var arg_serviceName = '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 + 12), |
| unittest.equals("v1/services/"), |
| ); |
| pathOffset += 12; |
| index = path.indexOf('/rollouts', pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect( |
| subPart, |
| unittest.equals('$arg_serviceName'), |
| ); |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/rollouts"), |
| ); |
| pathOffset += 9; |
| |
| 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(buildListServiceRolloutsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_serviceName, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListServiceRolloutsResponse( |
| response as api.ListServiceRolloutsResponse); |
| }); |
| }); |
| } |