| library googleapis.managedidentities.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/managedidentities/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 buildCounterAttachTrustRequest = 0; |
| buildAttachTrustRequest() { |
| var o = new api.AttachTrustRequest(); |
| buildCounterAttachTrustRequest++; |
| if (buildCounterAttachTrustRequest < 3) { |
| o.trust = buildTrust(); |
| } |
| buildCounterAttachTrustRequest--; |
| return o; |
| } |
| |
| checkAttachTrustRequest(api.AttachTrustRequest o) { |
| buildCounterAttachTrustRequest++; |
| if (buildCounterAttachTrustRequest < 3) { |
| checkTrust(o.trust); |
| } |
| buildCounterAttachTrustRequest--; |
| } |
| |
| buildUnnamed2781() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed2781(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterBinding = 0; |
| buildBinding() { |
| var o = new api.Binding(); |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| o.bindingId = "foo"; |
| o.condition = buildExpr(); |
| o.members = buildUnnamed2781(); |
| o.role = "foo"; |
| } |
| buildCounterBinding--; |
| return o; |
| } |
| |
| checkBinding(api.Binding o) { |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| unittest.expect(o.bindingId, unittest.equals('foo')); |
| checkExpr(o.condition); |
| checkUnnamed2781(o.members); |
| unittest.expect(o.role, unittest.equals('foo')); |
| } |
| buildCounterBinding--; |
| } |
| |
| 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--; |
| } |
| |
| core.int buildCounterDetachTrustRequest = 0; |
| buildDetachTrustRequest() { |
| var o = new api.DetachTrustRequest(); |
| buildCounterDetachTrustRequest++; |
| if (buildCounterDetachTrustRequest < 3) { |
| o.trust = buildTrust(); |
| } |
| buildCounterDetachTrustRequest--; |
| return o; |
| } |
| |
| checkDetachTrustRequest(api.DetachTrustRequest o) { |
| buildCounterDetachTrustRequest++; |
| if (buildCounterDetachTrustRequest < 3) { |
| checkTrust(o.trust); |
| } |
| buildCounterDetachTrustRequest--; |
| } |
| |
| buildUnnamed2782() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed2782(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')); |
| } |
| |
| buildUnnamed2783() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed2783(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')); |
| } |
| |
| buildUnnamed2784() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed2784(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')); |
| } |
| |
| buildUnnamed2785() { |
| var o = new core.List<api.Trust>(); |
| o.add(buildTrust()); |
| o.add(buildTrust()); |
| return o; |
| } |
| |
| checkUnnamed2785(core.List<api.Trust> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkTrust(o[0]); |
| checkTrust(o[1]); |
| } |
| |
| core.int buildCounterDomain = 0; |
| buildDomain() { |
| var o = new api.Domain(); |
| buildCounterDomain++; |
| if (buildCounterDomain < 3) { |
| o.admin = "foo"; |
| o.authorizedNetworks = buildUnnamed2782(); |
| o.createTime = "foo"; |
| o.fqdn = "foo"; |
| o.labels = buildUnnamed2783(); |
| o.locations = buildUnnamed2784(); |
| o.name = "foo"; |
| o.reservedIpRange = "foo"; |
| o.state = "foo"; |
| o.statusMessage = "foo"; |
| o.trusts = buildUnnamed2785(); |
| o.updateTime = "foo"; |
| } |
| buildCounterDomain--; |
| return o; |
| } |
| |
| checkDomain(api.Domain o) { |
| buildCounterDomain++; |
| if (buildCounterDomain < 3) { |
| unittest.expect(o.admin, unittest.equals('foo')); |
| checkUnnamed2782(o.authorizedNetworks); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.fqdn, unittest.equals('foo')); |
| checkUnnamed2783(o.labels); |
| checkUnnamed2784(o.locations); |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.reservedIpRange, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.statusMessage, unittest.equals('foo')); |
| checkUnnamed2785(o.trusts); |
| unittest.expect(o.updateTime, unittest.equals('foo')); |
| } |
| buildCounterDomain--; |
| } |
| |
| core.int buildCounterEmpty = 0; |
| buildEmpty() { |
| var o = new api.Empty(); |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| return o; |
| } |
| |
| checkEmpty(api.Empty o) { |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| } |
| |
| core.int buildCounterExpr = 0; |
| buildExpr() { |
| var o = new api.Expr(); |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| o.description = "foo"; |
| o.expression = "foo"; |
| o.location = "foo"; |
| o.title = "foo"; |
| } |
| buildCounterExpr--; |
| return o; |
| } |
| |
| checkExpr(api.Expr o) { |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| unittest.expect(o.description, unittest.equals('foo')); |
| unittest.expect(o.expression, unittest.equals('foo')); |
| unittest.expect(o.location, unittest.equals('foo')); |
| unittest.expect(o.title, unittest.equals('foo')); |
| } |
| buildCounterExpr--; |
| } |
| |
| core.int buildCounterGoogleCloudManagedidentitiesV1OpMetadata = 0; |
| buildGoogleCloudManagedidentitiesV1OpMetadata() { |
| var o = new api.GoogleCloudManagedidentitiesV1OpMetadata(); |
| buildCounterGoogleCloudManagedidentitiesV1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1OpMetadata < 3) { |
| o.apiVersion = "foo"; |
| o.createTime = "foo"; |
| o.endTime = "foo"; |
| o.requestedCancellation = true; |
| o.target = "foo"; |
| o.verb = "foo"; |
| } |
| buildCounterGoogleCloudManagedidentitiesV1OpMetadata--; |
| return o; |
| } |
| |
| checkGoogleCloudManagedidentitiesV1OpMetadata( |
| api.GoogleCloudManagedidentitiesV1OpMetadata o) { |
| buildCounterGoogleCloudManagedidentitiesV1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1OpMetadata < 3) { |
| unittest.expect(o.apiVersion, unittest.equals('foo')); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| unittest.expect(o.requestedCancellation, unittest.isTrue); |
| unittest.expect(o.target, unittest.equals('foo')); |
| unittest.expect(o.verb, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudManagedidentitiesV1OpMetadata--; |
| } |
| |
| core.int buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata = 0; |
| buildGoogleCloudManagedidentitiesV1alpha1OpMetadata() { |
| var o = new api.GoogleCloudManagedidentitiesV1alpha1OpMetadata(); |
| buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata < 3) { |
| o.apiVersion = "foo"; |
| o.createTime = "foo"; |
| o.endTime = "foo"; |
| o.requestedCancellation = true; |
| o.target = "foo"; |
| o.verb = "foo"; |
| } |
| buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata--; |
| return o; |
| } |
| |
| checkGoogleCloudManagedidentitiesV1alpha1OpMetadata( |
| api.GoogleCloudManagedidentitiesV1alpha1OpMetadata o) { |
| buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata < 3) { |
| unittest.expect(o.apiVersion, unittest.equals('foo')); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| unittest.expect(o.requestedCancellation, unittest.isTrue); |
| unittest.expect(o.target, unittest.equals('foo')); |
| unittest.expect(o.verb, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudManagedidentitiesV1alpha1OpMetadata--; |
| } |
| |
| core.int buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata = 0; |
| buildGoogleCloudManagedidentitiesV1beta1OpMetadata() { |
| var o = new api.GoogleCloudManagedidentitiesV1beta1OpMetadata(); |
| buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata < 3) { |
| o.apiVersion = "foo"; |
| o.createTime = "foo"; |
| o.endTime = "foo"; |
| o.requestedCancellation = true; |
| o.target = "foo"; |
| o.verb = "foo"; |
| } |
| buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata--; |
| return o; |
| } |
| |
| checkGoogleCloudManagedidentitiesV1beta1OpMetadata( |
| api.GoogleCloudManagedidentitiesV1beta1OpMetadata o) { |
| buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata++; |
| if (buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata < 3) { |
| unittest.expect(o.apiVersion, unittest.equals('foo')); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| unittest.expect(o.requestedCancellation, unittest.isTrue); |
| unittest.expect(o.target, unittest.equals('foo')); |
| unittest.expect(o.verb, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudManagedidentitiesV1beta1OpMetadata--; |
| } |
| |
| buildUnnamed2786() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed2786(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')); |
| } |
| |
| buildUnnamed2787() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed2787(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')); |
| } |
| |
| buildUnnamed2788() { |
| var o = new core.Map<core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule>(); |
| o["x"] = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(); |
| o["y"] = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(); |
| return o; |
| } |
| |
| checkUnnamed2788( |
| core.Map<core.String, |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule( |
| o["x"]); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule( |
| o["y"]); |
| } |
| |
| buildUnnamed2789() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed2789(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')); |
| } |
| |
| buildUnnamed2790() { |
| var o = new core.List< |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource>(); |
| o.add( |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource()); |
| o.add( |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource()); |
| return o; |
| } |
| |
| checkUnnamed2790( |
| core.List< |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(o[0]); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(o[1]); |
| } |
| |
| buildUnnamed2791() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed2791(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 buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance = |
| 0; |
| buildGoogleCloudSaasacceleratorManagementProvidersV1Instance() { |
| var o = new api.GoogleCloudSaasacceleratorManagementProvidersV1Instance(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance < 3) { |
| o.consumerDefinedName = "foo"; |
| o.createTime = "foo"; |
| o.labels = buildUnnamed2786(); |
| o.maintenancePolicyNames = buildUnnamed2787(); |
| o.maintenanceSchedules = buildUnnamed2788(); |
| o.maintenanceSettings = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(); |
| o.name = "foo"; |
| o.producerMetadata = buildUnnamed2789(); |
| o.provisionedResources = buildUnnamed2790(); |
| o.slmInstanceTemplate = "foo"; |
| o.sloMetadata = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(); |
| o.softwareVersions = buildUnnamed2791(); |
| o.state = "foo"; |
| o.tenantProjectId = "foo"; |
| o.updateTime = "foo"; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance--; |
| return o; |
| } |
| |
| checkGoogleCloudSaasacceleratorManagementProvidersV1Instance( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1Instance o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance < 3) { |
| unittest.expect(o.consumerDefinedName, unittest.equals('foo')); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| checkUnnamed2786(o.labels); |
| checkUnnamed2787(o.maintenancePolicyNames); |
| checkUnnamed2788(o.maintenanceSchedules); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings( |
| o.maintenanceSettings); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed2789(o.producerMetadata); |
| checkUnnamed2790(o.provisionedResources); |
| unittest.expect(o.slmInstanceTemplate, unittest.equals('foo')); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata( |
| o.sloMetadata); |
| checkUnnamed2791(o.softwareVersions); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.tenantProjectId, unittest.equals('foo')); |
| unittest.expect(o.updateTime, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1Instance--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule = |
| 0; |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule() { |
| var o = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule < |
| 3) { |
| o.canReschedule = true; |
| o.endTime = "foo"; |
| o.rolloutManagementPolicy = "foo"; |
| o.startTime = "foo"; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule--; |
| return o; |
| } |
| |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule < |
| 3) { |
| unittest.expect(o.canReschedule, unittest.isTrue); |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| unittest.expect(o.rolloutManagementPolicy, unittest.equals('foo')); |
| unittest.expect(o.startTime, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings = |
| 0; |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings() { |
| var o = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings < |
| 3) { |
| o.exclude = true; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings--; |
| return o; |
| } |
| |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings < |
| 3) { |
| unittest.expect(o.exclude, unittest.isTrue); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings--; |
| } |
| |
| buildUnnamed2792() { |
| var o = new core |
| .List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion>(); |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion()); |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion()); |
| return o; |
| } |
| |
| checkUnnamed2792( |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(o[0]); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(o[1]); |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata = |
| 0; |
| buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata() { |
| var o = |
| new api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata < |
| 3) { |
| o.exclusions = buildUnnamed2792(); |
| o.location = "foo"; |
| o.nodeId = "foo"; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata--; |
| return o; |
| } |
| |
| checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata < |
| 3) { |
| checkUnnamed2792(o.exclusions); |
| unittest.expect(o.location, unittest.equals('foo')); |
| unittest.expect(o.nodeId, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource = |
| 0; |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource() { |
| var o = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource < |
| 3) { |
| o.resourceType = "foo"; |
| o.resourceUrl = "foo"; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource--; |
| return o; |
| } |
| |
| checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource < |
| 3) { |
| unittest.expect(o.resourceType, unittest.equals('foo')); |
| unittest.expect(o.resourceUrl, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility = |
| 0; |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility() { |
| var o = |
| new api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility < |
| 3) { |
| o.eligible = true; |
| o.reason = "foo"; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility--; |
| return o; |
| } |
| |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility < |
| 3) { |
| unittest.expect(o.eligible, unittest.isTrue); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion = 0; |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion() { |
| var o = new api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion < |
| 3) { |
| o.duration = "foo"; |
| o.reason = "foo"; |
| o.sliName = "foo"; |
| o.startTime = "foo"; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion--; |
| return o; |
| } |
| |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion < |
| 3) { |
| unittest.expect(o.duration, unittest.equals('foo')); |
| unittest.expect(o.reason, unittest.equals('foo')); |
| unittest.expect(o.sliName, unittest.equals('foo')); |
| unittest.expect(o.startTime, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion--; |
| } |
| |
| buildUnnamed2793() { |
| var o = new core |
| .List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion>(); |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion()); |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion()); |
| return o; |
| } |
| |
| checkUnnamed2793( |
| core.List<api.GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(o[0]); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(o[1]); |
| } |
| |
| buildUnnamed2794() { |
| var o = new core.List< |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata>(); |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata()); |
| o.add(buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata()); |
| return o; |
| } |
| |
| checkUnnamed2794( |
| core.List< |
| api.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata> |
| o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(o[0]); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(o[1]); |
| } |
| |
| core.int |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata = 0; |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata() { |
| var o = new api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(); |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata < |
| 3) { |
| o.eligibility = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(); |
| o.exclusions = buildUnnamed2793(); |
| o.nodes = buildUnnamed2794(); |
| o.tier = "foo"; |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata--; |
| return o; |
| } |
| |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata( |
| api.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata o) { |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata++; |
| if (buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata < |
| 3) { |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility( |
| o.eligibility); |
| checkUnnamed2793(o.exclusions); |
| checkUnnamed2794(o.nodes); |
| unittest.expect(o.tier, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata--; |
| } |
| |
| buildUnnamed2795() { |
| var o = new core.List<api.Domain>(); |
| o.add(buildDomain()); |
| o.add(buildDomain()); |
| return o; |
| } |
| |
| checkUnnamed2795(core.List<api.Domain> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkDomain(o[0]); |
| checkDomain(o[1]); |
| } |
| |
| buildUnnamed2796() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed2796(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 buildCounterListDomainsResponse = 0; |
| buildListDomainsResponse() { |
| var o = new api.ListDomainsResponse(); |
| buildCounterListDomainsResponse++; |
| if (buildCounterListDomainsResponse < 3) { |
| o.domains = buildUnnamed2795(); |
| o.nextPageToken = "foo"; |
| o.unreachable = buildUnnamed2796(); |
| } |
| buildCounterListDomainsResponse--; |
| return o; |
| } |
| |
| checkListDomainsResponse(api.ListDomainsResponse o) { |
| buildCounterListDomainsResponse++; |
| if (buildCounterListDomainsResponse < 3) { |
| checkUnnamed2795(o.domains); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed2796(o.unreachable); |
| } |
| buildCounterListDomainsResponse--; |
| } |
| |
| buildUnnamed2797() { |
| var o = new core.List<api.Location>(); |
| o.add(buildLocation()); |
| o.add(buildLocation()); |
| return o; |
| } |
| |
| checkUnnamed2797(core.List<api.Location> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLocation(o[0]); |
| checkLocation(o[1]); |
| } |
| |
| core.int buildCounterListLocationsResponse = 0; |
| buildListLocationsResponse() { |
| var o = new api.ListLocationsResponse(); |
| buildCounterListLocationsResponse++; |
| if (buildCounterListLocationsResponse < 3) { |
| o.locations = buildUnnamed2797(); |
| o.nextPageToken = "foo"; |
| } |
| buildCounterListLocationsResponse--; |
| return o; |
| } |
| |
| checkListLocationsResponse(api.ListLocationsResponse o) { |
| buildCounterListLocationsResponse++; |
| if (buildCounterListLocationsResponse < 3) { |
| checkUnnamed2797(o.locations); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| } |
| buildCounterListLocationsResponse--; |
| } |
| |
| buildUnnamed2798() { |
| var o = new core.List<api.Operation>(); |
| o.add(buildOperation()); |
| o.add(buildOperation()); |
| return o; |
| } |
| |
| checkUnnamed2798(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 = buildUnnamed2798(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed2798(o.operations); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| buildUnnamed2799() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed2799(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')); |
| } |
| |
| buildUnnamed2800() { |
| 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; |
| } |
| |
| checkUnnamed2800(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted1 = (o["x"]) as core.Map; |
| unittest.expect(casted1, unittest.hasLength(3)); |
| unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); |
| unittest.expect(casted1["bool"], unittest.equals(true)); |
| unittest.expect(casted1["string"], unittest.equals('foo')); |
| var casted2 = (o["y"]) as core.Map; |
| unittest.expect(casted2, unittest.hasLength(3)); |
| unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); |
| unittest.expect(casted2["bool"], unittest.equals(true)); |
| unittest.expect(casted2["string"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterLocation = 0; |
| buildLocation() { |
| var o = new api.Location(); |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| o.displayName = "foo"; |
| o.labels = buildUnnamed2799(); |
| o.locationId = "foo"; |
| o.metadata = buildUnnamed2800(); |
| o.name = "foo"; |
| } |
| buildCounterLocation--; |
| return o; |
| } |
| |
| checkLocation(api.Location o) { |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| unittest.expect(o.displayName, unittest.equals('foo')); |
| checkUnnamed2799(o.labels); |
| unittest.expect(o.locationId, unittest.equals('foo')); |
| checkUnnamed2800(o.metadata); |
| unittest.expect(o.name, unittest.equals('foo')); |
| } |
| buildCounterLocation--; |
| } |
| |
| buildUnnamed2801() { |
| 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; |
| } |
| |
| checkUnnamed2801(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')); |
| } |
| |
| buildUnnamed2802() { |
| 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; |
| } |
| |
| checkUnnamed2802(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 buildCounterOperation = 0; |
| buildOperation() { |
| var o = new api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed2801(); |
| o.name = "foo"; |
| o.response = buildUnnamed2802(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done, unittest.isTrue); |
| checkStatus(o.error); |
| checkUnnamed2801(o.metadata); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed2802(o.response); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.int buildCounterOperationMetadata = 0; |
| buildOperationMetadata() { |
| var o = new api.OperationMetadata(); |
| buildCounterOperationMetadata++; |
| if (buildCounterOperationMetadata < 3) { |
| o.apiVersion = "foo"; |
| o.cancelRequested = true; |
| o.createTime = "foo"; |
| o.endTime = "foo"; |
| o.statusDetail = "foo"; |
| o.target = "foo"; |
| o.verb = "foo"; |
| } |
| buildCounterOperationMetadata--; |
| return o; |
| } |
| |
| checkOperationMetadata(api.OperationMetadata o) { |
| buildCounterOperationMetadata++; |
| if (buildCounterOperationMetadata < 3) { |
| unittest.expect(o.apiVersion, unittest.equals('foo')); |
| unittest.expect(o.cancelRequested, unittest.isTrue); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| unittest.expect(o.statusDetail, unittest.equals('foo')); |
| unittest.expect(o.target, unittest.equals('foo')); |
| unittest.expect(o.verb, unittest.equals('foo')); |
| } |
| buildCounterOperationMetadata--; |
| } |
| |
| buildUnnamed2803() { |
| var o = new core.List<api.Binding>(); |
| o.add(buildBinding()); |
| o.add(buildBinding()); |
| return o; |
| } |
| |
| checkUnnamed2803(core.List<api.Binding> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBinding(o[0]); |
| checkBinding(o[1]); |
| } |
| |
| core.int buildCounterPolicy = 0; |
| buildPolicy() { |
| var o = new api.Policy(); |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| o.bindings = buildUnnamed2803(); |
| o.etag = "foo"; |
| o.version = 42; |
| } |
| buildCounterPolicy--; |
| return o; |
| } |
| |
| checkPolicy(api.Policy o) { |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| checkUnnamed2803(o.bindings); |
| unittest.expect(o.etag, unittest.equals('foo')); |
| unittest.expect(o.version, unittest.equals(42)); |
| } |
| buildCounterPolicy--; |
| } |
| |
| buildUnnamed2804() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed2804(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 buildCounterReconfigureTrustRequest = 0; |
| buildReconfigureTrustRequest() { |
| var o = new api.ReconfigureTrustRequest(); |
| buildCounterReconfigureTrustRequest++; |
| if (buildCounterReconfigureTrustRequest < 3) { |
| o.targetDnsIpAddresses = buildUnnamed2804(); |
| o.targetDomainName = "foo"; |
| } |
| buildCounterReconfigureTrustRequest--; |
| return o; |
| } |
| |
| checkReconfigureTrustRequest(api.ReconfigureTrustRequest o) { |
| buildCounterReconfigureTrustRequest++; |
| if (buildCounterReconfigureTrustRequest < 3) { |
| checkUnnamed2804(o.targetDnsIpAddresses); |
| unittest.expect(o.targetDomainName, unittest.equals('foo')); |
| } |
| buildCounterReconfigureTrustRequest--; |
| } |
| |
| core.int buildCounterResetAdminPasswordRequest = 0; |
| buildResetAdminPasswordRequest() { |
| var o = new api.ResetAdminPasswordRequest(); |
| buildCounterResetAdminPasswordRequest++; |
| if (buildCounterResetAdminPasswordRequest < 3) {} |
| buildCounterResetAdminPasswordRequest--; |
| return o; |
| } |
| |
| checkResetAdminPasswordRequest(api.ResetAdminPasswordRequest o) { |
| buildCounterResetAdminPasswordRequest++; |
| if (buildCounterResetAdminPasswordRequest < 3) {} |
| buildCounterResetAdminPasswordRequest--; |
| } |
| |
| core.int buildCounterResetAdminPasswordResponse = 0; |
| buildResetAdminPasswordResponse() { |
| var o = new api.ResetAdminPasswordResponse(); |
| buildCounterResetAdminPasswordResponse++; |
| if (buildCounterResetAdminPasswordResponse < 3) { |
| o.password = "foo"; |
| } |
| buildCounterResetAdminPasswordResponse--; |
| return o; |
| } |
| |
| checkResetAdminPasswordResponse(api.ResetAdminPasswordResponse o) { |
| buildCounterResetAdminPasswordResponse++; |
| if (buildCounterResetAdminPasswordResponse < 3) { |
| unittest.expect(o.password, unittest.equals('foo')); |
| } |
| buildCounterResetAdminPasswordResponse--; |
| } |
| |
| core.int buildCounterSetIamPolicyRequest = 0; |
| buildSetIamPolicyRequest() { |
| var o = new api.SetIamPolicyRequest(); |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| o.policy = buildPolicy(); |
| } |
| buildCounterSetIamPolicyRequest--; |
| return o; |
| } |
| |
| checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| checkPolicy(o.policy); |
| } |
| buildCounterSetIamPolicyRequest--; |
| } |
| |
| buildUnnamed2805() { |
| 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; |
| } |
| |
| checkUnnamed2805(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')); |
| } |
| |
| buildUnnamed2806() { |
| var o = new core.List<core.Map<core.String, core.Object>>(); |
| o.add(buildUnnamed2805()); |
| o.add(buildUnnamed2805()); |
| return o; |
| } |
| |
| checkUnnamed2806(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed2805(o[0]); |
| checkUnnamed2805(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| buildStatus() { |
| var o = new api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed2806(); |
| o.message = "foo"; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect(o.code, unittest.equals(42)); |
| checkUnnamed2806(o.details); |
| unittest.expect(o.message, unittest.equals('foo')); |
| } |
| buildCounterStatus--; |
| } |
| |
| buildUnnamed2807() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed2807(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterTestIamPermissionsRequest = 0; |
| buildTestIamPermissionsRequest() { |
| var o = new api.TestIamPermissionsRequest(); |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| o.permissions = buildUnnamed2807(); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| return o; |
| } |
| |
| checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| checkUnnamed2807(o.permissions); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| } |
| |
| buildUnnamed2808() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed2808(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterTestIamPermissionsResponse = 0; |
| buildTestIamPermissionsResponse() { |
| var o = new api.TestIamPermissionsResponse(); |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| o.permissions = buildUnnamed2808(); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| return o; |
| } |
| |
| checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| checkUnnamed2808(o.permissions); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| } |
| |
| buildUnnamed2809() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed2809(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 buildCounterTrust = 0; |
| buildTrust() { |
| var o = new api.Trust(); |
| buildCounterTrust++; |
| if (buildCounterTrust < 3) { |
| o.createTime = "foo"; |
| o.lastTrustHeartbeatTime = "foo"; |
| o.selectiveAuthentication = true; |
| o.state = "foo"; |
| o.stateDescription = "foo"; |
| o.targetDnsIpAddresses = buildUnnamed2809(); |
| o.targetDomainName = "foo"; |
| o.trustDirection = "foo"; |
| o.trustHandshakeSecret = "foo"; |
| o.trustType = "foo"; |
| o.updateTime = "foo"; |
| } |
| buildCounterTrust--; |
| return o; |
| } |
| |
| checkTrust(api.Trust o) { |
| buildCounterTrust++; |
| if (buildCounterTrust < 3) { |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.lastTrustHeartbeatTime, unittest.equals('foo')); |
| unittest.expect(o.selectiveAuthentication, unittest.isTrue); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.stateDescription, unittest.equals('foo')); |
| checkUnnamed2809(o.targetDnsIpAddresses); |
| unittest.expect(o.targetDomainName, unittest.equals('foo')); |
| unittest.expect(o.trustDirection, unittest.equals('foo')); |
| unittest.expect(o.trustHandshakeSecret, unittest.equals('foo')); |
| unittest.expect(o.trustType, unittest.equals('foo')); |
| unittest.expect(o.updateTime, unittest.equals('foo')); |
| } |
| buildCounterTrust--; |
| } |
| |
| core.int buildCounterValidateTrustRequest = 0; |
| buildValidateTrustRequest() { |
| var o = new api.ValidateTrustRequest(); |
| buildCounterValidateTrustRequest++; |
| if (buildCounterValidateTrustRequest < 3) { |
| o.trust = buildTrust(); |
| } |
| buildCounterValidateTrustRequest--; |
| return o; |
| } |
| |
| checkValidateTrustRequest(api.ValidateTrustRequest o) { |
| buildCounterValidateTrustRequest++; |
| if (buildCounterValidateTrustRequest < 3) { |
| checkTrust(o.trust); |
| } |
| buildCounterValidateTrustRequest--; |
| } |
| |
| main() { |
| unittest.group("obj-schema-AttachTrustRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildAttachTrustRequest(); |
| var od = new api.AttachTrustRequest.fromJson(o.toJson()); |
| checkAttachTrustRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Binding", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildBinding(); |
| var od = new api.Binding.fromJson(o.toJson()); |
| checkBinding(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-DetachTrustRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDetachTrustRequest(); |
| var od = new api.DetachTrustRequest.fromJson(o.toJson()); |
| checkDetachTrustRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Domain", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDomain(); |
| var od = new api.Domain.fromJson(o.toJson()); |
| checkDomain(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-Expr", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildExpr(); |
| var od = new api.Expr.fromJson(o.toJson()); |
| checkExpr(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-GoogleCloudManagedidentitiesV1OpMetadata", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildGoogleCloudManagedidentitiesV1OpMetadata(); |
| var od = |
| new api.GoogleCloudManagedidentitiesV1OpMetadata.fromJson(o.toJson()); |
| checkGoogleCloudManagedidentitiesV1OpMetadata(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-GoogleCloudManagedidentitiesV1alpha1OpMetadata", |
| () { |
| unittest.test("to-json--from-json", () { |
| var o = buildGoogleCloudManagedidentitiesV1alpha1OpMetadata(); |
| var od = new api.GoogleCloudManagedidentitiesV1alpha1OpMetadata.fromJson( |
| o.toJson()); |
| checkGoogleCloudManagedidentitiesV1alpha1OpMetadata(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-GoogleCloudManagedidentitiesV1beta1OpMetadata", |
| () { |
| unittest.test("to-json--from-json", () { |
| var o = buildGoogleCloudManagedidentitiesV1beta1OpMetadata(); |
| var od = new api.GoogleCloudManagedidentitiesV1beta1OpMetadata.fromJson( |
| o.toJson()); |
| checkGoogleCloudManagedidentitiesV1beta1OpMetadata(od); |
| }); |
| }); |
| |
| unittest.group( |
| "obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1Instance", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildGoogleCloudSaasacceleratorManagementProvidersV1Instance(); |
| var od = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1Instance.fromJson( |
| o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1Instance(od); |
| }); |
| }); |
| |
| unittest.group( |
| "obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule", |
| () { |
| unittest.test("to-json--from-json", () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule(); |
| var od = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule.fromJson( |
| o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule( |
| od); |
| }); |
| }); |
| |
| unittest.group( |
| "obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings", |
| () { |
| unittest.test("to-json--from-json", () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings(); |
| var od = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings.fromJson( |
| o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings( |
| od); |
| }); |
| }); |
| |
| unittest.group( |
| "obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata", |
| () { |
| unittest.test("to-json--from-json", () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(); |
| var od = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata.fromJson( |
| o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata(od); |
| }); |
| }); |
| |
| unittest.group( |
| "obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource", |
| () { |
| unittest.test("to-json--from-json", () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource(); |
| var od = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource.fromJson( |
| o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource( |
| od); |
| }); |
| }); |
| |
| unittest.group( |
| "obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility", |
| () { |
| unittest.test("to-json--from-json", () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(); |
| var od = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1SloEligibility.fromJson( |
| o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloEligibility(od); |
| }); |
| }); |
| |
| unittest.group( |
| "obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion", |
| () { |
| unittest.test("to-json--from-json", () { |
| var o = |
| buildGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(); |
| var od = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion.fromJson( |
| o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloExclusion(od); |
| }); |
| }); |
| |
| unittest.group( |
| "obj-schema-GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata", |
| () { |
| unittest.test("to-json--from-json", () { |
| var o = buildGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(); |
| var od = new api |
| .GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata.fromJson( |
| o.toJson()); |
| checkGoogleCloudSaasacceleratorManagementProvidersV1SloMetadata(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ListDomainsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListDomainsResponse(); |
| var od = new api.ListDomainsResponse.fromJson(o.toJson()); |
| checkListDomainsResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ListLocationsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListLocationsResponse(); |
| var od = new api.ListLocationsResponse.fromJson(o.toJson()); |
| checkListLocationsResponse(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-Location", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildLocation(); |
| var od = new api.Location.fromJson(o.toJson()); |
| checkLocation(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Operation", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOperation(); |
| var od = new api.Operation.fromJson(o.toJson()); |
| checkOperation(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OperationMetadata", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOperationMetadata(); |
| var od = new api.OperationMetadata.fromJson(o.toJson()); |
| checkOperationMetadata(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Policy", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPolicy(); |
| var od = new api.Policy.fromJson(o.toJson()); |
| checkPolicy(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ReconfigureTrustRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildReconfigureTrustRequest(); |
| var od = new api.ReconfigureTrustRequest.fromJson(o.toJson()); |
| checkReconfigureTrustRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ResetAdminPasswordRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildResetAdminPasswordRequest(); |
| var od = new api.ResetAdminPasswordRequest.fromJson(o.toJson()); |
| checkResetAdminPasswordRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ResetAdminPasswordResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildResetAdminPasswordResponse(); |
| var od = new api.ResetAdminPasswordResponse.fromJson(o.toJson()); |
| checkResetAdminPasswordResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-SetIamPolicyRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSetIamPolicyRequest(); |
| var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); |
| checkSetIamPolicyRequest(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-TestIamPermissionsRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTestIamPermissionsRequest(); |
| var od = new api.TestIamPermissionsRequest.fromJson(o.toJson()); |
| checkTestIamPermissionsRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TestIamPermissionsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTestIamPermissionsResponse(); |
| var od = new api.TestIamPermissionsResponse.fromJson(o.toJson()); |
| checkTestIamPermissionsResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Trust", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTrust(); |
| var od = new api.Trust.fromJson(o.toJson()); |
| checkTrust(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ValidateTrustRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildValidateTrustRequest(); |
| var od = new api.ValidateTrustRequest.fromJson(o.toJson()); |
| checkValidateTrustRequest(od); |
| }); |
| }); |
| |
| unittest.group("resource-ProjectsLocationsResourceApi", () { |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildLocation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkLocation(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations; |
| var arg_name = "foo"; |
| var arg_filter = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_includeUnrevealedLocations = true; |
| 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 = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["includeUnrevealedLocations"].first, |
| unittest.equals("$arg_includeUnrevealedLocations")); |
| 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(buildListLocationsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_name, |
| filter: arg_filter, |
| pageToken: arg_pageToken, |
| includeUnrevealedLocations: arg_includeUnrevealedLocations, |
| pageSize: arg_pageSize, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListLocationsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group("resource-ProjectsLocationsGlobalDomainsResourceApi", () { |
| unittest.test("method--attachTrust", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_request = buildAttachTrustRequest(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.AttachTrustRequest.fromJson(json); |
| checkAttachTrustRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .attachTrust(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--create", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_request = buildDomain(); |
| var arg_parent = "foo"; |
| var arg_domainName = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.Domain.fromJson(json); |
| checkDomain(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["domainName"].first, unittest.equals(arg_domainName)); |
| 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 |
| .create(arg_request, arg_parent, |
| domainName: arg_domainName, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--detachTrust", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_request = buildDetachTrustRequest(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.DetachTrustRequest.fromJson(json); |
| checkDetachTrustRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .detachTrust(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildDomain()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkDomain(response); |
| }))); |
| }); |
| |
| unittest.test("method--getIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_resource = "foo"; |
| var arg_options_requestedPolicyVersion = 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 = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| core.int.parse(queryMap["options.requestedPolicyVersion"].first), |
| unittest.equals(arg_options_requestedPolicyVersion)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_resource, |
| options_requestedPolicyVersion: |
| arg_options_requestedPolicyVersion, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_parent = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_orderBy = "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 = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect( |
| queryMap["orderBy"].first, unittest.equals(arg_orderBy)); |
| 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(buildListDomainsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| pageToken: arg_pageToken, |
| orderBy: arg_orderBy, |
| pageSize: arg_pageSize, |
| filter: arg_filter, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListDomainsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--patch", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_request = buildDomain(); |
| var arg_name = "foo"; |
| var arg_updateMask = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.Domain.fromJson(json); |
| checkDomain(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["updateMask"].first, unittest.equals(arg_updateMask)); |
| 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 |
| .patch(arg_request, arg_name, |
| updateMask: arg_updateMask, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--reconfigureTrust", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_request = buildReconfigureTrustRequest(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.ReconfigureTrustRequest.fromJson(json); |
| checkReconfigureTrustRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .reconfigureTrust(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--resetAdminPassword", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_request = buildResetAdminPasswordRequest(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.ResetAdminPasswordRequest.fromJson(json); |
| checkResetAdminPasswordRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildResetAdminPasswordResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .resetAdminPassword(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkResetAdminPasswordResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--setIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--testIamPermissions", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--validateTrust", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalDomainsResourceApi res = |
| new api.ManagedidentitiesApi(mock).projects.locations.global.domains; |
| var arg_request = buildValidateTrustRequest(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.ValidateTrustRequest.fromJson(json); |
| checkValidateTrustRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .validateTrust(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group("resource-ProjectsLocationsGlobalOperationsResourceApi", () { |
| unittest.test("method--cancel", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalOperationsResourceApi res = |
| new api.ManagedidentitiesApi(mock) |
| .projects |
| .locations |
| .global |
| .operations; |
| var arg_request = buildCancelOperationRequest(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.CancelOperationRequest.fromJson(json); |
| checkCancelOperationRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .cancel(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalOperationsResourceApi res = |
| new api.ManagedidentitiesApi(mock) |
| .projects |
| .locations |
| .global |
| .operations; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalOperationsResourceApi res = |
| new api.ManagedidentitiesApi(mock) |
| .projects |
| .locations |
| .global |
| .operations; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsGlobalOperationsResourceApi res = |
| new api.ManagedidentitiesApi(mock) |
| .projects |
| .locations |
| .global |
| .operations; |
| var arg_name = "foo"; |
| var arg_pageSize = 42; |
| var arg_pageToken = "foo"; |
| var arg_filter = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildListOperationsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_name, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| filter: arg_filter, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListOperationsResponse(response); |
| }))); |
| }); |
| }); |
| } |