| // Copyright 2018 Google LLC |
| // |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file or at |
| // https://developers.google.com/open-source/licenses/bsd |
| |
| // ignore_for_file: camel_case_types |
| // ignore_for_file: comment_references |
| // ignore_for_file: deprecated_member_use_from_same_package |
| // ignore_for_file: doc_directive_unknown |
| // ignore_for_file: lines_longer_than_80_chars |
| // ignore_for_file: non_constant_identifier_names |
| // ignore_for_file: prefer_const_declarations |
| // ignore_for_file: prefer_expression_function_bodies |
| // ignore_for_file: prefer_final_locals |
| // ignore_for_file: prefer_interpolation_to_compose_strings |
| // ignore_for_file: unintended_html_in_doc_comment |
| // ignore_for_file: unnecessary_brace_in_string_interps |
| // ignore_for_file: unnecessary_cast |
| // ignore_for_file: unnecessary_lambdas |
| // ignore_for_file: unnecessary_string_interpolations |
| // ignore_for_file: unreachable_from_main |
| // ignore_for_file: unused_local_variable |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert; |
| import 'dart:core' as core; |
| |
| import 'package:googleapis/serviceusage/v1.dart' as api; |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import '../test_shared.dart'; |
| |
| core.List<api.Method> buildUnnamed0() => [buildMethod(), buildMethod()]; |
| |
| void checkUnnamed0(core.List<api.Method> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMethod(o[0]); |
| checkMethod(o[1]); |
| } |
| |
| core.List<api.Mixin> buildUnnamed1() => [buildMixin(), buildMixin()]; |
| |
| void checkUnnamed1(core.List<api.Mixin> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMixin(o[0]); |
| checkMixin(o[1]); |
| } |
| |
| core.List<api.Option> buildUnnamed2() => [buildOption(), buildOption()]; |
| |
| void checkUnnamed2(core.List<api.Option> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOption(o[0]); |
| checkOption(o[1]); |
| } |
| |
| core.int buildCounterApi = 0; |
| api.Api buildApi() { |
| final o = api.Api(); |
| buildCounterApi++; |
| if (buildCounterApi < 3) { |
| o.edition = 'foo'; |
| o.methods = buildUnnamed0(); |
| o.mixins = buildUnnamed1(); |
| o.name = 'foo'; |
| o.options = buildUnnamed2(); |
| o.sourceContext = buildSourceContext(); |
| o.syntax = 'foo'; |
| o.version = 'foo'; |
| } |
| buildCounterApi--; |
| return o; |
| } |
| |
| void checkApi(api.Api o) { |
| buildCounterApi++; |
| if (buildCounterApi < 3) { |
| unittest.expect(o.edition!, unittest.equals('foo')); |
| checkUnnamed0(o.methods!); |
| checkUnnamed1(o.mixins!); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| checkUnnamed2(o.options!); |
| checkSourceContext(o.sourceContext!); |
| unittest.expect(o.syntax!, unittest.equals('foo')); |
| unittest.expect(o.version!, unittest.equals('foo')); |
| } |
| buildCounterApi--; |
| } |
| |
| core.List<api.JwtLocation> buildUnnamed3() => [ |
| buildJwtLocation(), |
| buildJwtLocation(), |
| ]; |
| |
| void checkUnnamed3(core.List<api.JwtLocation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkJwtLocation(o[0]); |
| checkJwtLocation(o[1]); |
| } |
| |
| core.int buildCounterAuthProvider = 0; |
| api.AuthProvider buildAuthProvider() { |
| final o = api.AuthProvider(); |
| buildCounterAuthProvider++; |
| if (buildCounterAuthProvider < 3) { |
| o.audiences = 'foo'; |
| o.authorizationUrl = 'foo'; |
| o.id = 'foo'; |
| o.issuer = 'foo'; |
| o.jwksUri = 'foo'; |
| o.jwtLocations = buildUnnamed3(); |
| } |
| 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')); |
| checkUnnamed3(o.jwtLocations!); |
| } |
| buildCounterAuthProvider--; |
| } |
| |
| core.int buildCounterAuthRequirement = 0; |
| api.AuthRequirement buildAuthRequirement() { |
| final 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> buildUnnamed4() => [ |
| buildAuthProvider(), |
| buildAuthProvider(), |
| ]; |
| |
| void checkUnnamed4(core.List<api.AuthProvider> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuthProvider(o[0]); |
| checkAuthProvider(o[1]); |
| } |
| |
| core.List<api.AuthenticationRule> buildUnnamed5() => [ |
| buildAuthenticationRule(), |
| buildAuthenticationRule(), |
| ]; |
| |
| void checkUnnamed5(core.List<api.AuthenticationRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuthenticationRule(o[0]); |
| checkAuthenticationRule(o[1]); |
| } |
| |
| core.int buildCounterAuthentication = 0; |
| api.Authentication buildAuthentication() { |
| final o = api.Authentication(); |
| buildCounterAuthentication++; |
| if (buildCounterAuthentication < 3) { |
| o.providers = buildUnnamed4(); |
| o.rules = buildUnnamed5(); |
| } |
| buildCounterAuthentication--; |
| return o; |
| } |
| |
| void checkAuthentication(api.Authentication o) { |
| buildCounterAuthentication++; |
| if (buildCounterAuthentication < 3) { |
| checkUnnamed4(o.providers!); |
| checkUnnamed5(o.rules!); |
| } |
| buildCounterAuthentication--; |
| } |
| |
| core.List<api.AuthRequirement> buildUnnamed6() => [ |
| buildAuthRequirement(), |
| buildAuthRequirement(), |
| ]; |
| |
| void checkUnnamed6(core.List<api.AuthRequirement> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuthRequirement(o[0]); |
| checkAuthRequirement(o[1]); |
| } |
| |
| core.int buildCounterAuthenticationRule = 0; |
| api.AuthenticationRule buildAuthenticationRule() { |
| final o = api.AuthenticationRule(); |
| buildCounterAuthenticationRule++; |
| if (buildCounterAuthenticationRule < 3) { |
| o.allowWithoutCredential = true; |
| o.oauth = buildOAuthRequirements(); |
| o.requirements = buildUnnamed6(); |
| o.selector = 'foo'; |
| } |
| buildCounterAuthenticationRule--; |
| return o; |
| } |
| |
| void checkAuthenticationRule(api.AuthenticationRule o) { |
| buildCounterAuthenticationRule++; |
| if (buildCounterAuthenticationRule < 3) { |
| unittest.expect(o.allowWithoutCredential!, unittest.isTrue); |
| checkOAuthRequirements(o.oauth!); |
| checkUnnamed6(o.requirements!); |
| unittest.expect(o.selector!, unittest.equals('foo')); |
| } |
| buildCounterAuthenticationRule--; |
| } |
| |
| core.List<core.String> buildUnnamed7() => ['foo', 'foo']; |
| |
| void checkUnnamed7(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 buildCounterBatchEnableServicesRequest = 0; |
| api.BatchEnableServicesRequest buildBatchEnableServicesRequest() { |
| final o = api.BatchEnableServicesRequest(); |
| buildCounterBatchEnableServicesRequest++; |
| if (buildCounterBatchEnableServicesRequest < 3) { |
| o.serviceIds = buildUnnamed7(); |
| } |
| buildCounterBatchEnableServicesRequest--; |
| return o; |
| } |
| |
| void checkBatchEnableServicesRequest(api.BatchEnableServicesRequest o) { |
| buildCounterBatchEnableServicesRequest++; |
| if (buildCounterBatchEnableServicesRequest < 3) { |
| checkUnnamed7(o.serviceIds!); |
| } |
| buildCounterBatchEnableServicesRequest--; |
| } |
| |
| core.List<api.GoogleApiServiceusageV1Service> buildUnnamed8() => [ |
| buildGoogleApiServiceusageV1Service(), |
| buildGoogleApiServiceusageV1Service(), |
| ]; |
| |
| void checkUnnamed8(core.List<api.GoogleApiServiceusageV1Service> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleApiServiceusageV1Service(o[0]); |
| checkGoogleApiServiceusageV1Service(o[1]); |
| } |
| |
| core.int buildCounterBatchGetServicesResponse = 0; |
| api.BatchGetServicesResponse buildBatchGetServicesResponse() { |
| final o = api.BatchGetServicesResponse(); |
| buildCounterBatchGetServicesResponse++; |
| if (buildCounterBatchGetServicesResponse < 3) { |
| o.services = buildUnnamed8(); |
| } |
| buildCounterBatchGetServicesResponse--; |
| return o; |
| } |
| |
| void checkBatchGetServicesResponse(api.BatchGetServicesResponse o) { |
| buildCounterBatchGetServicesResponse++; |
| if (buildCounterBatchGetServicesResponse < 3) { |
| checkUnnamed8(o.services!); |
| } |
| buildCounterBatchGetServicesResponse--; |
| } |
| |
| core.int buildCounterCancelOperationRequest = 0; |
| api.CancelOperationRequest buildCancelOperationRequest() { |
| final o = api.CancelOperationRequest(); |
| buildCounterCancelOperationRequest++; |
| if (buildCounterCancelOperationRequest < 3) {} |
| buildCounterCancelOperationRequest--; |
| return o; |
| } |
| |
| void checkCancelOperationRequest(api.CancelOperationRequest o) { |
| buildCounterCancelOperationRequest++; |
| if (buildCounterCancelOperationRequest < 3) {} |
| buildCounterCancelOperationRequest--; |
| } |
| |
| core.int buildCounterDisableServiceRequest = 0; |
| api.DisableServiceRequest buildDisableServiceRequest() { |
| final o = api.DisableServiceRequest(); |
| buildCounterDisableServiceRequest++; |
| if (buildCounterDisableServiceRequest < 3) { |
| o.checkIfServiceHasUsage = 'foo'; |
| o.disableDependentServices = true; |
| } |
| buildCounterDisableServiceRequest--; |
| return o; |
| } |
| |
| void checkDisableServiceRequest(api.DisableServiceRequest o) { |
| buildCounterDisableServiceRequest++; |
| if (buildCounterDisableServiceRequest < 3) { |
| unittest.expect(o.checkIfServiceHasUsage!, unittest.equals('foo')); |
| unittest.expect(o.disableDependentServices!, unittest.isTrue); |
| } |
| buildCounterDisableServiceRequest--; |
| } |
| |
| core.List<api.Page> buildUnnamed9() => [buildPage(), buildPage()]; |
| |
| void checkUnnamed9(core.List<api.Page> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPage(o[0]); |
| checkPage(o[1]); |
| } |
| |
| core.List<api.DocumentationRule> buildUnnamed10() => [ |
| buildDocumentationRule(), |
| buildDocumentationRule(), |
| ]; |
| |
| void checkUnnamed10(core.List<api.DocumentationRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkDocumentationRule(o[0]); |
| checkDocumentationRule(o[1]); |
| } |
| |
| core.List<api.Page> buildUnnamed11() => [buildPage(), buildPage()]; |
| |
| void checkUnnamed11(core.List<api.Page> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPage(o[0]); |
| checkPage(o[1]); |
| } |
| |
| core.int buildCounterDocumentation = 0; |
| api.Documentation buildDocumentation() { |
| final o = api.Documentation(); |
| buildCounterDocumentation++; |
| if (buildCounterDocumentation < 3) { |
| o.additionalIamInfo = 'foo'; |
| o.documentationRootUrl = 'foo'; |
| o.overview = 'foo'; |
| o.pages = buildUnnamed9(); |
| o.rules = buildUnnamed10(); |
| o.sectionOverrides = buildUnnamed11(); |
| o.serviceRootUrl = 'foo'; |
| o.summary = 'foo'; |
| } |
| buildCounterDocumentation--; |
| return o; |
| } |
| |
| void checkDocumentation(api.Documentation o) { |
| buildCounterDocumentation++; |
| if (buildCounterDocumentation < 3) { |
| unittest.expect(o.additionalIamInfo!, unittest.equals('foo')); |
| unittest.expect(o.documentationRootUrl!, unittest.equals('foo')); |
| unittest.expect(o.overview!, unittest.equals('foo')); |
| checkUnnamed9(o.pages!); |
| checkUnnamed10(o.rules!); |
| checkUnnamed11(o.sectionOverrides!); |
| unittest.expect(o.serviceRootUrl!, unittest.equals('foo')); |
| unittest.expect(o.summary!, unittest.equals('foo')); |
| } |
| buildCounterDocumentation--; |
| } |
| |
| core.int buildCounterDocumentationRule = 0; |
| api.DocumentationRule buildDocumentationRule() { |
| final o = api.DocumentationRule(); |
| buildCounterDocumentationRule++; |
| if (buildCounterDocumentationRule < 3) { |
| o.deprecationDescription = 'foo'; |
| o.description = 'foo'; |
| o.disableReplacementWords = '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.disableReplacementWords!, unittest.equals('foo')); |
| unittest.expect(o.selector!, unittest.equals('foo')); |
| } |
| buildCounterDocumentationRule--; |
| } |
| |
| core.int buildCounterEmpty = 0; |
| api.Empty buildEmpty() { |
| final o = api.Empty(); |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| return o; |
| } |
| |
| void checkEmpty(api.Empty o) { |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| } |
| |
| core.int buildCounterEnableServiceRequest = 0; |
| api.EnableServiceRequest buildEnableServiceRequest() { |
| final o = api.EnableServiceRequest(); |
| buildCounterEnableServiceRequest++; |
| if (buildCounterEnableServiceRequest < 3) {} |
| buildCounterEnableServiceRequest--; |
| return o; |
| } |
| |
| void checkEnableServiceRequest(api.EnableServiceRequest o) { |
| buildCounterEnableServiceRequest++; |
| if (buildCounterEnableServiceRequest < 3) {} |
| buildCounterEnableServiceRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed12() => ['foo', 'foo']; |
| |
| void checkUnnamed12(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 buildCounterEndpoint = 0; |
| api.Endpoint buildEndpoint() { |
| final o = api.Endpoint(); |
| buildCounterEndpoint++; |
| if (buildCounterEndpoint < 3) { |
| o.aliases = buildUnnamed12(); |
| o.allowCors = true; |
| o.name = 'foo'; |
| o.target = 'foo'; |
| } |
| buildCounterEndpoint--; |
| return o; |
| } |
| |
| void checkEndpoint(api.Endpoint o) { |
| buildCounterEndpoint++; |
| if (buildCounterEndpoint < 3) { |
| checkUnnamed12(o.aliases!); |
| unittest.expect(o.allowCors!, unittest.isTrue); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| unittest.expect(o.target!, unittest.equals('foo')); |
| } |
| buildCounterEndpoint--; |
| } |
| |
| core.int buildCounterGoogleApiServiceusageV1Service = 0; |
| api.GoogleApiServiceusageV1Service buildGoogleApiServiceusageV1Service() { |
| final o = api.GoogleApiServiceusageV1Service(); |
| buildCounterGoogleApiServiceusageV1Service++; |
| if (buildCounterGoogleApiServiceusageV1Service < 3) { |
| o.config = buildGoogleApiServiceusageV1ServiceConfig(); |
| o.name = 'foo'; |
| o.parent = 'foo'; |
| o.state = 'foo'; |
| } |
| buildCounterGoogleApiServiceusageV1Service--; |
| return o; |
| } |
| |
| void checkGoogleApiServiceusageV1Service(api.GoogleApiServiceusageV1Service o) { |
| buildCounterGoogleApiServiceusageV1Service++; |
| if (buildCounterGoogleApiServiceusageV1Service < 3) { |
| checkGoogleApiServiceusageV1ServiceConfig(o.config!); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| unittest.expect(o.parent!, unittest.equals('foo')); |
| unittest.expect(o.state!, unittest.equals('foo')); |
| } |
| buildCounterGoogleApiServiceusageV1Service--; |
| } |
| |
| core.List<api.Api> buildUnnamed13() => [buildApi(), buildApi()]; |
| |
| void checkUnnamed13(core.List<api.Api> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkApi(o[0]); |
| checkApi(o[1]); |
| } |
| |
| core.List<api.Endpoint> buildUnnamed14() => [buildEndpoint(), buildEndpoint()]; |
| |
| void checkUnnamed14(core.List<api.Endpoint> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEndpoint(o[0]); |
| checkEndpoint(o[1]); |
| } |
| |
| core.List<api.MonitoredResourceDescriptor> buildUnnamed15() => [ |
| buildMonitoredResourceDescriptor(), |
| buildMonitoredResourceDescriptor(), |
| ]; |
| |
| void checkUnnamed15(core.List<api.MonitoredResourceDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMonitoredResourceDescriptor(o[0]); |
| checkMonitoredResourceDescriptor(o[1]); |
| } |
| |
| core.int buildCounterGoogleApiServiceusageV1ServiceConfig = 0; |
| api.GoogleApiServiceusageV1ServiceConfig |
| buildGoogleApiServiceusageV1ServiceConfig() { |
| final o = api.GoogleApiServiceusageV1ServiceConfig(); |
| buildCounterGoogleApiServiceusageV1ServiceConfig++; |
| if (buildCounterGoogleApiServiceusageV1ServiceConfig < 3) { |
| o.apis = buildUnnamed13(); |
| o.authentication = buildAuthentication(); |
| o.documentation = buildDocumentation(); |
| o.endpoints = buildUnnamed14(); |
| o.monitoredResources = buildUnnamed15(); |
| o.monitoring = buildMonitoring(); |
| o.name = 'foo'; |
| o.quota = buildQuota(); |
| o.title = 'foo'; |
| o.usage = buildUsage(); |
| } |
| buildCounterGoogleApiServiceusageV1ServiceConfig--; |
| return o; |
| } |
| |
| void checkGoogleApiServiceusageV1ServiceConfig( |
| api.GoogleApiServiceusageV1ServiceConfig o, |
| ) { |
| buildCounterGoogleApiServiceusageV1ServiceConfig++; |
| if (buildCounterGoogleApiServiceusageV1ServiceConfig < 3) { |
| checkUnnamed13(o.apis!); |
| checkAuthentication(o.authentication!); |
| checkDocumentation(o.documentation!); |
| checkUnnamed14(o.endpoints!); |
| checkUnnamed15(o.monitoredResources!); |
| checkMonitoring(o.monitoring!); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| checkQuota(o.quota!); |
| unittest.expect(o.title!, unittest.equals('foo')); |
| checkUsage(o.usage!); |
| } |
| buildCounterGoogleApiServiceusageV1ServiceConfig--; |
| } |
| |
| core.int buildCounterJwtLocation = 0; |
| api.JwtLocation buildJwtLocation() { |
| final o = api.JwtLocation(); |
| buildCounterJwtLocation++; |
| if (buildCounterJwtLocation < 3) { |
| o.cookie = 'foo'; |
| o.header = 'foo'; |
| o.query = 'foo'; |
| o.valuePrefix = 'foo'; |
| } |
| buildCounterJwtLocation--; |
| return o; |
| } |
| |
| void checkJwtLocation(api.JwtLocation o) { |
| buildCounterJwtLocation++; |
| if (buildCounterJwtLocation < 3) { |
| unittest.expect(o.cookie!, unittest.equals('foo')); |
| 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() { |
| final 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> buildUnnamed16() => [ |
| buildOperation(), |
| buildOperation(), |
| ]; |
| |
| void checkUnnamed16(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.List<core.String> buildUnnamed17() => ['foo', 'foo']; |
| |
| void checkUnnamed17(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 buildCounterListOperationsResponse = 0; |
| api.ListOperationsResponse buildListOperationsResponse() { |
| final o = api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed16(); |
| o.unreachable = buildUnnamed17(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| void checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken!, unittest.equals('foo')); |
| checkUnnamed16(o.operations!); |
| checkUnnamed17(o.unreachable!); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| core.List<api.GoogleApiServiceusageV1Service> buildUnnamed18() => [ |
| buildGoogleApiServiceusageV1Service(), |
| buildGoogleApiServiceusageV1Service(), |
| ]; |
| |
| void checkUnnamed18(core.List<api.GoogleApiServiceusageV1Service> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleApiServiceusageV1Service(o[0]); |
| checkGoogleApiServiceusageV1Service(o[1]); |
| } |
| |
| core.int buildCounterListServicesResponse = 0; |
| api.ListServicesResponse buildListServicesResponse() { |
| final o = api.ListServicesResponse(); |
| buildCounterListServicesResponse++; |
| if (buildCounterListServicesResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.services = buildUnnamed18(); |
| } |
| buildCounterListServicesResponse--; |
| return o; |
| } |
| |
| void checkListServicesResponse(api.ListServicesResponse o) { |
| buildCounterListServicesResponse++; |
| if (buildCounterListServicesResponse < 3) { |
| unittest.expect(o.nextPageToken!, unittest.equals('foo')); |
| checkUnnamed18(o.services!); |
| } |
| buildCounterListServicesResponse--; |
| } |
| |
| core.List<api.Option> buildUnnamed19() => [buildOption(), buildOption()]; |
| |
| void checkUnnamed19(core.List<api.Option> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOption(o[0]); |
| checkOption(o[1]); |
| } |
| |
| core.int buildCounterMethod = 0; |
| api.Method buildMethod() { |
| final o = api.Method(); |
| buildCounterMethod++; |
| if (buildCounterMethod < 3) { |
| o.edition = 'foo'; |
| o.name = 'foo'; |
| o.options = buildUnnamed19(); |
| 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.edition!, unittest.equals('foo')); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| checkUnnamed19(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.Map<core.String, core.String> buildUnnamed20() => {'x': 'foo', 'y': 'foo'}; |
| |
| void checkUnnamed20(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() { |
| final o = api.MetricRule(); |
| buildCounterMetricRule++; |
| if (buildCounterMetricRule < 3) { |
| o.metricCosts = buildUnnamed20(); |
| o.selector = 'foo'; |
| } |
| buildCounterMetricRule--; |
| return o; |
| } |
| |
| void checkMetricRule(api.MetricRule o) { |
| buildCounterMetricRule++; |
| if (buildCounterMetricRule < 3) { |
| checkUnnamed20(o.metricCosts!); |
| unittest.expect(o.selector!, unittest.equals('foo')); |
| } |
| buildCounterMetricRule--; |
| } |
| |
| core.int buildCounterMixin = 0; |
| api.Mixin buildMixin() { |
| final 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> buildUnnamed21() => [ |
| buildLabelDescriptor(), |
| buildLabelDescriptor(), |
| ]; |
| |
| void checkUnnamed21(core.List<api.LabelDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLabelDescriptor(o[0]); |
| checkLabelDescriptor(o[1]); |
| } |
| |
| core.int buildCounterMonitoredResourceDescriptor = 0; |
| api.MonitoredResourceDescriptor buildMonitoredResourceDescriptor() { |
| final o = api.MonitoredResourceDescriptor(); |
| buildCounterMonitoredResourceDescriptor++; |
| if (buildCounterMonitoredResourceDescriptor < 3) { |
| o.description = 'foo'; |
| o.displayName = 'foo'; |
| o.labels = buildUnnamed21(); |
| 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')); |
| checkUnnamed21(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> buildUnnamed22() => [ |
| buildMonitoringDestination(), |
| buildMonitoringDestination(), |
| ]; |
| |
| void checkUnnamed22(core.List<api.MonitoringDestination> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMonitoringDestination(o[0]); |
| checkMonitoringDestination(o[1]); |
| } |
| |
| core.List<api.MonitoringDestination> buildUnnamed23() => [ |
| buildMonitoringDestination(), |
| buildMonitoringDestination(), |
| ]; |
| |
| void checkUnnamed23(core.List<api.MonitoringDestination> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMonitoringDestination(o[0]); |
| checkMonitoringDestination(o[1]); |
| } |
| |
| core.int buildCounterMonitoring = 0; |
| api.Monitoring buildMonitoring() { |
| final o = api.Monitoring(); |
| buildCounterMonitoring++; |
| if (buildCounterMonitoring < 3) { |
| o.consumerDestinations = buildUnnamed22(); |
| o.producerDestinations = buildUnnamed23(); |
| } |
| buildCounterMonitoring--; |
| return o; |
| } |
| |
| void checkMonitoring(api.Monitoring o) { |
| buildCounterMonitoring++; |
| if (buildCounterMonitoring < 3) { |
| checkUnnamed22(o.consumerDestinations!); |
| checkUnnamed23(o.producerDestinations!); |
| } |
| buildCounterMonitoring--; |
| } |
| |
| core.List<core.String> buildUnnamed24() => ['foo', 'foo']; |
| |
| void checkUnnamed24(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() { |
| final o = api.MonitoringDestination(); |
| buildCounterMonitoringDestination++; |
| if (buildCounterMonitoringDestination < 3) { |
| o.metrics = buildUnnamed24(); |
| o.monitoredResource = 'foo'; |
| } |
| buildCounterMonitoringDestination--; |
| return o; |
| } |
| |
| void checkMonitoringDestination(api.MonitoringDestination o) { |
| buildCounterMonitoringDestination++; |
| if (buildCounterMonitoringDestination < 3) { |
| checkUnnamed24(o.metrics!); |
| unittest.expect(o.monitoredResource!, unittest.equals('foo')); |
| } |
| buildCounterMonitoringDestination--; |
| } |
| |
| core.int buildCounterOAuthRequirements = 0; |
| api.OAuthRequirements buildOAuthRequirements() { |
| final 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?> buildUnnamed25() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| }; |
| |
| void checkUnnamed25(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?> buildUnnamed26() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| }; |
| |
| void checkUnnamed26(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 buildCounterOperation = 0; |
| api.Operation buildOperation() { |
| final o = api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed25(); |
| o.name = 'foo'; |
| o.response = buildUnnamed26(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| void checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done!, unittest.isTrue); |
| checkStatus(o.error!); |
| checkUnnamed25(o.metadata!); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| checkUnnamed26(o.response!); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.Map<core.String, core.Object?> buildUnnamed27() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| }; |
| |
| void checkUnnamed27(core.Map<core.String, core.Object?> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted5 = (o['x']!) as core.Map; |
| unittest.expect(casted5, unittest.hasLength(3)); |
| unittest.expect(casted5['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted5['bool'], unittest.equals(true)); |
| unittest.expect(casted5['string'], unittest.equals('foo')); |
| var casted6 = (o['y']!) as core.Map; |
| unittest.expect(casted6, unittest.hasLength(3)); |
| unittest.expect(casted6['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted6['bool'], unittest.equals(true)); |
| unittest.expect(casted6['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterOption = 0; |
| api.Option buildOption() { |
| final o = api.Option(); |
| buildCounterOption++; |
| if (buildCounterOption < 3) { |
| o.name = 'foo'; |
| o.value = buildUnnamed27(); |
| } |
| buildCounterOption--; |
| return o; |
| } |
| |
| void checkOption(api.Option o) { |
| buildCounterOption++; |
| if (buildCounterOption < 3) { |
| unittest.expect(o.name!, unittest.equals('foo')); |
| checkUnnamed27(o.value!); |
| } |
| buildCounterOption--; |
| } |
| |
| core.List<api.Page> buildUnnamed28() => [buildPage(), buildPage()]; |
| |
| void checkUnnamed28(core.List<api.Page> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPage(o[0]); |
| checkPage(o[1]); |
| } |
| |
| core.int buildCounterPage = 0; |
| api.Page buildPage() { |
| final o = api.Page(); |
| buildCounterPage++; |
| if (buildCounterPage < 3) { |
| o.content = 'foo'; |
| o.name = 'foo'; |
| o.subpages = buildUnnamed28(); |
| } |
| 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')); |
| checkUnnamed28(o.subpages!); |
| } |
| buildCounterPage--; |
| } |
| |
| core.List<api.QuotaLimit> buildUnnamed29() => [ |
| buildQuotaLimit(), |
| buildQuotaLimit(), |
| ]; |
| |
| void checkUnnamed29(core.List<api.QuotaLimit> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkQuotaLimit(o[0]); |
| checkQuotaLimit(o[1]); |
| } |
| |
| core.List<api.MetricRule> buildUnnamed30() => [ |
| buildMetricRule(), |
| buildMetricRule(), |
| ]; |
| |
| void checkUnnamed30(core.List<api.MetricRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMetricRule(o[0]); |
| checkMetricRule(o[1]); |
| } |
| |
| core.int buildCounterQuota = 0; |
| api.Quota buildQuota() { |
| final o = api.Quota(); |
| buildCounterQuota++; |
| if (buildCounterQuota < 3) { |
| o.limits = buildUnnamed29(); |
| o.metricRules = buildUnnamed30(); |
| } |
| buildCounterQuota--; |
| return o; |
| } |
| |
| void checkQuota(api.Quota o) { |
| buildCounterQuota++; |
| if (buildCounterQuota < 3) { |
| checkUnnamed29(o.limits!); |
| checkUnnamed30(o.metricRules!); |
| } |
| buildCounterQuota--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed31() => {'x': 'foo', 'y': 'foo'}; |
| |
| void checkUnnamed31(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() { |
| final 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 = buildUnnamed31(); |
| } |
| 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')); |
| checkUnnamed31(o.values!); |
| } |
| buildCounterQuotaLimit--; |
| } |
| |
| core.int buildCounterSourceContext = 0; |
| api.SourceContext buildSourceContext() { |
| final 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?> buildUnnamed32() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| }; |
| |
| void checkUnnamed32(core.Map<core.String, core.Object?> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted7 = (o['x']!) as core.Map; |
| unittest.expect(casted7, unittest.hasLength(3)); |
| unittest.expect(casted7['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted7['bool'], unittest.equals(true)); |
| unittest.expect(casted7['string'], unittest.equals('foo')); |
| var casted8 = (o['y']!) as core.Map; |
| unittest.expect(casted8, unittest.hasLength(3)); |
| unittest.expect(casted8['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted8['bool'], unittest.equals(true)); |
| unittest.expect(casted8['string'], unittest.equals('foo')); |
| } |
| |
| core.List<core.Map<core.String, core.Object?>> buildUnnamed33() => [ |
| buildUnnamed32(), |
| buildUnnamed32(), |
| ]; |
| |
| void checkUnnamed33(core.List<core.Map<core.String, core.Object?>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed32(o[0]); |
| checkUnnamed32(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| api.Status buildStatus() { |
| final o = api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed33(); |
| o.message = 'foo'; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| void checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect(o.code!, unittest.equals(42)); |
| checkUnnamed33(o.details!); |
| unittest.expect(o.message!, unittest.equals('foo')); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.List<core.String> buildUnnamed34() => ['foo', 'foo']; |
| |
| void checkUnnamed34(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> buildUnnamed35() => [ |
| buildUsageRule(), |
| buildUsageRule(), |
| ]; |
| |
| void checkUnnamed35(core.List<api.UsageRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUsageRule(o[0]); |
| checkUsageRule(o[1]); |
| } |
| |
| core.int buildCounterUsage = 0; |
| api.Usage buildUsage() { |
| final o = api.Usage(); |
| buildCounterUsage++; |
| if (buildCounterUsage < 3) { |
| o.producerNotificationChannel = 'foo'; |
| o.requirements = buildUnnamed34(); |
| o.rules = buildUnnamed35(); |
| } |
| buildCounterUsage--; |
| return o; |
| } |
| |
| void checkUsage(api.Usage o) { |
| buildCounterUsage++; |
| if (buildCounterUsage < 3) { |
| unittest.expect(o.producerNotificationChannel!, unittest.equals('foo')); |
| checkUnnamed34(o.requirements!); |
| checkUnnamed35(o.rules!); |
| } |
| buildCounterUsage--; |
| } |
| |
| core.int buildCounterUsageRule = 0; |
| api.UsageRule buildUsageRule() { |
| final 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--; |
| } |
| |
| core.List<core.String> buildUnnamed36() => ['foo', 'foo']; |
| |
| void checkUnnamed36(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')); |
| } |
| |
| void main() { |
| unittest.group('obj-schema-Api', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildApi(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Api.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkApi(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuthProvider', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAuthProvider(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AuthProvider.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAuthProvider(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuthRequirement', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAuthRequirement(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AuthRequirement.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAuthRequirement(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Authentication', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAuthentication(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Authentication.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAuthentication(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuthenticationRule', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAuthenticationRule(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AuthenticationRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAuthenticationRule(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BatchEnableServicesRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBatchEnableServicesRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.BatchEnableServicesRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchEnableServicesRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BatchGetServicesResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBatchGetServicesResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.BatchGetServicesResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchGetServicesResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CancelOperationRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildCancelOperationRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.CancelOperationRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkCancelOperationRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DisableServiceRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDisableServiceRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.DisableServiceRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkDisableServiceRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Documentation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDocumentation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Documentation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkDocumentation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DocumentationRule', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDocumentationRule(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.DocumentationRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkDocumentationRule(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Empty', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildEmpty(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Empty.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkEmpty(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-EnableServiceRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildEnableServiceRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.EnableServiceRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkEnableServiceRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Endpoint', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildEndpoint(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Endpoint.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkEndpoint(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleApiServiceusageV1Service', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGoogleApiServiceusageV1Service(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GoogleApiServiceusageV1Service.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkGoogleApiServiceusageV1Service(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleApiServiceusageV1ServiceConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGoogleApiServiceusageV1ServiceConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GoogleApiServiceusageV1ServiceConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkGoogleApiServiceusageV1ServiceConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-JwtLocation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildJwtLocation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.JwtLocation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkJwtLocation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-LabelDescriptor', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildLabelDescriptor(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.LabelDescriptor.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkLabelDescriptor(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListOperationsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListOperationsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListOperationsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkListOperationsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListServicesResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListServicesResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListServicesResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkListServicesResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Method', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildMethod(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Method.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkMethod(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MetricRule', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildMetricRule(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.MetricRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkMetricRule(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Mixin', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildMixin(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Mixin.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkMixin(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MonitoredResourceDescriptor', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildMonitoredResourceDescriptor(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.MonitoredResourceDescriptor.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkMonitoredResourceDescriptor(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Monitoring', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildMonitoring(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Monitoring.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkMonitoring(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-MonitoringDestination', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildMonitoringDestination(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.MonitoringDestination.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkMonitoringDestination(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OAuthRequirements', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOAuthRequirements(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.OAuthRequirements.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkOAuthRequirements(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Operation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOperation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Operation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkOperation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Option', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOption(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Option.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkOption(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Page', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildPage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Page.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkPage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Quota', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildQuota(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Quota.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkQuota(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-QuotaLimit', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildQuotaLimit(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.QuotaLimit.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkQuotaLimit(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SourceContext', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSourceContext(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.SourceContext.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkSourceContext(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Status', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildStatus(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Status.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkStatus(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Usage', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildUsage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Usage.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkUsage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-UsageRule', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildUsageRule(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.UsageRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkUsageRule(od); |
| }); |
| }); |
| |
| unittest.group('resource-OperationsResource', () { |
| unittest.test('method--cancel', () async { |
| final mock = HttpServerMock(); |
| final res = api.ServiceUsageApi(mock).operations; |
| final arg_request = buildCancelOperationRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.CancelOperationRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkCancelOperationRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.cancel( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--delete', () async { |
| final mock = HttpServerMock(); |
| final res = api.ServiceUsageApi(mock).operations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.delete(arg_name, $fields: arg_$fields); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.ServiceUsageApi(mock).operations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.ServiceUsageApi(mock).operations; |
| final arg_filter = 'foo'; |
| final arg_name = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_returnPartialSuccess = true; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 13), |
| unittest.equals('v1/operations'), |
| ); |
| pathOffset += 13; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['filter']!.first, |
| unittest.equals(arg_filter), |
| ); |
| unittest.expect(queryMap['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['returnPartialSuccess']!.first, |
| unittest.equals('$arg_returnPartialSuccess'), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildListOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.list( |
| filter: arg_filter, |
| name: arg_name, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| returnPartialSuccess: arg_returnPartialSuccess, |
| $fields: arg_$fields, |
| ); |
| checkListOperationsResponse(response as api.ListOperationsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ServicesResource', () { |
| unittest.test('method--batchEnable', () async { |
| final mock = HttpServerMock(); |
| final res = api.ServiceUsageApi(mock).services; |
| final arg_request = buildBatchEnableServicesRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.BatchEnableServicesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchEnableServicesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.batchEnable( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--batchGet', () async { |
| final mock = HttpServerMock(); |
| final res = api.ServiceUsageApi(mock).services; |
| final arg_parent = 'foo'; |
| final arg_names = buildUnnamed36(); |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap['names']!, unittest.equals(arg_names)); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildBatchGetServicesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.batchGet( |
| arg_parent, |
| names: arg_names, |
| $fields: arg_$fields, |
| ); |
| checkBatchGetServicesResponse(response as api.BatchGetServicesResponse); |
| }); |
| |
| unittest.test('method--disable', () async { |
| final mock = HttpServerMock(); |
| final res = api.ServiceUsageApi(mock).services; |
| final arg_request = buildDisableServiceRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.DisableServiceRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkDisableServiceRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.disable( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--enable', () async { |
| final mock = HttpServerMock(); |
| final res = api.ServiceUsageApi(mock).services; |
| final arg_request = buildEnableServiceRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.EnableServiceRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkEnableServiceRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.enable( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.ServiceUsageApi(mock).services; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode( |
| buildGoogleApiServiceusageV1Service(), |
| ); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkGoogleApiServiceusageV1Service( |
| response as api.GoogleApiServiceusageV1Service, |
| ); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.ServiceUsageApi(mock).services; |
| final arg_parent = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['filter']!.first, |
| unittest.equals(arg_filter), |
| ); |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildListServicesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.list( |
| arg_parent, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields, |
| ); |
| checkListServicesResponse(response as api.ListServicesResponse); |
| }); |
| }); |
| } |