| // ignore_for_file: camel_case_types |
| // ignore_for_file: cascade_invocations |
| // ignore_for_file: comment_references |
| // ignore_for_file: file_names |
| // ignore_for_file: library_names |
| // ignore_for_file: lines_longer_than_80_chars |
| // ignore_for_file: non_constant_identifier_names |
| // ignore_for_file: prefer_const_declarations |
| // ignore_for_file: prefer_expression_function_bodies |
| // ignore_for_file: prefer_final_locals |
| // ignore_for_file: prefer_interpolation_to_compose_strings |
| // ignore_for_file: unnecessary_brace_in_string_interps |
| // ignore_for_file: unnecessary_cast |
| // ignore_for_file: unnecessary_lambdas |
| // ignore_for_file: unnecessary_parenthesis |
| // ignore_for_file: unnecessary_string_interpolations |
| // ignore_for_file: unused_local_variable |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert; |
| import 'dart:core' as core; |
| |
| import 'package:googleapis_beta/cloudfunctions/v2beta.dart' as api; |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import '../test_shared.dart'; |
| |
| core.List<api.AuditLogConfig> buildUnnamed0() => [ |
| buildAuditLogConfig(), |
| buildAuditLogConfig(), |
| ]; |
| |
| void checkUnnamed0(core.List<api.AuditLogConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuditLogConfig(o[0]); |
| checkAuditLogConfig(o[1]); |
| } |
| |
| core.int buildCounterAuditConfig = 0; |
| api.AuditConfig buildAuditConfig() { |
| final o = api.AuditConfig(); |
| buildCounterAuditConfig++; |
| if (buildCounterAuditConfig < 3) { |
| o.auditLogConfigs = buildUnnamed0(); |
| o.service = 'foo'; |
| } |
| buildCounterAuditConfig--; |
| return o; |
| } |
| |
| void checkAuditConfig(api.AuditConfig o) { |
| buildCounterAuditConfig++; |
| if (buildCounterAuditConfig < 3) { |
| checkUnnamed0(o.auditLogConfigs!); |
| unittest.expect( |
| o.service!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterAuditConfig--; |
| } |
| |
| core.List<core.String> buildUnnamed1() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed1(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 buildCounterAuditLogConfig = 0; |
| api.AuditLogConfig buildAuditLogConfig() { |
| final o = api.AuditLogConfig(); |
| buildCounterAuditLogConfig++; |
| if (buildCounterAuditLogConfig < 3) { |
| o.exemptedMembers = buildUnnamed1(); |
| o.logType = 'foo'; |
| } |
| buildCounterAuditLogConfig--; |
| return o; |
| } |
| |
| void checkAuditLogConfig(api.AuditLogConfig o) { |
| buildCounterAuditLogConfig++; |
| if (buildCounterAuditLogConfig < 3) { |
| checkUnnamed1(o.exemptedMembers!); |
| unittest.expect( |
| o.logType!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterAuditLogConfig--; |
| } |
| |
| core.List<core.String> buildUnnamed2() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed2(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; |
| api.Binding buildBinding() { |
| final o = api.Binding(); |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| o.condition = buildExpr(); |
| o.members = buildUnnamed2(); |
| o.role = 'foo'; |
| } |
| buildCounterBinding--; |
| return o; |
| } |
| |
| void checkBinding(api.Binding o) { |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| checkExpr(o.condition!); |
| checkUnnamed2(o.members!); |
| unittest.expect( |
| o.role!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterBinding--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed3() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed3(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 buildCounterBuildConfig = 0; |
| api.BuildConfig buildBuildConfig() { |
| final o = api.BuildConfig(); |
| buildCounterBuildConfig++; |
| if (buildCounterBuildConfig < 3) { |
| o.build = 'foo'; |
| o.dockerRepository = 'foo'; |
| o.entryPoint = 'foo'; |
| o.environmentVariables = buildUnnamed3(); |
| o.runtime = 'foo'; |
| o.source = buildSource(); |
| o.sourceProvenance = buildSourceProvenance(); |
| o.workerPool = 'foo'; |
| } |
| buildCounterBuildConfig--; |
| return o; |
| } |
| |
| void checkBuildConfig(api.BuildConfig o) { |
| buildCounterBuildConfig++; |
| if (buildCounterBuildConfig < 3) { |
| unittest.expect( |
| o.build!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.dockerRepository!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.entryPoint!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed3(o.environmentVariables!); |
| unittest.expect( |
| o.runtime!, |
| unittest.equals('foo'), |
| ); |
| checkSource(o.source!); |
| checkSourceProvenance(o.sourceProvenance!); |
| unittest.expect( |
| o.workerPool!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterBuildConfig--; |
| } |
| |
| core.int buildCounterEventFilter = 0; |
| api.EventFilter buildEventFilter() { |
| final o = api.EventFilter(); |
| buildCounterEventFilter++; |
| if (buildCounterEventFilter < 3) { |
| o.attribute = 'foo'; |
| o.operator = 'foo'; |
| o.value = 'foo'; |
| } |
| buildCounterEventFilter--; |
| return o; |
| } |
| |
| void checkEventFilter(api.EventFilter o) { |
| buildCounterEventFilter++; |
| if (buildCounterEventFilter < 3) { |
| unittest.expect( |
| o.attribute!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.operator!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.value!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterEventFilter--; |
| } |
| |
| core.List<api.EventFilter> buildUnnamed4() => [ |
| buildEventFilter(), |
| buildEventFilter(), |
| ]; |
| |
| void checkUnnamed4(core.List<api.EventFilter> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEventFilter(o[0]); |
| checkEventFilter(o[1]); |
| } |
| |
| core.int buildCounterEventTrigger = 0; |
| api.EventTrigger buildEventTrigger() { |
| final o = api.EventTrigger(); |
| buildCounterEventTrigger++; |
| if (buildCounterEventTrigger < 3) { |
| o.channel = 'foo'; |
| o.eventFilters = buildUnnamed4(); |
| o.eventType = 'foo'; |
| o.pubsubTopic = 'foo'; |
| o.retryPolicy = 'foo'; |
| o.serviceAccountEmail = 'foo'; |
| o.trigger = 'foo'; |
| o.triggerRegion = 'foo'; |
| } |
| buildCounterEventTrigger--; |
| return o; |
| } |
| |
| void checkEventTrigger(api.EventTrigger o) { |
| buildCounterEventTrigger++; |
| if (buildCounterEventTrigger < 3) { |
| unittest.expect( |
| o.channel!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed4(o.eventFilters!); |
| unittest.expect( |
| o.eventType!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.pubsubTopic!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.retryPolicy!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.serviceAccountEmail!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.trigger!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.triggerRegion!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterEventTrigger--; |
| } |
| |
| core.int buildCounterExpr = 0; |
| api.Expr buildExpr() { |
| final o = api.Expr(); |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| o.description = 'foo'; |
| o.expression = 'foo'; |
| o.location = 'foo'; |
| o.title = 'foo'; |
| } |
| buildCounterExpr--; |
| return o; |
| } |
| |
| void 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.Map<core.String, core.String> buildUnnamed5() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed5(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.List<api.GoogleCloudFunctionsV2betaStateMessage> buildUnnamed6() => [ |
| buildGoogleCloudFunctionsV2betaStateMessage(), |
| buildGoogleCloudFunctionsV2betaStateMessage(), |
| ]; |
| |
| void checkUnnamed6(core.List<api.GoogleCloudFunctionsV2betaStateMessage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudFunctionsV2betaStateMessage(o[0]); |
| checkGoogleCloudFunctionsV2betaStateMessage(o[1]); |
| } |
| |
| core.int buildCounterFunction_ = 0; |
| api.Function_ buildFunction_() { |
| final o = api.Function_(); |
| buildCounterFunction_++; |
| if (buildCounterFunction_ < 3) { |
| o.buildConfig = buildBuildConfig(); |
| o.description = 'foo'; |
| o.environment = 'foo'; |
| o.eventTrigger = buildEventTrigger(); |
| o.labels = buildUnnamed5(); |
| o.name = 'foo'; |
| o.serviceConfig = buildServiceConfig(); |
| o.state = 'foo'; |
| o.stateMessages = buildUnnamed6(); |
| o.updateTime = 'foo'; |
| } |
| buildCounterFunction_--; |
| return o; |
| } |
| |
| void checkFunction_(api.Function_ o) { |
| buildCounterFunction_++; |
| if (buildCounterFunction_ < 3) { |
| checkBuildConfig(o.buildConfig!); |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.environment!, |
| unittest.equals('foo'), |
| ); |
| checkEventTrigger(o.eventTrigger!); |
| checkUnnamed5(o.labels!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkServiceConfig(o.serviceConfig!); |
| unittest.expect( |
| o.state!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6(o.stateMessages!); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterFunction_--; |
| } |
| |
| core.int buildCounterGenerateDownloadUrlRequest = 0; |
| api.GenerateDownloadUrlRequest buildGenerateDownloadUrlRequest() { |
| final o = api.GenerateDownloadUrlRequest(); |
| buildCounterGenerateDownloadUrlRequest++; |
| if (buildCounterGenerateDownloadUrlRequest < 3) {} |
| buildCounterGenerateDownloadUrlRequest--; |
| return o; |
| } |
| |
| void checkGenerateDownloadUrlRequest(api.GenerateDownloadUrlRequest o) { |
| buildCounterGenerateDownloadUrlRequest++; |
| if (buildCounterGenerateDownloadUrlRequest < 3) {} |
| buildCounterGenerateDownloadUrlRequest--; |
| } |
| |
| core.int buildCounterGenerateDownloadUrlResponse = 0; |
| api.GenerateDownloadUrlResponse buildGenerateDownloadUrlResponse() { |
| final o = api.GenerateDownloadUrlResponse(); |
| buildCounterGenerateDownloadUrlResponse++; |
| if (buildCounterGenerateDownloadUrlResponse < 3) { |
| o.downloadUrl = 'foo'; |
| } |
| buildCounterGenerateDownloadUrlResponse--; |
| return o; |
| } |
| |
| void checkGenerateDownloadUrlResponse(api.GenerateDownloadUrlResponse o) { |
| buildCounterGenerateDownloadUrlResponse++; |
| if (buildCounterGenerateDownloadUrlResponse < 3) { |
| unittest.expect( |
| o.downloadUrl!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGenerateDownloadUrlResponse--; |
| } |
| |
| core.int buildCounterGenerateUploadUrlRequest = 0; |
| api.GenerateUploadUrlRequest buildGenerateUploadUrlRequest() { |
| final o = api.GenerateUploadUrlRequest(); |
| buildCounterGenerateUploadUrlRequest++; |
| if (buildCounterGenerateUploadUrlRequest < 3) {} |
| buildCounterGenerateUploadUrlRequest--; |
| return o; |
| } |
| |
| void checkGenerateUploadUrlRequest(api.GenerateUploadUrlRequest o) { |
| buildCounterGenerateUploadUrlRequest++; |
| if (buildCounterGenerateUploadUrlRequest < 3) {} |
| buildCounterGenerateUploadUrlRequest--; |
| } |
| |
| core.int buildCounterGenerateUploadUrlResponse = 0; |
| api.GenerateUploadUrlResponse buildGenerateUploadUrlResponse() { |
| final o = api.GenerateUploadUrlResponse(); |
| buildCounterGenerateUploadUrlResponse++; |
| if (buildCounterGenerateUploadUrlResponse < 3) { |
| o.storageSource = buildStorageSource(); |
| o.uploadUrl = 'foo'; |
| } |
| buildCounterGenerateUploadUrlResponse--; |
| return o; |
| } |
| |
| void checkGenerateUploadUrlResponse(api.GenerateUploadUrlResponse o) { |
| buildCounterGenerateUploadUrlResponse++; |
| if (buildCounterGenerateUploadUrlResponse < 3) { |
| checkStorageSource(o.storageSource!); |
| unittest.expect( |
| o.uploadUrl!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGenerateUploadUrlResponse--; |
| } |
| |
| core.int buildCounterGoogleCloudFunctionsV2betaStateMessage = 0; |
| api.GoogleCloudFunctionsV2betaStateMessage |
| buildGoogleCloudFunctionsV2betaStateMessage() { |
| final o = api.GoogleCloudFunctionsV2betaStateMessage(); |
| buildCounterGoogleCloudFunctionsV2betaStateMessage++; |
| if (buildCounterGoogleCloudFunctionsV2betaStateMessage < 3) { |
| o.message = 'foo'; |
| o.severity = 'foo'; |
| o.type = 'foo'; |
| } |
| buildCounterGoogleCloudFunctionsV2betaStateMessage--; |
| return o; |
| } |
| |
| void checkGoogleCloudFunctionsV2betaStateMessage( |
| api.GoogleCloudFunctionsV2betaStateMessage o) { |
| buildCounterGoogleCloudFunctionsV2betaStateMessage++; |
| if (buildCounterGoogleCloudFunctionsV2betaStateMessage < 3) { |
| unittest.expect( |
| o.message!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.severity!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.type!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterGoogleCloudFunctionsV2betaStateMessage--; |
| } |
| |
| core.List<api.Function_> buildUnnamed7() => [ |
| buildFunction_(), |
| buildFunction_(), |
| ]; |
| |
| void checkUnnamed7(core.List<api.Function_> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkFunction_(o[0]); |
| checkFunction_(o[1]); |
| } |
| |
| core.List<core.String> buildUnnamed8() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed8(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 buildCounterListFunctionsResponse = 0; |
| api.ListFunctionsResponse buildListFunctionsResponse() { |
| final o = api.ListFunctionsResponse(); |
| buildCounterListFunctionsResponse++; |
| if (buildCounterListFunctionsResponse < 3) { |
| o.functions = buildUnnamed7(); |
| o.nextPageToken = 'foo'; |
| o.unreachable = buildUnnamed8(); |
| } |
| buildCounterListFunctionsResponse--; |
| return o; |
| } |
| |
| void checkListFunctionsResponse(api.ListFunctionsResponse o) { |
| buildCounterListFunctionsResponse++; |
| if (buildCounterListFunctionsResponse < 3) { |
| checkUnnamed7(o.functions!); |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed8(o.unreachable!); |
| } |
| buildCounterListFunctionsResponse--; |
| } |
| |
| core.List<api.Location> buildUnnamed9() => [ |
| buildLocation(), |
| buildLocation(), |
| ]; |
| |
| void checkUnnamed9(core.List<api.Location> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLocation(o[0]); |
| checkLocation(o[1]); |
| } |
| |
| core.int buildCounterListLocationsResponse = 0; |
| api.ListLocationsResponse buildListLocationsResponse() { |
| final o = api.ListLocationsResponse(); |
| buildCounterListLocationsResponse++; |
| if (buildCounterListLocationsResponse < 3) { |
| o.locations = buildUnnamed9(); |
| o.nextPageToken = 'foo'; |
| } |
| buildCounterListLocationsResponse--; |
| return o; |
| } |
| |
| void checkListLocationsResponse(api.ListLocationsResponse o) { |
| buildCounterListLocationsResponse++; |
| if (buildCounterListLocationsResponse < 3) { |
| checkUnnamed9(o.locations!); |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterListLocationsResponse--; |
| } |
| |
| core.List<api.Operation> buildUnnamed10() => [ |
| buildOperation(), |
| buildOperation(), |
| ]; |
| |
| void checkUnnamed10(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.int buildCounterListOperationsResponse = 0; |
| api.ListOperationsResponse buildListOperationsResponse() { |
| final o = api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed10(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| void checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed10(o.operations!); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| core.List<api.Runtime> buildUnnamed11() => [ |
| buildRuntime(), |
| buildRuntime(), |
| ]; |
| |
| void checkUnnamed11(core.List<api.Runtime> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkRuntime(o[0]); |
| checkRuntime(o[1]); |
| } |
| |
| core.int buildCounterListRuntimesResponse = 0; |
| api.ListRuntimesResponse buildListRuntimesResponse() { |
| final o = api.ListRuntimesResponse(); |
| buildCounterListRuntimesResponse++; |
| if (buildCounterListRuntimesResponse < 3) { |
| o.runtimes = buildUnnamed11(); |
| } |
| buildCounterListRuntimesResponse--; |
| return o; |
| } |
| |
| void checkListRuntimesResponse(api.ListRuntimesResponse o) { |
| buildCounterListRuntimesResponse++; |
| if (buildCounterListRuntimesResponse < 3) { |
| checkUnnamed11(o.runtimes!); |
| } |
| buildCounterListRuntimesResponse--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed12() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed12(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.Map<core.String, core.Object?> buildUnnamed13() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed13(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; |
| api.Location buildLocation() { |
| final o = api.Location(); |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| o.displayName = 'foo'; |
| o.labels = buildUnnamed12(); |
| o.locationId = 'foo'; |
| o.metadata = buildUnnamed13(); |
| o.name = 'foo'; |
| } |
| buildCounterLocation--; |
| return o; |
| } |
| |
| void checkLocation(api.Location o) { |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed12(o.labels!); |
| unittest.expect( |
| o.locationId!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed13(o.metadata!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterLocation--; |
| } |
| |
| core.Map<core.String, core.Object?> buildUnnamed14() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed14(core.Map<core.String, core.Object?> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted3 = (o['x']!) as core.Map; |
| unittest.expect(casted3, unittest.hasLength(3)); |
| unittest.expect( |
| casted3['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted3['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted3['string'], |
| unittest.equals('foo'), |
| ); |
| var casted4 = (o['y']!) as core.Map; |
| unittest.expect(casted4, unittest.hasLength(3)); |
| unittest.expect( |
| casted4['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted4['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted4['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.Map<core.String, core.Object?> buildUnnamed15() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed15(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; |
| api.Operation buildOperation() { |
| final o = api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed14(); |
| o.name = 'foo'; |
| o.response = buildUnnamed15(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| void checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done!, unittest.isTrue); |
| checkStatus(o.error!); |
| checkUnnamed14(o.metadata!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed15(o.response!); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.List<api.AuditConfig> buildUnnamed16() => [ |
| buildAuditConfig(), |
| buildAuditConfig(), |
| ]; |
| |
| void checkUnnamed16(core.List<api.AuditConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuditConfig(o[0]); |
| checkAuditConfig(o[1]); |
| } |
| |
| core.List<api.Binding> buildUnnamed17() => [ |
| buildBinding(), |
| buildBinding(), |
| ]; |
| |
| void checkUnnamed17(core.List<api.Binding> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBinding(o[0]); |
| checkBinding(o[1]); |
| } |
| |
| core.int buildCounterPolicy = 0; |
| api.Policy buildPolicy() { |
| final o = api.Policy(); |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| o.auditConfigs = buildUnnamed16(); |
| o.bindings = buildUnnamed17(); |
| o.etag = 'foo'; |
| o.version = 42; |
| } |
| buildCounterPolicy--; |
| return o; |
| } |
| |
| void checkPolicy(api.Policy o) { |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| checkUnnamed16(o.auditConfigs!); |
| checkUnnamed17(o.bindings!); |
| unittest.expect( |
| o.etag!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.version!, |
| unittest.equals(42), |
| ); |
| } |
| buildCounterPolicy--; |
| } |
| |
| core.int buildCounterRepoSource = 0; |
| api.RepoSource buildRepoSource() { |
| final o = api.RepoSource(); |
| buildCounterRepoSource++; |
| if (buildCounterRepoSource < 3) { |
| o.branchName = 'foo'; |
| o.commitSha = 'foo'; |
| o.dir = 'foo'; |
| o.invertRegex = true; |
| o.projectId = 'foo'; |
| o.repoName = 'foo'; |
| o.tagName = 'foo'; |
| } |
| buildCounterRepoSource--; |
| return o; |
| } |
| |
| void checkRepoSource(api.RepoSource o) { |
| buildCounterRepoSource++; |
| if (buildCounterRepoSource < 3) { |
| unittest.expect( |
| o.branchName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.commitSha!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.dir!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.invertRegex!, unittest.isTrue); |
| unittest.expect( |
| o.projectId!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.repoName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.tagName!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterRepoSource--; |
| } |
| |
| core.List<core.String> buildUnnamed18() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed18(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 buildCounterRuntime = 0; |
| api.Runtime buildRuntime() { |
| final o = api.Runtime(); |
| buildCounterRuntime++; |
| if (buildCounterRuntime < 3) { |
| o.displayName = 'foo'; |
| o.environment = 'foo'; |
| o.name = 'foo'; |
| o.stage = 'foo'; |
| o.warnings = buildUnnamed18(); |
| } |
| buildCounterRuntime--; |
| return o; |
| } |
| |
| void checkRuntime(api.Runtime o) { |
| buildCounterRuntime++; |
| if (buildCounterRuntime < 3) { |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.environment!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.stage!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed18(o.warnings!); |
| } |
| buildCounterRuntime--; |
| } |
| |
| core.int buildCounterSecretEnvVar = 0; |
| api.SecretEnvVar buildSecretEnvVar() { |
| final o = api.SecretEnvVar(); |
| buildCounterSecretEnvVar++; |
| if (buildCounterSecretEnvVar < 3) { |
| o.key = 'foo'; |
| o.projectId = 'foo'; |
| o.secret = 'foo'; |
| o.version = 'foo'; |
| } |
| buildCounterSecretEnvVar--; |
| return o; |
| } |
| |
| void checkSecretEnvVar(api.SecretEnvVar o) { |
| buildCounterSecretEnvVar++; |
| if (buildCounterSecretEnvVar < 3) { |
| unittest.expect( |
| o.key!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.projectId!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.secret!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.version!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterSecretEnvVar--; |
| } |
| |
| core.int buildCounterSecretVersion = 0; |
| api.SecretVersion buildSecretVersion() { |
| final o = api.SecretVersion(); |
| buildCounterSecretVersion++; |
| if (buildCounterSecretVersion < 3) { |
| o.path = 'foo'; |
| o.version = 'foo'; |
| } |
| buildCounterSecretVersion--; |
| return o; |
| } |
| |
| void checkSecretVersion(api.SecretVersion o) { |
| buildCounterSecretVersion++; |
| if (buildCounterSecretVersion < 3) { |
| unittest.expect( |
| o.path!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.version!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterSecretVersion--; |
| } |
| |
| core.List<api.SecretVersion> buildUnnamed19() => [ |
| buildSecretVersion(), |
| buildSecretVersion(), |
| ]; |
| |
| void checkUnnamed19(core.List<api.SecretVersion> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSecretVersion(o[0]); |
| checkSecretVersion(o[1]); |
| } |
| |
| core.int buildCounterSecretVolume = 0; |
| api.SecretVolume buildSecretVolume() { |
| final o = api.SecretVolume(); |
| buildCounterSecretVolume++; |
| if (buildCounterSecretVolume < 3) { |
| o.mountPath = 'foo'; |
| o.projectId = 'foo'; |
| o.secret = 'foo'; |
| o.versions = buildUnnamed19(); |
| } |
| buildCounterSecretVolume--; |
| return o; |
| } |
| |
| void checkSecretVolume(api.SecretVolume o) { |
| buildCounterSecretVolume++; |
| if (buildCounterSecretVolume < 3) { |
| unittest.expect( |
| o.mountPath!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.projectId!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.secret!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed19(o.versions!); |
| } |
| buildCounterSecretVolume--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed20() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed20(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o['x']!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o['y']!, |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.List<api.SecretEnvVar> buildUnnamed21() => [ |
| buildSecretEnvVar(), |
| buildSecretEnvVar(), |
| ]; |
| |
| void checkUnnamed21(core.List<api.SecretEnvVar> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSecretEnvVar(o[0]); |
| checkSecretEnvVar(o[1]); |
| } |
| |
| core.List<api.SecretVolume> buildUnnamed22() => [ |
| buildSecretVolume(), |
| buildSecretVolume(), |
| ]; |
| |
| void checkUnnamed22(core.List<api.SecretVolume> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSecretVolume(o[0]); |
| checkSecretVolume(o[1]); |
| } |
| |
| core.int buildCounterServiceConfig = 0; |
| api.ServiceConfig buildServiceConfig() { |
| final o = api.ServiceConfig(); |
| buildCounterServiceConfig++; |
| if (buildCounterServiceConfig < 3) { |
| o.allTrafficOnLatestRevision = true; |
| o.availableMemory = 'foo'; |
| o.environmentVariables = buildUnnamed20(); |
| o.ingressSettings = 'foo'; |
| o.maxInstanceCount = 42; |
| o.minInstanceCount = 42; |
| o.revision = 'foo'; |
| o.secretEnvironmentVariables = buildUnnamed21(); |
| o.secretVolumes = buildUnnamed22(); |
| o.service = 'foo'; |
| o.serviceAccountEmail = 'foo'; |
| o.timeoutSeconds = 42; |
| o.uri = 'foo'; |
| o.vpcConnector = 'foo'; |
| o.vpcConnectorEgressSettings = 'foo'; |
| } |
| buildCounterServiceConfig--; |
| return o; |
| } |
| |
| void checkServiceConfig(api.ServiceConfig o) { |
| buildCounterServiceConfig++; |
| if (buildCounterServiceConfig < 3) { |
| unittest.expect(o.allTrafficOnLatestRevision!, unittest.isTrue); |
| unittest.expect( |
| o.availableMemory!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed20(o.environmentVariables!); |
| unittest.expect( |
| o.ingressSettings!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.maxInstanceCount!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.minInstanceCount!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.revision!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed21(o.secretEnvironmentVariables!); |
| checkUnnamed22(o.secretVolumes!); |
| unittest.expect( |
| o.service!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.serviceAccountEmail!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.timeoutSeconds!, |
| unittest.equals(42), |
| ); |
| unittest.expect( |
| o.uri!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.vpcConnector!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.vpcConnectorEgressSettings!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterServiceConfig--; |
| } |
| |
| core.int buildCounterSetIamPolicyRequest = 0; |
| api.SetIamPolicyRequest buildSetIamPolicyRequest() { |
| final o = api.SetIamPolicyRequest(); |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| o.policy = buildPolicy(); |
| o.updateMask = 'foo'; |
| } |
| buildCounterSetIamPolicyRequest--; |
| return o; |
| } |
| |
| void checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| checkPolicy(o.policy!); |
| unittest.expect( |
| o.updateMask!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterSetIamPolicyRequest--; |
| } |
| |
| core.int buildCounterSource = 0; |
| api.Source buildSource() { |
| final o = api.Source(); |
| buildCounterSource++; |
| if (buildCounterSource < 3) { |
| o.repoSource = buildRepoSource(); |
| o.storageSource = buildStorageSource(); |
| } |
| buildCounterSource--; |
| return o; |
| } |
| |
| void checkSource(api.Source o) { |
| buildCounterSource++; |
| if (buildCounterSource < 3) { |
| checkRepoSource(o.repoSource!); |
| checkStorageSource(o.storageSource!); |
| } |
| buildCounterSource--; |
| } |
| |
| core.int buildCounterSourceProvenance = 0; |
| api.SourceProvenance buildSourceProvenance() { |
| final o = api.SourceProvenance(); |
| buildCounterSourceProvenance++; |
| if (buildCounterSourceProvenance < 3) { |
| o.resolvedRepoSource = buildRepoSource(); |
| o.resolvedStorageSource = buildStorageSource(); |
| } |
| buildCounterSourceProvenance--; |
| return o; |
| } |
| |
| void checkSourceProvenance(api.SourceProvenance o) { |
| buildCounterSourceProvenance++; |
| if (buildCounterSourceProvenance < 3) { |
| checkRepoSource(o.resolvedRepoSource!); |
| checkStorageSource(o.resolvedStorageSource!); |
| } |
| buildCounterSourceProvenance--; |
| } |
| |
| core.Map<core.String, core.Object?> buildUnnamed23() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed23(core.Map<core.String, core.Object?> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted7 = (o['x']!) as core.Map; |
| unittest.expect(casted7, unittest.hasLength(3)); |
| unittest.expect( |
| casted7['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted7['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted7['string'], |
| unittest.equals('foo'), |
| ); |
| var casted8 = (o['y']!) as core.Map; |
| unittest.expect(casted8, unittest.hasLength(3)); |
| unittest.expect( |
| casted8['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted8['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted8['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.List<core.Map<core.String, core.Object?>> buildUnnamed24() => [ |
| buildUnnamed23(), |
| buildUnnamed23(), |
| ]; |
| |
| void checkUnnamed24(core.List<core.Map<core.String, core.Object?>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed23(o[0]); |
| checkUnnamed23(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| api.Status buildStatus() { |
| final o = api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed24(); |
| o.message = 'foo'; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| void checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect( |
| o.code!, |
| unittest.equals(42), |
| ); |
| checkUnnamed24(o.details!); |
| unittest.expect( |
| o.message!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.int buildCounterStorageSource = 0; |
| api.StorageSource buildStorageSource() { |
| final o = api.StorageSource(); |
| buildCounterStorageSource++; |
| if (buildCounterStorageSource < 3) { |
| o.bucket = 'foo'; |
| o.generation = 'foo'; |
| o.object = 'foo'; |
| } |
| buildCounterStorageSource--; |
| return o; |
| } |
| |
| void checkStorageSource(api.StorageSource o) { |
| buildCounterStorageSource++; |
| if (buildCounterStorageSource < 3) { |
| unittest.expect( |
| o.bucket!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.generation!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.object!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterStorageSource--; |
| } |
| |
| core.List<core.String> buildUnnamed25() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed25(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; |
| api.TestIamPermissionsRequest buildTestIamPermissionsRequest() { |
| final o = api.TestIamPermissionsRequest(); |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| o.permissions = buildUnnamed25(); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| checkUnnamed25(o.permissions!); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed26() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed26(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; |
| api.TestIamPermissionsResponse buildTestIamPermissionsResponse() { |
| final o = api.TestIamPermissionsResponse(); |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| o.permissions = buildUnnamed26(); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| checkUnnamed26(o.permissions!); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| } |
| |
| void main() { |
| unittest.group('obj-schema-AuditConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAuditConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AuditConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuditConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuditLogConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAuditLogConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AuditLogConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuditLogConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Binding', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBinding(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Binding.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkBinding(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BuildConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBuildConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.BuildConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkBuildConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-EventFilter', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildEventFilter(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.EventFilter.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkEventFilter(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-EventTrigger', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildEventTrigger(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.EventTrigger.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkEventTrigger(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Expr', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildExpr(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Expr.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkExpr(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Function_', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildFunction_(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Function_.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkFunction_(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GenerateDownloadUrlRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGenerateDownloadUrlRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GenerateDownloadUrlRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGenerateDownloadUrlRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GenerateDownloadUrlResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGenerateDownloadUrlResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GenerateDownloadUrlResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGenerateDownloadUrlResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GenerateUploadUrlRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGenerateUploadUrlRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GenerateUploadUrlRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGenerateUploadUrlRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GenerateUploadUrlResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGenerateUploadUrlResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GenerateUploadUrlResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGenerateUploadUrlResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudFunctionsV2betaStateMessage', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGoogleCloudFunctionsV2betaStateMessage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GoogleCloudFunctionsV2betaStateMessage.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkGoogleCloudFunctionsV2betaStateMessage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListFunctionsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListFunctionsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListFunctionsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListFunctionsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListLocationsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListLocationsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListLocationsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListLocationsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListOperationsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListOperationsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListOperationsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListOperationsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListRuntimesResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListRuntimesResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListRuntimesResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListRuntimesResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Location', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildLocation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Location.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkLocation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Operation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOperation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Operation.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkOperation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Policy', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildPolicy(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Policy.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkPolicy(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RepoSource', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildRepoSource(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.RepoSource.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkRepoSource(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Runtime', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildRuntime(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Runtime.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkRuntime(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SecretEnvVar', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSecretEnvVar(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.SecretEnvVar.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSecretEnvVar(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SecretVersion', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSecretVersion(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.SecretVersion.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSecretVersion(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SecretVolume', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSecretVolume(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.SecretVolume.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSecretVolume(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ServiceConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildServiceConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ServiceConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkServiceConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SetIamPolicyRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSetIamPolicyRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.SetIamPolicyRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSetIamPolicyRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Source', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSource(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Source.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkSource(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SourceProvenance', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSourceProvenance(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.SourceProvenance.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSourceProvenance(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Status', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildStatus(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Status.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkStatus(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-StorageSource', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildStorageSource(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.StorageSource.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkStorageSource(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildTestIamPermissionsRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.TestIamPermissionsRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkTestIamPermissionsRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildTestIamPermissionsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.TestIamPermissionsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkTestIamPermissionsResponse(od); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsResource', () { |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations; |
| final arg_name = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['filter']!.first, |
| unittest.equals(arg_filter), |
| ); |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListLocationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListLocationsResponse(response as api.ListLocationsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsFunctionsResource', () { |
| unittest.test('method--create', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildFunction_(); |
| final arg_parent = 'foo'; |
| final arg_functionId = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = |
| api.Function_.fromJson(json as core.Map<core.String, core.dynamic>); |
| checkFunction_(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['functionId']!.first, |
| unittest.equals(arg_functionId), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.create(arg_request, arg_parent, |
| functionId: arg_functionId, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--delete', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.delete(arg_name, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--generateDownloadUrl', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildGenerateDownloadUrlRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.GenerateDownloadUrlRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkGenerateDownloadUrlRequest(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildGenerateDownloadUrlResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.generateDownloadUrl(arg_request, arg_name, |
| $fields: arg_$fields); |
| checkGenerateDownloadUrlResponse( |
| response as api.GenerateDownloadUrlResponse); |
| }); |
| |
| unittest.test('method--generateUploadUrl', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildGenerateUploadUrlRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.GenerateUploadUrlRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkGenerateUploadUrlRequest(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildGenerateUploadUrlResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.generateUploadUrl(arg_request, arg_parent, |
| $fields: arg_$fields); |
| checkGenerateUploadUrlResponse(response as api.GenerateUploadUrlResponse); |
| }); |
| |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildFunction_()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkFunction_(response as api.Function_); |
| }); |
| |
| unittest.test('method--getIamPolicy', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_resource = 'foo'; |
| final arg_options_requestedPolicyVersion = 42; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| core.int.parse(queryMap['options.requestedPolicyVersion']!.first), |
| unittest.equals(arg_options_requestedPolicyVersion), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.getIamPolicy(arg_resource, |
| options_requestedPolicyVersion: arg_options_requestedPolicyVersion, |
| $fields: arg_$fields); |
| checkPolicy(response as api.Policy); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_parent = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_orderBy = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['filter']!.first, |
| unittest.equals(arg_filter), |
| ); |
| unittest.expect( |
| queryMap['orderBy']!.first, |
| unittest.equals(arg_orderBy), |
| ); |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListFunctionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_parent, |
| filter: arg_filter, |
| orderBy: arg_orderBy, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListFunctionsResponse(response as api.ListFunctionsResponse); |
| }); |
| |
| unittest.test('method--patch', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildFunction_(); |
| final arg_name = 'foo'; |
| final arg_updateMask = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = |
| api.Function_.fromJson(json as core.Map<core.String, core.dynamic>); |
| checkFunction_(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['updateMask']!.first, |
| unittest.equals(arg_updateMask), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.patch(arg_request, arg_name, |
| updateMask: arg_updateMask, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--setIamPolicy', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildSetIamPolicyRequest(); |
| final arg_resource = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.SetIamPolicyRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkSetIamPolicyRequest(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.setIamPolicy(arg_request, arg_resource, |
| $fields: arg_$fields); |
| checkPolicy(response as api.Policy); |
| }); |
| |
| unittest.test('method--testIamPermissions', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildTestIamPermissionsRequest(); |
| final arg_resource = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.TestIamPermissionsRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkTestIamPermissionsRequest(obj); |
| |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.testIamPermissions(arg_request, arg_resource, |
| $fields: arg_$fields); |
| checkTestIamPermissionsResponse( |
| response as api.TestIamPermissionsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsOperationsResource', () { |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.operations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.operations; |
| final arg_name = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['filter']!.first, |
| unittest.equals(arg_filter), |
| ); |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListOperationsResponse(response as api.ListOperationsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsRuntimesResource', () { |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.runtimes; |
| final arg_parent = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 7), |
| unittest.equals('v2beta/'), |
| ); |
| pathOffset += 7; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = (req.url).query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['filter']!.first, |
| unittest.equals(arg_filter), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListRuntimesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = |
| await res.list(arg_parent, filter: arg_filter, $fields: arg_$fields); |
| checkListRuntimesResponse(response as api.ListRuntimesResponse); |
| }); |
| }); |
| } |