| // ignore_for_file: camel_case_types |
| // ignore_for_file: cascade_invocations |
| // ignore_for_file: comment_references |
| // ignore_for_file: file_names |
| // ignore_for_file: library_names |
| // ignore_for_file: lines_longer_than_80_chars |
| // ignore_for_file: non_constant_identifier_names |
| // ignore_for_file: prefer_const_declarations |
| // ignore_for_file: prefer_expression_function_bodies |
| // ignore_for_file: prefer_final_locals |
| // ignore_for_file: prefer_interpolation_to_compose_strings |
| // ignore_for_file: unnecessary_brace_in_string_interps |
| // ignore_for_file: unnecessary_cast |
| // ignore_for_file: unnecessary_lambdas |
| // ignore_for_file: unnecessary_parenthesis |
| // ignore_for_file: unnecessary_string_interpolations |
| // ignore_for_file: unused_local_variable |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert; |
| import 'dart:core' as core; |
| |
| import 'package:googleapis/connectors/v1.dart' as api; |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import '../test_shared.dart'; |
| |
| core.List<api.AuditLogConfig> buildUnnamed0() => [ |
| buildAuditLogConfig(), |
| buildAuditLogConfig(), |
| ]; |
| |
| void checkUnnamed0(core.List<api.AuditLogConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuditLogConfig(o[0]); |
| checkAuditLogConfig(o[1]); |
| } |
| |
| core.int buildCounterAuditConfig = 0; |
| api.AuditConfig buildAuditConfig() { |
| final o = api.AuditConfig(); |
| buildCounterAuditConfig++; |
| if (buildCounterAuditConfig < 3) { |
| o.auditLogConfigs = buildUnnamed0(); |
| o.service = 'foo'; |
| } |
| buildCounterAuditConfig--; |
| return o; |
| } |
| |
| void checkAuditConfig(api.AuditConfig o) { |
| buildCounterAuditConfig++; |
| if (buildCounterAuditConfig < 3) { |
| checkUnnamed0(o.auditLogConfigs!); |
| unittest.expect( |
| o.service!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterAuditConfig--; |
| } |
| |
| core.List<core.String> buildUnnamed1() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed1(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o[0], |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o[1], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterAuditLogConfig = 0; |
| api.AuditLogConfig buildAuditLogConfig() { |
| final o = api.AuditLogConfig(); |
| buildCounterAuditLogConfig++; |
| if (buildCounterAuditLogConfig < 3) { |
| o.exemptedMembers = buildUnnamed1(); |
| o.logType = 'foo'; |
| } |
| buildCounterAuditLogConfig--; |
| return o; |
| } |
| |
| void checkAuditLogConfig(api.AuditLogConfig o) { |
| buildCounterAuditLogConfig++; |
| if (buildCounterAuditLogConfig < 3) { |
| checkUnnamed1(o.exemptedMembers!); |
| unittest.expect( |
| o.logType!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterAuditLogConfig--; |
| } |
| |
| core.List<api.ConfigVariable> buildUnnamed2() => [ |
| buildConfigVariable(), |
| buildConfigVariable(), |
| ]; |
| |
| void checkUnnamed2(core.List<api.ConfigVariable> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkConfigVariable(o[0]); |
| checkConfigVariable(o[1]); |
| } |
| |
| core.int buildCounterAuthConfig = 0; |
| api.AuthConfig buildAuthConfig() { |
| final o = api.AuthConfig(); |
| buildCounterAuthConfig++; |
| if (buildCounterAuthConfig < 3) { |
| o.additionalVariables = buildUnnamed2(); |
| o.authType = 'foo'; |
| o.oauth2ClientCredentials = buildOauth2ClientCredentials(); |
| o.oauth2JwtBearer = buildOauth2JwtBearer(); |
| o.userPassword = buildUserPassword(); |
| } |
| buildCounterAuthConfig--; |
| return o; |
| } |
| |
| void checkAuthConfig(api.AuthConfig o) { |
| buildCounterAuthConfig++; |
| if (buildCounterAuthConfig < 3) { |
| checkUnnamed2(o.additionalVariables!); |
| unittest.expect( |
| o.authType!, |
| unittest.equals('foo'), |
| ); |
| checkOauth2ClientCredentials(o.oauth2ClientCredentials!); |
| checkOauth2JwtBearer(o.oauth2JwtBearer!); |
| checkUserPassword(o.userPassword!); |
| } |
| buildCounterAuthConfig--; |
| } |
| |
| core.List<api.ConfigVariableTemplate> buildUnnamed3() => [ |
| buildConfigVariableTemplate(), |
| buildConfigVariableTemplate(), |
| ]; |
| |
| void checkUnnamed3(core.List<api.ConfigVariableTemplate> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkConfigVariableTemplate(o[0]); |
| checkConfigVariableTemplate(o[1]); |
| } |
| |
| core.int buildCounterAuthConfigTemplate = 0; |
| api.AuthConfigTemplate buildAuthConfigTemplate() { |
| final o = api.AuthConfigTemplate(); |
| buildCounterAuthConfigTemplate++; |
| if (buildCounterAuthConfigTemplate < 3) { |
| o.authType = 'foo'; |
| o.configVariableTemplates = buildUnnamed3(); |
| } |
| buildCounterAuthConfigTemplate--; |
| return o; |
| } |
| |
| void checkAuthConfigTemplate(api.AuthConfigTemplate o) { |
| buildCounterAuthConfigTemplate++; |
| if (buildCounterAuthConfigTemplate < 3) { |
| unittest.expect( |
| o.authType!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed3(o.configVariableTemplates!); |
| } |
| buildCounterAuthConfigTemplate--; |
| } |
| |
| core.List<core.String> buildUnnamed4() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed4(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 = buildUnnamed4(); |
| o.role = 'foo'; |
| } |
| buildCounterBinding--; |
| return o; |
| } |
| |
| void checkBinding(api.Binding o) { |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| checkExpr(o.condition!); |
| checkUnnamed4(o.members!); |
| unittest.expect( |
| o.role!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterBinding--; |
| } |
| |
| core.int buildCounterCancelOperationRequest = 0; |
| api.CancelOperationRequest buildCancelOperationRequest() { |
| final o = api.CancelOperationRequest(); |
| buildCounterCancelOperationRequest++; |
| if (buildCounterCancelOperationRequest < 3) {} |
| buildCounterCancelOperationRequest--; |
| return o; |
| } |
| |
| void checkCancelOperationRequest(api.CancelOperationRequest o) { |
| buildCounterCancelOperationRequest++; |
| if (buildCounterCancelOperationRequest < 3) {} |
| buildCounterCancelOperationRequest--; |
| } |
| |
| core.int buildCounterConfigVariable = 0; |
| api.ConfigVariable buildConfigVariable() { |
| final o = api.ConfigVariable(); |
| buildCounterConfigVariable++; |
| if (buildCounterConfigVariable < 3) { |
| o.boolValue = true; |
| o.intValue = 'foo'; |
| o.key = 'foo'; |
| o.secretValue = buildSecret(); |
| o.stringValue = 'foo'; |
| } |
| buildCounterConfigVariable--; |
| return o; |
| } |
| |
| void checkConfigVariable(api.ConfigVariable o) { |
| buildCounterConfigVariable++; |
| if (buildCounterConfigVariable < 3) { |
| unittest.expect(o.boolValue!, unittest.isTrue); |
| unittest.expect( |
| o.intValue!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.key!, |
| unittest.equals('foo'), |
| ); |
| checkSecret(o.secretValue!); |
| unittest.expect( |
| o.stringValue!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterConfigVariable--; |
| } |
| |
| core.int buildCounterConfigVariableTemplate = 0; |
| api.ConfigVariableTemplate buildConfigVariableTemplate() { |
| final o = api.ConfigVariableTemplate(); |
| buildCounterConfigVariableTemplate++; |
| if (buildCounterConfigVariableTemplate < 3) { |
| o.description = 'foo'; |
| o.displayName = 'foo'; |
| o.key = 'foo'; |
| o.required = true; |
| o.roleGrant = buildRoleGrant(); |
| o.validationRegex = 'foo'; |
| o.valueType = 'foo'; |
| } |
| buildCounterConfigVariableTemplate--; |
| return o; |
| } |
| |
| void checkConfigVariableTemplate(api.ConfigVariableTemplate o) { |
| buildCounterConfigVariableTemplate++; |
| if (buildCounterConfigVariableTemplate < 3) { |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.key!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.required!, unittest.isTrue); |
| checkRoleGrant(o.roleGrant!); |
| unittest.expect( |
| o.validationRegex!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.valueType!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterConfigVariableTemplate--; |
| } |
| |
| core.List<api.ConfigVariable> buildUnnamed5() => [ |
| buildConfigVariable(), |
| buildConfigVariable(), |
| ]; |
| |
| void checkUnnamed5(core.List<api.ConfigVariable> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkConfigVariable(o[0]); |
| checkConfigVariable(o[1]); |
| } |
| |
| core.List<core.String> buildUnnamed6() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed6(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.Map<core.String, core.String> buildUnnamed7() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed7(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 buildCounterConnection = 0; |
| api.Connection buildConnection() { |
| final o = api.Connection(); |
| buildCounterConnection++; |
| if (buildCounterConnection < 3) { |
| o.authConfig = buildAuthConfig(); |
| o.configVariables = buildUnnamed5(); |
| o.connectorVersion = 'foo'; |
| o.createTime = 'foo'; |
| o.description = 'foo'; |
| o.egressBackends = buildUnnamed6(); |
| o.envoyImageLocation = 'foo'; |
| o.imageLocation = 'foo'; |
| o.labels = buildUnnamed7(); |
| o.lockConfig = buildLockConfig(); |
| o.name = 'foo'; |
| o.serviceAccount = 'foo'; |
| o.serviceDirectory = 'foo'; |
| o.status = buildConnectionStatus(); |
| o.suspended = true; |
| o.updateTime = 'foo'; |
| } |
| buildCounterConnection--; |
| return o; |
| } |
| |
| void checkConnection(api.Connection o) { |
| buildCounterConnection++; |
| if (buildCounterConnection < 3) { |
| checkAuthConfig(o.authConfig!); |
| checkUnnamed5(o.configVariables!); |
| unittest.expect( |
| o.connectorVersion!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed6(o.egressBackends!); |
| unittest.expect( |
| o.envoyImageLocation!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.imageLocation!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed7(o.labels!); |
| checkLockConfig(o.lockConfig!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.serviceAccount!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.serviceDirectory!, |
| unittest.equals('foo'), |
| ); |
| checkConnectionStatus(o.status!); |
| unittest.expect(o.suspended!, unittest.isTrue); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterConnection--; |
| } |
| |
| 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.List<core.String> buildUnnamed9() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed9(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 buildCounterConnectionSchemaMetadata = 0; |
| api.ConnectionSchemaMetadata buildConnectionSchemaMetadata() { |
| final o = api.ConnectionSchemaMetadata(); |
| buildCounterConnectionSchemaMetadata++; |
| if (buildCounterConnectionSchemaMetadata < 3) { |
| o.actions = buildUnnamed8(); |
| o.entities = buildUnnamed9(); |
| } |
| buildCounterConnectionSchemaMetadata--; |
| return o; |
| } |
| |
| void checkConnectionSchemaMetadata(api.ConnectionSchemaMetadata o) { |
| buildCounterConnectionSchemaMetadata++; |
| if (buildCounterConnectionSchemaMetadata < 3) { |
| checkUnnamed8(o.actions!); |
| checkUnnamed9(o.entities!); |
| } |
| buildCounterConnectionSchemaMetadata--; |
| } |
| |
| core.int buildCounterConnectionStatus = 0; |
| api.ConnectionStatus buildConnectionStatus() { |
| final o = api.ConnectionStatus(); |
| buildCounterConnectionStatus++; |
| if (buildCounterConnectionStatus < 3) { |
| o.description = 'foo'; |
| o.state = 'foo'; |
| o.status = 'foo'; |
| } |
| buildCounterConnectionStatus--; |
| return o; |
| } |
| |
| void checkConnectionStatus(api.ConnectionStatus o) { |
| buildCounterConnectionStatus++; |
| if (buildCounterConnectionStatus < 3) { |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.state!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.status!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterConnectionStatus--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed10() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed10(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 buildCounterConnector = 0; |
| api.Connector buildConnector() { |
| final o = api.Connector(); |
| buildCounterConnector++; |
| if (buildCounterConnector < 3) { |
| o.createTime = 'foo'; |
| o.description = 'foo'; |
| o.displayName = 'foo'; |
| o.documentationUri = 'foo'; |
| o.externalUri = 'foo'; |
| o.labels = buildUnnamed10(); |
| o.launchStage = 'foo'; |
| o.name = 'foo'; |
| o.updateTime = 'foo'; |
| o.webAssetsLocation = 'foo'; |
| } |
| buildCounterConnector--; |
| return o; |
| } |
| |
| void checkConnector(api.Connector o) { |
| buildCounterConnector++; |
| if (buildCounterConnector < 3) { |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.documentationUri!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.externalUri!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed10(o.labels!); |
| unittest.expect( |
| o.launchStage!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.webAssetsLocation!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterConnector--; |
| } |
| |
| core.List<api.AuthConfigTemplate> buildUnnamed11() => [ |
| buildAuthConfigTemplate(), |
| buildAuthConfigTemplate(), |
| ]; |
| |
| void checkUnnamed11(core.List<api.AuthConfigTemplate> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuthConfigTemplate(o[0]); |
| checkAuthConfigTemplate(o[1]); |
| } |
| |
| core.List<api.ConfigVariableTemplate> buildUnnamed12() => [ |
| buildConfigVariableTemplate(), |
| buildConfigVariableTemplate(), |
| ]; |
| |
| void checkUnnamed12(core.List<api.ConfigVariableTemplate> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkConfigVariableTemplate(o[0]); |
| checkConfigVariableTemplate(o[1]); |
| } |
| |
| 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.List<api.RoleGrant> buildUnnamed14() => [ |
| buildRoleGrant(), |
| buildRoleGrant(), |
| ]; |
| |
| void checkUnnamed14(core.List<api.RoleGrant> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkRoleGrant(o[0]); |
| checkRoleGrant(o[1]); |
| } |
| |
| core.int buildCounterConnectorVersion = 0; |
| api.ConnectorVersion buildConnectorVersion() { |
| final o = api.ConnectorVersion(); |
| buildCounterConnectorVersion++; |
| if (buildCounterConnectorVersion < 3) { |
| o.authConfigTemplates = buildUnnamed11(); |
| o.configVariableTemplates = buildUnnamed12(); |
| o.createTime = 'foo'; |
| o.displayName = 'foo'; |
| o.egressControlConfig = buildEgressControlConfig(); |
| o.labels = buildUnnamed13(); |
| o.launchStage = 'foo'; |
| o.name = 'foo'; |
| o.releaseVersion = 'foo'; |
| o.roleGrant = buildRoleGrant(); |
| o.roleGrants = buildUnnamed14(); |
| o.supportedRuntimeFeatures = buildSupportedRuntimeFeatures(); |
| o.updateTime = 'foo'; |
| } |
| buildCounterConnectorVersion--; |
| return o; |
| } |
| |
| void checkConnectorVersion(api.ConnectorVersion o) { |
| buildCounterConnectorVersion++; |
| if (buildCounterConnectorVersion < 3) { |
| checkUnnamed11(o.authConfigTemplates!); |
| checkUnnamed12(o.configVariableTemplates!); |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| checkEgressControlConfig(o.egressControlConfig!); |
| checkUnnamed13(o.labels!); |
| unittest.expect( |
| o.launchStage!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.releaseVersion!, |
| unittest.equals('foo'), |
| ); |
| checkRoleGrant(o.roleGrant!); |
| checkUnnamed14(o.roleGrants!); |
| checkSupportedRuntimeFeatures(o.supportedRuntimeFeatures!); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterConnectorVersion--; |
| } |
| |
| core.int buildCounterEgressControlConfig = 0; |
| api.EgressControlConfig buildEgressControlConfig() { |
| final o = api.EgressControlConfig(); |
| buildCounterEgressControlConfig++; |
| if (buildCounterEgressControlConfig < 3) { |
| o.backends = 'foo'; |
| o.extractionRules = buildExtractionRules(); |
| } |
| buildCounterEgressControlConfig--; |
| return o; |
| } |
| |
| void checkEgressControlConfig(api.EgressControlConfig o) { |
| buildCounterEgressControlConfig++; |
| if (buildCounterEgressControlConfig < 3) { |
| unittest.expect( |
| o.backends!, |
| unittest.equals('foo'), |
| ); |
| checkExtractionRules(o.extractionRules!); |
| } |
| buildCounterEgressControlConfig--; |
| } |
| |
| core.int buildCounterEmpty = 0; |
| api.Empty buildEmpty() { |
| final o = api.Empty(); |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| return o; |
| } |
| |
| void checkEmpty(api.Empty o) { |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| } |
| |
| 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.int buildCounterExtractionRule = 0; |
| api.ExtractionRule buildExtractionRule() { |
| final o = api.ExtractionRule(); |
| buildCounterExtractionRule++; |
| if (buildCounterExtractionRule < 3) { |
| o.extractionRegex = 'foo'; |
| o.source = buildSource(); |
| } |
| buildCounterExtractionRule--; |
| return o; |
| } |
| |
| void checkExtractionRule(api.ExtractionRule o) { |
| buildCounterExtractionRule++; |
| if (buildCounterExtractionRule < 3) { |
| unittest.expect( |
| o.extractionRegex!, |
| unittest.equals('foo'), |
| ); |
| checkSource(o.source!); |
| } |
| buildCounterExtractionRule--; |
| } |
| |
| core.List<api.ExtractionRule> buildUnnamed15() => [ |
| buildExtractionRule(), |
| buildExtractionRule(), |
| ]; |
| |
| void checkUnnamed15(core.List<api.ExtractionRule> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkExtractionRule(o[0]); |
| checkExtractionRule(o[1]); |
| } |
| |
| core.int buildCounterExtractionRules = 0; |
| api.ExtractionRules buildExtractionRules() { |
| final o = api.ExtractionRules(); |
| buildCounterExtractionRules++; |
| if (buildCounterExtractionRules < 3) { |
| o.extractionRule = buildUnnamed15(); |
| } |
| buildCounterExtractionRules--; |
| return o; |
| } |
| |
| void checkExtractionRules(api.ExtractionRules o) { |
| buildCounterExtractionRules++; |
| if (buildCounterExtractionRules < 3) { |
| checkUnnamed15(o.extractionRule!); |
| } |
| buildCounterExtractionRules--; |
| } |
| |
| 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 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 buildCounterField = 0; |
| api.Field buildField() { |
| final o = api.Field(); |
| buildCounterField++; |
| if (buildCounterField < 3) { |
| o.additionalDetails = buildUnnamed16(); |
| o.dataType = 'foo'; |
| o.defaultValue = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o.description = 'foo'; |
| o.field = 'foo'; |
| o.key = true; |
| o.nullable = true; |
| o.readonly = true; |
| } |
| buildCounterField--; |
| return o; |
| } |
| |
| void checkField(api.Field o) { |
| buildCounterField++; |
| if (buildCounterField < 3) { |
| checkUnnamed16(o.additionalDetails!); |
| unittest.expect( |
| o.dataType!, |
| unittest.equals('foo'), |
| ); |
| var casted3 = (o.defaultValue!) 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'), |
| ); |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.field!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.key!, unittest.isTrue); |
| unittest.expect(o.nullable!, unittest.isTrue); |
| unittest.expect(o.readonly!, unittest.isTrue); |
| } |
| buildCounterField--; |
| } |
| |
| core.int buildCounterInputParameter = 0; |
| api.InputParameter buildInputParameter() { |
| final o = api.InputParameter(); |
| buildCounterInputParameter++; |
| if (buildCounterInputParameter < 3) { |
| o.dataType = 'foo'; |
| o.defaultValue = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o.description = 'foo'; |
| o.nullable = true; |
| o.parameter = 'foo'; |
| } |
| buildCounterInputParameter--; |
| return o; |
| } |
| |
| void checkInputParameter(api.InputParameter o) { |
| buildCounterInputParameter++; |
| if (buildCounterInputParameter < 3) { |
| unittest.expect( |
| o.dataType!, |
| unittest.equals('foo'), |
| ); |
| var casted4 = (o.defaultValue!) 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'), |
| ); |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect(o.nullable!, unittest.isTrue); |
| unittest.expect( |
| o.parameter!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterInputParameter--; |
| } |
| |
| core.int buildCounterJwtClaims = 0; |
| api.JwtClaims buildJwtClaims() { |
| final o = api.JwtClaims(); |
| buildCounterJwtClaims++; |
| if (buildCounterJwtClaims < 3) { |
| o.audience = 'foo'; |
| o.issuer = 'foo'; |
| o.subject = 'foo'; |
| } |
| buildCounterJwtClaims--; |
| return o; |
| } |
| |
| void checkJwtClaims(api.JwtClaims o) { |
| buildCounterJwtClaims++; |
| if (buildCounterJwtClaims < 3) { |
| unittest.expect( |
| o.audience!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.issuer!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.subject!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterJwtClaims--; |
| } |
| |
| core.List<api.Connection> buildUnnamed17() => [ |
| buildConnection(), |
| buildConnection(), |
| ]; |
| |
| void checkUnnamed17(core.List<api.Connection> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkConnection(o[0]); |
| checkConnection(o[1]); |
| } |
| |
| core.List<core.String> buildUnnamed18() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed18(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect( |
| o[0], |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o[1], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterListConnectionsResponse = 0; |
| api.ListConnectionsResponse buildListConnectionsResponse() { |
| final o = api.ListConnectionsResponse(); |
| buildCounterListConnectionsResponse++; |
| if (buildCounterListConnectionsResponse < 3) { |
| o.connections = buildUnnamed17(); |
| o.nextPageToken = 'foo'; |
| o.unreachable = buildUnnamed18(); |
| } |
| buildCounterListConnectionsResponse--; |
| return o; |
| } |
| |
| void checkListConnectionsResponse(api.ListConnectionsResponse o) { |
| buildCounterListConnectionsResponse++; |
| if (buildCounterListConnectionsResponse < 3) { |
| checkUnnamed17(o.connections!); |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed18(o.unreachable!); |
| } |
| buildCounterListConnectionsResponse--; |
| } |
| |
| core.List<api.ConnectorVersion> buildUnnamed19() => [ |
| buildConnectorVersion(), |
| buildConnectorVersion(), |
| ]; |
| |
| void checkUnnamed19(core.List<api.ConnectorVersion> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkConnectorVersion(o[0]); |
| checkConnectorVersion(o[1]); |
| } |
| |
| core.List<core.String> buildUnnamed20() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed20(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 buildCounterListConnectorVersionsResponse = 0; |
| api.ListConnectorVersionsResponse buildListConnectorVersionsResponse() { |
| final o = api.ListConnectorVersionsResponse(); |
| buildCounterListConnectorVersionsResponse++; |
| if (buildCounterListConnectorVersionsResponse < 3) { |
| o.connectorVersions = buildUnnamed19(); |
| o.nextPageToken = 'foo'; |
| o.unreachable = buildUnnamed20(); |
| } |
| buildCounterListConnectorVersionsResponse--; |
| return o; |
| } |
| |
| void checkListConnectorVersionsResponse(api.ListConnectorVersionsResponse o) { |
| buildCounterListConnectorVersionsResponse++; |
| if (buildCounterListConnectorVersionsResponse < 3) { |
| checkUnnamed19(o.connectorVersions!); |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed20(o.unreachable!); |
| } |
| buildCounterListConnectorVersionsResponse--; |
| } |
| |
| core.List<api.Connector> buildUnnamed21() => [ |
| buildConnector(), |
| buildConnector(), |
| ]; |
| |
| void checkUnnamed21(core.List<api.Connector> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkConnector(o[0]); |
| checkConnector(o[1]); |
| } |
| |
| core.List<core.String> buildUnnamed22() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed22(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 buildCounterListConnectorsResponse = 0; |
| api.ListConnectorsResponse buildListConnectorsResponse() { |
| final o = api.ListConnectorsResponse(); |
| buildCounterListConnectorsResponse++; |
| if (buildCounterListConnectorsResponse < 3) { |
| o.connectors = buildUnnamed21(); |
| o.nextPageToken = 'foo'; |
| o.unreachable = buildUnnamed22(); |
| } |
| buildCounterListConnectorsResponse--; |
| return o; |
| } |
| |
| void checkListConnectorsResponse(api.ListConnectorsResponse o) { |
| buildCounterListConnectorsResponse++; |
| if (buildCounterListConnectorsResponse < 3) { |
| checkUnnamed21(o.connectors!); |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed22(o.unreachable!); |
| } |
| buildCounterListConnectorsResponse--; |
| } |
| |
| core.List<api.Location> buildUnnamed23() => [ |
| buildLocation(), |
| buildLocation(), |
| ]; |
| |
| void checkUnnamed23(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 = buildUnnamed23(); |
| o.nextPageToken = 'foo'; |
| } |
| buildCounterListLocationsResponse--; |
| return o; |
| } |
| |
| void checkListLocationsResponse(api.ListLocationsResponse o) { |
| buildCounterListLocationsResponse++; |
| if (buildCounterListLocationsResponse < 3) { |
| checkUnnamed23(o.locations!); |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterListLocationsResponse--; |
| } |
| |
| core.List<api.Operation> buildUnnamed24() => [ |
| buildOperation(), |
| buildOperation(), |
| ]; |
| |
| void checkUnnamed24(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.int buildCounterListOperationsResponse = 0; |
| api.ListOperationsResponse buildListOperationsResponse() { |
| final o = api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed24(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| void checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed24(o.operations!); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| core.List<api.Provider> buildUnnamed25() => [ |
| buildProvider(), |
| buildProvider(), |
| ]; |
| |
| void checkUnnamed25(core.List<api.Provider> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkProvider(o[0]); |
| checkProvider(o[1]); |
| } |
| |
| 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 buildCounterListProvidersResponse = 0; |
| api.ListProvidersResponse buildListProvidersResponse() { |
| final o = api.ListProvidersResponse(); |
| buildCounterListProvidersResponse++; |
| if (buildCounterListProvidersResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.providers = buildUnnamed25(); |
| o.unreachable = buildUnnamed26(); |
| } |
| buildCounterListProvidersResponse--; |
| return o; |
| } |
| |
| void checkListProvidersResponse(api.ListProvidersResponse o) { |
| buildCounterListProvidersResponse++; |
| if (buildCounterListProvidersResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed25(o.providers!); |
| checkUnnamed26(o.unreachable!); |
| } |
| buildCounterListProvidersResponse--; |
| } |
| |
| core.List<api.RuntimeActionSchema> buildUnnamed27() => [ |
| buildRuntimeActionSchema(), |
| buildRuntimeActionSchema(), |
| ]; |
| |
| void checkUnnamed27(core.List<api.RuntimeActionSchema> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkRuntimeActionSchema(o[0]); |
| checkRuntimeActionSchema(o[1]); |
| } |
| |
| core.int buildCounterListRuntimeActionSchemasResponse = 0; |
| api.ListRuntimeActionSchemasResponse buildListRuntimeActionSchemasResponse() { |
| final o = api.ListRuntimeActionSchemasResponse(); |
| buildCounterListRuntimeActionSchemasResponse++; |
| if (buildCounterListRuntimeActionSchemasResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.runtimeActionSchemas = buildUnnamed27(); |
| } |
| buildCounterListRuntimeActionSchemasResponse--; |
| return o; |
| } |
| |
| void checkListRuntimeActionSchemasResponse( |
| api.ListRuntimeActionSchemasResponse o) { |
| buildCounterListRuntimeActionSchemasResponse++; |
| if (buildCounterListRuntimeActionSchemasResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed27(o.runtimeActionSchemas!); |
| } |
| buildCounterListRuntimeActionSchemasResponse--; |
| } |
| |
| core.List<api.RuntimeEntitySchema> buildUnnamed28() => [ |
| buildRuntimeEntitySchema(), |
| buildRuntimeEntitySchema(), |
| ]; |
| |
| void checkUnnamed28(core.List<api.RuntimeEntitySchema> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkRuntimeEntitySchema(o[0]); |
| checkRuntimeEntitySchema(o[1]); |
| } |
| |
| core.int buildCounterListRuntimeEntitySchemasResponse = 0; |
| api.ListRuntimeEntitySchemasResponse buildListRuntimeEntitySchemasResponse() { |
| final o = api.ListRuntimeEntitySchemasResponse(); |
| buildCounterListRuntimeEntitySchemasResponse++; |
| if (buildCounterListRuntimeEntitySchemasResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.runtimeEntitySchemas = buildUnnamed28(); |
| } |
| buildCounterListRuntimeEntitySchemasResponse--; |
| return o; |
| } |
| |
| void checkListRuntimeEntitySchemasResponse( |
| api.ListRuntimeEntitySchemasResponse o) { |
| buildCounterListRuntimeEntitySchemasResponse++; |
| if (buildCounterListRuntimeEntitySchemasResponse < 3) { |
| unittest.expect( |
| o.nextPageToken!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed28(o.runtimeEntitySchemas!); |
| } |
| buildCounterListRuntimeEntitySchemasResponse--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed29() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed29(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?> buildUnnamed30() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed30(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 buildCounterLocation = 0; |
| api.Location buildLocation() { |
| final o = api.Location(); |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| o.displayName = 'foo'; |
| o.labels = buildUnnamed29(); |
| o.locationId = 'foo'; |
| o.metadata = buildUnnamed30(); |
| o.name = 'foo'; |
| } |
| buildCounterLocation--; |
| return o; |
| } |
| |
| void checkLocation(api.Location o) { |
| buildCounterLocation++; |
| if (buildCounterLocation < 3) { |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed29(o.labels!); |
| unittest.expect( |
| o.locationId!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed30(o.metadata!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterLocation--; |
| } |
| |
| core.int buildCounterLockConfig = 0; |
| api.LockConfig buildLockConfig() { |
| final o = api.LockConfig(); |
| buildCounterLockConfig++; |
| if (buildCounterLockConfig < 3) { |
| o.locked = true; |
| o.reason = 'foo'; |
| } |
| buildCounterLockConfig--; |
| return o; |
| } |
| |
| void checkLockConfig(api.LockConfig o) { |
| buildCounterLockConfig++; |
| if (buildCounterLockConfig < 3) { |
| unittest.expect(o.locked!, unittest.isTrue); |
| unittest.expect( |
| o.reason!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterLockConfig--; |
| } |
| |
| core.int buildCounterOauth2ClientCredentials = 0; |
| api.Oauth2ClientCredentials buildOauth2ClientCredentials() { |
| final o = api.Oauth2ClientCredentials(); |
| buildCounterOauth2ClientCredentials++; |
| if (buildCounterOauth2ClientCredentials < 3) { |
| o.clientId = 'foo'; |
| o.clientSecret = buildSecret(); |
| } |
| buildCounterOauth2ClientCredentials--; |
| return o; |
| } |
| |
| void checkOauth2ClientCredentials(api.Oauth2ClientCredentials o) { |
| buildCounterOauth2ClientCredentials++; |
| if (buildCounterOauth2ClientCredentials < 3) { |
| unittest.expect( |
| o.clientId!, |
| unittest.equals('foo'), |
| ); |
| checkSecret(o.clientSecret!); |
| } |
| buildCounterOauth2ClientCredentials--; |
| } |
| |
| core.int buildCounterOauth2JwtBearer = 0; |
| api.Oauth2JwtBearer buildOauth2JwtBearer() { |
| final o = api.Oauth2JwtBearer(); |
| buildCounterOauth2JwtBearer++; |
| if (buildCounterOauth2JwtBearer < 3) { |
| o.clientKey = buildSecret(); |
| o.jwtClaims = buildJwtClaims(); |
| } |
| buildCounterOauth2JwtBearer--; |
| return o; |
| } |
| |
| void checkOauth2JwtBearer(api.Oauth2JwtBearer o) { |
| buildCounterOauth2JwtBearer++; |
| if (buildCounterOauth2JwtBearer < 3) { |
| checkSecret(o.clientKey!); |
| checkJwtClaims(o.jwtClaims!); |
| } |
| buildCounterOauth2JwtBearer--; |
| } |
| |
| core.Map<core.String, core.Object?> buildUnnamed31() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed31(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.Map<core.String, core.Object?> buildUnnamed32() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed32(core.Map<core.String, core.Object?> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted9 = (o['x']!) as core.Map; |
| unittest.expect(casted9, unittest.hasLength(3)); |
| unittest.expect( |
| casted9['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted9['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted9['string'], |
| unittest.equals('foo'), |
| ); |
| var casted10 = (o['y']!) as core.Map; |
| unittest.expect(casted10, unittest.hasLength(3)); |
| unittest.expect( |
| casted10['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted10['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted10['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.int buildCounterOperation = 0; |
| api.Operation buildOperation() { |
| final o = api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed31(); |
| o.name = 'foo'; |
| o.response = buildUnnamed32(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| void checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done!, unittest.isTrue); |
| checkStatus(o.error!); |
| checkUnnamed31(o.metadata!); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed32(o.response!); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.List<api.AuditConfig> buildUnnamed33() => [ |
| buildAuditConfig(), |
| buildAuditConfig(), |
| ]; |
| |
| void checkUnnamed33(core.List<api.AuditConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuditConfig(o[0]); |
| checkAuditConfig(o[1]); |
| } |
| |
| core.List<api.Binding> buildUnnamed34() => [ |
| buildBinding(), |
| buildBinding(), |
| ]; |
| |
| void checkUnnamed34(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 = buildUnnamed33(); |
| o.bindings = buildUnnamed34(); |
| o.etag = 'foo'; |
| o.version = 42; |
| } |
| buildCounterPolicy--; |
| return o; |
| } |
| |
| void checkPolicy(api.Policy o) { |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| checkUnnamed33(o.auditConfigs!); |
| checkUnnamed34(o.bindings!); |
| unittest.expect( |
| o.etag!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.version!, |
| unittest.equals(42), |
| ); |
| } |
| buildCounterPolicy--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed35() => { |
| 'x': 'foo', |
| 'y': 'foo', |
| }; |
| |
| void checkUnnamed35(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 buildCounterProvider = 0; |
| api.Provider buildProvider() { |
| final o = api.Provider(); |
| buildCounterProvider++; |
| if (buildCounterProvider < 3) { |
| o.createTime = 'foo'; |
| o.description = 'foo'; |
| o.displayName = 'foo'; |
| o.documentationUri = 'foo'; |
| o.externalUri = 'foo'; |
| o.labels = buildUnnamed35(); |
| o.launchStage = 'foo'; |
| o.name = 'foo'; |
| o.updateTime = 'foo'; |
| o.webAssetsLocation = 'foo'; |
| } |
| buildCounterProvider--; |
| return o; |
| } |
| |
| void checkProvider(api.Provider o) { |
| buildCounterProvider++; |
| if (buildCounterProvider < 3) { |
| unittest.expect( |
| o.createTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.displayName!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.documentationUri!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.externalUri!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed35(o.labels!); |
| unittest.expect( |
| o.launchStage!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.name!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.updateTime!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.webAssetsLocation!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterProvider--; |
| } |
| |
| core.int buildCounterResource = 0; |
| api.Resource buildResource() { |
| final o = api.Resource(); |
| buildCounterResource++; |
| if (buildCounterResource < 3) { |
| o.pathTemplate = 'foo'; |
| o.type = 'foo'; |
| } |
| buildCounterResource--; |
| return o; |
| } |
| |
| void checkResource(api.Resource o) { |
| buildCounterResource++; |
| if (buildCounterResource < 3) { |
| unittest.expect( |
| o.pathTemplate!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.type!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterResource--; |
| } |
| |
| core.int buildCounterResultMetadata = 0; |
| api.ResultMetadata buildResultMetadata() { |
| final o = api.ResultMetadata(); |
| buildCounterResultMetadata++; |
| if (buildCounterResultMetadata < 3) { |
| o.dataType = 'foo'; |
| o.description = 'foo'; |
| o.field = 'foo'; |
| } |
| buildCounterResultMetadata--; |
| return o; |
| } |
| |
| void checkResultMetadata(api.ResultMetadata o) { |
| buildCounterResultMetadata++; |
| if (buildCounterResultMetadata < 3) { |
| unittest.expect( |
| o.dataType!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.description!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.field!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterResultMetadata--; |
| } |
| |
| core.List<core.String> buildUnnamed36() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed36(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 buildCounterRoleGrant = 0; |
| api.RoleGrant buildRoleGrant() { |
| final o = api.RoleGrant(); |
| buildCounterRoleGrant++; |
| if (buildCounterRoleGrant < 3) { |
| o.helperTextTemplate = 'foo'; |
| o.principal = 'foo'; |
| o.resource = buildResource(); |
| o.roles = buildUnnamed36(); |
| } |
| buildCounterRoleGrant--; |
| return o; |
| } |
| |
| void checkRoleGrant(api.RoleGrant o) { |
| buildCounterRoleGrant++; |
| if (buildCounterRoleGrant < 3) { |
| unittest.expect( |
| o.helperTextTemplate!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.principal!, |
| unittest.equals('foo'), |
| ); |
| checkResource(o.resource!); |
| checkUnnamed36(o.roles!); |
| } |
| buildCounterRoleGrant--; |
| } |
| |
| core.List<api.InputParameter> buildUnnamed37() => [ |
| buildInputParameter(), |
| buildInputParameter(), |
| ]; |
| |
| void checkUnnamed37(core.List<api.InputParameter> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkInputParameter(o[0]); |
| checkInputParameter(o[1]); |
| } |
| |
| core.List<api.ResultMetadata> buildUnnamed38() => [ |
| buildResultMetadata(), |
| buildResultMetadata(), |
| ]; |
| |
| void checkUnnamed38(core.List<api.ResultMetadata> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkResultMetadata(o[0]); |
| checkResultMetadata(o[1]); |
| } |
| |
| core.int buildCounterRuntimeActionSchema = 0; |
| api.RuntimeActionSchema buildRuntimeActionSchema() { |
| final o = api.RuntimeActionSchema(); |
| buildCounterRuntimeActionSchema++; |
| if (buildCounterRuntimeActionSchema < 3) { |
| o.action = 'foo'; |
| o.inputParameters = buildUnnamed37(); |
| o.resultMetadata = buildUnnamed38(); |
| } |
| buildCounterRuntimeActionSchema--; |
| return o; |
| } |
| |
| void checkRuntimeActionSchema(api.RuntimeActionSchema o) { |
| buildCounterRuntimeActionSchema++; |
| if (buildCounterRuntimeActionSchema < 3) { |
| unittest.expect( |
| o.action!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed37(o.inputParameters!); |
| checkUnnamed38(o.resultMetadata!); |
| } |
| buildCounterRuntimeActionSchema--; |
| } |
| |
| core.int buildCounterRuntimeConfig = 0; |
| api.RuntimeConfig buildRuntimeConfig() { |
| final o = api.RuntimeConfig(); |
| buildCounterRuntimeConfig++; |
| if (buildCounterRuntimeConfig < 3) { |
| o.conndSubscription = 'foo'; |
| o.conndTopic = 'foo'; |
| o.controlPlaneSubscription = 'foo'; |
| o.controlPlaneTopic = 'foo'; |
| o.locationId = 'foo'; |
| o.runtimeEndpoint = 'foo'; |
| o.schemaGcsBucket = 'foo'; |
| o.serviceDirectory = 'foo'; |
| o.state = 'foo'; |
| } |
| buildCounterRuntimeConfig--; |
| return o; |
| } |
| |
| void checkRuntimeConfig(api.RuntimeConfig o) { |
| buildCounterRuntimeConfig++; |
| if (buildCounterRuntimeConfig < 3) { |
| unittest.expect( |
| o.conndSubscription!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.conndTopic!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.controlPlaneSubscription!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.controlPlaneTopic!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.locationId!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.runtimeEndpoint!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.schemaGcsBucket!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.serviceDirectory!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.state!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterRuntimeConfig--; |
| } |
| |
| core.List<api.Field> buildUnnamed39() => [ |
| buildField(), |
| buildField(), |
| ]; |
| |
| void checkUnnamed39(core.List<api.Field> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkField(o[0]); |
| checkField(o[1]); |
| } |
| |
| core.int buildCounterRuntimeEntitySchema = 0; |
| api.RuntimeEntitySchema buildRuntimeEntitySchema() { |
| final o = api.RuntimeEntitySchema(); |
| buildCounterRuntimeEntitySchema++; |
| if (buildCounterRuntimeEntitySchema < 3) { |
| o.entity = 'foo'; |
| o.fields = buildUnnamed39(); |
| } |
| buildCounterRuntimeEntitySchema--; |
| return o; |
| } |
| |
| void checkRuntimeEntitySchema(api.RuntimeEntitySchema o) { |
| buildCounterRuntimeEntitySchema++; |
| if (buildCounterRuntimeEntitySchema < 3) { |
| unittest.expect( |
| o.entity!, |
| unittest.equals('foo'), |
| ); |
| checkUnnamed39(o.fields!); |
| } |
| buildCounterRuntimeEntitySchema--; |
| } |
| |
| core.int buildCounterSecret = 0; |
| api.Secret buildSecret() { |
| final o = api.Secret(); |
| buildCounterSecret++; |
| if (buildCounterSecret < 3) { |
| o.secretVersion = 'foo'; |
| } |
| buildCounterSecret--; |
| return o; |
| } |
| |
| void checkSecret(api.Secret o) { |
| buildCounterSecret++; |
| if (buildCounterSecret < 3) { |
| unittest.expect( |
| o.secretVersion!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterSecret--; |
| } |
| |
| core.int buildCounterSetIamPolicyRequest = 0; |
| api.SetIamPolicyRequest buildSetIamPolicyRequest() { |
| final o = api.SetIamPolicyRequest(); |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| o.policy = buildPolicy(); |
| o.updateMask = 'foo'; |
| } |
| buildCounterSetIamPolicyRequest--; |
| return o; |
| } |
| |
| void checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| checkPolicy(o.policy!); |
| unittest.expect( |
| o.updateMask!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterSetIamPolicyRequest--; |
| } |
| |
| core.int buildCounterSource = 0; |
| api.Source buildSource() { |
| final o = api.Source(); |
| buildCounterSource++; |
| if (buildCounterSource < 3) { |
| o.fieldId = 'foo'; |
| o.sourceType = 'foo'; |
| } |
| buildCounterSource--; |
| return o; |
| } |
| |
| void checkSource(api.Source o) { |
| buildCounterSource++; |
| if (buildCounterSource < 3) { |
| unittest.expect( |
| o.fieldId!, |
| unittest.equals('foo'), |
| ); |
| unittest.expect( |
| o.sourceType!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterSource--; |
| } |
| |
| core.Map<core.String, core.Object?> buildUnnamed40() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }, |
| }; |
| |
| void checkUnnamed40(core.Map<core.String, core.Object?> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted11 = (o['x']!) as core.Map; |
| unittest.expect(casted11, unittest.hasLength(3)); |
| unittest.expect( |
| casted11['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted11['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted11['string'], |
| unittest.equals('foo'), |
| ); |
| var casted12 = (o['y']!) as core.Map; |
| unittest.expect(casted12, unittest.hasLength(3)); |
| unittest.expect( |
| casted12['list'], |
| unittest.equals([1, 2, 3]), |
| ); |
| unittest.expect( |
| casted12['bool'], |
| unittest.equals(true), |
| ); |
| unittest.expect( |
| casted12['string'], |
| unittest.equals('foo'), |
| ); |
| } |
| |
| core.List<core.Map<core.String, core.Object?>> buildUnnamed41() => [ |
| buildUnnamed40(), |
| buildUnnamed40(), |
| ]; |
| |
| void checkUnnamed41(core.List<core.Map<core.String, core.Object?>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed40(o[0]); |
| checkUnnamed40(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| api.Status buildStatus() { |
| final o = api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed41(); |
| o.message = 'foo'; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| void checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect( |
| o.code!, |
| unittest.equals(42), |
| ); |
| checkUnnamed41(o.details!); |
| unittest.expect( |
| o.message!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.int buildCounterSupportedRuntimeFeatures = 0; |
| api.SupportedRuntimeFeatures buildSupportedRuntimeFeatures() { |
| final o = api.SupportedRuntimeFeatures(); |
| buildCounterSupportedRuntimeFeatures++; |
| if (buildCounterSupportedRuntimeFeatures < 3) { |
| o.actionApis = true; |
| o.entityApis = true; |
| o.sqlQuery = true; |
| } |
| buildCounterSupportedRuntimeFeatures--; |
| return o; |
| } |
| |
| void checkSupportedRuntimeFeatures(api.SupportedRuntimeFeatures o) { |
| buildCounterSupportedRuntimeFeatures++; |
| if (buildCounterSupportedRuntimeFeatures < 3) { |
| unittest.expect(o.actionApis!, unittest.isTrue); |
| unittest.expect(o.entityApis!, unittest.isTrue); |
| unittest.expect(o.sqlQuery!, unittest.isTrue); |
| } |
| buildCounterSupportedRuntimeFeatures--; |
| } |
| |
| core.List<core.String> buildUnnamed42() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed42(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 = buildUnnamed42(); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| checkUnnamed42(o.permissions!); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed43() => [ |
| 'foo', |
| 'foo', |
| ]; |
| |
| void checkUnnamed43(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 = buildUnnamed43(); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| checkUnnamed43(o.permissions!); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| } |
| |
| core.int buildCounterUserPassword = 0; |
| api.UserPassword buildUserPassword() { |
| final o = api.UserPassword(); |
| buildCounterUserPassword++; |
| if (buildCounterUserPassword < 3) { |
| o.password = buildSecret(); |
| o.username = 'foo'; |
| } |
| buildCounterUserPassword--; |
| return o; |
| } |
| |
| void checkUserPassword(api.UserPassword o) { |
| buildCounterUserPassword++; |
| if (buildCounterUserPassword < 3) { |
| checkSecret(o.password!); |
| unittest.expect( |
| o.username!, |
| unittest.equals('foo'), |
| ); |
| } |
| buildCounterUserPassword--; |
| } |
| |
| void main() { |
| unittest.group('obj-schema-AuditConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAuditConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AuditConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuditConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuditLogConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAuditLogConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AuditLogConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuditLogConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuthConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAuthConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.AuthConfig.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkAuthConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuthConfigTemplate', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAuthConfigTemplate(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AuthConfigTemplate.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkAuthConfigTemplate(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-CancelOperationRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildCancelOperationRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.CancelOperationRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkCancelOperationRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ConfigVariable', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildConfigVariable(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ConfigVariable.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkConfigVariable(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ConfigVariableTemplate', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildConfigVariableTemplate(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ConfigVariableTemplate.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkConfigVariableTemplate(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Connection', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildConnection(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Connection.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkConnection(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ConnectionSchemaMetadata', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildConnectionSchemaMetadata(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ConnectionSchemaMetadata.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkConnectionSchemaMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ConnectionStatus', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildConnectionStatus(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ConnectionStatus.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkConnectionStatus(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Connector', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildConnector(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Connector.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkConnector(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ConnectorVersion', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildConnectorVersion(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ConnectorVersion.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkConnectorVersion(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-EgressControlConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildEgressControlConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.EgressControlConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkEgressControlConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Empty', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildEmpty(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Empty.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkEmpty(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-ExtractionRule', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildExtractionRule(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ExtractionRule.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkExtractionRule(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ExtractionRules', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildExtractionRules(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ExtractionRules.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkExtractionRules(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Field', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildField(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Field.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkField(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-InputParameter', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildInputParameter(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.InputParameter.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkInputParameter(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-JwtClaims', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildJwtClaims(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.JwtClaims.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkJwtClaims(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListConnectionsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListConnectionsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListConnectionsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListConnectionsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListConnectorVersionsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListConnectorVersionsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListConnectorVersionsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListConnectorVersionsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListConnectorsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListConnectorsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListConnectorsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListConnectorsResponse(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-ListProvidersResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListProvidersResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListProvidersResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListProvidersResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListRuntimeActionSchemasResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListRuntimeActionSchemasResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListRuntimeActionSchemasResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListRuntimeActionSchemasResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListRuntimeEntitySchemasResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListRuntimeEntitySchemasResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListRuntimeEntitySchemasResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkListRuntimeEntitySchemasResponse(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-LockConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildLockConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.LockConfig.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkLockConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Oauth2ClientCredentials', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOauth2ClientCredentials(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Oauth2ClientCredentials.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkOauth2ClientCredentials(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Oauth2JwtBearer', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOauth2JwtBearer(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Oauth2JwtBearer.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkOauth2JwtBearer(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-Provider', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildProvider(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Provider.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkProvider(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Resource', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildResource(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Resource.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkResource(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ResultMetadata', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildResultMetadata(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ResultMetadata.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkResultMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RoleGrant', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildRoleGrant(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.RoleGrant.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkRoleGrant(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RuntimeActionSchema', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildRuntimeActionSchema(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.RuntimeActionSchema.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkRuntimeActionSchema(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RuntimeConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildRuntimeConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.RuntimeConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkRuntimeConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RuntimeEntitySchema', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildRuntimeEntitySchema(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.RuntimeEntitySchema.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkRuntimeEntitySchema(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Secret', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSecret(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Secret.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkSecret(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SetIamPolicyRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSetIamPolicyRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.SetIamPolicyRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSetIamPolicyRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Source', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSource(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = |
| api.Source.fromJson(oJson as core.Map<core.String, core.dynamic>); |
| checkSource(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-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-SupportedRuntimeFeatures', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSupportedRuntimeFeatures(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.SupportedRuntimeFeatures.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkSupportedRuntimeFeatures(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-UserPassword', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildUserPassword(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.UserPassword.fromJson( |
| oJson as core.Map<core.String, core.dynamic>); |
| checkUserPassword(od); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsResource', () { |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations; |
| 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('v1/'), |
| ); |
| 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(buildLocation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkLocation(response as api.Location); |
| }); |
| |
| unittest.test('method--getRuntimeConfig', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations; |
| 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('v1/'), |
| ); |
| 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(buildRuntimeConfig()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = |
| await res.getRuntimeConfig(arg_name, $fields: arg_$fields); |
| checkRuntimeConfig(response as api.RuntimeConfig); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations; |
| final arg_name = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| 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['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListLocationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListLocationsResponse(response as api.ListLocationsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsConnectionsResource', () { |
| unittest.test('method--create', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.connections; |
| final arg_request = buildConnection(); |
| final arg_parent = 'foo'; |
| final arg_connectionId = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.Connection.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkConnection(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('v1/'), |
| ); |
| 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['connectionId']!.first, |
| unittest.equals(arg_connectionId), |
| ); |
| 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, |
| connectionId: arg_connectionId, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--delete', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.connections; |
| 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('v1/'), |
| ); |
| 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--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.connections; |
| final arg_name = 'foo'; |
| final arg_view = '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('v1/'), |
| ); |
| 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['view']!.first, |
| unittest.equals(arg_view), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildConnection()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = |
| await res.get(arg_name, view: arg_view, $fields: arg_$fields); |
| checkConnection(response as api.Connection); |
| }); |
| |
| unittest.test('method--getConnectionSchemaMetadata', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.connections; |
| 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('v1/'), |
| ); |
| 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(buildConnectionSchemaMetadata()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = |
| await res.getConnectionSchemaMetadata(arg_name, $fields: arg_$fields); |
| checkConnectionSchemaMetadata(response as api.ConnectionSchemaMetadata); |
| }); |
| |
| unittest.test('method--getIamPolicy', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.connections; |
| 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('v1/'), |
| ); |
| 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.ConnectorsApi(mock).projects.locations.connections; |
| final arg_parent = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_orderBy = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_view = '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('v1/'), |
| ); |
| 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['view']!.first, |
| unittest.equals(arg_view), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListConnectionsResponse()); |
| 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, |
| view: arg_view, |
| $fields: arg_$fields); |
| checkListConnectionsResponse(response as api.ListConnectionsResponse); |
| }); |
| |
| unittest.test('method--patch', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.connections; |
| final arg_request = buildConnection(); |
| final arg_name = 'foo'; |
| final arg_updateMask = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.Connection.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkConnection(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('v1/'), |
| ); |
| 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--setIamPolicy', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.connections; |
| 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('v1/'), |
| ); |
| 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--testIamPermissions', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.connections; |
| 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('v1/'), |
| ); |
| 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-ProjectsLocationsConnectionsRuntimeActionSchemasResource', () { |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock) |
| .projects |
| .locations |
| .connections |
| .runtimeActionSchemas; |
| final arg_parent = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| 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['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = |
| convert.json.encode(buildListRuntimeActionSchemasResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_parent, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListRuntimeActionSchemasResponse( |
| response as api.ListRuntimeActionSchemasResponse); |
| }); |
| }); |
| |
| unittest.group( |
| 'resource-ProjectsLocationsConnectionsRuntimeEntitySchemasResource', () { |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock) |
| .projects |
| .locations |
| .connections |
| .runtimeEntitySchemas; |
| final arg_parent = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| 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['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = |
| convert.json.encode(buildListRuntimeEntitySchemasResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_parent, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListRuntimeEntitySchemasResponse( |
| response as api.ListRuntimeEntitySchemasResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsGlobalProvidersResource', () { |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.global.providers; |
| 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('v1/'), |
| ); |
| 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(buildProvider()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkProvider(response as api.Provider); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.global.providers; |
| final arg_parent = '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('v1/'), |
| ); |
| 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['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(buildListProvidersResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_parent, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListProvidersResponse(response as api.ListProvidersResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsGlobalProvidersConnectorsResource', |
| () { |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock) |
| .projects |
| .locations |
| .global |
| .providers |
| .connectors; |
| 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('v1/'), |
| ); |
| 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(buildConnector()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkConnector(response as api.Connector); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock) |
| .projects |
| .locations |
| .global |
| .providers |
| .connectors; |
| final arg_parent = '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('v1/'), |
| ); |
| 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['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(buildListConnectorsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_parent, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListConnectorsResponse(response as api.ListConnectorsResponse); |
| }); |
| }); |
| |
| unittest.group( |
| 'resource-ProjectsLocationsGlobalProvidersConnectorsVersionsResource', |
| () { |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock) |
| .projects |
| .locations |
| .global |
| .providers |
| .connectors |
| .versions; |
| final arg_name = 'foo'; |
| final arg_view = '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('v1/'), |
| ); |
| 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['view']!.first, |
| unittest.equals(arg_view), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildConnectorVersion()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = |
| await res.get(arg_name, view: arg_view, $fields: arg_$fields); |
| checkConnectorVersion(response as api.ConnectorVersion); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock) |
| .projects |
| .locations |
| .global |
| .providers |
| .connectors |
| .versions; |
| final arg_parent = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_view = '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('v1/'), |
| ); |
| 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['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['view']!.first, |
| unittest.equals(arg_view), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListConnectorVersionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_parent, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| view: arg_view, |
| $fields: arg_$fields); |
| checkListConnectorVersionsResponse( |
| response as api.ListConnectorVersionsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsOperationsResource', () { |
| unittest.test('method--cancel', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.operations; |
| final arg_request = buildCancelOperationRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.CancelOperationRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkCancelOperationRequest(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('v1/'), |
| ); |
| 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(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = |
| await res.cancel(arg_request, arg_name, $fields: arg_$fields); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--delete', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(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('v1/'), |
| ); |
| 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(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.delete(arg_name, $fields: arg_$fields); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(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('v1/'), |
| ); |
| 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.ConnectorsApi(mock).projects.locations.operations; |
| final arg_name = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| 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['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| final resp = convert.json.encode(buildListOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| final response = await res.list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields); |
| checkListOperationsResponse(response as api.ListOperationsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsProvidersResource', () { |
| unittest.test('method--getIamPolicy', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.providers; |
| 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('v1/'), |
| ); |
| 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--setIamPolicy', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.providers; |
| 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('v1/'), |
| ); |
| 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--testIamPermissions', () async { |
| final mock = HttpServerMock(); |
| final res = api.ConnectorsApi(mock).projects.locations.providers; |
| 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('v1/'), |
| ); |
| 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); |
| }); |
| }); |
| } |