| library googleapis.serviceconsumermanagement.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/serviceconsumermanagement/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); |
| } |
| |
| core.int buildCounterAddTenantProjectRequest = 0; |
| buildAddTenantProjectRequest() { |
| var o = new api.AddTenantProjectRequest(); |
| buildCounterAddTenantProjectRequest++; |
| if (buildCounterAddTenantProjectRequest < 3) { |
| o.projectConfig = buildTenantProjectConfig(); |
| o.tag = "foo"; |
| } |
| buildCounterAddTenantProjectRequest--; |
| return o; |
| } |
| |
| checkAddTenantProjectRequest(api.AddTenantProjectRequest o) { |
| buildCounterAddTenantProjectRequest++; |
| if (buildCounterAddTenantProjectRequest < 3) { |
| checkTenantProjectConfig(o.projectConfig); |
| unittest.expect(o.tag, unittest.equals('foo')); |
| } |
| buildCounterAddTenantProjectRequest--; |
| } |
| |
| buildUnnamed3512() { |
| var o = new core.List<api.Method>(); |
| o.add(buildMethod()); |
| o.add(buildMethod()); |
| return o; |
| } |
| |
| checkUnnamed3512(core.List<api.Method> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMethod(o[0]); |
| checkMethod(o[1]); |
| } |
| |
| buildUnnamed3513() { |
| var o = new core.List<api.Mixin>(); |
| o.add(buildMixin()); |
| o.add(buildMixin()); |
| return o; |
| } |
| |
| checkUnnamed3513(core.List<api.Mixin> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMixin(o[0]); |
| checkMixin(o[1]); |
| } |
| |
| buildUnnamed3514() { |
| var o = new core.List<api.Option>(); |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| checkUnnamed3514(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 = buildUnnamed3512(); |
| o.mixins = buildUnnamed3513(); |
| o.name = "foo"; |
| o.options = buildUnnamed3514(); |
| o.sourceContext = buildSourceContext(); |
| o.syntax = "foo"; |
| o.version = "foo"; |
| } |
| buildCounterApi--; |
| return o; |
| } |
| |
| checkApi(api.Api o) { |
| buildCounterApi++; |
| if (buildCounterApi < 3) { |
| checkUnnamed3512(o.methods); |
| checkUnnamed3513(o.mixins); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed3514(o.options); |
| checkSourceContext(o.sourceContext); |
| unittest.expect(o.syntax, unittest.equals('foo')); |
| unittest.expect(o.version, unittest.equals('foo')); |
| } |
| buildCounterApi--; |
| } |
| |
| 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"; |
| } |
| 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')); |
| } |
| 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--; |
| } |
| |
| buildUnnamed3515() { |
| var o = new core.List<api.AuthProvider>(); |
| o.add(buildAuthProvider()); |
| o.add(buildAuthProvider()); |
| return o; |
| } |
| |
| checkUnnamed3515(core.List<api.AuthProvider> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuthProvider(o[0]); |
| checkAuthProvider(o[1]); |
| } |
| |
| buildUnnamed3516() { |
| var o = new core.List<api.AuthenticationRule>(); |
| o.add(buildAuthenticationRule()); |
| o.add(buildAuthenticationRule()); |
| return o; |
| } |
| |
| checkUnnamed3516(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 = buildUnnamed3515(); |
| o.rules = buildUnnamed3516(); |
| } |
| buildCounterAuthentication--; |
| return o; |
| } |
| |
| checkAuthentication(api.Authentication o) { |
| buildCounterAuthentication++; |
| if (buildCounterAuthentication < 3) { |
| checkUnnamed3515(o.providers); |
| checkUnnamed3516(o.rules); |
| } |
| buildCounterAuthentication--; |
| } |
| |
| buildUnnamed3517() { |
| var o = new core.List<api.AuthRequirement>(); |
| o.add(buildAuthRequirement()); |
| o.add(buildAuthRequirement()); |
| return o; |
| } |
| |
| checkUnnamed3517(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.customAuth = buildCustomAuthRequirements(); |
| o.oauth = buildOAuthRequirements(); |
| o.requirements = buildUnnamed3517(); |
| o.selector = "foo"; |
| } |
| buildCounterAuthenticationRule--; |
| return o; |
| } |
| |
| checkAuthenticationRule(api.AuthenticationRule o) { |
| buildCounterAuthenticationRule++; |
| if (buildCounterAuthenticationRule < 3) { |
| unittest.expect(o.allowWithoutCredential, unittest.isTrue); |
| checkCustomAuthRequirements(o.customAuth); |
| checkOAuthRequirements(o.oauth); |
| checkUnnamed3517(o.requirements); |
| unittest.expect(o.selector, unittest.equals('foo')); |
| } |
| buildCounterAuthenticationRule--; |
| } |
| |
| core.int buildCounterAuthorizationConfig = 0; |
| buildAuthorizationConfig() { |
| var o = new api.AuthorizationConfig(); |
| buildCounterAuthorizationConfig++; |
| if (buildCounterAuthorizationConfig < 3) { |
| o.provider = "foo"; |
| } |
| buildCounterAuthorizationConfig--; |
| return o; |
| } |
| |
| checkAuthorizationConfig(api.AuthorizationConfig o) { |
| buildCounterAuthorizationConfig++; |
| if (buildCounterAuthorizationConfig < 3) { |
| unittest.expect(o.provider, unittest.equals('foo')); |
| } |
| buildCounterAuthorizationConfig--; |
| } |
| |
| core.int buildCounterAuthorizationRule = 0; |
| buildAuthorizationRule() { |
| var o = new api.AuthorizationRule(); |
| buildCounterAuthorizationRule++; |
| if (buildCounterAuthorizationRule < 3) { |
| o.permissions = "foo"; |
| o.selector = "foo"; |
| } |
| buildCounterAuthorizationRule--; |
| return o; |
| } |
| |
| checkAuthorizationRule(api.AuthorizationRule o) { |
| buildCounterAuthorizationRule++; |
| if (buildCounterAuthorizationRule < 3) { |
| unittest.expect(o.permissions, unittest.equals('foo')); |
| unittest.expect(o.selector, unittest.equals('foo')); |
| } |
| buildCounterAuthorizationRule--; |
| } |
| |
| buildUnnamed3518() { |
| var o = new core.List<api.BackendRule>(); |
| o.add(buildBackendRule()); |
| o.add(buildBackendRule()); |
| return o; |
| } |
| |
| checkUnnamed3518(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 = buildUnnamed3518(); |
| } |
| buildCounterBackend--; |
| return o; |
| } |
| |
| checkBackend(api.Backend o) { |
| buildCounterBackend++; |
| if (buildCounterBackend < 3) { |
| checkUnnamed3518(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.minDeadline = 42.0; |
| 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.minDeadline, unittest.equals(42.0)); |
| unittest.expect(o.selector, unittest.equals('foo')); |
| } |
| buildCounterBackendRule--; |
| } |
| |
| buildUnnamed3519() { |
| var o = new core.List<api.BillingDestination>(); |
| o.add(buildBillingDestination()); |
| o.add(buildBillingDestination()); |
| return o; |
| } |
| |
| checkUnnamed3519(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 = buildUnnamed3519(); |
| } |
| buildCounterBilling--; |
| return o; |
| } |
| |
| checkBilling(api.Billing o) { |
| buildCounterBilling++; |
| if (buildCounterBilling < 3) { |
| checkUnnamed3519(o.consumerDestinations); |
| } |
| buildCounterBilling--; |
| } |
| |
| core.int buildCounterBillingConfig = 0; |
| buildBillingConfig() { |
| var o = new api.BillingConfig(); |
| buildCounterBillingConfig++; |
| if (buildCounterBillingConfig < 3) { |
| o.billingAccount = "foo"; |
| } |
| buildCounterBillingConfig--; |
| return o; |
| } |
| |
| checkBillingConfig(api.BillingConfig o) { |
| buildCounterBillingConfig++; |
| if (buildCounterBillingConfig < 3) { |
| unittest.expect(o.billingAccount, unittest.equals('foo')); |
| } |
| buildCounterBillingConfig--; |
| } |
| |
| buildUnnamed3520() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3520(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 = buildUnnamed3520(); |
| o.monitoredResource = "foo"; |
| } |
| buildCounterBillingDestination--; |
| return o; |
| } |
| |
| checkBillingDestination(api.BillingDestination o) { |
| buildCounterBillingDestination++; |
| if (buildCounterBillingDestination < 3) { |
| checkUnnamed3520(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--; |
| } |
| |
| buildUnnamed3521() { |
| var o = new core.List<api.ContextRule>(); |
| o.add(buildContextRule()); |
| o.add(buildContextRule()); |
| return o; |
| } |
| |
| checkUnnamed3521(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 = buildUnnamed3521(); |
| } |
| buildCounterContext--; |
| return o; |
| } |
| |
| checkContext(api.Context o) { |
| buildCounterContext++; |
| if (buildCounterContext < 3) { |
| checkUnnamed3521(o.rules); |
| } |
| buildCounterContext--; |
| } |
| |
| buildUnnamed3522() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3522(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')); |
| } |
| |
| buildUnnamed3523() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3523(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.provided = buildUnnamed3522(); |
| o.requested = buildUnnamed3523(); |
| o.selector = "foo"; |
| } |
| buildCounterContextRule--; |
| return o; |
| } |
| |
| checkContextRule(api.ContextRule o) { |
| buildCounterContextRule++; |
| if (buildCounterContextRule < 3) { |
| checkUnnamed3522(o.provided); |
| checkUnnamed3523(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--; |
| } |
| |
| core.int buildCounterCreateTenancyUnitRequest = 0; |
| buildCreateTenancyUnitRequest() { |
| var o = new api.CreateTenancyUnitRequest(); |
| buildCounterCreateTenancyUnitRequest++; |
| if (buildCounterCreateTenancyUnitRequest < 3) { |
| o.tenancyUnitId = "foo"; |
| } |
| buildCounterCreateTenancyUnitRequest--; |
| return o; |
| } |
| |
| checkCreateTenancyUnitRequest(api.CreateTenancyUnitRequest o) { |
| buildCounterCreateTenancyUnitRequest++; |
| if (buildCounterCreateTenancyUnitRequest < 3) { |
| unittest.expect(o.tenancyUnitId, unittest.equals('foo')); |
| } |
| buildCounterCreateTenancyUnitRequest--; |
| } |
| |
| core.int buildCounterCustomAuthRequirements = 0; |
| buildCustomAuthRequirements() { |
| var o = new api.CustomAuthRequirements(); |
| buildCounterCustomAuthRequirements++; |
| if (buildCounterCustomAuthRequirements < 3) { |
| o.provider = "foo"; |
| } |
| buildCounterCustomAuthRequirements--; |
| return o; |
| } |
| |
| checkCustomAuthRequirements(api.CustomAuthRequirements o) { |
| buildCounterCustomAuthRequirements++; |
| if (buildCounterCustomAuthRequirements < 3) { |
| unittest.expect(o.provider, unittest.equals('foo')); |
| } |
| buildCounterCustomAuthRequirements--; |
| } |
| |
| buildUnnamed3524() { |
| var o = new core.List<api.CustomErrorRule>(); |
| o.add(buildCustomErrorRule()); |
| o.add(buildCustomErrorRule()); |
| return o; |
| } |
| |
| checkUnnamed3524(core.List<api.CustomErrorRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkCustomErrorRule(o[0]); |
| checkCustomErrorRule(o[1]); |
| } |
| |
| buildUnnamed3525() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3525(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 = buildUnnamed3524(); |
| o.types = buildUnnamed3525(); |
| } |
| buildCounterCustomError--; |
| return o; |
| } |
| |
| checkCustomError(api.CustomError o) { |
| buildCounterCustomError++; |
| if (buildCounterCustomError < 3) { |
| checkUnnamed3524(o.rules); |
| checkUnnamed3525(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--; |
| } |
| |
| buildUnnamed3526() { |
| var o = new core.List<api.Page>(); |
| o.add(buildPage()); |
| o.add(buildPage()); |
| return o; |
| } |
| |
| checkUnnamed3526(core.List<api.Page> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPage(o[0]); |
| checkPage(o[1]); |
| } |
| |
| buildUnnamed3527() { |
| var o = new core.List<api.DocumentationRule>(); |
| o.add(buildDocumentationRule()); |
| o.add(buildDocumentationRule()); |
| return o; |
| } |
| |
| checkUnnamed3527(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 = buildUnnamed3526(); |
| o.rules = buildUnnamed3527(); |
| 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')); |
| checkUnnamed3526(o.pages); |
| checkUnnamed3527(o.rules); |
| 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--; |
| } |
| |
| buildUnnamed3528() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3528(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')); |
| } |
| |
| buildUnnamed3529() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3529(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 = buildUnnamed3528(); |
| o.allowCors = true; |
| o.features = buildUnnamed3529(); |
| o.name = "foo"; |
| o.target = "foo"; |
| } |
| buildCounterEndpoint--; |
| return o; |
| } |
| |
| checkEndpoint(api.Endpoint o) { |
| buildCounterEndpoint++; |
| if (buildCounterEndpoint < 3) { |
| checkUnnamed3528(o.aliases); |
| unittest.expect(o.allowCors, unittest.isTrue); |
| checkUnnamed3529(o.features); |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.target, unittest.equals('foo')); |
| } |
| buildCounterEndpoint--; |
| } |
| |
| buildUnnamed3530() { |
| var o = new core.List<api.EnumValue>(); |
| o.add(buildEnumValue()); |
| o.add(buildEnumValue()); |
| return o; |
| } |
| |
| checkUnnamed3530(core.List<api.EnumValue> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEnumValue(o[0]); |
| checkEnumValue(o[1]); |
| } |
| |
| buildUnnamed3531() { |
| var o = new core.List<api.Option>(); |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| checkUnnamed3531(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 = buildUnnamed3530(); |
| o.name = "foo"; |
| o.options = buildUnnamed3531(); |
| o.sourceContext = buildSourceContext(); |
| o.syntax = "foo"; |
| } |
| buildCounterEnum--; |
| return o; |
| } |
| |
| checkEnum(api.Enum o) { |
| buildCounterEnum++; |
| if (buildCounterEnum < 3) { |
| checkUnnamed3530(o.enumvalue); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed3531(o.options); |
| checkSourceContext(o.sourceContext); |
| unittest.expect(o.syntax, unittest.equals('foo')); |
| } |
| buildCounterEnum--; |
| } |
| |
| buildUnnamed3532() { |
| var o = new core.List<api.Option>(); |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| checkUnnamed3532(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 = buildUnnamed3532(); |
| } |
| 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)); |
| checkUnnamed3532(o.options); |
| } |
| buildCounterEnumValue--; |
| } |
| |
| core.int buildCounterExperimental = 0; |
| buildExperimental() { |
| var o = new api.Experimental(); |
| buildCounterExperimental++; |
| if (buildCounterExperimental < 3) { |
| o.authorization = buildAuthorizationConfig(); |
| } |
| buildCounterExperimental--; |
| return o; |
| } |
| |
| checkExperimental(api.Experimental o) { |
| buildCounterExperimental++; |
| if (buildCounterExperimental < 3) { |
| checkAuthorizationConfig(o.authorization); |
| } |
| buildCounterExperimental--; |
| } |
| |
| buildUnnamed3533() { |
| var o = new core.List<api.Option>(); |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| checkUnnamed3533(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 = buildUnnamed3533(); |
| 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)); |
| checkUnnamed3533(o.options); |
| unittest.expect(o.packed, unittest.isTrue); |
| unittest.expect(o.typeUrl, unittest.equals('foo')); |
| } |
| buildCounterField--; |
| } |
| |
| buildUnnamed3534() { |
| var o = new core.List<api.HttpRule>(); |
| o.add(buildHttpRule()); |
| o.add(buildHttpRule()); |
| return o; |
| } |
| |
| checkUnnamed3534(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 = buildUnnamed3534(); |
| } |
| buildCounterHttp--; |
| return o; |
| } |
| |
| checkHttp(api.Http o) { |
| buildCounterHttp++; |
| if (buildCounterHttp < 3) { |
| unittest.expect(o.fullyDecodeReservedExpansion, unittest.isTrue); |
| checkUnnamed3534(o.rules); |
| } |
| buildCounterHttp--; |
| } |
| |
| buildUnnamed3535() { |
| var o = new core.List<api.HttpRule>(); |
| o.add(buildHttpRule()); |
| o.add(buildHttpRule()); |
| return o; |
| } |
| |
| checkUnnamed3535(core.List<api.HttpRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkHttpRule(o[0]); |
| checkHttpRule(o[1]); |
| } |
| |
| buildUnnamed3536() { |
| var o = new core.List<api.AuthorizationRule>(); |
| o.add(buildAuthorizationRule()); |
| o.add(buildAuthorizationRule()); |
| return o; |
| } |
| |
| checkUnnamed3536(core.List<api.AuthorizationRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuthorizationRule(o[0]); |
| checkAuthorizationRule(o[1]); |
| } |
| |
| core.int buildCounterHttpRule = 0; |
| buildHttpRule() { |
| var o = new api.HttpRule(); |
| buildCounterHttpRule++; |
| if (buildCounterHttpRule < 3) { |
| o.additionalBindings = buildUnnamed3535(); |
| o.authorizations = buildUnnamed3536(); |
| o.body = "foo"; |
| o.custom = buildCustomHttpPattern(); |
| o.delete = "foo"; |
| o.get = "foo"; |
| o.mediaDownload = buildMediaDownload(); |
| o.mediaUpload = buildMediaUpload(); |
| o.patch = "foo"; |
| o.post = "foo"; |
| o.put = "foo"; |
| o.responseBody = "foo"; |
| o.restCollection = "foo"; |
| o.restMethodName = "foo"; |
| o.selector = "foo"; |
| } |
| buildCounterHttpRule--; |
| return o; |
| } |
| |
| checkHttpRule(api.HttpRule o) { |
| buildCounterHttpRule++; |
| if (buildCounterHttpRule < 3) { |
| checkUnnamed3535(o.additionalBindings); |
| checkUnnamed3536(o.authorizations); |
| unittest.expect(o.body, unittest.equals('foo')); |
| checkCustomHttpPattern(o.custom); |
| unittest.expect(o.delete, unittest.equals('foo')); |
| unittest.expect(o.get, unittest.equals('foo')); |
| checkMediaDownload(o.mediaDownload); |
| checkMediaUpload(o.mediaUpload); |
| 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.restCollection, unittest.equals('foo')); |
| unittest.expect(o.restMethodName, unittest.equals('foo')); |
| unittest.expect(o.selector, unittest.equals('foo')); |
| } |
| buildCounterHttpRule--; |
| } |
| |
| 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--; |
| } |
| |
| buildUnnamed3537() { |
| var o = new core.List<api.Operation>(); |
| o.add(buildOperation()); |
| o.add(buildOperation()); |
| return o; |
| } |
| |
| checkUnnamed3537(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 = buildUnnamed3537(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed3537(o.operations); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| buildUnnamed3538() { |
| var o = new core.List<api.TenancyUnit>(); |
| o.add(buildTenancyUnit()); |
| o.add(buildTenancyUnit()); |
| return o; |
| } |
| |
| checkUnnamed3538(core.List<api.TenancyUnit> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkTenancyUnit(o[0]); |
| checkTenancyUnit(o[1]); |
| } |
| |
| core.int buildCounterListTenancyUnitsResponse = 0; |
| buildListTenancyUnitsResponse() { |
| var o = new api.ListTenancyUnitsResponse(); |
| buildCounterListTenancyUnitsResponse++; |
| if (buildCounterListTenancyUnitsResponse < 3) { |
| o.nextPageToken = "foo"; |
| o.tenancyUnits = buildUnnamed3538(); |
| } |
| buildCounterListTenancyUnitsResponse--; |
| return o; |
| } |
| |
| checkListTenancyUnitsResponse(api.ListTenancyUnitsResponse o) { |
| buildCounterListTenancyUnitsResponse++; |
| if (buildCounterListTenancyUnitsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed3538(o.tenancyUnits); |
| } |
| buildCounterListTenancyUnitsResponse--; |
| } |
| |
| buildUnnamed3539() { |
| var o = new core.List<api.LabelDescriptor>(); |
| o.add(buildLabelDescriptor()); |
| o.add(buildLabelDescriptor()); |
| return o; |
| } |
| |
| checkUnnamed3539(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 = buildUnnamed3539(); |
| 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')); |
| checkUnnamed3539(o.labels); |
| unittest.expect(o.name, unittest.equals('foo')); |
| } |
| buildCounterLogDescriptor--; |
| } |
| |
| buildUnnamed3540() { |
| var o = new core.List<api.LoggingDestination>(); |
| o.add(buildLoggingDestination()); |
| o.add(buildLoggingDestination()); |
| return o; |
| } |
| |
| checkUnnamed3540(core.List<api.LoggingDestination> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLoggingDestination(o[0]); |
| checkLoggingDestination(o[1]); |
| } |
| |
| buildUnnamed3541() { |
| var o = new core.List<api.LoggingDestination>(); |
| o.add(buildLoggingDestination()); |
| o.add(buildLoggingDestination()); |
| return o; |
| } |
| |
| checkUnnamed3541(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 = buildUnnamed3540(); |
| o.producerDestinations = buildUnnamed3541(); |
| } |
| buildCounterLogging--; |
| return o; |
| } |
| |
| checkLogging(api.Logging o) { |
| buildCounterLogging++; |
| if (buildCounterLogging < 3) { |
| checkUnnamed3540(o.consumerDestinations); |
| checkUnnamed3541(o.producerDestinations); |
| } |
| buildCounterLogging--; |
| } |
| |
| buildUnnamed3542() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3542(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 = buildUnnamed3542(); |
| o.monitoredResource = "foo"; |
| } |
| buildCounterLoggingDestination--; |
| return o; |
| } |
| |
| checkLoggingDestination(api.LoggingDestination o) { |
| buildCounterLoggingDestination++; |
| if (buildCounterLoggingDestination < 3) { |
| checkUnnamed3542(o.logs); |
| unittest.expect(o.monitoredResource, unittest.equals('foo')); |
| } |
| buildCounterLoggingDestination--; |
| } |
| |
| core.int buildCounterMediaDownload = 0; |
| buildMediaDownload() { |
| var o = new api.MediaDownload(); |
| buildCounterMediaDownload++; |
| if (buildCounterMediaDownload < 3) { |
| o.completeNotification = true; |
| o.downloadService = "foo"; |
| o.dropzone = "foo"; |
| o.enabled = true; |
| o.maxDirectDownloadSize = "foo"; |
| o.useDirectDownload = true; |
| } |
| buildCounterMediaDownload--; |
| return o; |
| } |
| |
| checkMediaDownload(api.MediaDownload o) { |
| buildCounterMediaDownload++; |
| if (buildCounterMediaDownload < 3) { |
| unittest.expect(o.completeNotification, unittest.isTrue); |
| unittest.expect(o.downloadService, unittest.equals('foo')); |
| unittest.expect(o.dropzone, unittest.equals('foo')); |
| unittest.expect(o.enabled, unittest.isTrue); |
| unittest.expect(o.maxDirectDownloadSize, unittest.equals('foo')); |
| unittest.expect(o.useDirectDownload, unittest.isTrue); |
| } |
| buildCounterMediaDownload--; |
| } |
| |
| buildUnnamed3543() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3543(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 buildCounterMediaUpload = 0; |
| buildMediaUpload() { |
| var o = new api.MediaUpload(); |
| buildCounterMediaUpload++; |
| if (buildCounterMediaUpload < 3) { |
| o.completeNotification = true; |
| o.dropzone = "foo"; |
| o.enabled = true; |
| o.maxSize = "foo"; |
| o.mimeTypes = buildUnnamed3543(); |
| o.progressNotification = true; |
| o.startNotification = true; |
| o.uploadService = "foo"; |
| } |
| buildCounterMediaUpload--; |
| return o; |
| } |
| |
| checkMediaUpload(api.MediaUpload o) { |
| buildCounterMediaUpload++; |
| if (buildCounterMediaUpload < 3) { |
| unittest.expect(o.completeNotification, unittest.isTrue); |
| unittest.expect(o.dropzone, unittest.equals('foo')); |
| unittest.expect(o.enabled, unittest.isTrue); |
| unittest.expect(o.maxSize, unittest.equals('foo')); |
| checkUnnamed3543(o.mimeTypes); |
| unittest.expect(o.progressNotification, unittest.isTrue); |
| unittest.expect(o.startNotification, unittest.isTrue); |
| unittest.expect(o.uploadService, unittest.equals('foo')); |
| } |
| buildCounterMediaUpload--; |
| } |
| |
| buildUnnamed3544() { |
| var o = new core.List<api.Option>(); |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| checkUnnamed3544(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 = buildUnnamed3544(); |
| 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')); |
| checkUnnamed3544(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--; |
| } |
| |
| buildUnnamed3545() { |
| var o = new core.List<api.LabelDescriptor>(); |
| o.add(buildLabelDescriptor()); |
| o.add(buildLabelDescriptor()); |
| return o; |
| } |
| |
| checkUnnamed3545(core.List<api.LabelDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLabelDescriptor(o[0]); |
| checkLabelDescriptor(o[1]); |
| } |
| |
| core.int buildCounterMetricDescriptor = 0; |
| buildMetricDescriptor() { |
| var o = new api.MetricDescriptor(); |
| buildCounterMetricDescriptor++; |
| if (buildCounterMetricDescriptor < 3) { |
| o.description = "foo"; |
| o.displayName = "foo"; |
| o.labels = buildUnnamed3545(); |
| o.metricKind = "foo"; |
| 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')); |
| checkUnnamed3545(o.labels); |
| unittest.expect(o.metricKind, unittest.equals('foo')); |
| 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--; |
| } |
| |
| buildUnnamed3546() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed3546(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 = buildUnnamed3546(); |
| o.selector = "foo"; |
| } |
| buildCounterMetricRule--; |
| return o; |
| } |
| |
| checkMetricRule(api.MetricRule o) { |
| buildCounterMetricRule++; |
| if (buildCounterMetricRule < 3) { |
| checkUnnamed3546(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--; |
| } |
| |
| buildUnnamed3547() { |
| var o = new core.List<api.LabelDescriptor>(); |
| o.add(buildLabelDescriptor()); |
| o.add(buildLabelDescriptor()); |
| return o; |
| } |
| |
| checkUnnamed3547(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 = buildUnnamed3547(); |
| 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')); |
| checkUnnamed3547(o.labels); |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.type, unittest.equals('foo')); |
| } |
| buildCounterMonitoredResourceDescriptor--; |
| } |
| |
| buildUnnamed3548() { |
| var o = new core.List<api.MonitoringDestination>(); |
| o.add(buildMonitoringDestination()); |
| o.add(buildMonitoringDestination()); |
| return o; |
| } |
| |
| checkUnnamed3548(core.List<api.MonitoringDestination> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMonitoringDestination(o[0]); |
| checkMonitoringDestination(o[1]); |
| } |
| |
| buildUnnamed3549() { |
| var o = new core.List<api.MonitoringDestination>(); |
| o.add(buildMonitoringDestination()); |
| o.add(buildMonitoringDestination()); |
| return o; |
| } |
| |
| checkUnnamed3549(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 = buildUnnamed3548(); |
| o.producerDestinations = buildUnnamed3549(); |
| } |
| buildCounterMonitoring--; |
| return o; |
| } |
| |
| checkMonitoring(api.Monitoring o) { |
| buildCounterMonitoring++; |
| if (buildCounterMonitoring < 3) { |
| checkUnnamed3548(o.consumerDestinations); |
| checkUnnamed3549(o.producerDestinations); |
| } |
| buildCounterMonitoring--; |
| } |
| |
| buildUnnamed3550() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3550(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 = buildUnnamed3550(); |
| o.monitoredResource = "foo"; |
| } |
| buildCounterMonitoringDestination--; |
| return o; |
| } |
| |
| checkMonitoringDestination(api.MonitoringDestination o) { |
| buildCounterMonitoringDestination++; |
| if (buildCounterMonitoringDestination < 3) { |
| checkUnnamed3550(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--; |
| } |
| |
| buildUnnamed3551() { |
| 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; |
| } |
| |
| checkUnnamed3551(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')); |
| } |
| |
| buildUnnamed3552() { |
| 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; |
| } |
| |
| checkUnnamed3552(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 = buildUnnamed3551(); |
| o.name = "foo"; |
| o.response = buildUnnamed3552(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done, unittest.isTrue); |
| checkStatus(o.error); |
| checkUnnamed3551(o.metadata); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed3552(o.response); |
| } |
| buildCounterOperation--; |
| } |
| |
| buildUnnamed3553() { |
| 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; |
| } |
| |
| checkUnnamed3553(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 = buildUnnamed3553(); |
| } |
| buildCounterOption--; |
| return o; |
| } |
| |
| checkOption(api.Option o) { |
| buildCounterOption++; |
| if (buildCounterOption < 3) { |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed3553(o.value); |
| } |
| buildCounterOption--; |
| } |
| |
| buildUnnamed3554() { |
| var o = new core.List<api.Page>(); |
| o.add(buildPage()); |
| o.add(buildPage()); |
| return o; |
| } |
| |
| checkUnnamed3554(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 = buildUnnamed3554(); |
| } |
| 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')); |
| checkUnnamed3554(o.subpages); |
| } |
| buildCounterPage--; |
| } |
| |
| buildUnnamed3555() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3555(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 buildCounterPolicyBinding = 0; |
| buildPolicyBinding() { |
| var o = new api.PolicyBinding(); |
| buildCounterPolicyBinding++; |
| if (buildCounterPolicyBinding < 3) { |
| o.members = buildUnnamed3555(); |
| o.role = "foo"; |
| } |
| buildCounterPolicyBinding--; |
| return o; |
| } |
| |
| checkPolicyBinding(api.PolicyBinding o) { |
| buildCounterPolicyBinding++; |
| if (buildCounterPolicyBinding < 3) { |
| checkUnnamed3555(o.members); |
| unittest.expect(o.role, unittest.equals('foo')); |
| } |
| buildCounterPolicyBinding--; |
| } |
| |
| buildUnnamed3556() { |
| var o = new core.List<api.QuotaLimit>(); |
| o.add(buildQuotaLimit()); |
| o.add(buildQuotaLimit()); |
| return o; |
| } |
| |
| checkUnnamed3556(core.List<api.QuotaLimit> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkQuotaLimit(o[0]); |
| checkQuotaLimit(o[1]); |
| } |
| |
| buildUnnamed3557() { |
| var o = new core.List<api.MetricRule>(); |
| o.add(buildMetricRule()); |
| o.add(buildMetricRule()); |
| return o; |
| } |
| |
| checkUnnamed3557(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 = buildUnnamed3556(); |
| o.metricRules = buildUnnamed3557(); |
| } |
| buildCounterQuota--; |
| return o; |
| } |
| |
| checkQuota(api.Quota o) { |
| buildCounterQuota++; |
| if (buildCounterQuota < 3) { |
| checkUnnamed3556(o.limits); |
| checkUnnamed3557(o.metricRules); |
| } |
| buildCounterQuota--; |
| } |
| |
| buildUnnamed3558() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed3558(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 = buildUnnamed3558(); |
| } |
| 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')); |
| checkUnnamed3558(o.values); |
| } |
| buildCounterQuotaLimit--; |
| } |
| |
| core.int buildCounterRemoveTenantProjectRequest = 0; |
| buildRemoveTenantProjectRequest() { |
| var o = new api.RemoveTenantProjectRequest(); |
| buildCounterRemoveTenantProjectRequest++; |
| if (buildCounterRemoveTenantProjectRequest < 3) { |
| o.tag = "foo"; |
| } |
| buildCounterRemoveTenantProjectRequest--; |
| return o; |
| } |
| |
| checkRemoveTenantProjectRequest(api.RemoveTenantProjectRequest o) { |
| buildCounterRemoveTenantProjectRequest++; |
| if (buildCounterRemoveTenantProjectRequest < 3) { |
| unittest.expect(o.tag, unittest.equals('foo')); |
| } |
| buildCounterRemoveTenantProjectRequest--; |
| } |
| |
| buildUnnamed3559() { |
| var o = new core.List<api.TenancyUnit>(); |
| o.add(buildTenancyUnit()); |
| o.add(buildTenancyUnit()); |
| return o; |
| } |
| |
| checkUnnamed3559(core.List<api.TenancyUnit> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkTenancyUnit(o[0]); |
| checkTenancyUnit(o[1]); |
| } |
| |
| core.int buildCounterSearchTenancyUnitsResponse = 0; |
| buildSearchTenancyUnitsResponse() { |
| var o = new api.SearchTenancyUnitsResponse(); |
| buildCounterSearchTenancyUnitsResponse++; |
| if (buildCounterSearchTenancyUnitsResponse < 3) { |
| o.nextPageToken = "foo"; |
| o.tenancyUnits = buildUnnamed3559(); |
| } |
| buildCounterSearchTenancyUnitsResponse--; |
| return o; |
| } |
| |
| checkSearchTenancyUnitsResponse(api.SearchTenancyUnitsResponse o) { |
| buildCounterSearchTenancyUnitsResponse++; |
| if (buildCounterSearchTenancyUnitsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed3559(o.tenancyUnits); |
| } |
| buildCounterSearchTenancyUnitsResponse--; |
| } |
| |
| buildUnnamed3560() { |
| var o = new core.List<api.Api>(); |
| o.add(buildApi()); |
| o.add(buildApi()); |
| return o; |
| } |
| |
| checkUnnamed3560(core.List<api.Api> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkApi(o[0]); |
| checkApi(o[1]); |
| } |
| |
| buildUnnamed3561() { |
| var o = new core.List<api.Endpoint>(); |
| o.add(buildEndpoint()); |
| o.add(buildEndpoint()); |
| return o; |
| } |
| |
| checkUnnamed3561(core.List<api.Endpoint> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEndpoint(o[0]); |
| checkEndpoint(o[1]); |
| } |
| |
| buildUnnamed3562() { |
| var o = new core.List<api.Enum>(); |
| o.add(buildEnum()); |
| o.add(buildEnum()); |
| return o; |
| } |
| |
| checkUnnamed3562(core.List<api.Enum> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEnum(o[0]); |
| checkEnum(o[1]); |
| } |
| |
| buildUnnamed3563() { |
| var o = new core.List<api.LogDescriptor>(); |
| o.add(buildLogDescriptor()); |
| o.add(buildLogDescriptor()); |
| return o; |
| } |
| |
| checkUnnamed3563(core.List<api.LogDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLogDescriptor(o[0]); |
| checkLogDescriptor(o[1]); |
| } |
| |
| buildUnnamed3564() { |
| var o = new core.List<api.MetricDescriptor>(); |
| o.add(buildMetricDescriptor()); |
| o.add(buildMetricDescriptor()); |
| return o; |
| } |
| |
| checkUnnamed3564(core.List<api.MetricDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMetricDescriptor(o[0]); |
| checkMetricDescriptor(o[1]); |
| } |
| |
| buildUnnamed3565() { |
| var o = new core.List<api.MonitoredResourceDescriptor>(); |
| o.add(buildMonitoredResourceDescriptor()); |
| o.add(buildMonitoredResourceDescriptor()); |
| return o; |
| } |
| |
| checkUnnamed3565(core.List<api.MonitoredResourceDescriptor> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMonitoredResourceDescriptor(o[0]); |
| checkMonitoredResourceDescriptor(o[1]); |
| } |
| |
| buildUnnamed3566() { |
| var o = new core.List<api.Type>(); |
| o.add(buildType()); |
| o.add(buildType()); |
| return o; |
| } |
| |
| checkUnnamed3566(core.List<api.Type> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkType(o[0]); |
| checkType(o[1]); |
| } |
| |
| buildUnnamed3567() { |
| var o = new core.List<api.Type>(); |
| o.add(buildType()); |
| o.add(buildType()); |
| return o; |
| } |
| |
| checkUnnamed3567(core.List<api.Type> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkType(o[0]); |
| checkType(o[1]); |
| } |
| |
| core.int buildCounterService = 0; |
| buildService() { |
| var o = new api.Service(); |
| buildCounterService++; |
| if (buildCounterService < 3) { |
| o.apis = buildUnnamed3560(); |
| 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 = buildUnnamed3561(); |
| o.enums = buildUnnamed3562(); |
| o.experimental = buildExperimental(); |
| o.http = buildHttp(); |
| o.id = "foo"; |
| o.logging = buildLogging(); |
| o.logs = buildUnnamed3563(); |
| o.metrics = buildUnnamed3564(); |
| o.monitoredResources = buildUnnamed3565(); |
| o.monitoring = buildMonitoring(); |
| o.name = "foo"; |
| o.producerProjectId = "foo"; |
| o.quota = buildQuota(); |
| o.sourceInfo = buildSourceInfo(); |
| o.systemParameters = buildSystemParameters(); |
| o.systemTypes = buildUnnamed3566(); |
| o.title = "foo"; |
| o.types = buildUnnamed3567(); |
| o.usage = buildUsage(); |
| o.visibility = buildVisibility(); |
| } |
| buildCounterService--; |
| return o; |
| } |
| |
| checkService(api.Service o) { |
| buildCounterService++; |
| if (buildCounterService < 3) { |
| checkUnnamed3560(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); |
| checkUnnamed3561(o.endpoints); |
| checkUnnamed3562(o.enums); |
| checkExperimental(o.experimental); |
| checkHttp(o.http); |
| unittest.expect(o.id, unittest.equals('foo')); |
| checkLogging(o.logging); |
| checkUnnamed3563(o.logs); |
| checkUnnamed3564(o.metrics); |
| checkUnnamed3565(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); |
| checkUnnamed3566(o.systemTypes); |
| unittest.expect(o.title, unittest.equals('foo')); |
| checkUnnamed3567(o.types); |
| checkUsage(o.usage); |
| checkVisibility(o.visibility); |
| } |
| buildCounterService--; |
| } |
| |
| buildUnnamed3568() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3568(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 buildCounterServiceAccountConfig = 0; |
| buildServiceAccountConfig() { |
| var o = new api.ServiceAccountConfig(); |
| buildCounterServiceAccountConfig++; |
| if (buildCounterServiceAccountConfig < 3) { |
| o.accountId = "foo"; |
| o.tenantProjectRoles = buildUnnamed3568(); |
| } |
| buildCounterServiceAccountConfig--; |
| return o; |
| } |
| |
| checkServiceAccountConfig(api.ServiceAccountConfig o) { |
| buildCounterServiceAccountConfig++; |
| if (buildCounterServiceAccountConfig < 3) { |
| unittest.expect(o.accountId, unittest.equals('foo')); |
| checkUnnamed3568(o.tenantProjectRoles); |
| } |
| buildCounterServiceAccountConfig--; |
| } |
| |
| 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--; |
| } |
| |
| buildUnnamed3569() { |
| 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; |
| } |
| |
| checkUnnamed3569(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')); |
| } |
| |
| buildUnnamed3570() { |
| var o = new core.List<core.Map<core.String, core.Object>>(); |
| o.add(buildUnnamed3569()); |
| o.add(buildUnnamed3569()); |
| return o; |
| } |
| |
| checkUnnamed3570(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed3569(o[0]); |
| checkUnnamed3569(o[1]); |
| } |
| |
| core.int buildCounterSourceInfo = 0; |
| buildSourceInfo() { |
| var o = new api.SourceInfo(); |
| buildCounterSourceInfo++; |
| if (buildCounterSourceInfo < 3) { |
| o.sourceFiles = buildUnnamed3570(); |
| } |
| buildCounterSourceInfo--; |
| return o; |
| } |
| |
| checkSourceInfo(api.SourceInfo o) { |
| buildCounterSourceInfo++; |
| if (buildCounterSourceInfo < 3) { |
| checkUnnamed3570(o.sourceFiles); |
| } |
| buildCounterSourceInfo--; |
| } |
| |
| buildUnnamed3571() { |
| 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; |
| } |
| |
| checkUnnamed3571(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')); |
| } |
| |
| buildUnnamed3572() { |
| var o = new core.List<core.Map<core.String, core.Object>>(); |
| o.add(buildUnnamed3571()); |
| o.add(buildUnnamed3571()); |
| return o; |
| } |
| |
| checkUnnamed3572(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed3571(o[0]); |
| checkUnnamed3571(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| buildStatus() { |
| var o = new api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed3572(); |
| o.message = "foo"; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect(o.code, unittest.equals(42)); |
| checkUnnamed3572(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--; |
| } |
| |
| buildUnnamed3573() { |
| var o = new core.List<api.SystemParameter>(); |
| o.add(buildSystemParameter()); |
| o.add(buildSystemParameter()); |
| return o; |
| } |
| |
| checkUnnamed3573(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 = buildUnnamed3573(); |
| o.selector = "foo"; |
| } |
| buildCounterSystemParameterRule--; |
| return o; |
| } |
| |
| checkSystemParameterRule(api.SystemParameterRule o) { |
| buildCounterSystemParameterRule++; |
| if (buildCounterSystemParameterRule < 3) { |
| checkUnnamed3573(o.parameters); |
| unittest.expect(o.selector, unittest.equals('foo')); |
| } |
| buildCounterSystemParameterRule--; |
| } |
| |
| buildUnnamed3574() { |
| var o = new core.List<api.SystemParameterRule>(); |
| o.add(buildSystemParameterRule()); |
| o.add(buildSystemParameterRule()); |
| return o; |
| } |
| |
| checkUnnamed3574(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 = buildUnnamed3574(); |
| } |
| buildCounterSystemParameters--; |
| return o; |
| } |
| |
| checkSystemParameters(api.SystemParameters o) { |
| buildCounterSystemParameters++; |
| if (buildCounterSystemParameters < 3) { |
| checkUnnamed3574(o.rules); |
| } |
| buildCounterSystemParameters--; |
| } |
| |
| buildUnnamed3575() { |
| var o = new core.List<api.TenantResource>(); |
| o.add(buildTenantResource()); |
| o.add(buildTenantResource()); |
| return o; |
| } |
| |
| checkUnnamed3575(core.List<api.TenantResource> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkTenantResource(o[0]); |
| checkTenantResource(o[1]); |
| } |
| |
| core.int buildCounterTenancyUnit = 0; |
| buildTenancyUnit() { |
| var o = new api.TenancyUnit(); |
| buildCounterTenancyUnit++; |
| if (buildCounterTenancyUnit < 3) { |
| o.consumer = "foo"; |
| o.createTime = "foo"; |
| o.name = "foo"; |
| o.service = "foo"; |
| o.tenantResources = buildUnnamed3575(); |
| } |
| buildCounterTenancyUnit--; |
| return o; |
| } |
| |
| checkTenancyUnit(api.TenancyUnit o) { |
| buildCounterTenancyUnit++; |
| if (buildCounterTenancyUnit < 3) { |
| unittest.expect(o.consumer, unittest.equals('foo')); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.service, unittest.equals('foo')); |
| checkUnnamed3575(o.tenantResources); |
| } |
| buildCounterTenancyUnit--; |
| } |
| |
| buildUnnamed3576() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed3576(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')); |
| } |
| |
| buildUnnamed3577() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3577(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 buildCounterTenantProjectConfig = 0; |
| buildTenantProjectConfig() { |
| var o = new api.TenantProjectConfig(); |
| buildCounterTenantProjectConfig++; |
| if (buildCounterTenantProjectConfig < 3) { |
| o.billingConfig = buildBillingConfig(); |
| o.folder = "foo"; |
| o.labels = buildUnnamed3576(); |
| o.serviceAccountConfig = buildServiceAccountConfig(); |
| o.services = buildUnnamed3577(); |
| o.tenantProjectPolicy = buildTenantProjectPolicy(); |
| } |
| buildCounterTenantProjectConfig--; |
| return o; |
| } |
| |
| checkTenantProjectConfig(api.TenantProjectConfig o) { |
| buildCounterTenantProjectConfig++; |
| if (buildCounterTenantProjectConfig < 3) { |
| checkBillingConfig(o.billingConfig); |
| unittest.expect(o.folder, unittest.equals('foo')); |
| checkUnnamed3576(o.labels); |
| checkServiceAccountConfig(o.serviceAccountConfig); |
| checkUnnamed3577(o.services); |
| checkTenantProjectPolicy(o.tenantProjectPolicy); |
| } |
| buildCounterTenantProjectConfig--; |
| } |
| |
| buildUnnamed3578() { |
| var o = new core.List<api.PolicyBinding>(); |
| o.add(buildPolicyBinding()); |
| o.add(buildPolicyBinding()); |
| return o; |
| } |
| |
| checkUnnamed3578(core.List<api.PolicyBinding> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPolicyBinding(o[0]); |
| checkPolicyBinding(o[1]); |
| } |
| |
| core.int buildCounterTenantProjectPolicy = 0; |
| buildTenantProjectPolicy() { |
| var o = new api.TenantProjectPolicy(); |
| buildCounterTenantProjectPolicy++; |
| if (buildCounterTenantProjectPolicy < 3) { |
| o.policyBindings = buildUnnamed3578(); |
| } |
| buildCounterTenantProjectPolicy--; |
| return o; |
| } |
| |
| checkTenantProjectPolicy(api.TenantProjectPolicy o) { |
| buildCounterTenantProjectPolicy++; |
| if (buildCounterTenantProjectPolicy < 3) { |
| checkUnnamed3578(o.policyBindings); |
| } |
| buildCounterTenantProjectPolicy--; |
| } |
| |
| core.int buildCounterTenantResource = 0; |
| buildTenantResource() { |
| var o = new api.TenantResource(); |
| buildCounterTenantResource++; |
| if (buildCounterTenantResource < 3) { |
| o.resource = "foo"; |
| o.status = "foo"; |
| o.tag = "foo"; |
| } |
| buildCounterTenantResource--; |
| return o; |
| } |
| |
| checkTenantResource(api.TenantResource o) { |
| buildCounterTenantResource++; |
| if (buildCounterTenantResource < 3) { |
| unittest.expect(o.resource, unittest.equals('foo')); |
| unittest.expect(o.status, unittest.equals('foo')); |
| unittest.expect(o.tag, unittest.equals('foo')); |
| } |
| buildCounterTenantResource--; |
| } |
| |
| buildUnnamed3579() { |
| var o = new core.List<api.Field>(); |
| o.add(buildField()); |
| o.add(buildField()); |
| return o; |
| } |
| |
| checkUnnamed3579(core.List<api.Field> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkField(o[0]); |
| checkField(o[1]); |
| } |
| |
| buildUnnamed3580() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3580(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')); |
| } |
| |
| buildUnnamed3581() { |
| var o = new core.List<api.Option>(); |
| o.add(buildOption()); |
| o.add(buildOption()); |
| return o; |
| } |
| |
| checkUnnamed3581(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 = buildUnnamed3579(); |
| o.name = "foo"; |
| o.oneofs = buildUnnamed3580(); |
| o.options = buildUnnamed3581(); |
| o.sourceContext = buildSourceContext(); |
| o.syntax = "foo"; |
| } |
| buildCounterType--; |
| return o; |
| } |
| |
| checkType(api.Type o) { |
| buildCounterType++; |
| if (buildCounterType < 3) { |
| checkUnnamed3579(o.fields); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed3580(o.oneofs); |
| checkUnnamed3581(o.options); |
| checkSourceContext(o.sourceContext); |
| unittest.expect(o.syntax, unittest.equals('foo')); |
| } |
| buildCounterType--; |
| } |
| |
| buildUnnamed3582() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed3582(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')); |
| } |
| |
| buildUnnamed3583() { |
| var o = new core.List<api.UsageRule>(); |
| o.add(buildUsageRule()); |
| o.add(buildUsageRule()); |
| return o; |
| } |
| |
| checkUnnamed3583(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 = buildUnnamed3582(); |
| o.rules = buildUnnamed3583(); |
| } |
| buildCounterUsage--; |
| return o; |
| } |
| |
| checkUsage(api.Usage o) { |
| buildCounterUsage++; |
| if (buildCounterUsage < 3) { |
| unittest.expect(o.producerNotificationChannel, unittest.equals('foo')); |
| checkUnnamed3582(o.requirements); |
| checkUnnamed3583(o.rules); |
| } |
| 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--; |
| } |
| |
| buildUnnamed3584() { |
| var o = new core.List<api.VisibilityRule>(); |
| o.add(buildVisibilityRule()); |
| o.add(buildVisibilityRule()); |
| return o; |
| } |
| |
| checkUnnamed3584(core.List<api.VisibilityRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkVisibilityRule(o[0]); |
| checkVisibilityRule(o[1]); |
| } |
| |
| core.int buildCounterVisibility = 0; |
| buildVisibility() { |
| var o = new api.Visibility(); |
| buildCounterVisibility++; |
| if (buildCounterVisibility < 3) { |
| o.rules = buildUnnamed3584(); |
| } |
| buildCounterVisibility--; |
| return o; |
| } |
| |
| checkVisibility(api.Visibility o) { |
| buildCounterVisibility++; |
| if (buildCounterVisibility < 3) { |
| checkUnnamed3584(o.rules); |
| } |
| buildCounterVisibility--; |
| } |
| |
| core.int buildCounterVisibilityRule = 0; |
| buildVisibilityRule() { |
| var o = new api.VisibilityRule(); |
| buildCounterVisibilityRule++; |
| if (buildCounterVisibilityRule < 3) { |
| o.restriction = "foo"; |
| o.selector = "foo"; |
| } |
| buildCounterVisibilityRule--; |
| return o; |
| } |
| |
| checkVisibilityRule(api.VisibilityRule o) { |
| buildCounterVisibilityRule++; |
| if (buildCounterVisibilityRule < 3) { |
| unittest.expect(o.restriction, unittest.equals('foo')); |
| unittest.expect(o.selector, unittest.equals('foo')); |
| } |
| buildCounterVisibilityRule--; |
| } |
| |
| main() { |
| unittest.group("obj-schema-AddTenantProjectRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildAddTenantProjectRequest(); |
| var od = new api.AddTenantProjectRequest.fromJson(o.toJson()); |
| checkAddTenantProjectRequest(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-AuthorizationConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildAuthorizationConfig(); |
| var od = new api.AuthorizationConfig.fromJson(o.toJson()); |
| checkAuthorizationConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-AuthorizationRule", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildAuthorizationRule(); |
| var od = new api.AuthorizationRule.fromJson(o.toJson()); |
| checkAuthorizationRule(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-Billing", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildBilling(); |
| var od = new api.Billing.fromJson(o.toJson()); |
| checkBilling(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-BillingConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildBillingConfig(); |
| var od = new api.BillingConfig.fromJson(o.toJson()); |
| checkBillingConfig(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-CreateTenancyUnitRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCreateTenancyUnitRequest(); |
| var od = new api.CreateTenancyUnitRequest.fromJson(o.toJson()); |
| checkCreateTenancyUnitRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-CustomAuthRequirements", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCustomAuthRequirements(); |
| var od = new api.CustomAuthRequirements.fromJson(o.toJson()); |
| checkCustomAuthRequirements(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-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-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-Experimental", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildExperimental(); |
| var od = new api.Experimental.fromJson(o.toJson()); |
| checkExperimental(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-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-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-ListTenancyUnitsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListTenancyUnitsResponse(); |
| var od = new api.ListTenancyUnitsResponse.fromJson(o.toJson()); |
| checkListTenancyUnitsResponse(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-MediaDownload", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildMediaDownload(); |
| var od = new api.MediaDownload.fromJson(o.toJson()); |
| checkMediaDownload(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-MediaUpload", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildMediaUpload(); |
| var od = new api.MediaUpload.fromJson(o.toJson()); |
| checkMediaUpload(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-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-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-PolicyBinding", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPolicyBinding(); |
| var od = new api.PolicyBinding.fromJson(o.toJson()); |
| checkPolicyBinding(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-RemoveTenantProjectRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildRemoveTenantProjectRequest(); |
| var od = new api.RemoveTenantProjectRequest.fromJson(o.toJson()); |
| checkRemoveTenantProjectRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-SearchTenancyUnitsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSearchTenancyUnitsResponse(); |
| var od = new api.SearchTenancyUnitsResponse.fromJson(o.toJson()); |
| checkSearchTenancyUnitsResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Service", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildService(); |
| var od = new api.Service.fromJson(o.toJson()); |
| checkService(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ServiceAccountConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildServiceAccountConfig(); |
| var od = new api.ServiceAccountConfig.fromJson(o.toJson()); |
| checkServiceAccountConfig(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-TenancyUnit", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTenancyUnit(); |
| var od = new api.TenancyUnit.fromJson(o.toJson()); |
| checkTenancyUnit(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TenantProjectConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTenantProjectConfig(); |
| var od = new api.TenantProjectConfig.fromJson(o.toJson()); |
| checkTenantProjectConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TenantProjectPolicy", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTenantProjectPolicy(); |
| var od = new api.TenantProjectPolicy.fromJson(o.toJson()); |
| checkTenantProjectPolicy(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TenantResource", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTenantResource(); |
| var od = new api.TenantResource.fromJson(o.toJson()); |
| checkTenantResource(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("obj-schema-Visibility", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildVisibility(); |
| var od = new api.Visibility.fromJson(o.toJson()); |
| checkVisibility(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-VisibilityRule", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildVisibilityRule(); |
| var od = new api.VisibilityRule.fromJson(o.toJson()); |
| checkVisibilityRule(od); |
| }); |
| }); |
| |
| unittest.group("resource-OperationsResourceApi", () { |
| unittest.test("method--cancel", () { |
| var mock = new HttpServerMock(); |
| api.OperationsResourceApi res = |
| new api.ServiceconsumermanagementApi(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 = {}; |
| 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(((api.Empty response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.OperationsResourceApi res = |
| new api.ServiceconsumermanagementApi(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 = {}; |
| 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(((api.Empty response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.OperationsResourceApi res = |
| new api.ServiceconsumermanagementApi(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 = {}; |
| 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(((api.Operation response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.OperationsResourceApi res = |
| new api.ServiceconsumermanagementApi(mock).operations; |
| var arg_name = "foo"; |
| var arg_filter = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_pageSize = 42; |
| 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 = {}; |
| 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["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| 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(arg_name, |
| filter: arg_filter, |
| pageToken: arg_pageToken, |
| pageSize: arg_pageSize, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((api.ListOperationsResponse response) { |
| checkListOperationsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group("resource-ServicesResourceApi", () { |
| unittest.test("method--search", () { |
| var mock = new HttpServerMock(); |
| api.ServicesResourceApi res = |
| new api.ServiceconsumermanagementApi(mock).services; |
| var arg_parent = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_pageSize = 42; |
| var arg_query = "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 = {}; |
| 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["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect(queryMap["query"].first, unittest.equals(arg_query)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildSearchTenancyUnitsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .search(arg_parent, |
| pageToken: arg_pageToken, |
| pageSize: arg_pageSize, |
| query: arg_query, |
| $fields: arg_$fields) |
| .then( |
| unittest.expectAsync1(((api.SearchTenancyUnitsResponse response) { |
| checkSearchTenancyUnitsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group("resource-ServicesTenancyUnitsResourceApi", () { |
| unittest.test("method--addProject", () { |
| var mock = new HttpServerMock(); |
| api.ServicesTenancyUnitsResourceApi res = |
| new api.ServiceconsumermanagementApi(mock).services.tenancyUnits; |
| var arg_request = buildAddTenantProjectRequest(); |
| var arg_parent = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.AddTenantProjectRequest.fromJson(json); |
| checkAddTenantProjectRequest(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 = {}; |
| 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 |
| .addProject(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((api.Operation response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--create", () { |
| var mock = new HttpServerMock(); |
| api.ServicesTenancyUnitsResourceApi res = |
| new api.ServiceconsumermanagementApi(mock).services.tenancyUnits; |
| var arg_request = buildCreateTenancyUnitRequest(); |
| var arg_parent = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.CreateTenancyUnitRequest.fromJson(json); |
| checkCreateTenancyUnitRequest(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 = {}; |
| 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(buildTenancyUnit()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((api.TenancyUnit response) { |
| checkTenancyUnit(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.ServicesTenancyUnitsResourceApi res = |
| new api.ServiceconsumermanagementApi(mock).services.tenancyUnits; |
| 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 = {}; |
| 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 |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((api.Operation response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ServicesTenancyUnitsResourceApi res = |
| new api.ServiceconsumermanagementApi(mock).services.tenancyUnits; |
| var arg_parent = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_pageSize = 42; |
| 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 = {}; |
| 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["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| 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(buildListTenancyUnitsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| pageToken: arg_pageToken, |
| pageSize: arg_pageSize, |
| filter: arg_filter, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((api.ListTenancyUnitsResponse response) { |
| checkListTenancyUnitsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--removeProject", () { |
| var mock = new HttpServerMock(); |
| api.ServicesTenancyUnitsResourceApi res = |
| new api.ServiceconsumermanagementApi(mock).services.tenancyUnits; |
| var arg_request = buildRemoveTenantProjectRequest(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.RemoveTenantProjectRequest.fromJson(json); |
| checkRemoveTenantProjectRequest(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 = {}; |
| 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 |
| .removeProject(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((api.Operation response) { |
| checkOperation(response); |
| }))); |
| }); |
| }); |
| } |