| // ignore_for_file: camel_case_types |
| // ignore_for_file: comment_references |
| // ignore_for_file: deprecated_member_use_from_same_package |
| // ignore_for_file: doc_directive_unknown |
| // 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: unintended_html_in_doc_comment |
| // ignore_for_file: unnecessary_brace_in_string_interps |
| // ignore_for_file: unnecessary_cast |
| // ignore_for_file: unnecessary_lambdas |
| // ignore_for_file: unnecessary_string_interpolations |
| // ignore_for_file: unreachable_from_main |
| // ignore_for_file: unused_local_variable |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert; |
| import 'dart:core' as core; |
| |
| import 'package:googleapis/cloudfunctions/v2.dart' as api; |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import '../test_shared.dart'; |
| |
| core.int buildCounterAbortFunctionUpgradeRequest = 0; |
| api.AbortFunctionUpgradeRequest buildAbortFunctionUpgradeRequest() { |
| final o = api.AbortFunctionUpgradeRequest(); |
| buildCounterAbortFunctionUpgradeRequest++; |
| if (buildCounterAbortFunctionUpgradeRequest < 3) {} |
| buildCounterAbortFunctionUpgradeRequest--; |
| return o; |
| } |
| |
| void checkAbortFunctionUpgradeRequest(api.AbortFunctionUpgradeRequest o) { |
| buildCounterAbortFunctionUpgradeRequest++; |
| if (buildCounterAbortFunctionUpgradeRequest < 3) {} |
| buildCounterAbortFunctionUpgradeRequest--; |
| } |
| |
| 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.int buildCounterAutomaticUpdatePolicy = 0; |
| api.AutomaticUpdatePolicy buildAutomaticUpdatePolicy() { |
| final o = api.AutomaticUpdatePolicy(); |
| buildCounterAutomaticUpdatePolicy++; |
| if (buildCounterAutomaticUpdatePolicy < 3) {} |
| buildCounterAutomaticUpdatePolicy--; |
| return o; |
| } |
| |
| void checkAutomaticUpdatePolicy(api.AutomaticUpdatePolicy o) { |
| buildCounterAutomaticUpdatePolicy++; |
| if (buildCounterAutomaticUpdatePolicy < 3) {} |
| buildCounterAutomaticUpdatePolicy--; |
| } |
| |
| 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.automaticUpdatePolicy = buildAutomaticUpdatePolicy(); |
| o.build = 'foo'; |
| o.dockerRegistry = 'foo'; |
| o.dockerRepository = 'foo'; |
| o.entryPoint = 'foo'; |
| o.environmentVariables = buildUnnamed3(); |
| o.onDeployUpdatePolicy = buildOnDeployUpdatePolicy(); |
| o.runtime = 'foo'; |
| o.serviceAccount = 'foo'; |
| o.source = buildSource(); |
| o.sourceProvenance = buildSourceProvenance(); |
| o.sourceToken = 'foo'; |
| o.workerPool = 'foo'; |
| } |
| buildCounterBuildConfig--; |
| return o; |
| } |
| |
| void checkBuildConfig(api.BuildConfig o) { |
| buildCounterBuildConfig++; |
| if (buildCounterBuildConfig < 3) { |
| checkAutomaticUpdatePolicy(o.automaticUpdatePolicy!); |
| unittest.expect(o.build!, unittest.equals('foo')); |
| unittest.expect(o.dockerRegistry!, unittest.equals('foo')); |
| unittest.expect(o.dockerRepository!, unittest.equals('foo')); |
| unittest.expect(o.entryPoint!, unittest.equals('foo')); |
| checkUnnamed3(o.environmentVariables!); |
| checkOnDeployUpdatePolicy(o.onDeployUpdatePolicy!); |
| unittest.expect(o.runtime!, unittest.equals('foo')); |
| unittest.expect(o.serviceAccount!, unittest.equals('foo')); |
| checkSource(o.source!); |
| checkSourceProvenance(o.sourceProvenance!); |
| unittest.expect(o.sourceToken!, unittest.equals('foo')); |
| unittest.expect(o.workerPool!, unittest.equals('foo')); |
| } |
| buildCounterBuildConfig--; |
| } |
| |
| core.int buildCounterBuildConfigOverrides = 0; |
| api.BuildConfigOverrides buildBuildConfigOverrides() { |
| final o = api.BuildConfigOverrides(); |
| buildCounterBuildConfigOverrides++; |
| if (buildCounterBuildConfigOverrides < 3) { |
| o.runtime = 'foo'; |
| } |
| buildCounterBuildConfigOverrides--; |
| return o; |
| } |
| |
| void checkBuildConfigOverrides(api.BuildConfigOverrides o) { |
| buildCounterBuildConfigOverrides++; |
| if (buildCounterBuildConfigOverrides < 3) { |
| unittest.expect(o.runtime!, unittest.equals('foo')); |
| } |
| buildCounterBuildConfigOverrides--; |
| } |
| |
| core.int buildCounterCommitFunctionUpgradeAsGen2Request = 0; |
| api.CommitFunctionUpgradeAsGen2Request |
| buildCommitFunctionUpgradeAsGen2Request() { |
| final o = api.CommitFunctionUpgradeAsGen2Request(); |
| buildCounterCommitFunctionUpgradeAsGen2Request++; |
| if (buildCounterCommitFunctionUpgradeAsGen2Request < 3) {} |
| buildCounterCommitFunctionUpgradeAsGen2Request--; |
| return o; |
| } |
| |
| void checkCommitFunctionUpgradeAsGen2Request( |
| api.CommitFunctionUpgradeAsGen2Request o, |
| ) { |
| buildCounterCommitFunctionUpgradeAsGen2Request++; |
| if (buildCounterCommitFunctionUpgradeAsGen2Request < 3) {} |
| buildCounterCommitFunctionUpgradeAsGen2Request--; |
| } |
| |
| core.int buildCounterCommitFunctionUpgradeRequest = 0; |
| api.CommitFunctionUpgradeRequest buildCommitFunctionUpgradeRequest() { |
| final o = api.CommitFunctionUpgradeRequest(); |
| buildCounterCommitFunctionUpgradeRequest++; |
| if (buildCounterCommitFunctionUpgradeRequest < 3) {} |
| buildCounterCommitFunctionUpgradeRequest--; |
| return o; |
| } |
| |
| void checkCommitFunctionUpgradeRequest(api.CommitFunctionUpgradeRequest o) { |
| buildCounterCommitFunctionUpgradeRequest++; |
| if (buildCounterCommitFunctionUpgradeRequest < 3) {} |
| buildCounterCommitFunctionUpgradeRequest--; |
| } |
| |
| core.int buildCounterDate = 0; |
| api.Date buildDate() { |
| final o = api.Date(); |
| buildCounterDate++; |
| if (buildCounterDate < 3) { |
| o.day = 42; |
| o.month = 42; |
| o.year = 42; |
| } |
| buildCounterDate--; |
| return o; |
| } |
| |
| void checkDate(api.Date o) { |
| buildCounterDate++; |
| if (buildCounterDate < 3) { |
| unittest.expect(o.day!, unittest.equals(42)); |
| unittest.expect(o.month!, unittest.equals(42)); |
| unittest.expect(o.year!, unittest.equals(42)); |
| } |
| buildCounterDate--; |
| } |
| |
| core.int buildCounterDetachFunctionRequest = 0; |
| api.DetachFunctionRequest buildDetachFunctionRequest() { |
| final o = api.DetachFunctionRequest(); |
| buildCounterDetachFunctionRequest++; |
| if (buildCounterDetachFunctionRequest < 3) {} |
| buildCounterDetachFunctionRequest--; |
| return o; |
| } |
| |
| void checkDetachFunctionRequest(api.DetachFunctionRequest o) { |
| buildCounterDetachFunctionRequest++; |
| if (buildCounterDetachFunctionRequest < 3) {} |
| buildCounterDetachFunctionRequest--; |
| } |
| |
| 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.service = '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.service!, 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.GoogleCloudFunctionsV2StateMessage> buildUnnamed6() => [ |
| buildGoogleCloudFunctionsV2StateMessage(), |
| buildGoogleCloudFunctionsV2StateMessage(), |
| ]; |
| |
| void checkUnnamed6(core.List<api.GoogleCloudFunctionsV2StateMessage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGoogleCloudFunctionsV2StateMessage(o[0]); |
| checkGoogleCloudFunctionsV2StateMessage(o[1]); |
| } |
| |
| core.int buildCounterFunction_ = 0; |
| api.Function_ buildFunction_() { |
| final o = api.Function_(); |
| buildCounterFunction_++; |
| if (buildCounterFunction_ < 3) { |
| o.buildConfig = buildBuildConfig(); |
| o.createTime = 'foo'; |
| o.description = 'foo'; |
| o.environment = 'foo'; |
| o.eventTrigger = buildEventTrigger(); |
| o.kmsKeyName = 'foo'; |
| o.labels = buildUnnamed5(); |
| o.name = 'foo'; |
| o.satisfiesPzi = true; |
| o.satisfiesPzs = true; |
| o.serviceConfig = buildServiceConfig(); |
| o.state = 'foo'; |
| o.stateMessages = buildUnnamed6(); |
| o.updateTime = 'foo'; |
| o.upgradeInfo = buildUpgradeInfo(); |
| o.url = 'foo'; |
| } |
| buildCounterFunction_--; |
| return o; |
| } |
| |
| void checkFunction_(api.Function_ o) { |
| buildCounterFunction_++; |
| if (buildCounterFunction_ < 3) { |
| checkBuildConfig(o.buildConfig!); |
| unittest.expect(o.createTime!, unittest.equals('foo')); |
| unittest.expect(o.description!, unittest.equals('foo')); |
| unittest.expect(o.environment!, unittest.equals('foo')); |
| checkEventTrigger(o.eventTrigger!); |
| unittest.expect(o.kmsKeyName!, unittest.equals('foo')); |
| checkUnnamed5(o.labels!); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| unittest.expect(o.satisfiesPzi!, unittest.isTrue); |
| unittest.expect(o.satisfiesPzs!, unittest.isTrue); |
| checkServiceConfig(o.serviceConfig!); |
| unittest.expect(o.state!, unittest.equals('foo')); |
| checkUnnamed6(o.stateMessages!); |
| unittest.expect(o.updateTime!, unittest.equals('foo')); |
| checkUpgradeInfo(o.upgradeInfo!); |
| unittest.expect(o.url!, 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) { |
| o.environment = 'foo'; |
| o.kmsKeyName = 'foo'; |
| } |
| buildCounterGenerateUploadUrlRequest--; |
| return o; |
| } |
| |
| void checkGenerateUploadUrlRequest(api.GenerateUploadUrlRequest o) { |
| buildCounterGenerateUploadUrlRequest++; |
| if (buildCounterGenerateUploadUrlRequest < 3) { |
| unittest.expect(o.environment!, unittest.equals('foo')); |
| unittest.expect(o.kmsKeyName!, unittest.equals('foo')); |
| } |
| 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 buildCounterGoogleCloudFunctionsV2StateMessage = 0; |
| api.GoogleCloudFunctionsV2StateMessage |
| buildGoogleCloudFunctionsV2StateMessage() { |
| final o = api.GoogleCloudFunctionsV2StateMessage(); |
| buildCounterGoogleCloudFunctionsV2StateMessage++; |
| if (buildCounterGoogleCloudFunctionsV2StateMessage < 3) { |
| o.message = 'foo'; |
| o.severity = 'foo'; |
| o.type = 'foo'; |
| } |
| buildCounterGoogleCloudFunctionsV2StateMessage--; |
| return o; |
| } |
| |
| void checkGoogleCloudFunctionsV2StateMessage( |
| api.GoogleCloudFunctionsV2StateMessage o, |
| ) { |
| buildCounterGoogleCloudFunctionsV2StateMessage++; |
| if (buildCounterGoogleCloudFunctionsV2StateMessage < 3) { |
| unittest.expect(o.message!, unittest.equals('foo')); |
| unittest.expect(o.severity!, unittest.equals('foo')); |
| unittest.expect(o.type!, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudFunctionsV2StateMessage--; |
| } |
| |
| 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.List<core.String> buildUnnamed11() => ['foo', 'foo']; |
| |
| void checkUnnamed11(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 buildCounterListOperationsResponse = 0; |
| api.ListOperationsResponse buildListOperationsResponse() { |
| final o = api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed10(); |
| o.unreachable = buildUnnamed11(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| void checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken!, unittest.equals('foo')); |
| checkUnnamed10(o.operations!); |
| checkUnnamed11(o.unreachable!); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| core.List<api.Runtime> buildUnnamed12() => [buildRuntime(), buildRuntime()]; |
| |
| void checkUnnamed12(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 = buildUnnamed12(); |
| } |
| buildCounterListRuntimesResponse--; |
| return o; |
| } |
| |
| void checkListRuntimesResponse(api.ListRuntimesResponse o) { |
| buildCounterListRuntimesResponse++; |
| if (buildCounterListRuntimesResponse < 3) { |
| checkUnnamed12(o.runtimes!); |
| } |
| buildCounterListRuntimesResponse--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed13() => {'x': 'foo', 'y': 'foo'}; |
| |
| void checkUnnamed13(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?> 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 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 = buildUnnamed13(); |
| o.locationId = 'foo'; |
| o.metadata = buildUnnamed14(); |
| o.name = 'foo'; |
| } |
| buildCounterLocation--; |
| return o; |
| } |
| |
| void checkLocation(api.Location o) { |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| unittest.expect(o.displayName!, unittest.equals('foo')); |
| checkUnnamed13(o.labels!); |
| unittest.expect(o.locationId!, unittest.equals('foo')); |
| checkUnnamed14(o.metadata!); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| } |
| buildCounterLocation--; |
| } |
| |
| core.int buildCounterOnDeployUpdatePolicy = 0; |
| api.OnDeployUpdatePolicy buildOnDeployUpdatePolicy() { |
| final o = api.OnDeployUpdatePolicy(); |
| buildCounterOnDeployUpdatePolicy++; |
| if (buildCounterOnDeployUpdatePolicy < 3) { |
| o.runtimeVersion = 'foo'; |
| } |
| buildCounterOnDeployUpdatePolicy--; |
| return o; |
| } |
| |
| void checkOnDeployUpdatePolicy(api.OnDeployUpdatePolicy o) { |
| buildCounterOnDeployUpdatePolicy++; |
| if (buildCounterOnDeployUpdatePolicy < 3) { |
| unittest.expect(o.runtimeVersion!, unittest.equals('foo')); |
| } |
| buildCounterOnDeployUpdatePolicy--; |
| } |
| |
| 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 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?> buildUnnamed16() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| }; |
| |
| void checkUnnamed16(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 = buildUnnamed15(); |
| o.name = 'foo'; |
| o.response = buildUnnamed16(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| void checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done!, unittest.isTrue); |
| checkStatus(o.error!); |
| checkUnnamed15(o.metadata!); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| checkUnnamed16(o.response!); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.List<api.AuditConfig> buildUnnamed17() => [ |
| buildAuditConfig(), |
| buildAuditConfig(), |
| ]; |
| |
| void checkUnnamed17(core.List<api.AuditConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuditConfig(o[0]); |
| checkAuditConfig(o[1]); |
| } |
| |
| core.List<api.Binding> buildUnnamed18() => [buildBinding(), buildBinding()]; |
| |
| void checkUnnamed18(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 = buildUnnamed17(); |
| o.bindings = buildUnnamed18(); |
| o.etag = 'foo'; |
| o.version = 42; |
| } |
| buildCounterPolicy--; |
| return o; |
| } |
| |
| void checkPolicy(api.Policy o) { |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| checkUnnamed17(o.auditConfigs!); |
| checkUnnamed18(o.bindings!); |
| unittest.expect(o.etag!, unittest.equals('foo')); |
| unittest.expect(o.version!, unittest.equals(42)); |
| } |
| buildCounterPolicy--; |
| } |
| |
| core.int buildCounterRedirectFunctionUpgradeTrafficRequest = 0; |
| api.RedirectFunctionUpgradeTrafficRequest |
| buildRedirectFunctionUpgradeTrafficRequest() { |
| final o = api.RedirectFunctionUpgradeTrafficRequest(); |
| buildCounterRedirectFunctionUpgradeTrafficRequest++; |
| if (buildCounterRedirectFunctionUpgradeTrafficRequest < 3) {} |
| buildCounterRedirectFunctionUpgradeTrafficRequest--; |
| return o; |
| } |
| |
| void checkRedirectFunctionUpgradeTrafficRequest( |
| api.RedirectFunctionUpgradeTrafficRequest o, |
| ) { |
| buildCounterRedirectFunctionUpgradeTrafficRequest++; |
| if (buildCounterRedirectFunctionUpgradeTrafficRequest < 3) {} |
| buildCounterRedirectFunctionUpgradeTrafficRequest--; |
| } |
| |
| 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.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.projectId!, unittest.equals('foo')); |
| unittest.expect(o.repoName!, unittest.equals('foo')); |
| unittest.expect(o.tagName!, unittest.equals('foo')); |
| } |
| buildCounterRepoSource--; |
| } |
| |
| core.int buildCounterRollbackFunctionUpgradeTrafficRequest = 0; |
| api.RollbackFunctionUpgradeTrafficRequest |
| buildRollbackFunctionUpgradeTrafficRequest() { |
| final o = api.RollbackFunctionUpgradeTrafficRequest(); |
| buildCounterRollbackFunctionUpgradeTrafficRequest++; |
| if (buildCounterRollbackFunctionUpgradeTrafficRequest < 3) {} |
| buildCounterRollbackFunctionUpgradeTrafficRequest--; |
| return o; |
| } |
| |
| void checkRollbackFunctionUpgradeTrafficRequest( |
| api.RollbackFunctionUpgradeTrafficRequest o, |
| ) { |
| buildCounterRollbackFunctionUpgradeTrafficRequest++; |
| if (buildCounterRollbackFunctionUpgradeTrafficRequest < 3) {} |
| buildCounterRollbackFunctionUpgradeTrafficRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed19() => ['foo', 'foo']; |
| |
| void checkUnnamed19(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.decommissionDate = buildDate(); |
| o.deprecationDate = buildDate(); |
| o.displayName = 'foo'; |
| o.environment = 'foo'; |
| o.name = 'foo'; |
| o.stage = 'foo'; |
| o.warnings = buildUnnamed19(); |
| } |
| buildCounterRuntime--; |
| return o; |
| } |
| |
| void checkRuntime(api.Runtime o) { |
| buildCounterRuntime++; |
| if (buildCounterRuntime < 3) { |
| checkDate(o.decommissionDate!); |
| checkDate(o.deprecationDate!); |
| 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')); |
| checkUnnamed19(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> buildUnnamed20() => [ |
| buildSecretVersion(), |
| buildSecretVersion(), |
| ]; |
| |
| void checkUnnamed20(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 = buildUnnamed20(); |
| } |
| 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')); |
| checkUnnamed20(o.versions!); |
| } |
| buildCounterSecretVolume--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed21() => {'x': 'foo', 'y': 'foo'}; |
| |
| void checkUnnamed21(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> buildUnnamed22() => [ |
| buildSecretEnvVar(), |
| buildSecretEnvVar(), |
| ]; |
| |
| void checkUnnamed22(core.List<api.SecretEnvVar> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSecretEnvVar(o[0]); |
| checkSecretEnvVar(o[1]); |
| } |
| |
| core.List<api.SecretVolume> buildUnnamed23() => [ |
| buildSecretVolume(), |
| buildSecretVolume(), |
| ]; |
| |
| void checkUnnamed23(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.availableCpu = 'foo'; |
| o.availableMemory = 'foo'; |
| o.binaryAuthorizationPolicy = 'foo'; |
| o.environmentVariables = buildUnnamed21(); |
| o.ingressSettings = 'foo'; |
| o.maxInstanceCount = 42; |
| o.maxInstanceRequestConcurrency = 42; |
| o.minInstanceCount = 42; |
| o.revision = 'foo'; |
| o.secretEnvironmentVariables = buildUnnamed22(); |
| o.secretVolumes = buildUnnamed23(); |
| o.securityLevel = 'foo'; |
| 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.availableCpu!, unittest.equals('foo')); |
| unittest.expect(o.availableMemory!, unittest.equals('foo')); |
| unittest.expect(o.binaryAuthorizationPolicy!, unittest.equals('foo')); |
| checkUnnamed21(o.environmentVariables!); |
| unittest.expect(o.ingressSettings!, unittest.equals('foo')); |
| unittest.expect(o.maxInstanceCount!, unittest.equals(42)); |
| unittest.expect(o.maxInstanceRequestConcurrency!, unittest.equals(42)); |
| unittest.expect(o.minInstanceCount!, unittest.equals(42)); |
| unittest.expect(o.revision!, unittest.equals('foo')); |
| checkUnnamed22(o.secretEnvironmentVariables!); |
| checkUnnamed23(o.secretVolumes!); |
| unittest.expect(o.securityLevel!, unittest.equals('foo')); |
| 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 buildCounterServiceConfigOverrides = 0; |
| api.ServiceConfigOverrides buildServiceConfigOverrides() { |
| final o = api.ServiceConfigOverrides(); |
| buildCounterServiceConfigOverrides++; |
| if (buildCounterServiceConfigOverrides < 3) { |
| o.maxInstanceCount = 42; |
| } |
| buildCounterServiceConfigOverrides--; |
| return o; |
| } |
| |
| void checkServiceConfigOverrides(api.ServiceConfigOverrides o) { |
| buildCounterServiceConfigOverrides++; |
| if (buildCounterServiceConfigOverrides < 3) { |
| unittest.expect(o.maxInstanceCount!, unittest.equals(42)); |
| } |
| buildCounterServiceConfigOverrides--; |
| } |
| |
| 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 buildCounterSetupFunctionUpgradeConfigRequest = 0; |
| api.SetupFunctionUpgradeConfigRequest buildSetupFunctionUpgradeConfigRequest() { |
| final o = api.SetupFunctionUpgradeConfigRequest(); |
| buildCounterSetupFunctionUpgradeConfigRequest++; |
| if (buildCounterSetupFunctionUpgradeConfigRequest < 3) { |
| o.buildConfigOverrides = buildBuildConfigOverrides(); |
| o.serviceConfigOverrides = buildServiceConfigOverrides(); |
| o.triggerServiceAccount = 'foo'; |
| } |
| buildCounterSetupFunctionUpgradeConfigRequest--; |
| return o; |
| } |
| |
| void checkSetupFunctionUpgradeConfigRequest( |
| api.SetupFunctionUpgradeConfigRequest o, |
| ) { |
| buildCounterSetupFunctionUpgradeConfigRequest++; |
| if (buildCounterSetupFunctionUpgradeConfigRequest < 3) { |
| checkBuildConfigOverrides(o.buildConfigOverrides!); |
| checkServiceConfigOverrides(o.serviceConfigOverrides!); |
| unittest.expect(o.triggerServiceAccount!, unittest.equals('foo')); |
| } |
| buildCounterSetupFunctionUpgradeConfigRequest--; |
| } |
| |
| core.int buildCounterSource = 0; |
| api.Source buildSource() { |
| final o = api.Source(); |
| buildCounterSource++; |
| if (buildCounterSource < 3) { |
| o.gitUri = 'foo'; |
| o.repoSource = buildRepoSource(); |
| o.storageSource = buildStorageSource(); |
| } |
| buildCounterSource--; |
| return o; |
| } |
| |
| void checkSource(api.Source o) { |
| buildCounterSource++; |
| if (buildCounterSource < 3) { |
| unittest.expect(o.gitUri!, unittest.equals('foo')); |
| checkRepoSource(o.repoSource!); |
| checkStorageSource(o.storageSource!); |
| } |
| buildCounterSource--; |
| } |
| |
| core.int buildCounterSourceProvenance = 0; |
| api.SourceProvenance buildSourceProvenance() { |
| final o = api.SourceProvenance(); |
| buildCounterSourceProvenance++; |
| if (buildCounterSourceProvenance < 3) { |
| o.gitUri = 'foo'; |
| o.resolvedRepoSource = buildRepoSource(); |
| o.resolvedStorageSource = buildStorageSource(); |
| } |
| buildCounterSourceProvenance--; |
| return o; |
| } |
| |
| void checkSourceProvenance(api.SourceProvenance o) { |
| buildCounterSourceProvenance++; |
| if (buildCounterSourceProvenance < 3) { |
| unittest.expect(o.gitUri!, unittest.equals('foo')); |
| checkRepoSource(o.resolvedRepoSource!); |
| checkStorageSource(o.resolvedStorageSource!); |
| } |
| buildCounterSourceProvenance--; |
| } |
| |
| core.Map<core.String, core.Object?> buildUnnamed24() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| }; |
| |
| void checkUnnamed24(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?>> buildUnnamed25() => [ |
| buildUnnamed24(), |
| buildUnnamed24(), |
| ]; |
| |
| void checkUnnamed25(core.List<core.Map<core.String, core.Object?>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed24(o[0]); |
| checkUnnamed24(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| api.Status buildStatus() { |
| final o = api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed25(); |
| o.message = 'foo'; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| void checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect(o.code!, unittest.equals(42)); |
| checkUnnamed25(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'; |
| o.sourceUploadUrl = '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')); |
| unittest.expect(o.sourceUploadUrl!, unittest.equals('foo')); |
| } |
| buildCounterStorageSource--; |
| } |
| |
| 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 buildCounterTestIamPermissionsRequest = 0; |
| api.TestIamPermissionsRequest buildTestIamPermissionsRequest() { |
| final o = api.TestIamPermissionsRequest(); |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| o.permissions = buildUnnamed26(); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| checkUnnamed26(o.permissions!); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed27() => ['foo', 'foo']; |
| |
| void checkUnnamed27(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 = buildUnnamed27(); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| checkUnnamed27(o.permissions!); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| } |
| |
| core.int buildCounterUpgradeInfo = 0; |
| api.UpgradeInfo buildUpgradeInfo() { |
| final o = api.UpgradeInfo(); |
| buildCounterUpgradeInfo++; |
| if (buildCounterUpgradeInfo < 3) { |
| o.buildConfig = buildBuildConfig(); |
| o.eventTrigger = buildEventTrigger(); |
| o.serviceConfig = buildServiceConfig(); |
| o.upgradeState = 'foo'; |
| } |
| buildCounterUpgradeInfo--; |
| return o; |
| } |
| |
| void checkUpgradeInfo(api.UpgradeInfo o) { |
| buildCounterUpgradeInfo++; |
| if (buildCounterUpgradeInfo < 3) { |
| checkBuildConfig(o.buildConfig!); |
| checkEventTrigger(o.eventTrigger!); |
| checkServiceConfig(o.serviceConfig!); |
| unittest.expect(o.upgradeState!, unittest.equals('foo')); |
| } |
| buildCounterUpgradeInfo--; |
| } |
| |
| core.List<core.String> buildUnnamed28() => ['foo', 'foo']; |
| |
| void checkUnnamed28(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| void main() { |
| unittest.group('obj-schema-AbortFunctionUpgradeRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAbortFunctionUpgradeRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AbortFunctionUpgradeRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAbortFunctionUpgradeRequest(od); |
| }); |
| }); |
| |
| 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-AutomaticUpdatePolicy', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAutomaticUpdatePolicy(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AutomaticUpdatePolicy.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAutomaticUpdatePolicy(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-BuildConfigOverrides', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBuildConfigOverrides(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.BuildConfigOverrides.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkBuildConfigOverrides(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CommitFunctionUpgradeAsGen2Request', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildCommitFunctionUpgradeAsGen2Request(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.CommitFunctionUpgradeAsGen2Request.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkCommitFunctionUpgradeAsGen2Request(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CommitFunctionUpgradeRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildCommitFunctionUpgradeRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.CommitFunctionUpgradeRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkCommitFunctionUpgradeRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Date', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDate(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Date.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkDate(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DetachFunctionRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDetachFunctionRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.DetachFunctionRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkDetachFunctionRequest(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-GoogleCloudFunctionsV2StateMessage', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGoogleCloudFunctionsV2StateMessage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GoogleCloudFunctionsV2StateMessage.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkGoogleCloudFunctionsV2StateMessage(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-OnDeployUpdatePolicy', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOnDeployUpdatePolicy(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.OnDeployUpdatePolicy.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkOnDeployUpdatePolicy(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-RedirectFunctionUpgradeTrafficRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildRedirectFunctionUpgradeTrafficRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.RedirectFunctionUpgradeTrafficRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkRedirectFunctionUpgradeTrafficRequest(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-RollbackFunctionUpgradeTrafficRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildRollbackFunctionUpgradeTrafficRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.RollbackFunctionUpgradeTrafficRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkRollbackFunctionUpgradeTrafficRequest(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-ServiceConfigOverrides', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildServiceConfigOverrides(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ServiceConfigOverrides.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkServiceConfigOverrides(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-SetupFunctionUpgradeConfigRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSetupFunctionUpgradeConfigRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.SetupFunctionUpgradeConfigRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkSetupFunctionUpgradeConfigRequest(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('obj-schema-UpgradeInfo', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildUpgradeInfo(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.UpgradeInfo.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkUpgradeInfo(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_extraLocationTypes = buildUnnamed28(); |
| 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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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['extraLocationTypes']!, |
| unittest.equals(arg_extraLocationTypes), |
| ); |
| 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, |
| extraLocationTypes: arg_extraLocationTypes, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields, |
| ); |
| checkListLocationsResponse(response as api.ListLocationsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsFunctionsResource', () { |
| unittest.test('method--abortFunctionUpgrade', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildAbortFunctionUpgradeRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.AbortFunctionUpgradeRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkAbortFunctionUpgradeRequest(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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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.abortFunctionUpgrade( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--commitFunctionUpgrade', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildCommitFunctionUpgradeRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.CommitFunctionUpgradeRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkCommitFunctionUpgradeRequest(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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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.commitFunctionUpgrade( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--commitFunctionUpgradeAsGen2', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildCommitFunctionUpgradeAsGen2Request(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.CommitFunctionUpgradeAsGen2Request.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkCommitFunctionUpgradeAsGen2Request(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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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.commitFunctionUpgradeAsGen2( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| |
| 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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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--detachFunction', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildDetachFunctionRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.DetachFunctionRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkDetachFunctionRequest(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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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.detachFunction( |
| arg_request, |
| 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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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_revision = '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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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['revision']!.first, |
| unittest.equals(arg_revision), |
| ); |
| 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, |
| revision: arg_revision, |
| $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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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--redirectFunctionUpgradeTraffic', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildRedirectFunctionUpgradeTrafficRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.RedirectFunctionUpgradeTrafficRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkRedirectFunctionUpgradeTrafficRequest(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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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.redirectFunctionUpgradeTraffic( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--rollbackFunctionUpgradeTraffic', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildRollbackFunctionUpgradeTrafficRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.RollbackFunctionUpgradeTrafficRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkRollbackFunctionUpgradeTrafficRequest(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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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.rollbackFunctionUpgradeTraffic( |
| arg_request, |
| arg_name, |
| $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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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--setupFunctionUpgradeConfig', () async { |
| final mock = HttpServerMock(); |
| final res = api.CloudFunctionsApi(mock).projects.locations.functions; |
| final arg_request = buildSetupFunctionUpgradeConfigRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.SetupFunctionUpgradeConfigRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkSetupFunctionUpgradeConfigRequest(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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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.setupFunctionUpgradeConfig( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| |
| 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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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_returnPartialSuccess = true; |
| 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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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['returnPartialSuccess']!.first, |
| unittest.equals('$arg_returnPartialSuccess'), |
| ); |
| 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, |
| returnPartialSuccess: arg_returnPartialSuccess, |
| $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 + 3), |
| unittest.equals('v2/'), |
| ); |
| pathOffset += 3; |
| // 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); |
| }); |
| }); |
| } |