blob: bc0fd6cda5a4bf1eaa12c93a3c359cbbb9888234 [file]
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;
}
async.Future<http.StreamedResponse> send(http.BaseRequest request) {
if (_expectJson) {
return request
.finalize()
.transform(convert.utf8.decoder)
.join('')
.then((core.String jsonString) {
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 {
return stream.toBytes().then((data) {
return _callback(request, data);
});
}
}
}
}
http.StreamedResponse stringResponse(core.int status,
core.Map<core.String, core.String> headers, core.String body) {
var stream = new async.Stream.fromIterable([convert.utf8.encode(body)]);
return new http.StreamedResponse(stream, status, headers: headers);
}
buildUnnamed763() {
var o = new core.Map<core.String, core.String>();
o["x"] = "foo";
o["y"] = "foo";
return o;
}
checkUnnamed763(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;
buildAdminQuotaPolicy() {
var o = new api.AdminQuotaPolicy();
buildCounterAdminQuotaPolicy++;
if (buildCounterAdminQuotaPolicy < 3) {
o.container = "foo";
o.dimensions = buildUnnamed763();
o.metric = "foo";
o.name = "foo";
o.policyValue = "foo";
o.unit = "foo";
}
buildCounterAdminQuotaPolicy--;
return o;
}
checkAdminQuotaPolicy(api.AdminQuotaPolicy o) {
buildCounterAdminQuotaPolicy++;
if (buildCounterAdminQuotaPolicy < 3) {
unittest.expect(o.container, unittest.equals('foo'));
checkUnnamed763(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--;
}
buildUnnamed764() {
var o = new core.List<api.Method>();
o.add(buildMethod());
o.add(buildMethod());
return o;
}
checkUnnamed764(core.List<api.Method> o) {
unittest.expect(o, unittest.hasLength(2));
checkMethod(o[0]);
checkMethod(o[1]);
}
buildUnnamed765() {
var o = new core.List<api.Mixin>();
o.add(buildMixin());
o.add(buildMixin());
return o;
}
checkUnnamed765(core.List<api.Mixin> o) {
unittest.expect(o, unittest.hasLength(2));
checkMixin(o[0]);
checkMixin(o[1]);
}
buildUnnamed766() {
var o = new core.List<api.Option>();
o.add(buildOption());
o.add(buildOption());
return o;
}
checkUnnamed766(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterApi = 0;
buildApi() {
var o = new api.Api();
buildCounterApi++;
if (buildCounterApi < 3) {
o.methods = buildUnnamed764();
o.mixins = buildUnnamed765();
o.name = "foo";
o.options = buildUnnamed766();
o.sourceContext = buildSourceContext();
o.syntax = "foo";
o.version = "foo";
}
buildCounterApi--;
return o;
}
checkApi(api.Api o) {
buildCounterApi++;
if (buildCounterApi < 3) {
checkUnnamed764(o.methods);
checkUnnamed765(o.mixins);
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed766(o.options);
checkSourceContext(o.sourceContext);
unittest.expect(o.syntax, unittest.equals('foo'));
unittest.expect(o.version, unittest.equals('foo'));
}
buildCounterApi--;
}
buildUnnamed767() {
var o = new core.List<api.JwtLocation>();
o.add(buildJwtLocation());
o.add(buildJwtLocation());
return o;
}
checkUnnamed767(core.List<api.JwtLocation> o) {
unittest.expect(o, unittest.hasLength(2));
checkJwtLocation(o[0]);
checkJwtLocation(o[1]);
}
core.int buildCounterAuthProvider = 0;
buildAuthProvider() {
var o = new api.AuthProvider();
buildCounterAuthProvider++;
if (buildCounterAuthProvider < 3) {
o.audiences = "foo";
o.authorizationUrl = "foo";
o.id = "foo";
o.issuer = "foo";
o.jwksUri = "foo";
o.jwtLocations = buildUnnamed767();
}
buildCounterAuthProvider--;
return o;
}
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'));
checkUnnamed767(o.jwtLocations);
}
buildCounterAuthProvider--;
}
core.int buildCounterAuthRequirement = 0;
buildAuthRequirement() {
var o = new api.AuthRequirement();
buildCounterAuthRequirement++;
if (buildCounterAuthRequirement < 3) {
o.audiences = "foo";
o.providerId = "foo";
}
buildCounterAuthRequirement--;
return o;
}
checkAuthRequirement(api.AuthRequirement o) {
buildCounterAuthRequirement++;
if (buildCounterAuthRequirement < 3) {
unittest.expect(o.audiences, unittest.equals('foo'));
unittest.expect(o.providerId, unittest.equals('foo'));
}
buildCounterAuthRequirement--;
}
buildUnnamed768() {
var o = new core.List<api.AuthProvider>();
o.add(buildAuthProvider());
o.add(buildAuthProvider());
return o;
}
checkUnnamed768(core.List<api.AuthProvider> o) {
unittest.expect(o, unittest.hasLength(2));
checkAuthProvider(o[0]);
checkAuthProvider(o[1]);
}
buildUnnamed769() {
var o = new core.List<api.AuthenticationRule>();
o.add(buildAuthenticationRule());
o.add(buildAuthenticationRule());
return o;
}
checkUnnamed769(core.List<api.AuthenticationRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkAuthenticationRule(o[0]);
checkAuthenticationRule(o[1]);
}
core.int buildCounterAuthentication = 0;
buildAuthentication() {
var o = new api.Authentication();
buildCounterAuthentication++;
if (buildCounterAuthentication < 3) {
o.providers = buildUnnamed768();
o.rules = buildUnnamed769();
}
buildCounterAuthentication--;
return o;
}
checkAuthentication(api.Authentication o) {
buildCounterAuthentication++;
if (buildCounterAuthentication < 3) {
checkUnnamed768(o.providers);
checkUnnamed769(o.rules);
}
buildCounterAuthentication--;
}
buildUnnamed770() {
var o = new core.List<api.AuthRequirement>();
o.add(buildAuthRequirement());
o.add(buildAuthRequirement());
return o;
}
checkUnnamed770(core.List<api.AuthRequirement> o) {
unittest.expect(o, unittest.hasLength(2));
checkAuthRequirement(o[0]);
checkAuthRequirement(o[1]);
}
core.int buildCounterAuthenticationRule = 0;
buildAuthenticationRule() {
var o = new api.AuthenticationRule();
buildCounterAuthenticationRule++;
if (buildCounterAuthenticationRule < 3) {
o.allowWithoutCredential = true;
o.oauth = buildOAuthRequirements();
o.requirements = buildUnnamed770();
o.selector = "foo";
}
buildCounterAuthenticationRule--;
return o;
}
checkAuthenticationRule(api.AuthenticationRule o) {
buildCounterAuthenticationRule++;
if (buildCounterAuthenticationRule < 3) {
unittest.expect(o.allowWithoutCredential, unittest.isTrue);
checkOAuthRequirements(o.oauth);
checkUnnamed770(o.requirements);
unittest.expect(o.selector, unittest.equals('foo'));
}
buildCounterAuthenticationRule--;
}
buildUnnamed771() {
var o = new core.List<api.BackendRule>();
o.add(buildBackendRule());
o.add(buildBackendRule());
return o;
}
checkUnnamed771(core.List<api.BackendRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkBackendRule(o[0]);
checkBackendRule(o[1]);
}
core.int buildCounterBackend = 0;
buildBackend() {
var o = new api.Backend();
buildCounterBackend++;
if (buildCounterBackend < 3) {
o.rules = buildUnnamed771();
}
buildCounterBackend--;
return o;
}
checkBackend(api.Backend o) {
buildCounterBackend++;
if (buildCounterBackend < 3) {
checkUnnamed771(o.rules);
}
buildCounterBackend--;
}
core.int buildCounterBackendRule = 0;
buildBackendRule() {
var o = new 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;
}
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--;
}
buildUnnamed772() {
var o = new core.List<api.QuotaOverride>();
o.add(buildQuotaOverride());
o.add(buildQuotaOverride());
return o;
}
checkUnnamed772(core.List<api.QuotaOverride> o) {
unittest.expect(o, unittest.hasLength(2));
checkQuotaOverride(o[0]);
checkQuotaOverride(o[1]);
}
core.int buildCounterBatchCreateAdminOverridesResponse = 0;
buildBatchCreateAdminOverridesResponse() {
var o = new api.BatchCreateAdminOverridesResponse();
buildCounterBatchCreateAdminOverridesResponse++;
if (buildCounterBatchCreateAdminOverridesResponse < 3) {
o.overrides = buildUnnamed772();
}
buildCounterBatchCreateAdminOverridesResponse--;
return o;
}
checkBatchCreateAdminOverridesResponse(
api.BatchCreateAdminOverridesResponse o) {
buildCounterBatchCreateAdminOverridesResponse++;
if (buildCounterBatchCreateAdminOverridesResponse < 3) {
checkUnnamed772(o.overrides);
}
buildCounterBatchCreateAdminOverridesResponse--;
}
buildUnnamed773() {
var o = new core.List<api.QuotaOverride>();
o.add(buildQuotaOverride());
o.add(buildQuotaOverride());
return o;
}
checkUnnamed773(core.List<api.QuotaOverride> o) {
unittest.expect(o, unittest.hasLength(2));
checkQuotaOverride(o[0]);
checkQuotaOverride(o[1]);
}
core.int buildCounterBatchCreateConsumerOverridesResponse = 0;
buildBatchCreateConsumerOverridesResponse() {
var o = new api.BatchCreateConsumerOverridesResponse();
buildCounterBatchCreateConsumerOverridesResponse++;
if (buildCounterBatchCreateConsumerOverridesResponse < 3) {
o.overrides = buildUnnamed773();
}
buildCounterBatchCreateConsumerOverridesResponse--;
return o;
}
checkBatchCreateConsumerOverridesResponse(
api.BatchCreateConsumerOverridesResponse o) {
buildCounterBatchCreateConsumerOverridesResponse++;
if (buildCounterBatchCreateConsumerOverridesResponse < 3) {
checkUnnamed773(o.overrides);
}
buildCounterBatchCreateConsumerOverridesResponse--;
}
buildUnnamed774() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed774(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;
buildBatchEnableServicesRequest() {
var o = new api.BatchEnableServicesRequest();
buildCounterBatchEnableServicesRequest++;
if (buildCounterBatchEnableServicesRequest < 3) {
o.serviceIds = buildUnnamed774();
}
buildCounterBatchEnableServicesRequest--;
return o;
}
checkBatchEnableServicesRequest(api.BatchEnableServicesRequest o) {
buildCounterBatchEnableServicesRequest++;
if (buildCounterBatchEnableServicesRequest < 3) {
checkUnnamed774(o.serviceIds);
}
buildCounterBatchEnableServicesRequest--;
}
buildUnnamed775() {
var o = new core.List<api.EnableFailure>();
o.add(buildEnableFailure());
o.add(buildEnableFailure());
return o;
}
checkUnnamed775(core.List<api.EnableFailure> o) {
unittest.expect(o, unittest.hasLength(2));
checkEnableFailure(o[0]);
checkEnableFailure(o[1]);
}
buildUnnamed776() {
var o = new core.List<api.GoogleApiServiceusageV1Service>();
o.add(buildGoogleApiServiceusageV1Service());
o.add(buildGoogleApiServiceusageV1Service());
return o;
}
checkUnnamed776(core.List<api.GoogleApiServiceusageV1Service> o) {
unittest.expect(o, unittest.hasLength(2));
checkGoogleApiServiceusageV1Service(o[0]);
checkGoogleApiServiceusageV1Service(o[1]);
}
core.int buildCounterBatchEnableServicesResponse = 0;
buildBatchEnableServicesResponse() {
var o = new api.BatchEnableServicesResponse();
buildCounterBatchEnableServicesResponse++;
if (buildCounterBatchEnableServicesResponse < 3) {
o.failures = buildUnnamed775();
o.services = buildUnnamed776();
}
buildCounterBatchEnableServicesResponse--;
return o;
}
checkBatchEnableServicesResponse(api.BatchEnableServicesResponse o) {
buildCounterBatchEnableServicesResponse++;
if (buildCounterBatchEnableServicesResponse < 3) {
checkUnnamed775(o.failures);
checkUnnamed776(o.services);
}
buildCounterBatchEnableServicesResponse--;
}
buildUnnamed777() {
var o = new core.List<api.GoogleApiServiceusageV1Service>();
o.add(buildGoogleApiServiceusageV1Service());
o.add(buildGoogleApiServiceusageV1Service());
return o;
}
checkUnnamed777(core.List<api.GoogleApiServiceusageV1Service> o) {
unittest.expect(o, unittest.hasLength(2));
checkGoogleApiServiceusageV1Service(o[0]);
checkGoogleApiServiceusageV1Service(o[1]);
}
core.int buildCounterBatchGetServicesResponse = 0;
buildBatchGetServicesResponse() {
var o = new api.BatchGetServicesResponse();
buildCounterBatchGetServicesResponse++;
if (buildCounterBatchGetServicesResponse < 3) {
o.services = buildUnnamed777();
}
buildCounterBatchGetServicesResponse--;
return o;
}
checkBatchGetServicesResponse(api.BatchGetServicesResponse o) {
buildCounterBatchGetServicesResponse++;
if (buildCounterBatchGetServicesResponse < 3) {
checkUnnamed777(o.services);
}
buildCounterBatchGetServicesResponse--;
}
buildUnnamed778() {
var o = new core.List<api.BillingDestination>();
o.add(buildBillingDestination());
o.add(buildBillingDestination());
return o;
}
checkUnnamed778(core.List<api.BillingDestination> o) {
unittest.expect(o, unittest.hasLength(2));
checkBillingDestination(o[0]);
checkBillingDestination(o[1]);
}
core.int buildCounterBilling = 0;
buildBilling() {
var o = new api.Billing();
buildCounterBilling++;
if (buildCounterBilling < 3) {
o.consumerDestinations = buildUnnamed778();
}
buildCounterBilling--;
return o;
}
checkBilling(api.Billing o) {
buildCounterBilling++;
if (buildCounterBilling < 3) {
checkUnnamed778(o.consumerDestinations);
}
buildCounterBilling--;
}
buildUnnamed779() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed779(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;
buildBillingDestination() {
var o = new api.BillingDestination();
buildCounterBillingDestination++;
if (buildCounterBillingDestination < 3) {
o.metrics = buildUnnamed779();
o.monitoredResource = "foo";
}
buildCounterBillingDestination--;
return o;
}
checkBillingDestination(api.BillingDestination o) {
buildCounterBillingDestination++;
if (buildCounterBillingDestination < 3) {
checkUnnamed779(o.metrics);
unittest.expect(o.monitoredResource, unittest.equals('foo'));
}
buildCounterBillingDestination--;
}
core.int buildCounterCancelOperationRequest = 0;
buildCancelOperationRequest() {
var o = new api.CancelOperationRequest();
buildCounterCancelOperationRequest++;
if (buildCounterCancelOperationRequest < 3) {}
buildCounterCancelOperationRequest--;
return o;
}
checkCancelOperationRequest(api.CancelOperationRequest o) {
buildCounterCancelOperationRequest++;
if (buildCounterCancelOperationRequest < 3) {}
buildCounterCancelOperationRequest--;
}
buildUnnamed780() {
var o = new core.List<api.ContextRule>();
o.add(buildContextRule());
o.add(buildContextRule());
return o;
}
checkUnnamed780(core.List<api.ContextRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkContextRule(o[0]);
checkContextRule(o[1]);
}
core.int buildCounterContext = 0;
buildContext() {
var o = new api.Context();
buildCounterContext++;
if (buildCounterContext < 3) {
o.rules = buildUnnamed780();
}
buildCounterContext--;
return o;
}
checkContext(api.Context o) {
buildCounterContext++;
if (buildCounterContext < 3) {
checkUnnamed780(o.rules);
}
buildCounterContext--;
}
buildUnnamed781() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed781(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'));
}
buildUnnamed782() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed782(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'));
}
buildUnnamed783() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed783(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'));
}
buildUnnamed784() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed784(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;
buildContextRule() {
var o = new api.ContextRule();
buildCounterContextRule++;
if (buildCounterContextRule < 3) {
o.allowedRequestExtensions = buildUnnamed781();
o.allowedResponseExtensions = buildUnnamed782();
o.provided = buildUnnamed783();
o.requested = buildUnnamed784();
o.selector = "foo";
}
buildCounterContextRule--;
return o;
}
checkContextRule(api.ContextRule o) {
buildCounterContextRule++;
if (buildCounterContextRule < 3) {
checkUnnamed781(o.allowedRequestExtensions);
checkUnnamed782(o.allowedResponseExtensions);
checkUnnamed783(o.provided);
checkUnnamed784(o.requested);
unittest.expect(o.selector, unittest.equals('foo'));
}
buildCounterContextRule--;
}
core.int buildCounterControl = 0;
buildControl() {
var o = new api.Control();
buildCounterControl++;
if (buildCounterControl < 3) {
o.environment = "foo";
}
buildCounterControl--;
return o;
}
checkControl(api.Control o) {
buildCounterControl++;
if (buildCounterControl < 3) {
unittest.expect(o.environment, unittest.equals('foo'));
}
buildCounterControl--;
}
buildUnnamed785() {
var o = new core.List<api.CustomErrorRule>();
o.add(buildCustomErrorRule());
o.add(buildCustomErrorRule());
return o;
}
checkUnnamed785(core.List<api.CustomErrorRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkCustomErrorRule(o[0]);
checkCustomErrorRule(o[1]);
}
buildUnnamed786() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed786(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;
buildCustomError() {
var o = new api.CustomError();
buildCounterCustomError++;
if (buildCounterCustomError < 3) {
o.rules = buildUnnamed785();
o.types = buildUnnamed786();
}
buildCounterCustomError--;
return o;
}
checkCustomError(api.CustomError o) {
buildCounterCustomError++;
if (buildCounterCustomError < 3) {
checkUnnamed785(o.rules);
checkUnnamed786(o.types);
}
buildCounterCustomError--;
}
core.int buildCounterCustomErrorRule = 0;
buildCustomErrorRule() {
var o = new api.CustomErrorRule();
buildCounterCustomErrorRule++;
if (buildCounterCustomErrorRule < 3) {
o.isErrorType = true;
o.selector = "foo";
}
buildCounterCustomErrorRule--;
return o;
}
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;
buildCustomHttpPattern() {
var o = new api.CustomHttpPattern();
buildCounterCustomHttpPattern++;
if (buildCounterCustomHttpPattern < 3) {
o.kind = "foo";
o.path = "foo";
}
buildCounterCustomHttpPattern--;
return o;
}
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;
buildDisableServiceRequest() {
var o = new api.DisableServiceRequest();
buildCounterDisableServiceRequest++;
if (buildCounterDisableServiceRequest < 3) {
o.checkIfServiceHasUsage = "foo";
o.disableDependentServices = true;
}
buildCounterDisableServiceRequest--;
return o;
}
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;
buildDisableServiceResponse() {
var o = new api.DisableServiceResponse();
buildCounterDisableServiceResponse++;
if (buildCounterDisableServiceResponse < 3) {
o.service = buildGoogleApiServiceusageV1Service();
}
buildCounterDisableServiceResponse--;
return o;
}
checkDisableServiceResponse(api.DisableServiceResponse o) {
buildCounterDisableServiceResponse++;
if (buildCounterDisableServiceResponse < 3) {
checkGoogleApiServiceusageV1Service(o.service);
}
buildCounterDisableServiceResponse--;
}
buildUnnamed787() {
var o = new core.List<api.Page>();
o.add(buildPage());
o.add(buildPage());
return o;
}
checkUnnamed787(core.List<api.Page> o) {
unittest.expect(o, unittest.hasLength(2));
checkPage(o[0]);
checkPage(o[1]);
}
buildUnnamed788() {
var o = new core.List<api.DocumentationRule>();
o.add(buildDocumentationRule());
o.add(buildDocumentationRule());
return o;
}
checkUnnamed788(core.List<api.DocumentationRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkDocumentationRule(o[0]);
checkDocumentationRule(o[1]);
}
core.int buildCounterDocumentation = 0;
buildDocumentation() {
var o = new api.Documentation();
buildCounterDocumentation++;
if (buildCounterDocumentation < 3) {
o.documentationRootUrl = "foo";
o.overview = "foo";
o.pages = buildUnnamed787();
o.rules = buildUnnamed788();
o.serviceRootUrl = "foo";
o.summary = "foo";
}
buildCounterDocumentation--;
return o;
}
checkDocumentation(api.Documentation o) {
buildCounterDocumentation++;
if (buildCounterDocumentation < 3) {
unittest.expect(o.documentationRootUrl, unittest.equals('foo'));
unittest.expect(o.overview, unittest.equals('foo'));
checkUnnamed787(o.pages);
checkUnnamed788(o.rules);
unittest.expect(o.serviceRootUrl, unittest.equals('foo'));
unittest.expect(o.summary, unittest.equals('foo'));
}
buildCounterDocumentation--;
}
core.int buildCounterDocumentationRule = 0;
buildDocumentationRule() {
var o = new api.DocumentationRule();
buildCounterDocumentationRule++;
if (buildCounterDocumentationRule < 3) {
o.deprecationDescription = "foo";
o.description = "foo";
o.selector = "foo";
}
buildCounterDocumentationRule--;
return o;
}
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;
buildEmpty() {
var o = new api.Empty();
buildCounterEmpty++;
if (buildCounterEmpty < 3) {}
buildCounterEmpty--;
return o;
}
checkEmpty(api.Empty o) {
buildCounterEmpty++;
if (buildCounterEmpty < 3) {}
buildCounterEmpty--;
}
core.int buildCounterEnableFailure = 0;
buildEnableFailure() {
var o = new api.EnableFailure();
buildCounterEnableFailure++;
if (buildCounterEnableFailure < 3) {
o.errorMessage = "foo";
o.serviceId = "foo";
}
buildCounterEnableFailure--;
return o;
}
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;
buildEnableServiceRequest() {
var o = new api.EnableServiceRequest();
buildCounterEnableServiceRequest++;
if (buildCounterEnableServiceRequest < 3) {}
buildCounterEnableServiceRequest--;
return o;
}
checkEnableServiceRequest(api.EnableServiceRequest o) {
buildCounterEnableServiceRequest++;
if (buildCounterEnableServiceRequest < 3) {}
buildCounterEnableServiceRequest--;
}
core.int buildCounterEnableServiceResponse = 0;
buildEnableServiceResponse() {
var o = new api.EnableServiceResponse();
buildCounterEnableServiceResponse++;
if (buildCounterEnableServiceResponse < 3) {
o.service = buildGoogleApiServiceusageV1Service();
}
buildCounterEnableServiceResponse--;
return o;
}
checkEnableServiceResponse(api.EnableServiceResponse o) {
buildCounterEnableServiceResponse++;
if (buildCounterEnableServiceResponse < 3) {
checkGoogleApiServiceusageV1Service(o.service);
}
buildCounterEnableServiceResponse--;
}
buildUnnamed789() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed789(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;
buildEndpoint() {
var o = new api.Endpoint();
buildCounterEndpoint++;
if (buildCounterEndpoint < 3) {
o.aliases = buildUnnamed789();
o.allowCors = true;
o.name = "foo";
o.target = "foo";
}
buildCounterEndpoint--;
return o;
}
checkEndpoint(api.Endpoint o) {
buildCounterEndpoint++;
if (buildCounterEndpoint < 3) {
checkUnnamed789(o.aliases);
unittest.expect(o.allowCors, unittest.isTrue);
unittest.expect(o.name, unittest.equals('foo'));
unittest.expect(o.target, unittest.equals('foo'));
}
buildCounterEndpoint--;
}
buildUnnamed790() {
var o = new core.List<api.EnumValue>();
o.add(buildEnumValue());
o.add(buildEnumValue());
return o;
}
checkUnnamed790(core.List<api.EnumValue> o) {
unittest.expect(o, unittest.hasLength(2));
checkEnumValue(o[0]);
checkEnumValue(o[1]);
}
buildUnnamed791() {
var o = new core.List<api.Option>();
o.add(buildOption());
o.add(buildOption());
return o;
}
checkUnnamed791(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterEnum = 0;
buildEnum() {
var o = new api.Enum();
buildCounterEnum++;
if (buildCounterEnum < 3) {
o.enumvalue = buildUnnamed790();
o.name = "foo";
o.options = buildUnnamed791();
o.sourceContext = buildSourceContext();
o.syntax = "foo";
}
buildCounterEnum--;
return o;
}
checkEnum(api.Enum o) {
buildCounterEnum++;
if (buildCounterEnum < 3) {
checkUnnamed790(o.enumvalue);
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed791(o.options);
checkSourceContext(o.sourceContext);
unittest.expect(o.syntax, unittest.equals('foo'));
}
buildCounterEnum--;
}
buildUnnamed792() {
var o = new core.List<api.Option>();
o.add(buildOption());
o.add(buildOption());
return o;
}
checkUnnamed792(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterEnumValue = 0;
buildEnumValue() {
var o = new api.EnumValue();
buildCounterEnumValue++;
if (buildCounterEnumValue < 3) {
o.name = "foo";
o.number = 42;
o.options = buildUnnamed792();
}
buildCounterEnumValue--;
return o;
}
checkEnumValue(api.EnumValue o) {
buildCounterEnumValue++;
if (buildCounterEnumValue < 3) {
unittest.expect(o.name, unittest.equals('foo'));
unittest.expect(o.number, unittest.equals(42));
checkUnnamed792(o.options);
}
buildCounterEnumValue--;
}
buildUnnamed793() {
var o = new core.List<api.Option>();
o.add(buildOption());
o.add(buildOption());
return o;
}
checkUnnamed793(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterField = 0;
buildField() {
var o = new 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 = buildUnnamed793();
o.packed = true;
o.typeUrl = "foo";
}
buildCounterField--;
return o;
}
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));
checkUnnamed793(o.options);
unittest.expect(o.packed, unittest.isTrue);
unittest.expect(o.typeUrl, unittest.equals('foo'));
}
buildCounterField--;
}
core.int buildCounterGetServiceIdentityResponse = 0;
buildGetServiceIdentityResponse() {
var o = new api.GetServiceIdentityResponse();
buildCounterGetServiceIdentityResponse++;
if (buildCounterGetServiceIdentityResponse < 3) {
o.identity = buildServiceIdentity();
o.state = "foo";
}
buildCounterGetServiceIdentityResponse--;
return o;
}
checkGetServiceIdentityResponse(api.GetServiceIdentityResponse o) {
buildCounterGetServiceIdentityResponse++;
if (buildCounterGetServiceIdentityResponse < 3) {
checkServiceIdentity(o.identity);
unittest.expect(o.state, unittest.equals('foo'));
}
buildCounterGetServiceIdentityResponse--;
}
buildUnnamed794() {
var o = new core.List<api.Api>();
o.add(buildApi());
o.add(buildApi());
return o;
}
checkUnnamed794(core.List<api.Api> o) {
unittest.expect(o, unittest.hasLength(2));
checkApi(o[0]);
checkApi(o[1]);
}
buildUnnamed795() {
var o = new core.List<api.Endpoint>();
o.add(buildEndpoint());
o.add(buildEndpoint());
return o;
}
checkUnnamed795(core.List<api.Endpoint> o) {
unittest.expect(o, unittest.hasLength(2));
checkEndpoint(o[0]);
checkEndpoint(o[1]);
}
buildUnnamed796() {
var o = new core.List<api.Enum>();
o.add(buildEnum());
o.add(buildEnum());
return o;
}
checkUnnamed796(core.List<api.Enum> o) {
unittest.expect(o, unittest.hasLength(2));
checkEnum(o[0]);
checkEnum(o[1]);
}
buildUnnamed797() {
var o = new core.List<api.LogDescriptor>();
o.add(buildLogDescriptor());
o.add(buildLogDescriptor());
return o;
}
checkUnnamed797(core.List<api.LogDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkLogDescriptor(o[0]);
checkLogDescriptor(o[1]);
}
buildUnnamed798() {
var o = new core.List<api.MetricDescriptor>();
o.add(buildMetricDescriptor());
o.add(buildMetricDescriptor());
return o;
}
checkUnnamed798(core.List<api.MetricDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkMetricDescriptor(o[0]);
checkMetricDescriptor(o[1]);
}
buildUnnamed799() {
var o = new core.List<api.MonitoredResourceDescriptor>();
o.add(buildMonitoredResourceDescriptor());
o.add(buildMonitoredResourceDescriptor());
return o;
}
checkUnnamed799(core.List<api.MonitoredResourceDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkMonitoredResourceDescriptor(o[0]);
checkMonitoredResourceDescriptor(o[1]);
}
buildUnnamed800() {
var o = new core.List<api.Type>();
o.add(buildType());
o.add(buildType());
return o;
}
checkUnnamed800(core.List<api.Type> o) {
unittest.expect(o, unittest.hasLength(2));
checkType(o[0]);
checkType(o[1]);
}
buildUnnamed801() {
var o = new core.List<api.Type>();
o.add(buildType());
o.add(buildType());
return o;
}
checkUnnamed801(core.List<api.Type> o) {
unittest.expect(o, unittest.hasLength(2));
checkType(o[0]);
checkType(o[1]);
}
core.int buildCounterGoogleApiService = 0;
buildGoogleApiService() {
var o = new api.GoogleApiService();
buildCounterGoogleApiService++;
if (buildCounterGoogleApiService < 3) {
o.apis = buildUnnamed794();
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 = buildUnnamed795();
o.enums = buildUnnamed796();
o.http = buildHttp();
o.id = "foo";
o.logging = buildLogging();
o.logs = buildUnnamed797();
o.metrics = buildUnnamed798();
o.monitoredResources = buildUnnamed799();
o.monitoring = buildMonitoring();
o.name = "foo";
o.producerProjectId = "foo";
o.quota = buildQuota();
o.sourceInfo = buildSourceInfo();
o.systemParameters = buildSystemParameters();
o.systemTypes = buildUnnamed800();
o.title = "foo";
o.types = buildUnnamed801();
o.usage = buildUsage();
}
buildCounterGoogleApiService--;
return o;
}
checkGoogleApiService(api.GoogleApiService o) {
buildCounterGoogleApiService++;
if (buildCounterGoogleApiService < 3) {
checkUnnamed794(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);
checkUnnamed795(o.endpoints);
checkUnnamed796(o.enums);
checkHttp(o.http);
unittest.expect(o.id, unittest.equals('foo'));
checkLogging(o.logging);
checkUnnamed797(o.logs);
checkUnnamed798(o.metrics);
checkUnnamed799(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);
checkUnnamed800(o.systemTypes);
unittest.expect(o.title, unittest.equals('foo'));
checkUnnamed801(o.types);
checkUsage(o.usage);
}
buildCounterGoogleApiService--;
}
core.int buildCounterGoogleApiServiceIdentity = 0;
buildGoogleApiServiceIdentity() {
var o = new api.GoogleApiServiceIdentity();
buildCounterGoogleApiServiceIdentity++;
if (buildCounterGoogleApiServiceIdentity < 3) {
o.description = "foo";
o.displayName = "foo";
o.serviceAccountParent = "foo";
}
buildCounterGoogleApiServiceIdentity--;
return o;
}
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--;
}
buildUnnamed802() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed802(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;
buildGoogleApiServiceusageV1OperationMetadata() {
var o = new api.GoogleApiServiceusageV1OperationMetadata();
buildCounterGoogleApiServiceusageV1OperationMetadata++;
if (buildCounterGoogleApiServiceusageV1OperationMetadata < 3) {
o.resourceNames = buildUnnamed802();
}
buildCounterGoogleApiServiceusageV1OperationMetadata--;
return o;
}
checkGoogleApiServiceusageV1OperationMetadata(
api.GoogleApiServiceusageV1OperationMetadata o) {
buildCounterGoogleApiServiceusageV1OperationMetadata++;
if (buildCounterGoogleApiServiceusageV1OperationMetadata < 3) {
checkUnnamed802(o.resourceNames);
}
buildCounterGoogleApiServiceusageV1OperationMetadata--;
}
core.int buildCounterGoogleApiServiceusageV1Service = 0;
buildGoogleApiServiceusageV1Service() {
var o = new api.GoogleApiServiceusageV1Service();
buildCounterGoogleApiServiceusageV1Service++;
if (buildCounterGoogleApiServiceusageV1Service < 3) {
o.config = buildGoogleApiServiceusageV1ServiceConfig();
o.name = "foo";
o.parent = "foo";
o.state = "foo";
}
buildCounterGoogleApiServiceusageV1Service--;
return o;
}
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--;
}
buildUnnamed803() {
var o = new core.List<api.Api>();
o.add(buildApi());
o.add(buildApi());
return o;
}
checkUnnamed803(core.List<api.Api> o) {
unittest.expect(o, unittest.hasLength(2));
checkApi(o[0]);
checkApi(o[1]);
}
buildUnnamed804() {
var o = new core.List<api.Endpoint>();
o.add(buildEndpoint());
o.add(buildEndpoint());
return o;
}
checkUnnamed804(core.List<api.Endpoint> o) {
unittest.expect(o, unittest.hasLength(2));
checkEndpoint(o[0]);
checkEndpoint(o[1]);
}
buildUnnamed805() {
var o = new core.List<api.MonitoredResourceDescriptor>();
o.add(buildMonitoredResourceDescriptor());
o.add(buildMonitoredResourceDescriptor());
return o;
}
checkUnnamed805(core.List<api.MonitoredResourceDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkMonitoredResourceDescriptor(o[0]);
checkMonitoredResourceDescriptor(o[1]);
}
core.int buildCounterGoogleApiServiceusageV1ServiceConfig = 0;
buildGoogleApiServiceusageV1ServiceConfig() {
var o = new api.GoogleApiServiceusageV1ServiceConfig();
buildCounterGoogleApiServiceusageV1ServiceConfig++;
if (buildCounterGoogleApiServiceusageV1ServiceConfig < 3) {
o.apis = buildUnnamed803();
o.authentication = buildAuthentication();
o.documentation = buildDocumentation();
o.endpoints = buildUnnamed804();
o.monitoredResources = buildUnnamed805();
o.monitoring = buildMonitoring();
o.name = "foo";
o.quota = buildQuota();
o.title = "foo";
o.usage = buildUsage();
}
buildCounterGoogleApiServiceusageV1ServiceConfig--;
return o;
}
checkGoogleApiServiceusageV1ServiceConfig(
api.GoogleApiServiceusageV1ServiceConfig o) {
buildCounterGoogleApiServiceusageV1ServiceConfig++;
if (buildCounterGoogleApiServiceusageV1ServiceConfig < 3) {
checkUnnamed803(o.apis);
checkAuthentication(o.authentication);
checkDocumentation(o.documentation);
checkUnnamed804(o.endpoints);
checkUnnamed805(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;
buildGoogleApiServiceusageV1beta1GetServiceIdentityResponse() {
var o = new api.GoogleApiServiceusageV1beta1GetServiceIdentityResponse();
buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse++;
if (buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse < 3) {
o.identity = buildGoogleApiServiceusageV1beta1ServiceIdentity();
o.state = "foo";
}
buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse--;
return o;
}
checkGoogleApiServiceusageV1beta1GetServiceIdentityResponse(
api.GoogleApiServiceusageV1beta1GetServiceIdentityResponse o) {
buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse++;
if (buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse < 3) {
checkGoogleApiServiceusageV1beta1ServiceIdentity(o.identity);
unittest.expect(o.state, unittest.equals('foo'));
}
buildCounterGoogleApiServiceusageV1beta1GetServiceIdentityResponse--;
}
core.int buildCounterGoogleApiServiceusageV1beta1ServiceIdentity = 0;
buildGoogleApiServiceusageV1beta1ServiceIdentity() {
var o = new api.GoogleApiServiceusageV1beta1ServiceIdentity();
buildCounterGoogleApiServiceusageV1beta1ServiceIdentity++;
if (buildCounterGoogleApiServiceusageV1beta1ServiceIdentity < 3) {
o.email = "foo";
o.uniqueId = "foo";
}
buildCounterGoogleApiServiceusageV1beta1ServiceIdentity--;
return o;
}
checkGoogleApiServiceusageV1beta1ServiceIdentity(
api.GoogleApiServiceusageV1beta1ServiceIdentity o) {
buildCounterGoogleApiServiceusageV1beta1ServiceIdentity++;
if (buildCounterGoogleApiServiceusageV1beta1ServiceIdentity < 3) {
unittest.expect(o.email, unittest.equals('foo'));
unittest.expect(o.uniqueId, unittest.equals('foo'));
}
buildCounterGoogleApiServiceusageV1beta1ServiceIdentity--;
}
buildUnnamed806() {
var o = new core.List<api.HttpRule>();
o.add(buildHttpRule());
o.add(buildHttpRule());
return o;
}
checkUnnamed806(core.List<api.HttpRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkHttpRule(o[0]);
checkHttpRule(o[1]);
}
core.int buildCounterHttp = 0;
buildHttp() {
var o = new api.Http();
buildCounterHttp++;
if (buildCounterHttp < 3) {
o.fullyDecodeReservedExpansion = true;
o.rules = buildUnnamed806();
}
buildCounterHttp--;
return o;
}
checkHttp(api.Http o) {
buildCounterHttp++;
if (buildCounterHttp < 3) {
unittest.expect(o.fullyDecodeReservedExpansion, unittest.isTrue);
checkUnnamed806(o.rules);
}
buildCounterHttp--;
}
buildUnnamed807() {
var o = new core.List<api.HttpRule>();
o.add(buildHttpRule());
o.add(buildHttpRule());
return o;
}
checkUnnamed807(core.List<api.HttpRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkHttpRule(o[0]);
checkHttpRule(o[1]);
}
core.int buildCounterHttpRule = 0;
buildHttpRule() {
var o = new api.HttpRule();
buildCounterHttpRule++;
if (buildCounterHttpRule < 3) {
o.additionalBindings = buildUnnamed807();
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;
}
checkHttpRule(api.HttpRule o) {
buildCounterHttpRule++;
if (buildCounterHttpRule < 3) {
checkUnnamed807(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--;
}
buildUnnamed808() {
var o = new core.List<api.QuotaOverride>();
o.add(buildQuotaOverride());
o.add(buildQuotaOverride());
return o;
}
checkUnnamed808(core.List<api.QuotaOverride> o) {
unittest.expect(o, unittest.hasLength(2));
checkQuotaOverride(o[0]);
checkQuotaOverride(o[1]);
}
core.int buildCounterImportAdminOverridesResponse = 0;
buildImportAdminOverridesResponse() {
var o = new api.ImportAdminOverridesResponse();
buildCounterImportAdminOverridesResponse++;
if (buildCounterImportAdminOverridesResponse < 3) {
o.overrides = buildUnnamed808();
}
buildCounterImportAdminOverridesResponse--;
return o;
}
checkImportAdminOverridesResponse(api.ImportAdminOverridesResponse o) {
buildCounterImportAdminOverridesResponse++;
if (buildCounterImportAdminOverridesResponse < 3) {
checkUnnamed808(o.overrides);
}
buildCounterImportAdminOverridesResponse--;
}
buildUnnamed809() {
var o = new core.List<api.AdminQuotaPolicy>();
o.add(buildAdminQuotaPolicy());
o.add(buildAdminQuotaPolicy());
return o;
}
checkUnnamed809(core.List<api.AdminQuotaPolicy> o) {
unittest.expect(o, unittest.hasLength(2));
checkAdminQuotaPolicy(o[0]);
checkAdminQuotaPolicy(o[1]);
}
core.int buildCounterImportAdminQuotaPoliciesResponse = 0;
buildImportAdminQuotaPoliciesResponse() {
var o = new api.ImportAdminQuotaPoliciesResponse();
buildCounterImportAdminQuotaPoliciesResponse++;
if (buildCounterImportAdminQuotaPoliciesResponse < 3) {
o.policies = buildUnnamed809();
}
buildCounterImportAdminQuotaPoliciesResponse--;
return o;
}
checkImportAdminQuotaPoliciesResponse(api.ImportAdminQuotaPoliciesResponse o) {
buildCounterImportAdminQuotaPoliciesResponse++;
if (buildCounterImportAdminQuotaPoliciesResponse < 3) {
checkUnnamed809(o.policies);
}
buildCounterImportAdminQuotaPoliciesResponse--;
}
buildUnnamed810() {
var o = new core.List<api.QuotaOverride>();
o.add(buildQuotaOverride());
o.add(buildQuotaOverride());
return o;
}
checkUnnamed810(core.List<api.QuotaOverride> o) {
unittest.expect(o, unittest.hasLength(2));
checkQuotaOverride(o[0]);
checkQuotaOverride(o[1]);
}
core.int buildCounterImportConsumerOverridesResponse = 0;
buildImportConsumerOverridesResponse() {
var o = new api.ImportConsumerOverridesResponse();
buildCounterImportConsumerOverridesResponse++;
if (buildCounterImportConsumerOverridesResponse < 3) {
o.overrides = buildUnnamed810();
}
buildCounterImportConsumerOverridesResponse--;
return o;
}
checkImportConsumerOverridesResponse(api.ImportConsumerOverridesResponse o) {
buildCounterImportConsumerOverridesResponse++;
if (buildCounterImportConsumerOverridesResponse < 3) {
checkUnnamed810(o.overrides);
}
buildCounterImportConsumerOverridesResponse--;
}
core.int buildCounterJwtLocation = 0;
buildJwtLocation() {
var o = new api.JwtLocation();
buildCounterJwtLocation++;
if (buildCounterJwtLocation < 3) {
o.header = "foo";
o.query = "foo";
o.valuePrefix = "foo";
}
buildCounterJwtLocation--;
return o;
}
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;
buildLabelDescriptor() {
var o = new api.LabelDescriptor();
buildCounterLabelDescriptor++;
if (buildCounterLabelDescriptor < 3) {
o.description = "foo";
o.key = "foo";
o.valueType = "foo";
}
buildCounterLabelDescriptor--;
return o;
}
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--;
}
buildUnnamed811() {
var o = new core.List<api.Operation>();
o.add(buildOperation());
o.add(buildOperation());
return o;
}
checkUnnamed811(core.List<api.Operation> o) {
unittest.expect(o, unittest.hasLength(2));
checkOperation(o[0]);
checkOperation(o[1]);
}
core.int buildCounterListOperationsResponse = 0;
buildListOperationsResponse() {
var o = new api.ListOperationsResponse();
buildCounterListOperationsResponse++;
if (buildCounterListOperationsResponse < 3) {
o.nextPageToken = "foo";
o.operations = buildUnnamed811();
}
buildCounterListOperationsResponse--;
return o;
}
checkListOperationsResponse(api.ListOperationsResponse o) {
buildCounterListOperationsResponse++;
if (buildCounterListOperationsResponse < 3) {
unittest.expect(o.nextPageToken, unittest.equals('foo'));
checkUnnamed811(o.operations);
}
buildCounterListOperationsResponse--;
}
buildUnnamed812() {
var o = new core.List<api.GoogleApiServiceusageV1Service>();
o.add(buildGoogleApiServiceusageV1Service());
o.add(buildGoogleApiServiceusageV1Service());
return o;
}
checkUnnamed812(core.List<api.GoogleApiServiceusageV1Service> o) {
unittest.expect(o, unittest.hasLength(2));
checkGoogleApiServiceusageV1Service(o[0]);
checkGoogleApiServiceusageV1Service(o[1]);
}
core.int buildCounterListServicesResponse = 0;
buildListServicesResponse() {
var o = new api.ListServicesResponse();
buildCounterListServicesResponse++;
if (buildCounterListServicesResponse < 3) {
o.nextPageToken = "foo";
o.services = buildUnnamed812();
}
buildCounterListServicesResponse--;
return o;
}
checkListServicesResponse(api.ListServicesResponse o) {
buildCounterListServicesResponse++;
if (buildCounterListServicesResponse < 3) {
unittest.expect(o.nextPageToken, unittest.equals('foo'));
checkUnnamed812(o.services);
}
buildCounterListServicesResponse--;
}
buildUnnamed813() {
var o = new core.List<api.LabelDescriptor>();
o.add(buildLabelDescriptor());
o.add(buildLabelDescriptor());
return o;
}
checkUnnamed813(core.List<api.LabelDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkLabelDescriptor(o[0]);
checkLabelDescriptor(o[1]);
}
core.int buildCounterLogDescriptor = 0;
buildLogDescriptor() {
var o = new api.LogDescriptor();
buildCounterLogDescriptor++;
if (buildCounterLogDescriptor < 3) {
o.description = "foo";
o.displayName = "foo";
o.labels = buildUnnamed813();
o.name = "foo";
}
buildCounterLogDescriptor--;
return o;
}
checkLogDescriptor(api.LogDescriptor o) {
buildCounterLogDescriptor++;
if (buildCounterLogDescriptor < 3) {
unittest.expect(o.description, unittest.equals('foo'));
unittest.expect(o.displayName, unittest.equals('foo'));
checkUnnamed813(o.labels);
unittest.expect(o.name, unittest.equals('foo'));
}
buildCounterLogDescriptor--;
}
buildUnnamed814() {
var o = new core.List<api.LoggingDestination>();
o.add(buildLoggingDestination());
o.add(buildLoggingDestination());
return o;
}
checkUnnamed814(core.List<api.LoggingDestination> o) {
unittest.expect(o, unittest.hasLength(2));
checkLoggingDestination(o[0]);
checkLoggingDestination(o[1]);
}
buildUnnamed815() {
var o = new core.List<api.LoggingDestination>();
o.add(buildLoggingDestination());
o.add(buildLoggingDestination());
return o;
}
checkUnnamed815(core.List<api.LoggingDestination> o) {
unittest.expect(o, unittest.hasLength(2));
checkLoggingDestination(o[0]);
checkLoggingDestination(o[1]);
}
core.int buildCounterLogging = 0;
buildLogging() {
var o = new api.Logging();
buildCounterLogging++;
if (buildCounterLogging < 3) {
o.consumerDestinations = buildUnnamed814();
o.producerDestinations = buildUnnamed815();
}
buildCounterLogging--;
return o;
}
checkLogging(api.Logging o) {
buildCounterLogging++;
if (buildCounterLogging < 3) {
checkUnnamed814(o.consumerDestinations);
checkUnnamed815(o.producerDestinations);
}
buildCounterLogging--;
}
buildUnnamed816() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed816(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;
buildLoggingDestination() {
var o = new api.LoggingDestination();
buildCounterLoggingDestination++;
if (buildCounterLoggingDestination < 3) {
o.logs = buildUnnamed816();
o.monitoredResource = "foo";
}
buildCounterLoggingDestination--;
return o;
}
checkLoggingDestination(api.LoggingDestination o) {
buildCounterLoggingDestination++;
if (buildCounterLoggingDestination < 3) {
checkUnnamed816(o.logs);
unittest.expect(o.monitoredResource, unittest.equals('foo'));
}
buildCounterLoggingDestination--;
}
buildUnnamed817() {
var o = new core.List<api.Option>();
o.add(buildOption());
o.add(buildOption());
return o;
}
checkUnnamed817(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterMethod = 0;
buildMethod() {
var o = new api.Method();
buildCounterMethod++;
if (buildCounterMethod < 3) {
o.name = "foo";
o.options = buildUnnamed817();
o.requestStreaming = true;
o.requestTypeUrl = "foo";
o.responseStreaming = true;
o.responseTypeUrl = "foo";
o.syntax = "foo";
}
buildCounterMethod--;
return o;
}
checkMethod(api.Method o) {
buildCounterMethod++;
if (buildCounterMethod < 3) {
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed817(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--;
}
buildUnnamed818() {
var o = new core.List<api.LabelDescriptor>();
o.add(buildLabelDescriptor());
o.add(buildLabelDescriptor());
return o;
}
checkUnnamed818(core.List<api.LabelDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkLabelDescriptor(o[0]);
checkLabelDescriptor(o[1]);
}
buildUnnamed819() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed819(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;
buildMetricDescriptor() {
var o = new api.MetricDescriptor();
buildCounterMetricDescriptor++;
if (buildCounterMetricDescriptor < 3) {
o.description = "foo";
o.displayName = "foo";
o.labels = buildUnnamed818();
o.launchStage = "foo";
o.metadata = buildMetricDescriptorMetadata();
o.metricKind = "foo";
o.monitoredResourceTypes = buildUnnamed819();
o.name = "foo";
o.type = "foo";
o.unit = "foo";
o.valueType = "foo";
}
buildCounterMetricDescriptor--;
return o;
}
checkMetricDescriptor(api.MetricDescriptor o) {
buildCounterMetricDescriptor++;
if (buildCounterMetricDescriptor < 3) {
unittest.expect(o.description, unittest.equals('foo'));
unittest.expect(o.displayName, unittest.equals('foo'));
checkUnnamed818(o.labels);
unittest.expect(o.launchStage, unittest.equals('foo'));
checkMetricDescriptorMetadata(o.metadata);
unittest.expect(o.metricKind, unittest.equals('foo'));
checkUnnamed819(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;
buildMetricDescriptorMetadata() {
var o = new api.MetricDescriptorMetadata();
buildCounterMetricDescriptorMetadata++;
if (buildCounterMetricDescriptorMetadata < 3) {
o.ingestDelay = "foo";
o.launchStage = "foo";
o.samplePeriod = "foo";
}
buildCounterMetricDescriptorMetadata--;
return o;
}
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--;
}
buildUnnamed820() {
var o = new core.Map<core.String, core.String>();
o["x"] = "foo";
o["y"] = "foo";
return o;
}
checkUnnamed820(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;
buildMetricRule() {
var o = new api.MetricRule();
buildCounterMetricRule++;
if (buildCounterMetricRule < 3) {
o.metricCosts = buildUnnamed820();
o.selector = "foo";
}
buildCounterMetricRule--;
return o;
}
checkMetricRule(api.MetricRule o) {
buildCounterMetricRule++;
if (buildCounterMetricRule < 3) {
checkUnnamed820(o.metricCosts);
unittest.expect(o.selector, unittest.equals('foo'));
}
buildCounterMetricRule--;
}
core.int buildCounterMixin = 0;
buildMixin() {
var o = new api.Mixin();
buildCounterMixin++;
if (buildCounterMixin < 3) {
o.name = "foo";
o.root = "foo";
}
buildCounterMixin--;
return o;
}
checkMixin(api.Mixin o) {
buildCounterMixin++;
if (buildCounterMixin < 3) {
unittest.expect(o.name, unittest.equals('foo'));
unittest.expect(o.root, unittest.equals('foo'));
}
buildCounterMixin--;
}
buildUnnamed821() {
var o = new core.List<api.LabelDescriptor>();
o.add(buildLabelDescriptor());
o.add(buildLabelDescriptor());
return o;
}
checkUnnamed821(core.List<api.LabelDescriptor> o) {
unittest.expect(o, unittest.hasLength(2));
checkLabelDescriptor(o[0]);
checkLabelDescriptor(o[1]);
}
core.int buildCounterMonitoredResourceDescriptor = 0;
buildMonitoredResourceDescriptor() {
var o = new api.MonitoredResourceDescriptor();
buildCounterMonitoredResourceDescriptor++;
if (buildCounterMonitoredResourceDescriptor < 3) {
o.description = "foo";
o.displayName = "foo";
o.labels = buildUnnamed821();
o.launchStage = "foo";
o.name = "foo";
o.type = "foo";
}
buildCounterMonitoredResourceDescriptor--;
return o;
}
checkMonitoredResourceDescriptor(api.MonitoredResourceDescriptor o) {
buildCounterMonitoredResourceDescriptor++;
if (buildCounterMonitoredResourceDescriptor < 3) {
unittest.expect(o.description, unittest.equals('foo'));
unittest.expect(o.displayName, unittest.equals('foo'));
checkUnnamed821(o.labels);
unittest.expect(o.launchStage, unittest.equals('foo'));
unittest.expect(o.name, unittest.equals('foo'));
unittest.expect(o.type, unittest.equals('foo'));
}
buildCounterMonitoredResourceDescriptor--;
}
buildUnnamed822() {
var o = new core.List<api.MonitoringDestination>();
o.add(buildMonitoringDestination());
o.add(buildMonitoringDestination());
return o;
}
checkUnnamed822(core.List<api.MonitoringDestination> o) {
unittest.expect(o, unittest.hasLength(2));
checkMonitoringDestination(o[0]);
checkMonitoringDestination(o[1]);
}
buildUnnamed823() {
var o = new core.List<api.MonitoringDestination>();
o.add(buildMonitoringDestination());
o.add(buildMonitoringDestination());
return o;
}
checkUnnamed823(core.List<api.MonitoringDestination> o) {
unittest.expect(o, unittest.hasLength(2));
checkMonitoringDestination(o[0]);
checkMonitoringDestination(o[1]);
}
core.int buildCounterMonitoring = 0;
buildMonitoring() {
var o = new api.Monitoring();
buildCounterMonitoring++;
if (buildCounterMonitoring < 3) {
o.consumerDestinations = buildUnnamed822();
o.producerDestinations = buildUnnamed823();
}
buildCounterMonitoring--;
return o;
}
checkMonitoring(api.Monitoring o) {
buildCounterMonitoring++;
if (buildCounterMonitoring < 3) {
checkUnnamed822(o.consumerDestinations);
checkUnnamed823(o.producerDestinations);
}
buildCounterMonitoring--;
}
buildUnnamed824() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed824(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;
buildMonitoringDestination() {
var o = new api.MonitoringDestination();
buildCounterMonitoringDestination++;
if (buildCounterMonitoringDestination < 3) {
o.metrics = buildUnnamed824();
o.monitoredResource = "foo";
}
buildCounterMonitoringDestination--;
return o;
}
checkMonitoringDestination(api.MonitoringDestination o) {
buildCounterMonitoringDestination++;
if (buildCounterMonitoringDestination < 3) {
checkUnnamed824(o.metrics);
unittest.expect(o.monitoredResource, unittest.equals('foo'));
}
buildCounterMonitoringDestination--;
}
core.int buildCounterOAuthRequirements = 0;
buildOAuthRequirements() {
var o = new api.OAuthRequirements();
buildCounterOAuthRequirements++;
if (buildCounterOAuthRequirements < 3) {
o.canonicalScopes = "foo";
}
buildCounterOAuthRequirements--;
return o;
}
checkOAuthRequirements(api.OAuthRequirements o) {
buildCounterOAuthRequirements++;
if (buildCounterOAuthRequirements < 3) {
unittest.expect(o.canonicalScopes, unittest.equals('foo'));
}
buildCounterOAuthRequirements--;
}
buildUnnamed825() {
var o = new core.Map<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;
}
checkUnnamed825(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'));
}
buildUnnamed826() {
var o = new core.Map<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;
}
checkUnnamed826(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;
buildOperation() {
var o = new api.Operation();
buildCounterOperation++;
if (buildCounterOperation < 3) {
o.done = true;
o.error = buildStatus();
o.metadata = buildUnnamed825();
o.name = "foo";
o.response = buildUnnamed826();
}
buildCounterOperation--;
return o;
}
checkOperation(api.Operation o) {
buildCounterOperation++;
if (buildCounterOperation < 3) {
unittest.expect(o.done, unittest.isTrue);
checkStatus(o.error);
checkUnnamed825(o.metadata);
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed826(o.response);
}
buildCounterOperation--;
}
buildUnnamed827() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed827(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;
buildOperationMetadata() {
var o = new api.OperationMetadata();
buildCounterOperationMetadata++;
if (buildCounterOperationMetadata < 3) {
o.resourceNames = buildUnnamed827();
}
buildCounterOperationMetadata--;
return o;
}
checkOperationMetadata(api.OperationMetadata o) {
buildCounterOperationMetadata++;
if (buildCounterOperationMetadata < 3) {
checkUnnamed827(o.resourceNames);
}
buildCounterOperationMetadata--;
}
buildUnnamed828() {
var o = new core.Map<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;
}
checkUnnamed828(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;
buildOption() {
var o = new api.Option();
buildCounterOption++;
if (buildCounterOption < 3) {
o.name = "foo";
o.value = buildUnnamed828();
}
buildCounterOption--;
return o;
}
checkOption(api.Option o) {
buildCounterOption++;
if (buildCounterOption < 3) {
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed828(o.value);
}
buildCounterOption--;
}
buildUnnamed829() {
var o = new core.List<api.Page>();
o.add(buildPage());
o.add(buildPage());
return o;
}
checkUnnamed829(core.List<api.Page> o) {
unittest.expect(o, unittest.hasLength(2));
checkPage(o[0]);
checkPage(o[1]);
}
core.int buildCounterPage = 0;
buildPage() {
var o = new api.Page();
buildCounterPage++;
if (buildCounterPage < 3) {
o.content = "foo";
o.name = "foo";
o.subpages = buildUnnamed829();
}
buildCounterPage--;
return o;
}
checkPage(api.Page o) {
buildCounterPage++;
if (buildCounterPage < 3) {
unittest.expect(o.content, unittest.equals('foo'));
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed829(o.subpages);
}
buildCounterPage--;
}
buildUnnamed830() {
var o = new core.List<api.QuotaLimit>();
o.add(buildQuotaLimit());
o.add(buildQuotaLimit());
return o;
}
checkUnnamed830(core.List<api.QuotaLimit> o) {
unittest.expect(o, unittest.hasLength(2));
checkQuotaLimit(o[0]);
checkQuotaLimit(o[1]);
}
buildUnnamed831() {
var o = new core.List<api.MetricRule>();
o.add(buildMetricRule());
o.add(buildMetricRule());
return o;
}
checkUnnamed831(core.List<api.MetricRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkMetricRule(o[0]);
checkMetricRule(o[1]);
}
core.int buildCounterQuota = 0;
buildQuota() {
var o = new api.Quota();
buildCounterQuota++;
if (buildCounterQuota < 3) {
o.limits = buildUnnamed830();
o.metricRules = buildUnnamed831();
}
buildCounterQuota--;
return o;
}
checkQuota(api.Quota o) {
buildCounterQuota++;
if (buildCounterQuota < 3) {
checkUnnamed830(o.limits);
checkUnnamed831(o.metricRules);
}
buildCounterQuota--;
}
buildUnnamed832() {
var o = new core.Map<core.String, core.String>();
o["x"] = "foo";
o["y"] = "foo";
return o;
}
checkUnnamed832(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;
buildQuotaLimit() {
var o = new 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 = buildUnnamed832();
}
buildCounterQuotaLimit--;
return o;
}
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'));
checkUnnamed832(o.values);
}
buildCounterQuotaLimit--;
}
buildUnnamed833() {
var o = new core.Map<core.String, core.String>();
o["x"] = "foo";
o["y"] = "foo";
return o;
}
checkUnnamed833(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;
buildQuotaOverride() {
var o = new api.QuotaOverride();
buildCounterQuotaOverride++;
if (buildCounterQuotaOverride < 3) {
o.adminOverrideAncestor = "foo";
o.dimensions = buildUnnamed833();
o.metric = "foo";
o.name = "foo";
o.overrideValue = "foo";
o.unit = "foo";
}
buildCounterQuotaOverride--;
return o;
}
checkQuotaOverride(api.QuotaOverride o) {
buildCounterQuotaOverride++;
if (buildCounterQuotaOverride < 3) {
unittest.expect(o.adminOverrideAncestor, unittest.equals('foo'));
checkUnnamed833(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;
buildServiceIdentity() {
var o = new api.ServiceIdentity();
buildCounterServiceIdentity++;
if (buildCounterServiceIdentity < 3) {
o.email = "foo";
o.uniqueId = "foo";
}
buildCounterServiceIdentity--;
return o;
}
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;
buildSourceContext() {
var o = new api.SourceContext();
buildCounterSourceContext++;
if (buildCounterSourceContext < 3) {
o.fileName = "foo";
}
buildCounterSourceContext--;
return o;
}
checkSourceContext(api.SourceContext o) {
buildCounterSourceContext++;
if (buildCounterSourceContext < 3) {
unittest.expect(o.fileName, unittest.equals('foo'));
}
buildCounterSourceContext--;
}
buildUnnamed834() {
var o = new core.Map<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;
}
checkUnnamed834(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'));
}
buildUnnamed835() {
var o = new core.List<core.Map<core.String, core.Object>>();
o.add(buildUnnamed834());
o.add(buildUnnamed834());
return o;
}
checkUnnamed835(core.List<core.Map<core.String, core.Object>> o) {
unittest.expect(o, unittest.hasLength(2));
checkUnnamed834(o[0]);
checkUnnamed834(o[1]);
}
core.int buildCounterSourceInfo = 0;
buildSourceInfo() {
var o = new api.SourceInfo();
buildCounterSourceInfo++;
if (buildCounterSourceInfo < 3) {
o.sourceFiles = buildUnnamed835();
}
buildCounterSourceInfo--;
return o;
}
checkSourceInfo(api.SourceInfo o) {
buildCounterSourceInfo++;
if (buildCounterSourceInfo < 3) {
checkUnnamed835(o.sourceFiles);
}
buildCounterSourceInfo--;
}
buildUnnamed836() {
var o = new core.Map<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;
}
checkUnnamed836(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'));
}
buildUnnamed837() {
var o = new core.List<core.Map<core.String, core.Object>>();
o.add(buildUnnamed836());
o.add(buildUnnamed836());
return o;
}
checkUnnamed837(core.List<core.Map<core.String, core.Object>> o) {
unittest.expect(o, unittest.hasLength(2));
checkUnnamed836(o[0]);
checkUnnamed836(o[1]);
}
core.int buildCounterStatus = 0;
buildStatus() {
var o = new api.Status();
buildCounterStatus++;
if (buildCounterStatus < 3) {
o.code = 42;
o.details = buildUnnamed837();
o.message = "foo";
}
buildCounterStatus--;
return o;
}
checkStatus(api.Status o) {
buildCounterStatus++;
if (buildCounterStatus < 3) {
unittest.expect(o.code, unittest.equals(42));
checkUnnamed837(o.details);
unittest.expect(o.message, unittest.equals('foo'));
}
buildCounterStatus--;
}
core.int buildCounterSystemParameter = 0;
buildSystemParameter() {
var o = new api.SystemParameter();
buildCounterSystemParameter++;
if (buildCounterSystemParameter < 3) {
o.httpHeader = "foo";
o.name = "foo";
o.urlQueryParameter = "foo";
}
buildCounterSystemParameter--;
return o;
}
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--;
}
buildUnnamed838() {
var o = new core.List<api.SystemParameter>();
o.add(buildSystemParameter());
o.add(buildSystemParameter());
return o;
}
checkUnnamed838(core.List<api.SystemParameter> o) {
unittest.expect(o, unittest.hasLength(2));
checkSystemParameter(o[0]);
checkSystemParameter(o[1]);
}
core.int buildCounterSystemParameterRule = 0;
buildSystemParameterRule() {
var o = new api.SystemParameterRule();
buildCounterSystemParameterRule++;
if (buildCounterSystemParameterRule < 3) {
o.parameters = buildUnnamed838();
o.selector = "foo";
}
buildCounterSystemParameterRule--;
return o;
}
checkSystemParameterRule(api.SystemParameterRule o) {
buildCounterSystemParameterRule++;
if (buildCounterSystemParameterRule < 3) {
checkUnnamed838(o.parameters);
unittest.expect(o.selector, unittest.equals('foo'));
}
buildCounterSystemParameterRule--;
}
buildUnnamed839() {
var o = new core.List<api.SystemParameterRule>();
o.add(buildSystemParameterRule());
o.add(buildSystemParameterRule());
return o;
}
checkUnnamed839(core.List<api.SystemParameterRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkSystemParameterRule(o[0]);
checkSystemParameterRule(o[1]);
}
core.int buildCounterSystemParameters = 0;
buildSystemParameters() {
var o = new api.SystemParameters();
buildCounterSystemParameters++;
if (buildCounterSystemParameters < 3) {
o.rules = buildUnnamed839();
}
buildCounterSystemParameters--;
return o;
}
checkSystemParameters(api.SystemParameters o) {
buildCounterSystemParameters++;
if (buildCounterSystemParameters < 3) {
checkUnnamed839(o.rules);
}
buildCounterSystemParameters--;
}
buildUnnamed840() {
var o = new core.List<api.Field>();
o.add(buildField());
o.add(buildField());
return o;
}
checkUnnamed840(core.List<api.Field> o) {
unittest.expect(o, unittest.hasLength(2));
checkField(o[0]);
checkField(o[1]);
}
buildUnnamed841() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed841(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'));
}
buildUnnamed842() {
var o = new core.List<api.Option>();
o.add(buildOption());
o.add(buildOption());
return o;
}
checkUnnamed842(core.List<api.Option> o) {
unittest.expect(o, unittest.hasLength(2));
checkOption(o[0]);
checkOption(o[1]);
}
core.int buildCounterType = 0;
buildType() {
var o = new api.Type();
buildCounterType++;
if (buildCounterType < 3) {
o.fields = buildUnnamed840();
o.name = "foo";
o.oneofs = buildUnnamed841();
o.options = buildUnnamed842();
o.sourceContext = buildSourceContext();
o.syntax = "foo";
}
buildCounterType--;
return o;
}
checkType(api.Type o) {
buildCounterType++;
if (buildCounterType < 3) {
checkUnnamed840(o.fields);
unittest.expect(o.name, unittest.equals('foo'));
checkUnnamed841(o.oneofs);
checkUnnamed842(o.options);
checkSourceContext(o.sourceContext);
unittest.expect(o.syntax, unittest.equals('foo'));
}
buildCounterType--;
}
buildUnnamed843() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed843(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'));
}
buildUnnamed844() {
var o = new core.List<api.UsageRule>();
o.add(buildUsageRule());
o.add(buildUsageRule());
return o;
}
checkUnnamed844(core.List<api.UsageRule> o) {
unittest.expect(o, unittest.hasLength(2));
checkUsageRule(o[0]);
checkUsageRule(o[1]);
}
core.int buildCounterUsage = 0;
buildUsage() {
var o = new api.Usage();
buildCounterUsage++;
if (buildCounterUsage < 3) {
o.producerNotificationChannel = "foo";
o.requirements = buildUnnamed843();
o.rules = buildUnnamed844();
o.serviceIdentity = buildGoogleApiServiceIdentity();
}
buildCounterUsage--;
return o;
}
checkUsage(api.Usage o) {
buildCounterUsage++;
if (buildCounterUsage < 3) {
unittest.expect(o.producerNotificationChannel, unittest.equals('foo'));
checkUnnamed843(o.requirements);
checkUnnamed844(o.rules);
checkGoogleApiServiceIdentity(o.serviceIdentity);
}
buildCounterUsage--;
}
core.int buildCounterUsageRule = 0;
buildUsageRule() {
var o = new api.UsageRule();
buildCounterUsageRule++;
if (buildCounterUsageRule < 3) {
o.allowUnregisteredCalls = true;
o.selector = "foo";
o.skipServiceControl = true;
}
buildCounterUsageRule--;
return o;
}
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--;
}
buildUnnamed845() {
var o = new core.List<core.String>();
o.add("foo");
o.add("foo");
return o;
}
checkUnnamed845(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'));
}
main() {
unittest.group("obj-schema-AdminQuotaPolicy", () {
unittest.test("to-json--from-json", () {
var o = buildAdminQuotaPolicy();
var od = new api.AdminQuotaPolicy.fromJson(o.toJson());
checkAdminQuotaPolicy(od);
});
});
unittest.group("obj-schema-Api", () {
unittest.test("to-json--from-json", () {
var o = buildApi();
var od = new api.Api.fromJson(o.toJson());
checkApi(od);
});
});
unittest.group("obj-schema-AuthProvider", () {
unittest.test("to-json--from-json", () {
var o = buildAuthProvider();
var od = new api.AuthProvider.fromJson(o.toJson());
checkAuthProvider(od);
});
});
unittest.group("obj-schema-AuthRequirement", () {
unittest.test("to-json--from-json", () {
var o = buildAuthRequirement();
var od = new api.AuthRequirement.fromJson(o.toJson());
checkAuthRequirement(od);
});
});
unittest.group("obj-schema-Authentication", () {
unittest.test("to-json--from-json", () {
var o = buildAuthentication();
var od = new api.Authentication.fromJson(o.toJson());
checkAuthentication(od);
});
});
unittest.group("obj-schema-AuthenticationRule", () {
unittest.test("to-json--from-json", () {
var o = buildAuthenticationRule();
var od = new api.AuthenticationRule.fromJson(o.toJson());
checkAuthenticationRule(od);
});
});
unittest.group("obj-schema-Backend", () {
unittest.test("to-json--from-json", () {
var o = buildBackend();
var od = new api.Backend.fromJson(o.toJson());
checkBackend(od);
});
});
unittest.group("obj-schema-BackendRule", () {
unittest.test("to-json--from-json", () {
var o = buildBackendRule();
var od = new api.BackendRule.fromJson(o.toJson());
checkBackendRule(od);
});
});
unittest.group("obj-schema-BatchCreateAdminOverridesResponse", () {
unittest.test("to-json--from-json", () {
var o = buildBatchCreateAdminOverridesResponse();
var od = new api.BatchCreateAdminOverridesResponse.fromJson(o.toJson());
checkBatchCreateAdminOverridesResponse(od);
});
});
unittest.group("obj-schema-BatchCreateConsumerOverridesResponse", () {
unittest.test("to-json--from-json", () {
var o = buildBatchCreateConsumerOverridesResponse();
var od =
new api.BatchCreateConsumerOverridesResponse.fromJson(o.toJson());
checkBatchCreateConsumerOverridesResponse(od);
});
});
unittest.group("obj-schema-BatchEnableServicesRequest", () {
unittest.test("to-json--from-json", () {
var o = buildBatchEnableServicesRequest();
var od = new api.BatchEnableServicesRequest.fromJson(o.toJson());
checkBatchEnableServicesRequest(od);
});
});
unittest.group("obj-schema-BatchEnableServicesResponse", () {
unittest.test("to-json--from-json", () {
var o = buildBatchEnableServicesResponse();
var od = new api.BatchEnableServicesResponse.fromJson(o.toJson());
checkBatchEnableServicesResponse(od);
});
});
unittest.group("obj-schema-BatchGetServicesResponse", () {
unittest.test("to-json--from-json", () {
var o = buildBatchGetServicesResponse();
var od = new api.BatchGetServicesResponse.fromJson(o.toJson());
checkBatchGetServicesResponse(od);
});
});
unittest.group("obj-schema-Billing", () {
unittest.test("to-json--from-json", () {
var o = buildBilling();
var od = new api.Billing.fromJson(o.toJson());
checkBilling(od);
});
});
unittest.group("obj-schema-BillingDestination", () {
unittest.test("to-json--from-json", () {
var o = buildBillingDestination();
var od = new api.BillingDestination.fromJson(o.toJson());
checkBillingDestination(od);
});
});
unittest.group("obj-schema-CancelOperationRequest", () {
unittest.test("to-json--from-json", () {
var o = buildCancelOperationRequest();
var od = new api.CancelOperationRequest.fromJson(o.toJson());
checkCancelOperationRequest(od);
});
});
unittest.group("obj-schema-Context", () {
unittest.test("to-json--from-json", () {
var o = buildContext();
var od = new api.Context.fromJson(o.toJson());
checkContext(od);
});
});
unittest.group("obj-schema-ContextRule", () {
unittest.test("to-json--from-json", () {
var o = buildContextRule();
var od = new api.ContextRule.fromJson(o.toJson());
checkContextRule(od);
});
});
unittest.group("obj-schema-Control", () {
unittest.test("to-json--from-json", () {
var o = buildControl();
var od = new api.Control.fromJson(o.toJson());
checkControl(od);
});
});
unittest.group("obj-schema-CustomError", () {
unittest.test("to-json--from-json", () {
var o = buildCustomError();
var od = new api.CustomError.fromJson(o.toJson());
checkCustomError(od);
});
});
unittest.group("obj-schema-CustomErrorRule", () {
unittest.test("to-json--from-json", () {
var o = buildCustomErrorRule();
var od = new api.CustomErrorRule.fromJson(o.toJson());
checkCustomErrorRule(od);
});
});
unittest.group("obj-schema-CustomHttpPattern", () {
unittest.test("to-json--from-json", () {
var o = buildCustomHttpPattern();
var od = new api.CustomHttpPattern.fromJson(o.toJson());
checkCustomHttpPattern(od);
});
});
unittest.group("obj-schema-DisableServiceRequest", () {
unittest.test("to-json--from-json", () {
var o = buildDisableServiceRequest();
var od = new api.DisableServiceRequest.fromJson(o.toJson());
checkDisableServiceRequest(od);
});
});
unittest.group("obj-schema-DisableServiceResponse", () {
unittest.test("to-json--from-json", () {
var o = buildDisableServiceResponse();
var od = new api.DisableServiceResponse.fromJson(o.toJson());
checkDisableServiceResponse(od);
});
});
unittest.group("obj-schema-Documentation", () {
unittest.test("to-json--from-json", () {
var o = buildDocumentation();
var od = new api.Documentation.fromJson(o.toJson());
checkDocumentation(od);
});
});
unittest.group("obj-schema-DocumentationRule", () {
unittest.test("to-json--from-json", () {
var o = buildDocumentationRule();
var od = new api.DocumentationRule.fromJson(o.toJson());
checkDocumentationRule(od);
});
});
unittest.group("obj-schema-Empty", () {
unittest.test("to-json--from-json", () {
var o = buildEmpty();
var od = new api.Empty.fromJson(o.toJson());
checkEmpty(od);
});
});
unittest.group("obj-schema-EnableFailure", () {
unittest.test("to-json--from-json", () {
var o = buildEnableFailure();
var od = new api.EnableFailure.fromJson(o.toJson());
checkEnableFailure(od);
});
});
unittest.group("obj-schema-EnableServiceRequest", () {
unittest.test("to-json--from-json", () {
var o = buildEnableServiceRequest();
var od = new api.EnableServiceRequest.fromJson(o.toJson());
checkEnableServiceRequest(od);
});
});
unittest.group("obj-schema-EnableServiceResponse", () {
unittest.test("to-json--from-json", () {
var o = buildEnableServiceResponse();
var od = new api.EnableServiceResponse.fromJson(o.toJson());
checkEnableServiceResponse(od);
});
});
unittest.group("obj-schema-Endpoint", () {
unittest.test("to-json--from-json", () {
var o = buildEndpoint();
var od = new api.Endpoint.fromJson(o.toJson());
checkEndpoint(od);
});
});
unittest.group("obj-schema-Enum", () {
unittest.test("to-json--from-json", () {
var o = buildEnum();
var od = new api.Enum.fromJson(o.toJson());
checkEnum(od);
});
});
unittest.group("obj-schema-EnumValue", () {
unittest.test("to-json--from-json", () {
var o = buildEnumValue();
var od = new api.EnumValue.fromJson(o.toJson());
checkEnumValue(od);
});
});
unittest.group("obj-schema-Field", () {
unittest.test("to-json--from-json", () {
var o = buildField();
var od = new api.Field.fromJson(o.toJson());
checkField(od);
});
});
unittest.group("obj-schema-GetServiceIdentityResponse", () {
unittest.test("to-json--from-json", () {
var o = buildGetServiceIdentityResponse();
var od = new api.GetServiceIdentityResponse.fromJson(o.toJson());
checkGetServiceIdentityResponse(od);
});
});
unittest.group("obj-schema-GoogleApiService", () {
unittest.test("to-json--from-json", () {
var o = buildGoogleApiService();
var od = new api.GoogleApiService.fromJson(o.toJson());
checkGoogleApiService(od);
});
});
unittest.group("obj-schema-GoogleApiServiceIdentity", () {
unittest.test("to-json--from-json", () {
var o = buildGoogleApiServiceIdentity();
var od = new api.GoogleApiServiceIdentity.fromJson(o.toJson());
checkGoogleApiServiceIdentity(od);
});
});
unittest.group("obj-schema-GoogleApiServiceusageV1OperationMetadata", () {
unittest.test("to-json--from-json", () {
var o = buildGoogleApiServiceusageV1OperationMetadata();
var od =
new api.GoogleApiServiceusageV1OperationMetadata.fromJson(o.toJson());
checkGoogleApiServiceusageV1OperationMetadata(od);
});
});
unittest.group("obj-schema-GoogleApiServiceusageV1Service", () {
unittest.test("to-json--from-json", () {
var o = buildGoogleApiServiceusageV1Service();
var od = new api.GoogleApiServiceusageV1Service.fromJson(o.toJson());
checkGoogleApiServiceusageV1Service(od);
});
});
unittest.group("obj-schema-GoogleApiServiceusageV1ServiceConfig", () {
unittest.test("to-json--from-json", () {
var o = buildGoogleApiServiceusageV1ServiceConfig();
var od =
new api.GoogleApiServiceusageV1ServiceConfig.fromJson(o.toJson());
checkGoogleApiServiceusageV1ServiceConfig(od);
});
});
unittest.group(
"obj-schema-GoogleApiServiceusageV1beta1GetServiceIdentityResponse", () {
unittest.test("to-json--from-json", () {
var o = buildGoogleApiServiceusageV1beta1GetServiceIdentityResponse();
var od = new api
.GoogleApiServiceusageV1beta1GetServiceIdentityResponse.fromJson(
o.toJson());
checkGoogleApiServiceusageV1beta1GetServiceIdentityResponse(od);
});
});
unittest.group("obj-schema-GoogleApiServiceusageV1beta1ServiceIdentity", () {
unittest.test("to-json--from-json", () {
var o = buildGoogleApiServiceusageV1beta1ServiceIdentity();
var od = new api.GoogleApiServiceusageV1beta1ServiceIdentity.fromJson(
o.toJson());
checkGoogleApiServiceusageV1beta1ServiceIdentity(od);
});
});
unittest.group("obj-schema-Http", () {
unittest.test("to-json--from-json", () {
var o = buildHttp();
var od = new api.Http.fromJson(o.toJson());
checkHttp(od);
});
});
unittest.group("obj-schema-HttpRule", () {
unittest.test("to-json--from-json", () {
var o = buildHttpRule();
var od = new api.HttpRule.fromJson(o.toJson());
checkHttpRule(od);
});
});
unittest.group("obj-schema-ImportAdminOverridesResponse", () {
unittest.test("to-json--from-json", () {
var o = buildImportAdminOverridesResponse();
var od = new api.ImportAdminOverridesResponse.fromJson(o.toJson());
checkImportAdminOverridesResponse(od);
});
});
unittest.group("obj-schema-ImportAdminQuotaPoliciesResponse", () {
unittest.test("to-json--from-json", () {
var o = buildImportAdminQuotaPoliciesResponse();
var od = new api.ImportAdminQuotaPoliciesResponse.fromJson(o.toJson());
checkImportAdminQuotaPoliciesResponse(od);
});
});
unittest.group("obj-schema-ImportConsumerOverridesResponse", () {
unittest.test("to-json--from-json", () {
var o = buildImportConsumerOverridesResponse();
var od = new api.ImportConsumerOverridesResponse.fromJson(o.toJson());
checkImportConsumerOverridesResponse(od);
});
});
unittest.group("obj-schema-JwtLocation", () {
unittest.test("to-json--from-json", () {
var o = buildJwtLocation();
var od = new api.JwtLocation.fromJson(o.toJson());
checkJwtLocation(od);
});
});
unittest.group("obj-schema-LabelDescriptor", () {
unittest.test("to-json--from-json", () {
var o = buildLabelDescriptor();
var od = new api.LabelDescriptor.fromJson(o.toJson());
checkLabelDescriptor(od);
});
});
unittest.group("obj-schema-ListOperationsResponse", () {
unittest.test("to-json--from-json", () {
var o = buildListOperationsResponse();
var od = new api.ListOperationsResponse.fromJson(o.toJson());
checkListOperationsResponse(od);
});
});
unittest.group("obj-schema-ListServicesResponse", () {
unittest.test("to-json--from-json", () {
var o = buildListServicesResponse();
var od = new api.ListServicesResponse.fromJson(o.toJson());
checkListServicesResponse(od);
});
});
unittest.group("obj-schema-LogDescriptor", () {
unittest.test("to-json--from-json", () {
var o = buildLogDescriptor();
var od = new api.LogDescriptor.fromJson(o.toJson());
checkLogDescriptor(od);
});
});
unittest.group("obj-schema-Logging", () {
unittest.test("to-json--from-json", () {
var o = buildLogging();
var od = new api.Logging.fromJson(o.toJson());
checkLogging(od);
});
});
unittest.group("obj-schema-LoggingDestination", () {
unittest.test("to-json--from-json", () {
var o = buildLoggingDestination();
var od = new api.LoggingDestination.fromJson(o.toJson());
checkLoggingDestination(od);
});
});
unittest.group("obj-schema-Method", () {
unittest.test("to-json--from-json", () {
var o = buildMethod();
var od = new api.Method.fromJson(o.toJson());
checkMethod(od);
});
});
unittest.group("obj-schema-MetricDescriptor", () {
unittest.test("to-json--from-json", () {
var o = buildMetricDescriptor();
var od = new api.MetricDescriptor.fromJson(o.toJson());
checkMetricDescriptor(od);
});
});
unittest.group("obj-schema-MetricDescriptorMetadata", () {
unittest.test("to-json--from-json", () {
var o = buildMetricDescriptorMetadata();
var od = new api.MetricDescriptorMetadata.fromJson(o.toJson());
checkMetricDescriptorMetadata(od);
});
});
unittest.group("obj-schema-MetricRule", () {
unittest.test("to-json--from-json", () {
var o = buildMetricRule();
var od = new api.MetricRule.fromJson(o.toJson());
checkMetricRule(od);
});
});
unittest.group("obj-schema-Mixin", () {
unittest.test("to-json--from-json", () {
var o = buildMixin();
var od = new api.Mixin.fromJson(o.toJson());
checkMixin(od);
});
});
unittest.group("obj-schema-MonitoredResourceDescriptor", () {
unittest.test("to-json--from-json", () {
var o = buildMonitoredResourceDescriptor();
var od = new api.MonitoredResourceDescriptor.fromJson(o.toJson());
checkMonitoredResourceDescriptor(od);
});
});
unittest.group("obj-schema-Monitoring", () {
unittest.test("to-json--from-json", () {
var o = buildMonitoring();
var od = new api.Monitoring.fromJson(o.toJson());
checkMonitoring(od);
});
});
unittest.group("obj-schema-MonitoringDestination", () {
unittest.test("to-json--from-json", () {
var o = buildMonitoringDestination();
var od = new api.MonitoringDestination.fromJson(o.toJson());
checkMonitoringDestination(od);
});
});
unittest.group("obj-schema-OAuthRequirements", () {
unittest.test("to-json--from-json", () {
var o = buildOAuthRequirements();
var od = new api.OAuthRequirements.fromJson(o.toJson());
checkOAuthRequirements(od);
});
});
unittest.group("obj-schema-Operation", () {
unittest.test("to-json--from-json", () {
var o = buildOperation();
var od = new api.Operation.fromJson(o.toJson());
checkOperation(od);
});
});
unittest.group("obj-schema-OperationMetadata", () {
unittest.test("to-json--from-json", () {
var o = buildOperationMetadata();
var od = new api.OperationMetadata.fromJson(o.toJson());
checkOperationMetadata(od);
});
});
unittest.group("obj-schema-Option", () {
unittest.test("to-json--from-json", () {
var o = buildOption();
var od = new api.Option.fromJson(o.toJson());
checkOption(od);
});
});
unittest.group("obj-schema-Page", () {
unittest.test("to-json--from-json", () {
var o = buildPage();
var od = new api.Page.fromJson(o.toJson());
checkPage(od);
});
});
unittest.group("obj-schema-Quota", () {
unittest.test("to-json--from-json", () {
var o = buildQuota();
var od = new api.Quota.fromJson(o.toJson());
checkQuota(od);
});
});
unittest.group("obj-schema-QuotaLimit", () {
unittest.test("to-json--from-json", () {
var o = buildQuotaLimit();
var od = new api.QuotaLimit.fromJson(o.toJson());
checkQuotaLimit(od);
});
});
unittest.group("obj-schema-QuotaOverride", () {
unittest.test("to-json--from-json", () {
var o = buildQuotaOverride();
var od = new api.QuotaOverride.fromJson(o.toJson());
checkQuotaOverride(od);
});
});
unittest.group("obj-schema-ServiceIdentity", () {
unittest.test("to-json--from-json", () {
var o = buildServiceIdentity();
var od = new api.ServiceIdentity.fromJson(o.toJson());
checkServiceIdentity(od);
});
});
unittest.group("obj-schema-SourceContext", () {
unittest.test("to-json--from-json", () {
var o = buildSourceContext();
var od = new api.SourceContext.fromJson(o.toJson());
checkSourceContext(od);
});
});
unittest.group("obj-schema-SourceInfo", () {
unittest.test("to-json--from-json", () {
var o = buildSourceInfo();
var od = new api.SourceInfo.fromJson(o.toJson());
checkSourceInfo(od);
});
});
unittest.group("obj-schema-Status", () {
unittest.test("to-json--from-json", () {
var o = buildStatus();
var od = new api.Status.fromJson(o.toJson());
checkStatus(od);
});
});
unittest.group("obj-schema-SystemParameter", () {
unittest.test("to-json--from-json", () {
var o = buildSystemParameter();
var od = new api.SystemParameter.fromJson(o.toJson());
checkSystemParameter(od);
});
});
unittest.group("obj-schema-SystemParameterRule", () {
unittest.test("to-json--from-json", () {
var o = buildSystemParameterRule();
var od = new api.SystemParameterRule.fromJson(o.toJson());
checkSystemParameterRule(od);
});
});
unittest.group("obj-schema-SystemParameters", () {
unittest.test("to-json--from-json", () {
var o = buildSystemParameters();
var od = new api.SystemParameters.fromJson(o.toJson());
checkSystemParameters(od);
});
});
unittest.group("obj-schema-Type", () {
unittest.test("to-json--from-json", () {
var o = buildType();
var od = new api.Type.fromJson(o.toJson());
checkType(od);
});
});
unittest.group("obj-schema-Usage", () {
unittest.test("to-json--from-json", () {
var o = buildUsage();
var od = new api.Usage.fromJson(o.toJson());
checkUsage(od);
});
});
unittest.group("obj-schema-UsageRule", () {
unittest.test("to-json--from-json", () {
var o = buildUsageRule();
var od = new api.UsageRule.fromJson(o.toJson());
checkUsageRule(od);
});
});
unittest.group("resource-OperationsResourceApi", () {
unittest.test("method--cancel", () {
var mock = new HttpServerMock();
api.OperationsResourceApi res = new 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 = new api.CancelOperationRequest.fromJson(json);
checkCancelOperationRequest(obj);
var path = (req.url).path;
var pathOffset = 0;
var index;
var 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>>{};
addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
parseBool(n) {
if (n == "true") return true;
if (n == "false") return false;
if (n == null) return null;
throw new core.ArgumentError("Invalid boolean: $n");
}
if (query.length > 0) {
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 new 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 = new HttpServerMock();
api.OperationsResourceApi res = new 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;
var index;
var 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>>{};
addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
parseBool(n) {
if (n == "true") return true;
if (n == "false") return false;
if (n == null) return null;
throw new core.ArgumentError("Invalid boolean: $n");
}
if (query.length > 0) {
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 new 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 = new HttpServerMock();
api.OperationsResourceApi res = new 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;
var index;
var 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>>{};
addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
parseBool(n) {
if (n == "true") return true;
if (n == "false") return false;
if (n == null) return null;
throw new core.ArgumentError("Invalid boolean: $n");
}
if (query.length > 0) {
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 new 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 = new HttpServerMock();
api.OperationsResourceApi res = new api.ServiceusageApi(mock).operations;
var arg_pageSize = 42;
var arg_name = "foo";
var arg_filter = "foo";
var arg_pageToken = "foo";
var arg_$fields = "foo";
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
var index;
var 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>>{};
addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
parseBool(n) {
if (n == "true") return true;
if (n == "false") return false;
if (n == null) return null;
throw new core.ArgumentError("Invalid boolean: $n");
}
if (query.length > 0) {
for (var part in query.split("&")) {
var keyvalue = part.split("=");
addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
core.Uri.decodeQueryComponent(keyvalue[1]));
}
}
unittest.expect(core.int.parse(queryMap["pageSize"].first),
unittest.equals(arg_pageSize));
unittest.expect(queryMap["name"].first, unittest.equals(arg_name));
unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
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 new async.Future.value(stringResponse(200, h, resp));
}), true);
res
.list(
pageSize: arg_pageSize,
name: arg_name,
filter: arg_filter,
pageToken: arg_pageToken,
$fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkListOperationsResponse(response);
})));
});
});
unittest.group("resource-ServicesResourceApi", () {
unittest.test("method--batchEnable", () {
var mock = new HttpServerMock();
api.ServicesResourceApi res = new 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 = new api.BatchEnableServicesRequest.fromJson(json);
checkBatchEnableServicesRequest(obj);
var path = (req.url).path;
var pathOffset = 0;
var index;
var 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>>{};
addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
parseBool(n) {
if (n == "true") return true;
if (n == "false") return false;
if (n == null) return null;
throw new core.ArgumentError("Invalid boolean: $n");
}
if (query.length > 0) {
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 new 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 = new HttpServerMock();
api.ServicesResourceApi res = new api.ServiceusageApi(mock).services;
var arg_parent = "foo";
var arg_names = buildUnnamed845();
var arg_$fields = "foo";
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
var index;
var 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>>{};
addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
parseBool(n) {
if (n == "true") return true;
if (n == "false") return false;
if (n == null) return null;
throw new core.ArgumentError("Invalid boolean: $n");
}
if (query.length > 0) {
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 new 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 = new HttpServerMock();
api.ServicesResourceApi res = new 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 = new api.DisableServiceRequest.fromJson(json);
checkDisableServiceRequest(obj);
var path = (req.url).path;
var pathOffset = 0;
var index;
var 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>>{};
addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
parseBool(n) {
if (n == "true") return true;
if (n == "false") return false;
if (n == null) return null;
throw new core.ArgumentError("Invalid boolean: $n");
}
if (query.length > 0) {
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 new 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 = new HttpServerMock();
api.ServicesResourceApi res = new 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 = new api.EnableServiceRequest.fromJson(json);
checkEnableServiceRequest(obj);
var path = (req.url).path;
var pathOffset = 0;
var index;
var 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>>{};
addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
parseBool(n) {
if (n == "true") return true;
if (n == "false") return false;
if (n == null) return null;
throw new core.ArgumentError("Invalid boolean: $n");
}
if (query.length > 0) {
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 new 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 = new HttpServerMock();
api.ServicesResourceApi res = new 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;
var index;
var 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>>{};
addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
parseBool(n) {
if (n == "true") return true;
if (n == "false") return false;
if (n == null) return null;
throw new core.ArgumentError("Invalid boolean: $n");
}
if (query.length > 0) {
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 new 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 = new HttpServerMock();
api.ServicesResourceApi res = new api.ServiceusageApi(mock).services;
var arg_parent = "foo";
var arg_pageSize = 42;
var arg_pageToken = "foo";
var arg_filter = "foo";
var arg_$fields = "foo";
mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
var path = (req.url).path;
var pathOffset = 0;
var index;
var 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>>{};
addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
parseBool(n) {
if (n == "true") return true;
if (n == "false") return false;
if (n == null) return null;
throw new core.ArgumentError("Invalid boolean: $n");
}
if (query.length > 0) {
for (var part in query.split("&")) {
var keyvalue = part.split("=");
addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
core.Uri.decodeQueryComponent(keyvalue[1]));
}
}
unittest.expect(core.int.parse(queryMap["pageSize"].first),
unittest.equals(arg_pageSize));
unittest.expect(
queryMap["pageToken"].first, unittest.equals(arg_pageToken));
unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
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 new async.Future.value(stringResponse(200, h, resp));
}), true);
res
.list(arg_parent,
pageSize: arg_pageSize,
pageToken: arg_pageToken,
filter: arg_filter,
$fields: arg_$fields)
.then(unittest.expectAsync1(((response) {
checkListServicesResponse(response);
})));
});
});
}