blob: 059dc254c6de20482d83cb5a43807e57d52ec6b2 [file] [log] [blame]
// ignore_for_file: camel_case_types
// ignore_for_file: comment_references
// ignore_for_file: directives_ordering
// 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: unnecessary_brace_in_string_interps
// ignore_for_file: unnecessary_cast
// ignore_for_file: unnecessary_lambdas
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: unnecessary_string_interpolations
// ignore_for_file: avoid_returning_null
// ignore_for_file: cascade_invocations
// ignore_for_file: prefer_single_quotes
// ignore_for_file: unused_local_variable
library googleapis.serviceusage.v1.test;
import "dart:core" as core;
import "dart:async" as async;
import "dart:convert" as convert;
import 'package:http/http.dart' as http;
import 'package:test/test.dart' as unittest;
import 'package:googleapis/serviceusage/v1.dart' as api;
class HttpServerMock extends http.BaseClient {
core.Function _callback;
core.bool _expectJson;
void register(core.Function callback, core.bool expectJson) {
_callback = callback;
_expectJson = expectJson;
}
@core.override
async.Future<http.StreamedResponse> send(http.BaseRequest request) async {
if (_expectJson) {
final jsonString =
await request.finalize().transform(convert.utf8.decoder).join('');
if (jsonString.isEmpty) {
return _callback(request, null);
} else {
return _callback(request, convert.json.decode(jsonString));
}
} else {
var stream = request.finalize();
if (stream == null) {
return _callback(request, []);
} else {
final data = await stream.toBytes();
return _callback(request, data);
}
}
}
}
http.StreamedResponse stringResponse(core.int status,
core.Map<core.String, core.String> headers, core.String body) {
var stream = async.Stream.fromIterable([convert.utf8.encode(body)]);
return http.StreamedResponse(stream, status, headers: headers);
}
core.Map<core.String, core.String> buildUnnamed166() {
var o = <core.String, core.String>{};
o['x'] = 'foo';
o['y'] = 'foo';
return o;
}
void checkUnnamed166(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 buildCounterAdminQuotaPolicy = 0;
api.AdminQuotaPolicy buildAdminQuotaPolicy() {
var o = api.AdminQuotaPolicy();
buildCounterAdminQuotaPolicy++;
if (buildCounterAdminQuotaPolicy < 3) {
o.container = 'foo';
o.dimensions = buildUnnamed166();
o.metric = 'foo';
o.name = 'foo';
o.policyValue = 'foo';
o.unit = 'foo';
}
buildCounterAdminQuotaPolicy--;
return o;
}
void checkAdminQuotaPolicy(api.AdminQuotaPolicy o) {
buildCounterAdminQuotaPolicy++;
if (buildCounterAdminQuotaPolicy < 3) {
unittest.expect(o.container, unittest.equals('foo'));
checkUnnamed166(o.dimensions);
unittest.expect(o.metric, unittest.equals('foo'));
unittest.expect(o.name, unittest.equals('foo'));
unittest.expect(o.policyValue, unittest.equals('foo'));
unittest.expect(o.unit, unittest.equals('foo'));
}
buildCounterAdminQuotaPolicy--;
}
core.List<api.Method> buildUnnamed167() {
var o = <api.Method>[];
o.add(buildMethod());
o.add(buildMethod());
return o;
}
void checkUnnamed167(core.List<api.Method> o) {
unittest.expect(o, unittest.hasLength(2));
checkMethod(o[0]);
checkMethod(o[1]);
}
core.List<api.Mixin> buildUnnamed168() {
var o = <api.Mixin>[];
o.add(buildMixin());
o.add(buildMixin());
return o;
}
void checkUnnamed168(core.List<api.Mixin> o) {
unittest.expect(o, unittest.hasLength(2));
checkMixin(o[0]);
checkMixin(o[1]);
}
core.List<api.Option> buildUnnamed169() {
var o = <api.Option>[];
o.add(buildOption());
o.add(buildOption());
return o;
}
void checkUnnamed169(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterApi = 0;
api.Api buildApi() {
var o = api.Api();
buildCounterApi++;
if (buildCounterApi < 3) {
o.methods = buildUnnamed167();
o.mixins = buildUnnamed168();
o.name = 'foo';
o.options = buildUnnamed169();
o.sourceContext = buildSourceContext();
o.syntax = 'foo';
o.version = 'foo';
}
buildCounterApi--;
return o;
}
void checkApi(api.Api o) {
buildCounterApi++;
if (buildCounterApi < 3) {
checkUnnamed167(o.methods);
checkUnnamed168(o.mixins);
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed169(o.options);
checkSourceContext(o.sourceContext);
unittest.expect(o.syntax, unittest.equals('foo'));
unittest.expect(o.version, unittest.equals('foo'));
}
buildCounterApi--;
}
core.List<api.JwtLocation> buildUnnamed170() {
var o = <api.JwtLocation>[];
o.add(buildJwtLocation());
o.add(buildJwtLocation());
return o;
}
void checkUnnamed170(core.List<api.JwtLocation> o) {
unittest.expect(o, unittest.hasLength(2));
checkJwtLocation(o[0]);
checkJwtLocation(o[1]);
}
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 = buildUnnamed170();
}
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'));
checkUnnamed170(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> buildUnnamed171() {
var o = <api.AuthProvider>[];
o.add(buildAuthProvider());
o.add(buildAuthProvider());
return o;
}
void checkUnnamed171(core.List<api.AuthProvider> o) {
unittest.expect(o, unittest.hasLength(2));
checkAuthProvider(o[0]);
checkAuthProvider(o[1]);
}
core.List<api.AuthenticationRule> buildUnnamed172() {
var o = <api.AuthenticationRule>[];
o.add(buildAuthenticationRule());
o.add(buildAuthenticationRule());
return o;
}
void checkUnnamed172(core.List<api.AuthenticationRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkAuthenticationRule(o[0]);
checkAuthenticationRule(o[1]);
}
core.int buildCounterAuthentication = 0;
api.Authentication buildAuthentication() {
var o = api.Authentication();
buildCounterAuthentication++;
if (buildCounterAuthentication < 3) {
o.providers = buildUnnamed171();
o.rules = buildUnnamed172();
}
buildCounterAuthentication--;
return o;
}
void checkAuthentication(api.Authentication o) {
buildCounterAuthentication++;
if (buildCounterAuthentication < 3) {
checkUnnamed171(o.providers);
checkUnnamed172(o.rules);
}
buildCounterAuthentication--;
}
core.List<api.AuthRequirement> buildUnnamed173() {
var o = <api.AuthRequirement>[];
o.add(buildAuthRequirement());
o.add(buildAuthRequirement());
return o;
}
void checkUnnamed173(core.List<api.AuthRequirement> o) {
unittest.expect(o, unittest.hasLength(2));
checkAuthRequirement(o[0]);
checkAuthRequirement(o[1]);
}
core.int buildCounterAuthenticationRule = 0;
api.AuthenticationRule buildAuthenticationRule() {
var o = api.AuthenticationRule();
buildCounterAuthenticationRule++;
if (buildCounterAuthenticationRule < 3) {
o.allowWithoutCredential = true;
o.oauth = buildOAuthRequirements();
o.requirements = buildUnnamed173();
o.selector = 'foo';
}
buildCounterAuthenticationRule--;
return o;
}
void checkAuthenticationRule(api.AuthenticationRule o) {
buildCounterAuthenticationRule++;
if (buildCounterAuthenticationRule < 3) {
unittest.expect(o.allowWithoutCredential, unittest.isTrue);
checkOAuthRequirements(o.oauth);
checkUnnamed173(o.requirements);
unittest.expect(o.selector, unittest.equals('foo'));
}
buildCounterAuthenticationRule--;
}
core.List<api.BackendRule> buildUnnamed174() {
var o = <api.BackendRule>[];
o.add(buildBackendRule());
o.add(buildBackendRule());
return o;
}
void checkUnnamed174(core.List<api.BackendRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkBackendRule(o[0]);
checkBackendRule(o[1]);
}
core.int buildCounterBackend = 0;
api.Backend buildBackend() {
var o = api.Backend();
buildCounterBackend++;
if (buildCounterBackend < 3) {
o.rules = buildUnnamed174();
}
buildCounterBackend--;
return o;
}
void checkBackend(api.Backend o) {
buildCounterBackend++;
if (buildCounterBackend < 3) {
checkUnnamed174(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.minDeadline = 42.0;
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.minDeadline, unittest.equals(42.0));
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.QuotaOverride> buildUnnamed175() {
var o = <api.QuotaOverride>[];
o.add(buildQuotaOverride());
o.add(buildQuotaOverride());
return o;
}
void checkUnnamed175(core.List<api.QuotaOverride> o) {
unittest.expect(o, unittest.hasLength(2));
checkQuotaOverride(o[0]);
checkQuotaOverride(o[1]);
}
core.int buildCounterBatchCreateAdminOverridesResponse = 0;
api.BatchCreateAdminOverridesResponse buildBatchCreateAdminOverridesResponse() {
var o = api.BatchCreateAdminOverridesResponse();
buildCounterBatchCreateAdminOverridesResponse++;
if (buildCounterBatchCreateAdminOverridesResponse < 3) {
o.overrides = buildUnnamed175();
}
buildCounterBatchCreateAdminOverridesResponse--;
return o;
}
void checkBatchCreateAdminOverridesResponse(
api.BatchCreateAdminOverridesResponse o) {
buildCounterBatchCreateAdminOverridesResponse++;
if (buildCounterBatchCreateAdminOverridesResponse < 3) {
checkUnnamed175(o.overrides);
}
buildCounterBatchCreateAdminOverridesResponse--;
}
core.List<api.QuotaOverride> buildUnnamed176() {
var o = <api.QuotaOverride>[];
o.add(buildQuotaOverride());
o.add(buildQuotaOverride());
return o;
}
void checkUnnamed176(core.List<api.QuotaOverride> o) {
unittest.expect(o, unittest.hasLength(2));
checkQuotaOverride(o[0]);
checkQuotaOverride(o[1]);
}
core.int buildCounterBatchCreateConsumerOverridesResponse = 0;
api.BatchCreateConsumerOverridesResponse
buildBatchCreateConsumerOverridesResponse() {
var o = api.BatchCreateConsumerOverridesResponse();
buildCounterBatchCreateConsumerOverridesResponse++;
if (buildCounterBatchCreateConsumerOverridesResponse < 3) {
o.overrides = buildUnnamed176();
}
buildCounterBatchCreateConsumerOverridesResponse--;
return o;
}
void checkBatchCreateConsumerOverridesResponse(
api.BatchCreateConsumerOverridesResponse o) {
buildCounterBatchCreateConsumerOverridesResponse++;
if (buildCounterBatchCreateConsumerOverridesResponse < 3) {
checkUnnamed176(o.overrides);
}
buildCounterBatchCreateConsumerOverridesResponse--;
}
core.List<core.String> buildUnnamed177() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed177(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() {
var o = api.BatchEnableServicesRequest();
buildCounterBatchEnableServicesRequest++;
if (buildCounterBatchEnableServicesRequest < 3) {
o.serviceIds = buildUnnamed177();
}
buildCounterBatchEnableServicesRequest--;
return o;
}
void checkBatchEnableServicesRequest(api.BatchEnableServicesRequest o) {
buildCounterBatchEnableServicesRequest++;
if (buildCounterBatchEnableServicesRequest < 3) {
checkUnnamed177(o.serviceIds);
}
buildCounterBatchEnableServicesRequest--;
}
core.List<api.EnableFailure> buildUnnamed178() {
var o = <api.EnableFailure>[];
o.add(buildEnableFailure());
o.add(buildEnableFailure());
return o;
}
void checkUnnamed178(core.List<api.EnableFailure> o) {
unittest.expect(o, unittest.hasLength(2));
checkEnableFailure(o[0]);
checkEnableFailure(o[1]);
}
core.List<api.GoogleApiServiceusageV1Service> buildUnnamed179() {
var o = <api.GoogleApiServiceusageV1Service>[];
o.add(buildGoogleApiServiceusageV1Service());
o.add(buildGoogleApiServiceusageV1Service());
return o;
}
void checkUnnamed179(core.List<api.GoogleApiServiceusageV1Service> o) {
unittest.expect(o, unittest.hasLength(2));
checkGoogleApiServiceusageV1Service(o[0]);
checkGoogleApiServiceusageV1Service(o[1]);
}
core.int buildCounterBatchEnableServicesResponse = 0;
api.BatchEnableServicesResponse buildBatchEnableServicesResponse() {
var o = api.BatchEnableServicesResponse();
buildCounterBatchEnableServicesResponse++;
if (buildCounterBatchEnableServicesResponse < 3) {
o.failures = buildUnnamed178();
o.services = buildUnnamed179();
}
buildCounterBatchEnableServicesResponse--;
return o;
}
void checkBatchEnableServicesResponse(api.BatchEnableServicesResponse o) {
buildCounterBatchEnableServicesResponse++;
if (buildCounterBatchEnableServicesResponse < 3) {
checkUnnamed178(o.failures);
checkUnnamed179(o.services);
}
buildCounterBatchEnableServicesResponse--;
}
core.List<api.GoogleApiServiceusageV1Service> buildUnnamed180() {
var o = <api.GoogleApiServiceusageV1Service>[];
o.add(buildGoogleApiServiceusageV1Service());
o.add(buildGoogleApiServiceusageV1Service());
return o;
}
void checkUnnamed180(core.List<api.GoogleApiServiceusageV1Service> o) {
unittest.expect(o, unittest.hasLength(2));
checkGoogleApiServiceusageV1Service(o[0]);
checkGoogleApiServiceusageV1Service(o[1]);
}
core.int buildCounterBatchGetServicesResponse = 0;
api.BatchGetServicesResponse buildBatchGetServicesResponse() {
var o = api.BatchGetServicesResponse();
buildCounterBatchGetServicesResponse++;
if (buildCounterBatchGetServicesResponse < 3) {
o.services = buildUnnamed180();
}
buildCounterBatchGetServicesResponse--;
return o;
}
void checkBatchGetServicesResponse(api.BatchGetServicesResponse o) {
buildCounterBatchGetServicesResponse++;
if (buildCounterBatchGetServicesResponse < 3) {
checkUnnamed180(o.services);
}
buildCounterBatchGetServicesResponse--;
}
core.List<api.BillingDestination> buildUnnamed181() {
var o = <api.BillingDestination>[];
o.add(buildBillingDestination());
o.add(buildBillingDestination());
return o;
}
void checkUnnamed181(core.List<api.BillingDestination> o) {
unittest.expect(o, unittest.hasLength(2));
checkBillingDestination(o[0]);
checkBillingDestination(o[1]);
}
core.int buildCounterBilling = 0;
api.Billing buildBilling() {
var o = api.Billing();
buildCounterBilling++;
if (buildCounterBilling < 3) {
o.consumerDestinations = buildUnnamed181();
}
buildCounterBilling--;
return o;
}
void checkBilling(api.Billing o) {
buildCounterBilling++;
if (buildCounterBilling < 3) {
checkUnnamed181(o.consumerDestinations);
}
buildCounterBilling--;
}
core.List<core.String> buildUnnamed182() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed182(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 = buildUnnamed182();
o.monitoredResource = 'foo';
}
buildCounterBillingDestination--;
return o;
}
void checkBillingDestination(api.BillingDestination o) {
buildCounterBillingDestination++;
if (buildCounterBillingDestination < 3) {
checkUnnamed182(o.metrics);
unittest.expect(o.monitoredResource, unittest.equals('foo'));
}
buildCounterBillingDestination--;
}
core.int buildCounterCancelOperationRequest = 0;
api.CancelOperationRequest buildCancelOperationRequest() {
var o = api.CancelOperationRequest();
buildCounterCancelOperationRequest++;
if (buildCounterCancelOperationRequest < 3) {}
buildCounterCancelOperationRequest--;
return o;
}
void checkCancelOperationRequest(api.CancelOperationRequest o) {
buildCounterCancelOperationRequest++;
if (buildCounterCancelOperationRequest < 3) {}
buildCounterCancelOperationRequest--;
}
core.List<api.ContextRule> buildUnnamed183() {
var o = <api.ContextRule>[];
o.add(buildContextRule());
o.add(buildContextRule());
return o;
}
void checkUnnamed183(core.List<api.ContextRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkContextRule(o[0]);
checkContextRule(o[1]);
}
core.int buildCounterContext = 0;
api.Context buildContext() {
var o = api.Context();
buildCounterContext++;
if (buildCounterContext < 3) {
o.rules = buildUnnamed183();
}
buildCounterContext--;
return o;
}
void checkContext(api.Context o) {
buildCounterContext++;
if (buildCounterContext < 3) {
checkUnnamed183(o.rules);
}
buildCounterContext--;
}
core.List<core.String> buildUnnamed184() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed184(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> buildUnnamed185() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed185(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> buildUnnamed186() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed186(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> buildUnnamed187() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed187(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 = buildUnnamed184();
o.allowedResponseExtensions = buildUnnamed185();
o.provided = buildUnnamed186();
o.requested = buildUnnamed187();
o.selector = 'foo';
}
buildCounterContextRule--;
return o;
}
void checkContextRule(api.ContextRule o) {
buildCounterContextRule++;
if (buildCounterContextRule < 3) {
checkUnnamed184(o.allowedRequestExtensions);
checkUnnamed185(o.allowedResponseExtensions);
checkUnnamed186(o.provided);
checkUnnamed187(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> buildUnnamed188() {
var o = <api.CustomErrorRule>[];
o.add(buildCustomErrorRule());
o.add(buildCustomErrorRule());
return o;
}
void checkUnnamed188(core.List<api.CustomErrorRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkCustomErrorRule(o[0]);
checkCustomErrorRule(o[1]);
}
core.List<core.String> buildUnnamed189() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed189(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 = buildUnnamed188();
o.types = buildUnnamed189();
}
buildCounterCustomError--;
return o;
}
void checkCustomError(api.CustomError o) {
buildCounterCustomError++;
if (buildCounterCustomError < 3) {
checkUnnamed188(o.rules);
checkUnnamed189(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 buildCounterDisableServiceRequest = 0;
api.DisableServiceRequest buildDisableServiceRequest() {
var 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.int buildCounterDisableServiceResponse = 0;
api.DisableServiceResponse buildDisableServiceResponse() {
var o = api.DisableServiceResponse();
buildCounterDisableServiceResponse++;
if (buildCounterDisableServiceResponse < 3) {
o.service = buildGoogleApiServiceusageV1Service();
}
buildCounterDisableServiceResponse--;
return o;
}
void checkDisableServiceResponse(api.DisableServiceResponse o) {
buildCounterDisableServiceResponse++;
if (buildCounterDisableServiceResponse < 3) {
checkGoogleApiServiceusageV1Service(o.service);
}
buildCounterDisableServiceResponse--;
}
core.List<api.Page> buildUnnamed190() {
var o = <api.Page>[];
o.add(buildPage());
o.add(buildPage());
return o;
}
void checkUnnamed190(core.List<api.Page> o) {
unittest.expect(o, unittest.hasLength(2));
checkPage(o[0]);
checkPage(o[1]);
}
core.List<api.DocumentationRule> buildUnnamed191() {
var o = <api.DocumentationRule>[];
o.add(buildDocumentationRule());
o.add(buildDocumentationRule());
return o;
}
void checkUnnamed191(core.List<api.DocumentationRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkDocumentationRule(o[0]);
checkDocumentationRule(o[1]);
}
core.int buildCounterDocumentation = 0;
api.Documentation buildDocumentation() {
var o = api.Documentation();
buildCounterDocumentation++;
if (buildCounterDocumentation < 3) {
o.documentationRootUrl = 'foo';
o.overview = 'foo';
o.pages = buildUnnamed190();
o.rules = buildUnnamed191();
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'));
checkUnnamed190(o.pages);
checkUnnamed191(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 buildCounterEmpty = 0;
api.Empty buildEmpty() {
var o = api.Empty();
buildCounterEmpty++;
if (buildCounterEmpty < 3) {}
buildCounterEmpty--;
return o;
}
void checkEmpty(api.Empty o) {
buildCounterEmpty++;
if (buildCounterEmpty < 3) {}
buildCounterEmpty--;
}
core.int buildCounterEnableFailure = 0;
api.EnableFailure buildEnableFailure() {
var o = api.EnableFailure();
buildCounterEnableFailure++;
if (buildCounterEnableFailure < 3) {
o.errorMessage = 'foo';
o.serviceId = 'foo';
}
buildCounterEnableFailure--;
return o;
}
void checkEnableFailure(api.EnableFailure o) {
buildCounterEnableFailure++;
if (buildCounterEnableFailure < 3) {
unittest.expect(o.errorMessage, unittest.equals('foo'));
unittest.expect(o.serviceId, unittest.equals('foo'));
}
buildCounterEnableFailure--;
}
core.int buildCounterEnableServiceRequest = 0;
api.EnableServiceRequest buildEnableServiceRequest() {
var o = api.EnableServiceRequest();
buildCounterEnableServiceRequest++;
if (buildCounterEnableServiceRequest < 3) {}
buildCounterEnableServiceRequest--;
return o;
}
void checkEnableServiceRequest(api.EnableServiceRequest o) {
buildCounterEnableServiceRequest++;
if (buildCounterEnableServiceRequest < 3) {}
buildCounterEnableServiceRequest--;
}
core.int buildCounterEnableServiceResponse = 0;
api.EnableServiceResponse buildEnableServiceResponse() {
var o = api.EnableServiceResponse();
buildCounterEnableServiceResponse++;
if (buildCounterEnableServiceResponse < 3) {
o.service = buildGoogleApiServiceusageV1Service();
}
buildCounterEnableServiceResponse--;
return o;
}
void checkEnableServiceResponse(api.EnableServiceResponse o) {
buildCounterEnableServiceResponse++;
if (buildCounterEnableServiceResponse < 3) {
checkGoogleApiServiceusageV1Service(o.service);
}
buildCounterEnableServiceResponse--;
}
core.List<core.String> buildUnnamed192() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed192(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() {
var o = api.Endpoint();
buildCounterEndpoint++;
if (buildCounterEndpoint < 3) {
o.aliases = buildUnnamed192();
o.allowCors = true;
o.name = 'foo';
o.target = 'foo';
}
buildCounterEndpoint--;
return o;
}
void checkEndpoint(api.Endpoint o) {
buildCounterEndpoint++;
if (buildCounterEndpoint < 3) {
checkUnnamed192(o.aliases);
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> buildUnnamed193() {
var o = <api.EnumValue>[];
o.add(buildEnumValue());
o.add(buildEnumValue());
return o;
}
void checkUnnamed193(core.List<api.EnumValue> o) {
unittest.expect(o, unittest.hasLength(2));
checkEnumValue(o[0]);
checkEnumValue(o[1]);
}
core.List<api.Option> buildUnnamed194() {
var o = <api.Option>[];
o.add(buildOption());
o.add(buildOption());
return o;
}
void checkUnnamed194(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterEnum = 0;
api.Enum buildEnum() {
var o = api.Enum();
buildCounterEnum++;
if (buildCounterEnum < 3) {
o.enumvalue = buildUnnamed193();
o.name = 'foo';
o.options = buildUnnamed194();
o.sourceContext = buildSourceContext();
o.syntax = 'foo';
}
buildCounterEnum--;
return o;
}
void checkEnum(api.Enum o) {
buildCounterEnum++;
if (buildCounterEnum < 3) {
checkUnnamed193(o.enumvalue);
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed194(o.options);
checkSourceContext(o.sourceContext);
unittest.expect(o.syntax, unittest.equals('foo'));
}
buildCounterEnum--;
}
core.List<api.Option> buildUnnamed195() {
var o = <api.Option>[];
o.add(buildOption());
o.add(buildOption());
return o;
}
void checkUnnamed195(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterEnumValue = 0;
api.EnumValue buildEnumValue() {
var o = api.EnumValue();
buildCounterEnumValue++;
if (buildCounterEnumValue < 3) {
o.name = 'foo';
o.number = 42;
o.options = buildUnnamed195();
}
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));
checkUnnamed195(o.options);
}
buildCounterEnumValue--;
}
core.List<api.Option> buildUnnamed196() {
var o = <api.Option>[];
o.add(buildOption());
o.add(buildOption());
return o;
}
void checkUnnamed196(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
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 = buildUnnamed196();
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));
checkUnnamed196(o.options);
unittest.expect(o.packed, unittest.isTrue);
unittest.expect(o.typeUrl, unittest.equals('foo'));
}
buildCounterField--;
}
core.int buildCounterGetServiceIdentityResponse = 0;
api.GetServiceIdentityResponse buildGetServiceIdentityResponse() {
var o = api.GetServiceIdentityResponse();
buildCounterGetServiceIdentityResponse++;
if (buildCounterGetServiceIdentityResponse < 3) {
o.identity = buildServiceIdentity();
o.state = 'foo';
}
buildCounterGetServiceIdentityResponse--;
return o;
}
void checkGetServiceIdentityResponse(api.GetServiceIdentityResponse o) {
buildCounterGetServiceIdentityResponse++;
if (buildCounterGetServiceIdentityResponse < 3) {
checkServiceIdentity(o.identity);
unittest.expect(o.state, unittest.equals('foo'));
}
buildCounterGetServiceIdentityResponse--;
}
core.List<api.Api> buildUnnamed197() {
var o = <api.Api>[];
o.add(buildApi());
o.add(buildApi());
return o;
}
void checkUnnamed197(core.List<api.Api> o) {
unittest.expect(o, unittest.hasLength(2));
checkApi(o[0]);
checkApi(o[1]);
}
core.List<api.Endpoint> buildUnnamed198() {
var o = <api.Endpoint>[];
o.add(buildEndpoint());
o.add(buildEndpoint());
return o;
}
void checkUnnamed198(core.List<api.Endpoint> o) {
unittest.expect(o, unittest.hasLength(2));
checkEndpoint(o[0]);
checkEndpoint(o[1]);
}
core.List<api.Enum> buildUnnamed199() {
var o = <api.Enum>[];
o.add(buildEnum());
o.add(buildEnum());
return o;
}
void checkUnnamed199(core.List<api.Enum> o) {
unittest.expect(o, unittest.hasLength(2));
checkEnum(o[0]);
checkEnum(o[1]);
}
core.List<api.LogDescriptor> buildUnnamed200() {
var o = <api.LogDescriptor>[];
o.add(buildLogDescriptor());
o.add(buildLogDescriptor());
return o;
}
void checkUnnamed200(core.List<api.LogDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkLogDescriptor(o[0]);
checkLogDescriptor(o[1]);
}
core.List<api.MetricDescriptor> buildUnnamed201() {
var o = <api.MetricDescriptor>[];
o.add(buildMetricDescriptor());
o.add(buildMetricDescriptor());
return o;
}
void checkUnnamed201(core.List<api.MetricDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkMetricDescriptor(o[0]);
checkMetricDescriptor(o[1]);
}
core.List<api.MonitoredResourceDescriptor> buildUnnamed202() {
var o = <api.MonitoredResourceDescriptor>[];
o.add(buildMonitoredResourceDescriptor());
o.add(buildMonitoredResourceDescriptor());
return o;
}
void checkUnnamed202(core.List<api.MonitoredResourceDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkMonitoredResourceDescriptor(o[0]);
checkMonitoredResourceDescriptor(o[1]);
}
core.List<api.Type> buildUnnamed203() {
var o = <api.Type>[];
o.add(buildType());
o.add(buildType());
return o;
}
void checkUnnamed203(core.List<api.Type> o) {
unittest.expect(o, unittest.hasLength(2));
checkType(o[0]);
checkType(o[1]);
}
core.List<api.Type> buildUnnamed204() {
var o = <api.Type>[];
o.add(buildType());
o.add(buildType());
return o;
}
void checkUnnamed204(core.List<api.Type> o) {
unittest.expect(o, unittest.hasLength(2));
checkType(o[0]);
checkType(o[1]);
}
core.int buildCounterGoogleApiService = 0;
api.GoogleApiService buildGoogleApiService() {
var o = api.GoogleApiService();
buildCounterGoogleApiService++;
if (buildCounterGoogleApiService < 3) {
o.apis = buildUnnamed197();
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 = buildUnnamed198();
o.enums = buildUnnamed199();
o.http = buildHttp();
o.id = 'foo';
o.logging = buildLogging();
o.logs = buildUnnamed200();
o.metrics = buildUnnamed201();
o.monitoredResources = buildUnnamed202();
o.monitoring = buildMonitoring();
o.name = 'foo';
o.producerProjectId = 'foo';
o.quota = buildQuota();
o.sourceInfo = buildSourceInfo();
o.systemParameters = buildSystemParameters();
o.systemTypes = buildUnnamed203();
o.title = 'foo';
o.types = buildUnnamed204();
o.usage = buildUsage();
}
buildCounterGoogleApiService--;
return o;
}
void checkGoogleApiService(api.GoogleApiService o) {
buildCounterGoogleApiService++;
if (buildCounterGoogleApiService < 3) {
checkUnnamed197(o.apis);
checkAuthentication(o.authentication);
checkBackend(o.backend);
checkBilling(o.billing);
unittest.expect(o.configVersion, unittest.equals(42));
checkContext(o.context);
checkControl(o.control);
checkCustomError(o.customError);
checkDocumentation(o.documentation);
checkUnnamed198(o.endpoints);
checkUnnamed199(o.enums);
checkHttp(o.http);
unittest.expect(o.id, unittest.equals('foo'));
checkLogging(o.logging);
checkUnnamed200(o.logs);
checkUnnamed201(o.metrics);
checkUnnamed202(o.monitoredResources);
checkMonitoring(o.monitoring);
unittest.expect(o.name, unittest.equals('foo'));
unittest.expect(o.producerProjectId, unittest.equals('foo'));
checkQuota(o.quota);
checkSourceInfo(o.sourceInfo);
checkSystemParameters(o.systemParameters);
checkUnnamed203(o.systemTypes);
unittest.expect(o.title, unittest.equals('foo'));
checkUnnamed204(o.types);
checkUsage(o.usage);
}
buildCounterGoogleApiService--;
}
core.int buildCounterGoogleApiServiceIdentity = 0;
api.GoogleApiServiceIdentity buildGoogleApiServiceIdentity() {
var o = api.GoogleApiServiceIdentity();
buildCounterGoogleApiServiceIdentity++;
if (buildCounterGoogleApiServiceIdentity < 3) {
o.description = 'foo';
o.displayName = 'foo';
o.serviceAccountParent = 'foo';
}
buildCounterGoogleApiServiceIdentity--;
return o;
}
void checkGoogleApiServiceIdentity(api.GoogleApiServiceIdentity o) {
buildCounterGoogleApiServiceIdentity++;
if (buildCounterGoogleApiServiceIdentity < 3) {
unittest.expect(o.description, unittest.equals('foo'));
unittest.expect(o.displayName, unittest.equals('foo'));
unittest.expect(o.serviceAccountParent, unittest.equals('foo'));
}
buildCounterGoogleApiServiceIdentity--;
}
core.List<core.String> buildUnnamed205() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed205(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 buildCounterGoogleApiServiceusageV1OperationMetadata = 0;
api.GoogleApiServiceusageV1OperationMetadata
buildGoogleApiServiceusageV1OperationMetadata() {
var o = api.GoogleApiServiceusageV1OperationMetadata();
buildCounterGoogleApiServiceusageV1OperationMetadata++;
if (buildCounterGoogleApiServiceusageV1OperationMetadata < 3) {
o.resourceNames = buildUnnamed205();
}
buildCounterGoogleApiServiceusageV1OperationMetadata--;
return o;
}
void checkGoogleApiServiceusageV1OperationMetadata(
api.GoogleApiServiceusageV1OperationMetadata o) {
buildCounterGoogleApiServiceusageV1OperationMetadata++;
if (buildCounterGoogleApiServiceusageV1OperationMetadata < 3) {
checkUnnamed205(o.resourceNames);
}
buildCounterGoogleApiServiceusageV1OperationMetadata--;
}
core.int buildCounterGoogleApiServiceusageV1Service = 0;
api.GoogleApiServiceusageV1Service buildGoogleApiServiceusageV1Service() {
var 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> buildUnnamed206() {
var o = <api.Api>[];
o.add(buildApi());
o.add(buildApi());
return o;
}
void checkUnnamed206(core.List<api.Api> o) {
unittest.expect(o, unittest.hasLength(2));
checkApi(o[0]);
checkApi(o[1]);
}
core.List<api.Endpoint> buildUnnamed207() {
var o = <api.Endpoint>[];
o.add(buildEndpoint());
o.add(buildEndpoint());
return o;
}
void checkUnnamed207(core.List<api.Endpoint> o) {
unittest.expect(o, unittest.hasLength(2));
checkEndpoint(o[0]);
checkEndpoint(o[1]);
}
core.List<api.MonitoredResourceDescriptor> buildUnnamed208() {
var o = <api.MonitoredResourceDescriptor>[];
o.add(buildMonitoredResourceDescriptor());
o.add(buildMonitoredResourceDescriptor());
return o;
}
void checkUnnamed208(core.List<api.MonitoredResourceDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkMonitoredResourceDescriptor(o[0]);
checkMonitoredResourceDescriptor(o[1]);
}
core.int buildCounterGoogleApiServiceusageV1ServiceConfig = 0;
api.GoogleApiServiceusageV1ServiceConfig
buildGoogleApiServiceusageV1ServiceConfig() {
var o = api.GoogleApiServiceusageV1ServiceConfig();
buildCounterGoogleApiServiceusageV1ServiceConfig++;
if (buildCounterGoogleApiServiceusageV1ServiceConfig < 3) {
o.apis = buildUnnamed206();
o.authentication = buildAuthentication();
o.documentation = buildDocumentation();
o.endpoints = buildUnnamed207();
o.monitoredResources = buildUnnamed208();
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) {
checkUnnamed206(o.apis);
checkAuthentication(o.authentication);
checkDocumentation(o.documentation);
checkUnnamed207(o.endpoints);
checkUnnamed208(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 buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse = 0;
api.GoogleApiServiceusageV1beta1GetServiceIdentityResponse
buildGoogleApiServiceusageV1beta1GetServiceIdentityResponse() {
var o = api.GoogleApiServiceusageV1beta1GetServiceIdentityResponse();
buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse++;
if (buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse < 3) {
o.identity = buildGoogleApiServiceusageV1beta1ServiceIdentity();
o.state = 'foo';
}
buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse--;
return o;
}
void checkGoogleApiServiceusageV1beta1GetServiceIdentityResponse(
api.GoogleApiServiceusageV1beta1GetServiceIdentityResponse o) {
buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse++;
if (buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse < 3) {
checkGoogleApiServiceusageV1beta1ServiceIdentity(o.identity);
unittest.expect(o.state, unittest.equals('foo'));
}
buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse--;
}
core.int buildCounterGoogleApiServiceusageV1beta1ServiceIdentity = 0;
api.GoogleApiServiceusageV1beta1ServiceIdentity
buildGoogleApiServiceusageV1beta1ServiceIdentity() {
var o = api.GoogleApiServiceusageV1beta1ServiceIdentity();
buildCounterGoogleApiServiceusageV1beta1ServiceIdentity++;
if (buildCounterGoogleApiServiceusageV1beta1ServiceIdentity < 3) {
o.email = 'foo';
o.uniqueId = 'foo';
}
buildCounterGoogleApiServiceusageV1beta1ServiceIdentity--;
return o;
}
void checkGoogleApiServiceusageV1beta1ServiceIdentity(
api.GoogleApiServiceusageV1beta1ServiceIdentity o) {
buildCounterGoogleApiServiceusageV1beta1ServiceIdentity++;
if (buildCounterGoogleApiServiceusageV1beta1ServiceIdentity < 3) {
unittest.expect(o.email, unittest.equals('foo'));
unittest.expect(o.uniqueId, unittest.equals('foo'));
}
buildCounterGoogleApiServiceusageV1beta1ServiceIdentity--;
}
core.List<api.HttpRule> buildUnnamed209() {
var o = <api.HttpRule>[];
o.add(buildHttpRule());
o.add(buildHttpRule());
return o;
}
void checkUnnamed209(core.List<api.HttpRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkHttpRule(o[0]);
checkHttpRule(o[1]);
}
core.int buildCounterHttp = 0;
api.Http buildHttp() {
var o = api.Http();
buildCounterHttp++;
if (buildCounterHttp < 3) {
o.fullyDecodeReservedExpansion = true;
o.rules = buildUnnamed209();
}
buildCounterHttp--;
return o;
}
void checkHttp(api.Http o) {
buildCounterHttp++;
if (buildCounterHttp < 3) {
unittest.expect(o.fullyDecodeReservedExpansion, unittest.isTrue);
checkUnnamed209(o.rules);
}
buildCounterHttp--;
}
core.List<api.HttpRule> buildUnnamed210() {
var o = <api.HttpRule>[];
o.add(buildHttpRule());
o.add(buildHttpRule());
return o;
}
void checkUnnamed210(core.List<api.HttpRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkHttpRule(o[0]);
checkHttpRule(o[1]);
}
core.int buildCounterHttpRule = 0;
api.HttpRule buildHttpRule() {
var o = api.HttpRule();
buildCounterHttpRule++;
if (buildCounterHttpRule < 3) {
o.additionalBindings = buildUnnamed210();
o.allowHalfDuplex = true;
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) {
checkUnnamed210(o.additionalBindings);
unittest.expect(o.allowHalfDuplex, unittest.isTrue);
unittest.expect(o.body, unittest.equals('foo'));
checkCustomHttpPattern(o.custom);
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.List<api.QuotaOverride> buildUnnamed211() {
var o = <api.QuotaOverride>[];
o.add(buildQuotaOverride());
o.add(buildQuotaOverride());
return o;
}
void checkUnnamed211(core.List<api.QuotaOverride> o) {
unittest.expect(o, unittest.hasLength(2));
checkQuotaOverride(o[0]);
checkQuotaOverride(o[1]);
}
core.int buildCounterImportAdminOverridesResponse = 0;
api.ImportAdminOverridesResponse buildImportAdminOverridesResponse() {
var o = api.ImportAdminOverridesResponse();
buildCounterImportAdminOverridesResponse++;
if (buildCounterImportAdminOverridesResponse < 3) {
o.overrides = buildUnnamed211();
}
buildCounterImportAdminOverridesResponse--;
return o;
}
void checkImportAdminOverridesResponse(api.ImportAdminOverridesResponse o) {
buildCounterImportAdminOverridesResponse++;
if (buildCounterImportAdminOverridesResponse < 3) {
checkUnnamed211(o.overrides);
}
buildCounterImportAdminOverridesResponse--;
}
core.List<api.AdminQuotaPolicy> buildUnnamed212() {
var o = <api.AdminQuotaPolicy>[];
o.add(buildAdminQuotaPolicy());
o.add(buildAdminQuotaPolicy());
return o;
}
void checkUnnamed212(core.List<api.AdminQuotaPolicy> o) {
unittest.expect(o, unittest.hasLength(2));
checkAdminQuotaPolicy(o[0]);
checkAdminQuotaPolicy(o[1]);
}
core.int buildCounterImportAdminQuotaPoliciesResponse = 0;
api.ImportAdminQuotaPoliciesResponse buildImportAdminQuotaPoliciesResponse() {
var o = api.ImportAdminQuotaPoliciesResponse();
buildCounterImportAdminQuotaPoliciesResponse++;
if (buildCounterImportAdminQuotaPoliciesResponse < 3) {
o.policies = buildUnnamed212();
}
buildCounterImportAdminQuotaPoliciesResponse--;
return o;
}
void checkImportAdminQuotaPoliciesResponse(
api.ImportAdminQuotaPoliciesResponse o) {
buildCounterImportAdminQuotaPoliciesResponse++;
if (buildCounterImportAdminQuotaPoliciesResponse < 3) {
checkUnnamed212(o.policies);
}
buildCounterImportAdminQuotaPoliciesResponse--;
}
core.List<api.QuotaOverride> buildUnnamed213() {
var o = <api.QuotaOverride>[];
o.add(buildQuotaOverride());
o.add(buildQuotaOverride());
return o;
}
void checkUnnamed213(core.List<api.QuotaOverride> o) {
unittest.expect(o, unittest.hasLength(2));
checkQuotaOverride(o[0]);
checkQuotaOverride(o[1]);
}
core.int buildCounterImportConsumerOverridesResponse = 0;
api.ImportConsumerOverridesResponse buildImportConsumerOverridesResponse() {
var o = api.ImportConsumerOverridesResponse();
buildCounterImportConsumerOverridesResponse++;
if (buildCounterImportConsumerOverridesResponse < 3) {
o.overrides = buildUnnamed213();
}
buildCounterImportConsumerOverridesResponse--;
return o;
}
void checkImportConsumerOverridesResponse(
api.ImportConsumerOverridesResponse o) {
buildCounterImportConsumerOverridesResponse++;
if (buildCounterImportConsumerOverridesResponse < 3) {
checkUnnamed213(o.overrides);
}
buildCounterImportConsumerOverridesResponse--;
}
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> buildUnnamed214() {
var o = <api.Operation>[];
o.add(buildOperation());
o.add(buildOperation());
return o;
}
void checkUnnamed214(core.List<api.Operation> o) {
unittest.expect(o, unittest.hasLength(2));
checkOperation(o[0]);
checkOperation(o[1]);
}
core.int buildCounterListOperationsResponse = 0;
api.ListOperationsResponse buildListOperationsResponse() {
var o = api.ListOperationsResponse();
buildCounterListOperationsResponse++;
if (buildCounterListOperationsResponse < 3) {
o.nextPageToken = 'foo';
o.operations = buildUnnamed214();
}
buildCounterListOperationsResponse--;
return o;
}
void checkListOperationsResponse(api.ListOperationsResponse o) {
buildCounterListOperationsResponse++;
if (buildCounterListOperationsResponse < 3) {
unittest.expect(o.nextPageToken, unittest.equals('foo'));
checkUnnamed214(o.operations);
}
buildCounterListOperationsResponse--;
}
core.List<api.GoogleApiServiceusageV1Service> buildUnnamed215() {
var o = <api.GoogleApiServiceusageV1Service>[];
o.add(buildGoogleApiServiceusageV1Service());
o.add(buildGoogleApiServiceusageV1Service());
return o;
}
void checkUnnamed215(core.List<api.GoogleApiServiceusageV1Service> o) {
unittest.expect(o, unittest.hasLength(2));
checkGoogleApiServiceusageV1Service(o[0]);
checkGoogleApiServiceusageV1Service(o[1]);
}
core.int buildCounterListServicesResponse = 0;
api.ListServicesResponse buildListServicesResponse() {
var o = api.ListServicesResponse();
buildCounterListServicesResponse++;
if (buildCounterListServicesResponse < 3) {
o.nextPageToken = 'foo';
o.services = buildUnnamed215();
}
buildCounterListServicesResponse--;
return o;
}
void checkListServicesResponse(api.ListServicesResponse o) {
buildCounterListServicesResponse++;
if (buildCounterListServicesResponse < 3) {
unittest.expect(o.nextPageToken, unittest.equals('foo'));
checkUnnamed215(o.services);
}
buildCounterListServicesResponse--;
}
core.List<api.LabelDescriptor> buildUnnamed216() {
var o = <api.LabelDescriptor>[];
o.add(buildLabelDescriptor());
o.add(buildLabelDescriptor());
return o;
}
void checkUnnamed216(core.List<api.LabelDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkLabelDescriptor(o[0]);
checkLabelDescriptor(o[1]);
}
core.int buildCounterLogDescriptor = 0;
api.LogDescriptor buildLogDescriptor() {
var o = api.LogDescriptor();
buildCounterLogDescriptor++;
if (buildCounterLogDescriptor < 3) {
o.description = 'foo';
o.displayName = 'foo';
o.labels = buildUnnamed216();
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'));
checkUnnamed216(o.labels);
unittest.expect(o.name, unittest.equals('foo'));
}
buildCounterLogDescriptor--;
}
core.List<api.LoggingDestination> buildUnnamed217() {
var o = <api.LoggingDestination>[];
o.add(buildLoggingDestination());
o.add(buildLoggingDestination());
return o;
}
void checkUnnamed217(core.List<api.LoggingDestination> o) {
unittest.expect(o, unittest.hasLength(2));
checkLoggingDestination(o[0]);
checkLoggingDestination(o[1]);
}
core.List<api.LoggingDestination> buildUnnamed218() {
var o = <api.LoggingDestination>[];
o.add(buildLoggingDestination());
o.add(buildLoggingDestination());
return o;
}
void checkUnnamed218(core.List<api.LoggingDestination> o) {
unittest.expect(o, unittest.hasLength(2));
checkLoggingDestination(o[0]);
checkLoggingDestination(o[1]);
}
core.int buildCounterLogging = 0;
api.Logging buildLogging() {
var o = api.Logging();
buildCounterLogging++;
if (buildCounterLogging < 3) {
o.consumerDestinations = buildUnnamed217();
o.producerDestinations = buildUnnamed218();
}
buildCounterLogging--;
return o;
}
void checkLogging(api.Logging o) {
buildCounterLogging++;
if (buildCounterLogging < 3) {
checkUnnamed217(o.consumerDestinations);
checkUnnamed218(o.producerDestinations);
}
buildCounterLogging--;
}
core.List<core.String> buildUnnamed219() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed219(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 = buildUnnamed219();
o.monitoredResource = 'foo';
}
buildCounterLoggingDestination--;
return o;
}
void checkLoggingDestination(api.LoggingDestination o) {
buildCounterLoggingDestination++;
if (buildCounterLoggingDestination < 3) {
checkUnnamed219(o.logs);
unittest.expect(o.monitoredResource, unittest.equals('foo'));
}
buildCounterLoggingDestination--;
}
core.List<api.Option> buildUnnamed220() {
var o = <api.Option>[];
o.add(buildOption());
o.add(buildOption());
return o;
}
void checkUnnamed220(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterMethod = 0;
api.Method buildMethod() {
var o = api.Method();
buildCounterMethod++;
if (buildCounterMethod < 3) {
o.name = 'foo';
o.options = buildUnnamed220();
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'));
checkUnnamed220(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> buildUnnamed221() {
var o = <api.LabelDescriptor>[];
o.add(buildLabelDescriptor());
o.add(buildLabelDescriptor());
return o;
}
void checkUnnamed221(core.List<api.LabelDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkLabelDescriptor(o[0]);
checkLabelDescriptor(o[1]);
}
core.List<core.String> buildUnnamed222() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed222(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 = buildUnnamed221();
o.launchStage = 'foo';
o.metadata = buildMetricDescriptorMetadata();
o.metricKind = 'foo';
o.monitoredResourceTypes = buildUnnamed222();
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'));
checkUnnamed221(o.labels);
unittest.expect(o.launchStage, unittest.equals('foo'));
checkMetricDescriptorMetadata(o.metadata);
unittest.expect(o.metricKind, unittest.equals('foo'));
checkUnnamed222(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> buildUnnamed223() {
var o = <core.String, core.String>{};
o['x'] = 'foo';
o['y'] = 'foo';
return o;
}
void checkUnnamed223(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 = buildUnnamed223();
o.selector = 'foo';
}
buildCounterMetricRule--;
return o;
}
void checkMetricRule(api.MetricRule o) {
buildCounterMetricRule++;
if (buildCounterMetricRule < 3) {
checkUnnamed223(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> buildUnnamed224() {
var o = <api.LabelDescriptor>[];
o.add(buildLabelDescriptor());
o.add(buildLabelDescriptor());
return o;
}
void checkUnnamed224(core.List<api.LabelDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkLabelDescriptor(o[0]);
checkLabelDescriptor(o[1]);
}
core.int buildCounterMonitoredResourceDescriptor = 0;
api.MonitoredResourceDescriptor buildMonitoredResourceDescriptor() {
var o = api.MonitoredResourceDescriptor();
buildCounterMonitoredResourceDescriptor++;
if (buildCounterMonitoredResourceDescriptor < 3) {
o.description = 'foo';
o.displayName = 'foo';
o.labels = buildUnnamed224();
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'));
checkUnnamed224(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> buildUnnamed225() {
var o = <api.MonitoringDestination>[];
o.add(buildMonitoringDestination());
o.add(buildMonitoringDestination());
return o;
}
void checkUnnamed225(core.List<api.MonitoringDestination> o) {
unittest.expect(o, unittest.hasLength(2));
checkMonitoringDestination(o[0]);
checkMonitoringDestination(o[1]);
}
core.List<api.MonitoringDestination> buildUnnamed226() {
var o = <api.MonitoringDestination>[];
o.add(buildMonitoringDestination());
o.add(buildMonitoringDestination());
return o;
}
void checkUnnamed226(core.List<api.MonitoringDestination> o) {
unittest.expect(o, unittest.hasLength(2));
checkMonitoringDestination(o[0]);
checkMonitoringDestination(o[1]);
}
core.int buildCounterMonitoring = 0;
api.Monitoring buildMonitoring() {
var o = api.Monitoring();
buildCounterMonitoring++;
if (buildCounterMonitoring < 3) {
o.consumerDestinations = buildUnnamed225();
o.producerDestinations = buildUnnamed226();
}
buildCounterMonitoring--;
return o;
}
void checkMonitoring(api.Monitoring o) {
buildCounterMonitoring++;
if (buildCounterMonitoring < 3) {
checkUnnamed225(o.consumerDestinations);
checkUnnamed226(o.producerDestinations);
}
buildCounterMonitoring--;
}
core.List<core.String> buildUnnamed227() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed227(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 = buildUnnamed227();
o.monitoredResource = 'foo';
}
buildCounterMonitoringDestination--;
return o;
}
void checkMonitoringDestination(api.MonitoringDestination o) {
buildCounterMonitoringDestination++;
if (buildCounterMonitoringDestination < 3) {
checkUnnamed227(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> buildUnnamed228() {
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 checkUnnamed228(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> buildUnnamed229() {
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 checkUnnamed229(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() {
var o = api.Operation();
buildCounterOperation++;
if (buildCounterOperation < 3) {
o.done = true;
o.error = buildStatus();
o.metadata = buildUnnamed228();
o.name = 'foo';
o.response = buildUnnamed229();
}
buildCounterOperation--;
return o;
}
void checkOperation(api.Operation o) {
buildCounterOperation++;
if (buildCounterOperation < 3) {
unittest.expect(o.done, unittest.isTrue);
checkStatus(o.error);
checkUnnamed228(o.metadata);
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed229(o.response);
}
buildCounterOperation--;
}
core.List<core.String> buildUnnamed230() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed230(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 buildCounterOperationMetadata = 0;
api.OperationMetadata buildOperationMetadata() {
var o = api.OperationMetadata();
buildCounterOperationMetadata++;
if (buildCounterOperationMetadata < 3) {
o.resourceNames = buildUnnamed230();
}
buildCounterOperationMetadata--;
return o;
}
void checkOperationMetadata(api.OperationMetadata o) {
buildCounterOperationMetadata++;
if (buildCounterOperationMetadata < 3) {
checkUnnamed230(o.resourceNames);
}
buildCounterOperationMetadata--;
}
core.Map<core.String, core.Object> buildUnnamed231() {
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 checkUnnamed231(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() {
var o = api.Option();
buildCounterOption++;
if (buildCounterOption < 3) {
o.name = 'foo';
o.value = buildUnnamed231();
}
buildCounterOption--;
return o;
}
void checkOption(api.Option o) {
buildCounterOption++;
if (buildCounterOption < 3) {
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed231(o.value);
}
buildCounterOption--;
}
core.List<api.Page> buildUnnamed232() {
var o = <api.Page>[];
o.add(buildPage());
o.add(buildPage());
return o;
}
void checkUnnamed232(core.List<api.Page> o) {
unittest.expect(o, unittest.hasLength(2));
checkPage(o[0]);
checkPage(o[1]);
}
core.int buildCounterPage = 0;
api.Page buildPage() {
var o = api.Page();
buildCounterPage++;
if (buildCounterPage < 3) {
o.content = 'foo';
o.name = 'foo';
o.subpages = buildUnnamed232();
}
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'));
checkUnnamed232(o.subpages);
}
buildCounterPage--;
}
core.List<api.QuotaLimit> buildUnnamed233() {
var o = <api.QuotaLimit>[];
o.add(buildQuotaLimit());
o.add(buildQuotaLimit());
return o;
}
void checkUnnamed233(core.List<api.QuotaLimit> o) {
unittest.expect(o, unittest.hasLength(2));
checkQuotaLimit(o[0]);
checkQuotaLimit(o[1]);
}
core.List<api.MetricRule> buildUnnamed234() {
var o = <api.MetricRule>[];
o.add(buildMetricRule());
o.add(buildMetricRule());
return o;
}
void checkUnnamed234(core.List<api.MetricRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkMetricRule(o[0]);
checkMetricRule(o[1]);
}
core.int buildCounterQuota = 0;
api.Quota buildQuota() {
var o = api.Quota();
buildCounterQuota++;
if (buildCounterQuota < 3) {
o.limits = buildUnnamed233();
o.metricRules = buildUnnamed234();
}
buildCounterQuota--;
return o;
}
void checkQuota(api.Quota o) {
buildCounterQuota++;
if (buildCounterQuota < 3) {
checkUnnamed233(o.limits);
checkUnnamed234(o.metricRules);
}
buildCounterQuota--;
}
core.Map<core.String, core.String> buildUnnamed235() {
var o = <core.String, core.String>{};
o['x'] = 'foo';
o['y'] = 'foo';
return o;
}
void checkUnnamed235(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 = buildUnnamed235();
}
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'));
checkUnnamed235(o.values);
}
buildCounterQuotaLimit--;
}
core.Map<core.String, core.String> buildUnnamed236() {
var o = <core.String, core.String>{};
o['x'] = 'foo';
o['y'] = 'foo';
return o;
}
void checkUnnamed236(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 buildCounterQuotaOverride = 0;
api.QuotaOverride buildQuotaOverride() {
var o = api.QuotaOverride();
buildCounterQuotaOverride++;
if (buildCounterQuotaOverride < 3) {
o.adminOverrideAncestor = 'foo';
o.dimensions = buildUnnamed236();
o.metric = 'foo';
o.name = 'foo';
o.overrideValue = 'foo';
o.unit = 'foo';
}
buildCounterQuotaOverride--;
return o;
}
void checkQuotaOverride(api.QuotaOverride o) {
buildCounterQuotaOverride++;
if (buildCounterQuotaOverride < 3) {
unittest.expect(o.adminOverrideAncestor, unittest.equals('foo'));
checkUnnamed236(o.dimensions);
unittest.expect(o.metric, unittest.equals('foo'));
unittest.expect(o.name, unittest.equals('foo'));
unittest.expect(o.overrideValue, unittest.equals('foo'));
unittest.expect(o.unit, unittest.equals('foo'));
}
buildCounterQuotaOverride--;
}
core.int buildCounterServiceIdentity = 0;
api.ServiceIdentity buildServiceIdentity() {
var o = api.ServiceIdentity();
buildCounterServiceIdentity++;
if (buildCounterServiceIdentity < 3) {
o.email = 'foo';
o.uniqueId = 'foo';
}
buildCounterServiceIdentity--;
return o;
}
void checkServiceIdentity(api.ServiceIdentity o) {
buildCounterServiceIdentity++;
if (buildCounterServiceIdentity < 3) {
unittest.expect(o.email, unittest.equals('foo'));
unittest.expect(o.uniqueId, unittest.equals('foo'));
}
buildCounterServiceIdentity--;
}
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> buildUnnamed237() {
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 checkUnnamed237(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>> buildUnnamed238() {
var o = <core.Map<core.String, core.Object>>[];
o.add(buildUnnamed237());
o.add(buildUnnamed237());
return o;
}
void checkUnnamed238(core.List<core.Map<core.String, core.Object>> o) {
unittest.expect(o, unittest.hasLength(2));
checkUnnamed237(o[0]);
checkUnnamed237(o[1]);
}
core.int buildCounterSourceInfo = 0;
api.SourceInfo buildSourceInfo() {
var o = api.SourceInfo();
buildCounterSourceInfo++;
if (buildCounterSourceInfo < 3) {
o.sourceFiles = buildUnnamed238();
}
buildCounterSourceInfo--;
return o;
}
void checkSourceInfo(api.SourceInfo o) {
buildCounterSourceInfo++;
if (buildCounterSourceInfo < 3) {
checkUnnamed238(o.sourceFiles);
}
buildCounterSourceInfo--;
}
core.Map<core.String, core.Object> buildUnnamed239() {
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 checkUnnamed239(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.List<core.Map<core.String, core.Object>> buildUnnamed240() {
var o = <core.Map<core.String, core.Object>>[];
o.add(buildUnnamed239());
o.add(buildUnnamed239());
return o;
}
void checkUnnamed240(core.List<core.Map<core.String, core.Object>> o) {
unittest.expect(o, unittest.hasLength(2));
checkUnnamed239(o[0]);
checkUnnamed239(o[1]);
}
core.int buildCounterStatus = 0;
api.Status buildStatus() {
var o = api.Status();
buildCounterStatus++;
if (buildCounterStatus < 3) {
o.code = 42;
o.details = buildUnnamed240();
o.message = 'foo';
}
buildCounterStatus--;
return o;
}
void checkStatus(api.Status o) {
buildCounterStatus++;
if (buildCounterStatus < 3) {
unittest.expect(o.code, unittest.equals(42));
checkUnnamed240(o.details);
unittest.expect(o.message, unittest.equals('foo'));
}
buildCounterStatus--;
}
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> buildUnnamed241() {
var o = <api.SystemParameter>[];
o.add(buildSystemParameter());
o.add(buildSystemParameter());
return o;
}
void checkUnnamed241(core.List<api.SystemParameter> o) {
unittest.expect(o, unittest.hasLength(2));
checkSystemParameter(o[0]);
checkSystemParameter(o[1]);
}
core.int buildCounterSystemParameterRule = 0;
api.SystemParameterRule buildSystemParameterRule() {
var o = api.SystemParameterRule();
buildCounterSystemParameterRule++;
if (buildCounterSystemParameterRule < 3) {
o.parameters = buildUnnamed241();
o.selector = 'foo';
}
buildCounterSystemParameterRule--;
return o;
}
void checkSystemParameterRule(api.SystemParameterRule o) {
buildCounterSystemParameterRule++;
if (buildCounterSystemParameterRule < 3) {
checkUnnamed241(o.parameters);
unittest.expect(o.selector, unittest.equals('foo'));
}
buildCounterSystemParameterRule--;
}
core.List<api.SystemParameterRule> buildUnnamed242() {
var o = <api.SystemParameterRule>[];
o.add(buildSystemParameterRule());
o.add(buildSystemParameterRule());
return o;
}
void checkUnnamed242(core.List<api.SystemParameterRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkSystemParameterRule(o[0]);
checkSystemParameterRule(o[1]);
}
core.int buildCounterSystemParameters = 0;
api.SystemParameters buildSystemParameters() {
var o = api.SystemParameters();
buildCounterSystemParameters++;
if (buildCounterSystemParameters < 3) {
o.rules = buildUnnamed242();
}
buildCounterSystemParameters--;
return o;
}
void checkSystemParameters(api.SystemParameters o) {
buildCounterSystemParameters++;
if (buildCounterSystemParameters < 3) {
checkUnnamed242(o.rules);
}
buildCounterSystemParameters--;
}
core.List<api.Field> buildUnnamed243() {
var o = <api.Field>[];
o.add(buildField());
o.add(buildField());
return o;
}
void checkUnnamed243(core.List<api.Field> o) {
unittest.expect(o, unittest.hasLength(2));
checkField(o[0]);
checkField(o[1]);
}
core.List<core.String> buildUnnamed244() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed244(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> buildUnnamed245() {
var o = <api.Option>[];
o.add(buildOption());
o.add(buildOption());
return o;
}
void checkUnnamed245(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterType = 0;
api.Type buildType() {
var o = api.Type();
buildCounterType++;
if (buildCounterType < 3) {
o.fields = buildUnnamed243();
o.name = 'foo';
o.oneofs = buildUnnamed244();
o.options = buildUnnamed245();
o.sourceContext = buildSourceContext();
o.syntax = 'foo';
}
buildCounterType--;
return o;
}
void checkType(api.Type o) {
buildCounterType++;
if (buildCounterType < 3) {
checkUnnamed243(o.fields);
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed244(o.oneofs);
checkUnnamed245(o.options);
checkSourceContext(o.sourceContext);
unittest.expect(o.syntax, unittest.equals('foo'));
}
buildCounterType--;
}
core.List<core.String> buildUnnamed246() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed246(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> buildUnnamed247() {
var o = <api.UsageRule>[];
o.add(buildUsageRule());
o.add(buildUsageRule());
return o;
}
void checkUnnamed247(core.List<api.UsageRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkUsageRule(o[0]);
checkUsageRule(o[1]);
}
core.int buildCounterUsage = 0;
api.Usage buildUsage() {
var o = api.Usage();
buildCounterUsage++;
if (buildCounterUsage < 3) {
o.producerNotificationChannel = 'foo';
o.requirements = buildUnnamed246();
o.rules = buildUnnamed247();
o.serviceIdentity = buildGoogleApiServiceIdentity();
}
buildCounterUsage--;
return o;
}
void checkUsage(api.Usage o) {
buildCounterUsage++;
if (buildCounterUsage < 3) {
unittest.expect(o.producerNotificationChannel, unittest.equals('foo'));
checkUnnamed246(o.requirements);
checkUnnamed247(o.rules);
checkGoogleApiServiceIdentity(o.serviceIdentity);
}
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--;
}
core.List<core.String> buildUnnamed248() {
var o = <core.String>[];
o.add('foo');
o.add('foo');
return o;
}
void checkUnnamed248(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-AdminQuotaPolicy', () {
unittest.test('to-json--from-json', () {
var o = buildAdminQuotaPolicy();
var od = api.AdminQuotaPolicy.fromJson(o.toJson());
checkAdminQuotaPolicy(od);
});
});
unittest.group('obj-schema-Api', () {
unittest.test('to-json--from-json', () {
var o = buildApi();
var od = api.Api.fromJson(o.toJson());
checkApi(od);
});
});
unittest.group('obj-schema-AuthProvider', () {
unittest.test('to-json--from-json', () {
var o = buildAuthProvider();
var od = api.AuthProvider.fromJson(o.toJson());
checkAuthProvider(od);
});
});
unittest.group('obj-schema-AuthRequirement', () {
unittest.test('to-json--from-json', () {
var o = buildAuthRequirement();
var od = api.AuthRequirement.fromJson(o.toJson());
checkAuthRequirement(od);
});
});
unittest.group('obj-schema-Authentication', () {
unittest.test('to-json--from-json', () {
var o = buildAuthentication();
var od = api.Authentication.fromJson(o.toJson());
checkAuthentication(od);
});
});
unittest.group('obj-schema-AuthenticationRule', () {
unittest.test('to-json--from-json', () {
var o = buildAuthenticationRule();
var od = api.AuthenticationRule.fromJson(o.toJson());
checkAuthenticationRule(od);
});
});
unittest.group('obj-schema-Backend', () {
unittest.test('to-json--from-json', () {
var o = buildBackend();
var od = api.Backend.fromJson(o.toJson());
checkBackend(od);
});
});
unittest.group('obj-schema-BackendRule', () {
unittest.test('to-json--from-json', () {
var o = buildBackendRule();
var od = api.BackendRule.fromJson(o.toJson());
checkBackendRule(od);
});
});
unittest.group('obj-schema-BatchCreateAdminOverridesResponse', () {
unittest.test('to-json--from-json', () {
var o = buildBatchCreateAdminOverridesResponse();
var od = api.BatchCreateAdminOverridesResponse.fromJson(o.toJson());
checkBatchCreateAdminOverridesResponse(od);
});
});
unittest.group('obj-schema-BatchCreateConsumerOverridesResponse', () {
unittest.test('to-json--from-json', () {
var o = buildBatchCreateConsumerOverridesResponse();
var od = api.BatchCreateConsumerOverridesResponse.fromJson(o.toJson());
checkBatchCreateConsumerOverridesResponse(od);
});
});
unittest.group('obj-schema-BatchEnableServicesRequest', () {
unittest.test('to-json--from-json', () {
var o = buildBatchEnableServicesRequest();
var od = api.BatchEnableServicesRequest.fromJson(o.toJson());
checkBatchEnableServicesRequest(od);
});
});
unittest.group('obj-schema-BatchEnableServicesResponse', () {
unittest.test('to-json--from-json', () {
var o = buildBatchEnableServicesResponse();
var od = api.BatchEnableServicesResponse.fromJson(o.toJson());
checkBatchEnableServicesResponse(od);
});
});
unittest.group('obj-schema-BatchGetServicesResponse', () {
unittest.test('to-json--from-json', () {
var o = buildBatchGetServicesResponse();
var od = api.BatchGetServicesResponse.fromJson(o.toJson());
checkBatchGetServicesResponse(od);
});
});
unittest.group('obj-schema-Billing', () {
unittest.test('to-json--from-json', () {
var o = buildBilling();
var od = api.Billing.fromJson(o.toJson());
checkBilling(od);
});
});
unittest.group('obj-schema-BillingDestination', () {
unittest.test('to-json--from-json', () {
var o = buildBillingDestination();
var od = api.BillingDestination.fromJson(o.toJson());
checkBillingDestination(od);
});
});
unittest.group('obj-schema-CancelOperationRequest', () {
unittest.test('to-json--from-json', () {
var o = buildCancelOperationRequest();
var od = api.CancelOperationRequest.fromJson(o.toJson());
checkCancelOperationRequest(od);
});
});
unittest.group('obj-schema-Context', () {
unittest.test('to-json--from-json', () {
var o = buildContext();
var od = api.Context.fromJson(o.toJson());
checkContext(od);
});
});
unittest.group('obj-schema-ContextRule', () {
unittest.test('to-json--from-json', () {
var o = buildContextRule();
var od = api.ContextRule.fromJson(o.toJson());
checkContextRule(od);
});
});
unittest.group('obj-schema-Control', () {
unittest.test('to-json--from-json', () {
var o = buildControl();
var od = api.Control.fromJson(o.toJson());
checkControl(od);
});
});
unittest.group('obj-schema-CustomError', () {
unittest.test('to-json--from-json', () {
var o = buildCustomError();
var od = api.CustomError.fromJson(o.toJson());
checkCustomError(od);
});
});
unittest.group('obj-schema-CustomErrorRule', () {
unittest.test('to-json--from-json', () {
var o = buildCustomErrorRule();
var od = api.CustomErrorRule.fromJson(o.toJson());
checkCustomErrorRule(od);
});
});
unittest.group('obj-schema-CustomHttpPattern', () {
unittest.test('to-json--from-json', () {
var o = buildCustomHttpPattern();
var od = api.CustomHttpPattern.fromJson(o.toJson());
checkCustomHttpPattern(od);
});
});
unittest.group('obj-schema-DisableServiceRequest', () {
unittest.test('to-json--from-json', () {
var o = buildDisableServiceRequest();
var od = api.DisableServiceRequest.fromJson(o.toJson());
checkDisableServiceRequest(od);
});
});
unittest.group('obj-schema-DisableServiceResponse', () {
unittest.test('to-json--from-json', () {
var o = buildDisableServiceResponse();
var od = api.DisableServiceResponse.fromJson(o.toJson());
checkDisableServiceResponse(od);
});
});
unittest.group('obj-schema-Documentation', () {
unittest.test('to-json--from-json', () {
var o = buildDocumentation();
var od = api.Documentation.fromJson(o.toJson());
checkDocumentation(od);
});
});
unittest.group('obj-schema-DocumentationRule', () {
unittest.test('to-json--from-json', () {
var o = buildDocumentationRule();
var od = api.DocumentationRule.fromJson(o.toJson());
checkDocumentationRule(od);
});
});
unittest.group('obj-schema-Empty', () {
unittest.test('to-json--from-json', () {
var o = buildEmpty();
var od = api.Empty.fromJson(o.toJson());
checkEmpty(od);
});
});
unittest.group('obj-schema-EnableFailure', () {
unittest.test('to-json--from-json', () {
var o = buildEnableFailure();
var od = api.EnableFailure.fromJson(o.toJson());
checkEnableFailure(od);
});
});
unittest.group('obj-schema-EnableServiceRequest', () {
unittest.test('to-json--from-json', () {
var o = buildEnableServiceRequest();
var od = api.EnableServiceRequest.fromJson(o.toJson());
checkEnableServiceRequest(od);
});
});
unittest.group('obj-schema-EnableServiceResponse', () {
unittest.test('to-json--from-json', () {
var o = buildEnableServiceResponse();
var od = api.EnableServiceResponse.fromJson(o.toJson());
checkEnableServiceResponse(od);
});
});
unittest.group('obj-schema-Endpoint', () {
unittest.test('to-json--from-json', () {
var o = buildEndpoint();
var od = api.Endpoint.fromJson(o.toJson());
checkEndpoint(od);
});
});
unittest.group('obj-schema-Enum', () {
unittest.test('to-json--from-json', () {
var o = buildEnum();
var od = api.Enum.fromJson(o.toJson());
checkEnum(od);
});
});
unittest.group('obj-schema-EnumValue', () {
unittest.test('to-json--from-json', () {
var o = buildEnumValue();
var od = api.EnumValue.fromJson(o.toJson());
checkEnumValue(od);
});
});
unittest.group('obj-schema-Field', () {
unittest.test('to-json--from-json', () {
var o = buildField();
var od = api.Field.fromJson(o.toJson());
checkField(od);
});
});
unittest.group('obj-schema-GetServiceIdentityResponse', () {
unittest.test('to-json--from-json', () {
var o = buildGetServiceIdentityResponse();
var od = api.GetServiceIdentityResponse.fromJson(o.toJson());
checkGetServiceIdentityResponse(od);
});
});
unittest.group('obj-schema-GoogleApiService', () {
unittest.test('to-json--from-json', () {
var o = buildGoogleApiService();
var od = api.GoogleApiService.fromJson(o.toJson());
checkGoogleApiService(od);
});
});
unittest.group('obj-schema-GoogleApiServiceIdentity', () {
unittest.test('to-json--from-json', () {
var o = buildGoogleApiServiceIdentity();
var od = api.GoogleApiServiceIdentity.fromJson(o.toJson());
checkGoogleApiServiceIdentity(od);
});
});
unittest.group('obj-schema-GoogleApiServiceusageV1OperationMetadata', () {
unittest.test('to-json--from-json', () {
var o = buildGoogleApiServiceusageV1OperationMetadata();
var od =
api.GoogleApiServiceusageV1OperationMetadata.fromJson(o.toJson());
checkGoogleApiServiceusageV1OperationMetadata(od);
});
});
unittest.group('obj-schema-GoogleApiServiceusageV1Service', () {
unittest.test('to-json--from-json', () {
var o = buildGoogleApiServiceusageV1Service();
var od = api.GoogleApiServiceusageV1Service.fromJson(o.toJson());
checkGoogleApiServiceusageV1Service(od);
});
});
unittest.group('obj-schema-GoogleApiServiceusageV1ServiceConfig', () {
unittest.test('to-json--from-json', () {
var o = buildGoogleApiServiceusageV1ServiceConfig();
var od = api.GoogleApiServiceusageV1ServiceConfig.fromJson(o.toJson());
checkGoogleApiServiceusageV1ServiceConfig(od);
});
});
unittest.group(
'obj-schema-GoogleApiServiceusageV1beta1GetServiceIdentityResponse', () {
unittest.test('to-json--from-json', () {
var o = buildGoogleApiServiceusageV1beta1GetServiceIdentityResponse();
var od =
api.GoogleApiServiceusageV1beta1GetServiceIdentityResponse.fromJson(
o.toJson());
checkGoogleApiServiceusageV1beta1GetServiceIdentityResponse(od);
});
});
unittest.group('obj-schema-GoogleApiServiceusageV1beta1ServiceIdentity', () {
unittest.test('to-json--from-json', () {
var o = buildGoogleApiServiceusageV1beta1ServiceIdentity();
var od =
api.GoogleApiServiceusageV1beta1ServiceIdentity.fromJson(o.toJson());
checkGoogleApiServiceusageV1beta1ServiceIdentity(od);
});
});
unittest.group('obj-schema-Http', () {
unittest.test('to-json--from-json', () {
var o = buildHttp();
var od = api.Http.fromJson(o.toJson());
checkHttp(od);
});
});
unittest.group('obj-schema-HttpRule', () {
unittest.test('to-json--from-json', () {
var o = buildHttpRule();
var od = api.HttpRule.fromJson(o.toJson());
checkHttpRule(od);
});
});
unittest.group('obj-schema-ImportAdminOverridesResponse', () {
unittest.test('to-json--from-json', () {
var o = buildImportAdminOverridesResponse();
var od = api.ImportAdminOverridesResponse.fromJson(o.toJson());
checkImportAdminOverridesResponse(od);
});
});
unittest.group('obj-schema-ImportAdminQuotaPoliciesResponse', () {
unittest.test('to-json--from-json', () {
var o = buildImportAdminQuotaPoliciesResponse();
var od = api.ImportAdminQuotaPoliciesResponse.fromJson(o.toJson());
checkImportAdminQuotaPoliciesResponse(od);
});
});
unittest.group('obj-schema-ImportConsumerOverridesResponse', () {
unittest.test('to-json--from-json', () {
var o = buildImportConsumerOverridesResponse();
var od = api.ImportConsumerOverridesResponse.fromJson(o.toJson());
checkImportConsumerOverridesResponse(od);
});
});
unittest.group('obj-schema-JwtLocation', () {
unittest.test('to-json--from-json', () {
var o = buildJwtLocation();
var od = api.JwtLocation.fromJson(o.toJson());
checkJwtLocation(od);
});
});
unittest.group('obj-schema-LabelDescriptor', () {
unittest.test('to-json--from-json', () {
var o = buildLabelDescriptor();
var od = api.LabelDescriptor.fromJson(o.toJson());
checkLabelDescriptor(od);
});
});
unittest.group('obj-schema-ListOperationsResponse', () {
unittest.test('to-json--from-json', () {
var o = buildListOperationsResponse();
var od = api.ListOperationsResponse.fromJson(o.toJson());
checkListOperationsResponse(od);
});
});
unittest.group('obj-schema-ListServicesResponse', () {
unittest.test('to-json--from-json', () {
var o = buildListServicesResponse();
var od = api.ListServicesResponse.fromJson(o.toJson());
checkListServicesResponse(od);
});
});
unittest.group('obj-schema-LogDescriptor', () {
unittest.test('to-json--from-json', () {
var o = buildLogDescriptor();
var od = api.LogDescriptor.fromJson(o.toJson());
checkLogDescriptor(od);
});
});
unittest.group('obj-schema-Logging', () {
unittest.test('to-json--from-json', () {
var o = buildLogging();
var od = api.Logging.fromJson(o.toJson());
checkLogging(od);
});
});
unittest.group('obj-schema-LoggingDestination', () {
unittest.test('to-json--from-json', () {
var o = buildLoggingDestination();
var od = api.LoggingDestination.fromJson(o.toJson());
checkLoggingDestination(od);
});
});
unittest.group('obj-schema-Method', () {
unittest.test('to-json--from-json', () {
var o = buildMethod();
var od = api.Method.fromJson(o.toJson());
checkMethod(od);
});
});
unittest.group('obj-schema-MetricDescriptor', () {
unittest.test('to-json--from-json', () {
var o = buildMetricDescriptor();
var od = api.MetricDescriptor.fromJson(o.toJson());
checkMetricDescriptor(od);
});
});
unittest.group('obj-schema-MetricDescriptorMetadata', () {
unittest.test('to-json--from-json', () {
var o = buildMetricDescriptorMetadata();
var od = api.MetricDescriptorMetadata.fromJson(o.toJson());
checkMetricDescriptorMetadata(od);
});
});
unittest.group('obj-schema-MetricRule', () {
unittest.test('to-json--from-json', () {
var o = buildMetricRule();
var od = api.MetricRule.fromJson(o.toJson());
checkMetricRule(od);
});
});
unittest.group('obj-schema-Mixin', () {
unittest.test('to-json--from-json', () {
var o = buildMixin();
var od = api.Mixin.fromJson(o.toJson());
checkMixin(od);
});
});
unittest.group('obj-schema-MonitoredResourceDescriptor', () {
unittest.test('to-json--from-json', () {
var o = buildMonitoredResourceDescriptor();
var od = api.MonitoredResourceDescriptor.fromJson(o.toJson());
checkMonitoredResourceDescriptor(od);
});
});
unittest.group('obj-schema-Monitoring', () {
unittest.test('to-json--from-json', () {
var o = buildMonitoring();
var od = api.Monitoring.fromJson(o.toJson());
checkMonitoring(od);
});
});
unittest.group('obj-schema-MonitoringDestination', () {
unittest.test('to-json--from-json', () {
var o = buildMonitoringDestination();
var od = api.MonitoringDestination.fromJson(o.toJson());
checkMonitoringDestination(od);
});
});
unittest.group('obj-schema-OAuthRequirements', () {
unittest.test('to-json--from-json', () {
var o = buildOAuthRequirements();
var od = api.OAuthRequirements.fromJson(o.toJson());
checkOAuthRequirements(od);
});
});
unittest.group('obj-schema-Operation', () {
unittest.test('to-json--from-json', () {
var o = buildOperation();
var od = api.Operation.fromJson(o.toJson());
checkOperation(od);
});
});
unittest.group('obj-schema-OperationMetadata', () {
unittest.test('to-json--from-json', () {
var o = buildOperationMetadata();
var od = api.OperationMetadata.fromJson(o.toJson());
checkOperationMetadata(od);
});
});
unittest.group('obj-schema-Option', () {
unittest.test('to-json--from-json', () {
var o = buildOption();
var od = api.Option.fromJson(o.toJson());
checkOption(od);
});
});
unittest.group('obj-schema-Page', () {
unittest.test('to-json--from-json', () {
var o = buildPage();
var od = api.Page.fromJson(o.toJson());
checkPage(od);
});
});
unittest.group('obj-schema-Quota', () {
unittest.test('to-json--from-json', () {
var o = buildQuota();
var od = api.Quota.fromJson(o.toJson());
checkQuota(od);
});
});
unittest.group('obj-schema-QuotaLimit', () {
unittest.test('to-json--from-json', () {
var o = buildQuotaLimit();
var od = api.QuotaLimit.fromJson(o.toJson());
checkQuotaLimit(od);
});
});
unittest.group('obj-schema-QuotaOverride', () {
unittest.test('to-json--from-json', () {
var o = buildQuotaOverride();
var od = api.QuotaOverride.fromJson(o.toJson());
checkQuotaOverride(od);
});
});
unittest.group('obj-schema-ServiceIdentity', () {
unittest.test('to-json--from-json', () {
var o = buildServiceIdentity();
var od = api.ServiceIdentity.fromJson(o.toJson());
checkServiceIdentity(od);
});
});
unittest.group('obj-schema-SourceContext', () {
unittest.test('to-json--from-json', () {
var o = buildSourceContext();
var od = api.SourceContext.fromJson(o.toJson());
checkSourceContext(od);
});
});
unittest.group('obj-schema-SourceInfo', () {
unittest.test('to-json--from-json', () {
var o = buildSourceInfo();
var od = api.SourceInfo.fromJson(o.toJson());
checkSourceInfo(od);
});
});
unittest.group('obj-schema-Status', () {
unittest.test('to-json--from-json', () {
var o = buildStatus();
var od = api.Status.fromJson(o.toJson());
checkStatus(od);
});
});
unittest.group('obj-schema-SystemParameter', () {
unittest.test('to-json--from-json', () {
var o = buildSystemParameter();
var od = api.SystemParameter.fromJson(o.toJson());
checkSystemParameter(od);
});
});
unittest.group('obj-schema-SystemParameterRule', () {
unittest.test('to-json--from-json', () {
var o = buildSystemParameterRule();
var od = api.SystemParameterRule.fromJson(o.toJson());
checkSystemParameterRule(od);
});
});
unittest.group('obj-schema-SystemParameters', () {
unittest.test('to-json--from-json', () {
var o = buildSystemParameters();
var od = api.SystemParameters.fromJson(o.toJson());
checkSystemParameters(od);
});
});
unittest.group('obj-schema-Type', () {
unittest.test('to-json--from-json', () {
var o = buildType();
var od = api.Type.fromJson(o.toJson());
checkType(od);
});
});
unittest.group('obj-schema-Usage', () {
unittest.test('to-json--from-json', () {
var o = buildUsage();
var od = api.Usage.fromJson(o.toJson());
checkUsage(od);
});
});
unittest.group('obj-schema-UsageRule', () {
unittest.test('to-json--from-json', () {
var o = buildUsageRule();
var od = api.UsageRule.fromJson(o.toJson());
checkUsageRule(od);
});
});
unittest.group('resource-OperationsResourceApi', () {
unittest.test('method--cancel', () {
var mock = HttpServerMock();
var res = api.ServiceusageApi(mock).operations;
var arg_request = buildCancelOperationRequest();
var arg_name = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var obj = api.CancelOperationRequest.fromJson(json);
checkCancelOperationRequest(obj);
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(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildEmpty());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.cancel(arg_request, arg_name, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkEmpty(response);
})));
});
unittest.test('method--delete', () {
var mock = HttpServerMock();
var res = api.ServiceusageApi(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(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildEmpty());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.delete(arg_name, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkEmpty(response);
})));
});
unittest.test('method--get', () {
var mock = HttpServerMock();
var res = api.ServiceusageApi(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(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildOperation());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.get(arg_name, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkOperation(response);
})));
});
unittest.test('method--list', () {
var mock = HttpServerMock();
var res = api.ServiceusageApi(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(n, 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);
res
.list(
filter: arg_filter,
name: arg_name,
pageSize: arg_pageSize,
pageToken: arg_pageToken,
$fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkListOperationsResponse(response);
})));
});
});
unittest.group('resource-ServicesResourceApi', () {
unittest.test('method--batchEnable', () {
var mock = HttpServerMock();
var res = api.ServiceusageApi(mock).services;
var arg_request = buildBatchEnableServicesRequest();
var arg_parent = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var obj = api.BatchEnableServicesRequest.fromJson(json);
checkBatchEnableServicesRequest(obj);
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(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildOperation());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.batchEnable(arg_request, arg_parent, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkOperation(response);
})));
});
unittest.test('method--batchGet', () {
var mock = HttpServerMock();
var res = api.ServiceusageApi(mock).services;
var arg_parent = 'foo';
var arg_names = buildUnnamed248();
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(n, 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["names"], unittest.equals(arg_names));
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildBatchGetServicesResponse());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.batchGet(arg_parent, names: arg_names, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkBatchGetServicesResponse(response);
})));
});
unittest.test('method--disable', () {
var mock = HttpServerMock();
var res = api.ServiceusageApi(mock).services;
var arg_request = buildDisableServiceRequest();
var arg_name = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var obj = api.DisableServiceRequest.fromJson(json);
checkDisableServiceRequest(obj);
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(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildOperation());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.disable(arg_request, arg_name, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkOperation(response);
})));
});
unittest.test('method--enable', () {
var mock = HttpServerMock();
var res = api.ServiceusageApi(mock).services;
var arg_request = buildEnableServiceRequest();
var arg_name = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var obj = api.EnableServiceRequest.fromJson(json);
checkEnableServiceRequest(obj);
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(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
if (query.isNotEmpty) {
for (var part in query.split('&')) {
var keyValue = part.split('=');
addQueryParam(
core.Uri.decodeQueryComponent(keyValue[0]),
core.Uri.decodeQueryComponent(keyValue[1]),
);
}
}
unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
var h = {
'content-type': 'application/json; charset=utf-8',
};
var resp = convert.json.encode(buildOperation());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.enable(arg_request, arg_name, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkOperation(response);
})));
});
unittest.test('method--get', () {
var mock = HttpServerMock();
var res = api.ServiceusageApi(mock).services;
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(n, 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(buildGoogleApiServiceusageV1Service());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.get(arg_name, $fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkGoogleApiServiceusageV1Service(response);
})));
});
unittest.test('method--list', () {
var mock = HttpServerMock();
var res = api.ServiceusageApi(mock).services;
var arg_parent = 'foo';
var arg_filter = 'foo';
var arg_pageSize = 42;
var arg_pageToken = 'foo';
var arg_$fields = 'foo';
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
core.int index;
core.String subPart;
unittest.expect(
path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
pathOffset += 1;
unittest.expect(
path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
pathOffset += 3;
// NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
var query = (req.url).query;
var queryOffset = 0;
var queryMap = <core.String, core.List<core.String>>{};
void addQueryParam(n, 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(buildListServicesResponse());
return async.Future.value(stringResponse(200, h, resp));
}), true);
res
.list(arg_parent,
filter: arg_filter,
pageSize: arg_pageSize,
pageToken: arg_pageToken,
$fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkListServicesResponse(response);
})));
});
});
}