| // ignore_for_file: camel_case_types |
| // ignore_for_file: comment_references |
| // ignore_for_file: directives_ordering |
| // 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_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: avoid_returning_null |
| // ignore_for_file: cascade_invocations |
| // ignore_for_file: prefer_single_quotes |
| // ignore_for_file: unused_local_variable |
| |
| library googleapis.securitycenter.v1.test; |
| |
| import "dart:core" as core; |
| import "dart:async" as async; |
| import "dart:convert" as convert; |
| |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import 'package:googleapis/securitycenter/v1.dart' as api; |
| |
| class HttpServerMock extends http.BaseClient { |
| core.Future<http.StreamedResponse> Function(http.BaseRequest, core.Object) |
| _callback; |
| core.bool _expectJson; |
| |
| void register( |
| core.Future<http.StreamedResponse> Function( |
| http.BaseRequest bob, |
| core.Object foo, |
| ) |
| callback, |
| core.bool expectJson, |
| ) { |
| _callback = callback; |
| _expectJson = expectJson; |
| } |
| |
| @core.override |
| async.Future<http.StreamedResponse> send(http.BaseRequest request) async { |
| if (_expectJson) { |
| final jsonString = |
| await request.finalize().transform(convert.utf8.decoder).join(''); |
| if (jsonString.isEmpty) { |
| return _callback(request, null); |
| } else { |
| return _callback(request, convert.json.decode(jsonString)); |
| } |
| } else { |
| var stream = request.finalize(); |
| if (stream == null) { |
| return _callback(request, []); |
| } else { |
| final data = await stream.toBytes(); |
| return _callback(request, data); |
| } |
| } |
| } |
| } |
| |
| http.StreamedResponse stringResponse(core.int status, |
| core.Map<core.String, core.String> headers, core.String body) { |
| var stream = async.Stream.fromIterable([convert.utf8.encode(body)]); |
| return http.StreamedResponse(stream, status, headers: headers); |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1489() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1489(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 buildCounterAsset = 0; |
| api.Asset buildAsset() { |
| var o = api.Asset(); |
| buildCounterAsset++; |
| if (buildCounterAsset < 3) { |
| o.createTime = 'foo'; |
| o.iamPolicy = buildIamPolicy(); |
| o.name = 'foo'; |
| o.resourceProperties = buildUnnamed1489(); |
| o.securityCenterProperties = buildSecurityCenterProperties(); |
| o.securityMarks = buildSecurityMarks(); |
| o.updateTime = 'foo'; |
| } |
| buildCounterAsset--; |
| return o; |
| } |
| |
| void checkAsset(api.Asset o) { |
| buildCounterAsset++; |
| if (buildCounterAsset < 3) { |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| checkIamPolicy(o.iamPolicy); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed1489(o.resourceProperties); |
| checkSecurityCenterProperties(o.securityCenterProperties); |
| checkSecurityMarks(o.securityMarks); |
| unittest.expect(o.updateTime, unittest.equals('foo')); |
| } |
| buildCounterAsset--; |
| } |
| |
| core.List<core.String> buildUnnamed1490() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1490(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 buildCounterAssetDiscoveryConfig = 0; |
| api.AssetDiscoveryConfig buildAssetDiscoveryConfig() { |
| var o = api.AssetDiscoveryConfig(); |
| buildCounterAssetDiscoveryConfig++; |
| if (buildCounterAssetDiscoveryConfig < 3) { |
| o.inclusionMode = 'foo'; |
| o.projectIds = buildUnnamed1490(); |
| } |
| buildCounterAssetDiscoveryConfig--; |
| return o; |
| } |
| |
| void checkAssetDiscoveryConfig(api.AssetDiscoveryConfig o) { |
| buildCounterAssetDiscoveryConfig++; |
| if (buildCounterAssetDiscoveryConfig < 3) { |
| unittest.expect(o.inclusionMode, unittest.equals('foo')); |
| checkUnnamed1490(o.projectIds); |
| } |
| buildCounterAssetDiscoveryConfig--; |
| } |
| |
| core.List<api.AuditLogConfig> buildUnnamed1491() { |
| var o = <api.AuditLogConfig>[]; |
| o.add(buildAuditLogConfig()); |
| o.add(buildAuditLogConfig()); |
| return o; |
| } |
| |
| void checkUnnamed1491(core.List<api.AuditLogConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuditLogConfig(o[0]); |
| checkAuditLogConfig(o[1]); |
| } |
| |
| core.int buildCounterAuditConfig = 0; |
| api.AuditConfig buildAuditConfig() { |
| var o = api.AuditConfig(); |
| buildCounterAuditConfig++; |
| if (buildCounterAuditConfig < 3) { |
| o.auditLogConfigs = buildUnnamed1491(); |
| o.service = 'foo'; |
| } |
| buildCounterAuditConfig--; |
| return o; |
| } |
| |
| void checkAuditConfig(api.AuditConfig o) { |
| buildCounterAuditConfig++; |
| if (buildCounterAuditConfig < 3) { |
| checkUnnamed1491(o.auditLogConfigs); |
| unittest.expect(o.service, unittest.equals('foo')); |
| } |
| buildCounterAuditConfig--; |
| } |
| |
| core.List<core.String> buildUnnamed1492() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1492(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() { |
| var o = api.AuditLogConfig(); |
| buildCounterAuditLogConfig++; |
| if (buildCounterAuditLogConfig < 3) { |
| o.exemptedMembers = buildUnnamed1492(); |
| o.logType = 'foo'; |
| } |
| buildCounterAuditLogConfig--; |
| return o; |
| } |
| |
| void checkAuditLogConfig(api.AuditLogConfig o) { |
| buildCounterAuditLogConfig++; |
| if (buildCounterAuditLogConfig < 3) { |
| checkUnnamed1492(o.exemptedMembers); |
| unittest.expect(o.logType, unittest.equals('foo')); |
| } |
| buildCounterAuditLogConfig--; |
| } |
| |
| core.List<core.String> buildUnnamed1493() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1493(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() { |
| var o = api.Binding(); |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| o.condition = buildExpr(); |
| o.members = buildUnnamed1493(); |
| o.role = 'foo'; |
| } |
| buildCounterBinding--; |
| return o; |
| } |
| |
| void checkBinding(api.Binding o) { |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| checkExpr(o.condition); |
| checkUnnamed1493(o.members); |
| unittest.expect(o.role, unittest.equals('foo')); |
| } |
| buildCounterBinding--; |
| } |
| |
| core.int buildCounterEmpty = 0; |
| api.Empty buildEmpty() { |
| var 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() { |
| var o = api.Expr(); |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| o.description = 'foo'; |
| o.expression = 'foo'; |
| o.location = 'foo'; |
| o.title = 'foo'; |
| } |
| buildCounterExpr--; |
| return o; |
| } |
| |
| void checkExpr(api.Expr o) { |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| unittest.expect(o.description, unittest.equals('foo')); |
| unittest.expect(o.expression, unittest.equals('foo')); |
| unittest.expect(o.location, unittest.equals('foo')); |
| unittest.expect(o.title, unittest.equals('foo')); |
| } |
| buildCounterExpr--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1494() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1494(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted3 = (o['x']) as core.Map; |
| unittest.expect(casted3, unittest.hasLength(3)); |
| unittest.expect(casted3['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted3['bool'], unittest.equals(true)); |
| unittest.expect(casted3['string'], unittest.equals('foo')); |
| var casted4 = (o['y']) as core.Map; |
| unittest.expect(casted4, unittest.hasLength(3)); |
| unittest.expect(casted4['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted4['bool'], unittest.equals(true)); |
| unittest.expect(casted4['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterFinding = 0; |
| api.Finding buildFinding() { |
| var o = api.Finding(); |
| buildCounterFinding++; |
| if (buildCounterFinding < 3) { |
| o.category = 'foo'; |
| o.createTime = 'foo'; |
| o.eventTime = 'foo'; |
| o.externalUri = 'foo'; |
| o.name = 'foo'; |
| o.parent = 'foo'; |
| o.resourceName = 'foo'; |
| o.securityMarks = buildSecurityMarks(); |
| o.sourceProperties = buildUnnamed1494(); |
| o.state = 'foo'; |
| } |
| buildCounterFinding--; |
| return o; |
| } |
| |
| void checkFinding(api.Finding o) { |
| buildCounterFinding++; |
| if (buildCounterFinding < 3) { |
| unittest.expect(o.category, unittest.equals('foo')); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.eventTime, unittest.equals('foo')); |
| unittest.expect(o.externalUri, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.parent, unittest.equals('foo')); |
| unittest.expect(o.resourceName, unittest.equals('foo')); |
| checkSecurityMarks(o.securityMarks); |
| checkUnnamed1494(o.sourceProperties); |
| unittest.expect(o.state, unittest.equals('foo')); |
| } |
| buildCounterFinding--; |
| } |
| |
| core.int buildCounterGetIamPolicyRequest = 0; |
| api.GetIamPolicyRequest buildGetIamPolicyRequest() { |
| var o = api.GetIamPolicyRequest(); |
| buildCounterGetIamPolicyRequest++; |
| if (buildCounterGetIamPolicyRequest < 3) { |
| o.options = buildGetPolicyOptions(); |
| } |
| buildCounterGetIamPolicyRequest--; |
| return o; |
| } |
| |
| void checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { |
| buildCounterGetIamPolicyRequest++; |
| if (buildCounterGetIamPolicyRequest < 3) { |
| checkGetPolicyOptions(o.options); |
| } |
| buildCounterGetIamPolicyRequest--; |
| } |
| |
| core.int buildCounterGetPolicyOptions = 0; |
| api.GetPolicyOptions buildGetPolicyOptions() { |
| var o = api.GetPolicyOptions(); |
| buildCounterGetPolicyOptions++; |
| if (buildCounterGetPolicyOptions < 3) { |
| o.requestedPolicyVersion = 42; |
| } |
| buildCounterGetPolicyOptions--; |
| return o; |
| } |
| |
| void checkGetPolicyOptions(api.GetPolicyOptions o) { |
| buildCounterGetPolicyOptions++; |
| if (buildCounterGetPolicyOptions < 3) { |
| unittest.expect(o.requestedPolicyVersion, unittest.equals(42)); |
| } |
| buildCounterGetPolicyOptions--; |
| } |
| |
| core.int buildCounterGoogleCloudSecuritycenterV1NotificationMessage = 0; |
| api.GoogleCloudSecuritycenterV1NotificationMessage |
| buildGoogleCloudSecuritycenterV1NotificationMessage() { |
| var o = api.GoogleCloudSecuritycenterV1NotificationMessage(); |
| buildCounterGoogleCloudSecuritycenterV1NotificationMessage++; |
| if (buildCounterGoogleCloudSecuritycenterV1NotificationMessage < 3) { |
| o.finding = buildFinding(); |
| o.notificationConfigName = 'foo'; |
| o.resource = buildGoogleCloudSecuritycenterV1Resource(); |
| } |
| buildCounterGoogleCloudSecuritycenterV1NotificationMessage--; |
| return o; |
| } |
| |
| void checkGoogleCloudSecuritycenterV1NotificationMessage( |
| api.GoogleCloudSecuritycenterV1NotificationMessage o) { |
| buildCounterGoogleCloudSecuritycenterV1NotificationMessage++; |
| if (buildCounterGoogleCloudSecuritycenterV1NotificationMessage < 3) { |
| checkFinding(o.finding); |
| unittest.expect(o.notificationConfigName, unittest.equals('foo')); |
| checkGoogleCloudSecuritycenterV1Resource(o.resource); |
| } |
| buildCounterGoogleCloudSecuritycenterV1NotificationMessage--; |
| } |
| |
| core.int buildCounterGoogleCloudSecuritycenterV1Resource = 0; |
| api.GoogleCloudSecuritycenterV1Resource |
| buildGoogleCloudSecuritycenterV1Resource() { |
| var o = api.GoogleCloudSecuritycenterV1Resource(); |
| buildCounterGoogleCloudSecuritycenterV1Resource++; |
| if (buildCounterGoogleCloudSecuritycenterV1Resource < 3) { |
| o.name = 'foo'; |
| o.parent = 'foo'; |
| o.parentDisplayName = 'foo'; |
| o.project = 'foo'; |
| o.projectDisplayName = 'foo'; |
| } |
| buildCounterGoogleCloudSecuritycenterV1Resource--; |
| return o; |
| } |
| |
| void checkGoogleCloudSecuritycenterV1Resource( |
| api.GoogleCloudSecuritycenterV1Resource o) { |
| buildCounterGoogleCloudSecuritycenterV1Resource++; |
| if (buildCounterGoogleCloudSecuritycenterV1Resource < 3) { |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.parent, unittest.equals('foo')); |
| unittest.expect(o.parentDisplayName, unittest.equals('foo')); |
| unittest.expect(o.project, unittest.equals('foo')); |
| unittest.expect(o.projectDisplayName, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSecuritycenterV1Resource--; |
| } |
| |
| core.int buildCounterGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse = 0; |
| api.GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse |
| buildGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse() { |
| var o = api.GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse(); |
| buildCounterGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse++; |
| if (buildCounterGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse < 3) { |
| o.duration = 'foo'; |
| o.state = 'foo'; |
| } |
| buildCounterGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse--; |
| return o; |
| } |
| |
| void checkGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse( |
| api.GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse o) { |
| buildCounterGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse++; |
| if (buildCounterGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse < 3) { |
| unittest.expect(o.duration, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse--; |
| } |
| |
| core.int buildCounterGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse = |
| 0; |
| api.GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse |
| buildGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse() { |
| var o = api.GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse(); |
| buildCounterGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse++; |
| if (buildCounterGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse < |
| 3) { |
| o.duration = 'foo'; |
| o.state = 'foo'; |
| } |
| buildCounterGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse--; |
| return o; |
| } |
| |
| void checkGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse( |
| api.GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse o) { |
| buildCounterGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse++; |
| if (buildCounterGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse < |
| 3) { |
| unittest.expect(o.duration, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1495() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1495(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 buildCounterGoogleCloudSecuritycenterV1p1beta1Finding = 0; |
| api.GoogleCloudSecuritycenterV1p1beta1Finding |
| buildGoogleCloudSecuritycenterV1p1beta1Finding() { |
| var o = api.GoogleCloudSecuritycenterV1p1beta1Finding(); |
| buildCounterGoogleCloudSecuritycenterV1p1beta1Finding++; |
| if (buildCounterGoogleCloudSecuritycenterV1p1beta1Finding < 3) { |
| o.category = 'foo'; |
| o.createTime = 'foo'; |
| o.eventTime = 'foo'; |
| o.externalUri = 'foo'; |
| o.name = 'foo'; |
| o.parent = 'foo'; |
| o.resourceName = 'foo'; |
| o.securityMarks = buildGoogleCloudSecuritycenterV1p1beta1SecurityMarks(); |
| o.severity = 'foo'; |
| o.sourceProperties = buildUnnamed1495(); |
| o.state = 'foo'; |
| } |
| buildCounterGoogleCloudSecuritycenterV1p1beta1Finding--; |
| return o; |
| } |
| |
| void checkGoogleCloudSecuritycenterV1p1beta1Finding( |
| api.GoogleCloudSecuritycenterV1p1beta1Finding o) { |
| buildCounterGoogleCloudSecuritycenterV1p1beta1Finding++; |
| if (buildCounterGoogleCloudSecuritycenterV1p1beta1Finding < 3) { |
| unittest.expect(o.category, unittest.equals('foo')); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.eventTime, unittest.equals('foo')); |
| unittest.expect(o.externalUri, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.parent, unittest.equals('foo')); |
| unittest.expect(o.resourceName, unittest.equals('foo')); |
| checkGoogleCloudSecuritycenterV1p1beta1SecurityMarks(o.securityMarks); |
| unittest.expect(o.severity, unittest.equals('foo')); |
| checkUnnamed1495(o.sourceProperties); |
| unittest.expect(o.state, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSecuritycenterV1p1beta1Finding--; |
| } |
| |
| core.int buildCounterGoogleCloudSecuritycenterV1p1beta1NotificationMessage = 0; |
| api.GoogleCloudSecuritycenterV1p1beta1NotificationMessage |
| buildGoogleCloudSecuritycenterV1p1beta1NotificationMessage() { |
| var o = api.GoogleCloudSecuritycenterV1p1beta1NotificationMessage(); |
| buildCounterGoogleCloudSecuritycenterV1p1beta1NotificationMessage++; |
| if (buildCounterGoogleCloudSecuritycenterV1p1beta1NotificationMessage < 3) { |
| o.finding = buildGoogleCloudSecuritycenterV1p1beta1Finding(); |
| o.notificationConfigName = 'foo'; |
| o.resource = buildGoogleCloudSecuritycenterV1p1beta1Resource(); |
| } |
| buildCounterGoogleCloudSecuritycenterV1p1beta1NotificationMessage--; |
| return o; |
| } |
| |
| void checkGoogleCloudSecuritycenterV1p1beta1NotificationMessage( |
| api.GoogleCloudSecuritycenterV1p1beta1NotificationMessage o) { |
| buildCounterGoogleCloudSecuritycenterV1p1beta1NotificationMessage++; |
| if (buildCounterGoogleCloudSecuritycenterV1p1beta1NotificationMessage < 3) { |
| checkGoogleCloudSecuritycenterV1p1beta1Finding(o.finding); |
| unittest.expect(o.notificationConfigName, unittest.equals('foo')); |
| checkGoogleCloudSecuritycenterV1p1beta1Resource(o.resource); |
| } |
| buildCounterGoogleCloudSecuritycenterV1p1beta1NotificationMessage--; |
| } |
| |
| core.int buildCounterGoogleCloudSecuritycenterV1p1beta1Resource = 0; |
| api.GoogleCloudSecuritycenterV1p1beta1Resource |
| buildGoogleCloudSecuritycenterV1p1beta1Resource() { |
| var o = api.GoogleCloudSecuritycenterV1p1beta1Resource(); |
| buildCounterGoogleCloudSecuritycenterV1p1beta1Resource++; |
| if (buildCounterGoogleCloudSecuritycenterV1p1beta1Resource < 3) { |
| o.name = 'foo'; |
| o.parent = 'foo'; |
| o.parentDisplayName = 'foo'; |
| o.project = 'foo'; |
| o.projectDisplayName = 'foo'; |
| } |
| buildCounterGoogleCloudSecuritycenterV1p1beta1Resource--; |
| return o; |
| } |
| |
| void checkGoogleCloudSecuritycenterV1p1beta1Resource( |
| api.GoogleCloudSecuritycenterV1p1beta1Resource o) { |
| buildCounterGoogleCloudSecuritycenterV1p1beta1Resource++; |
| if (buildCounterGoogleCloudSecuritycenterV1p1beta1Resource < 3) { |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.parent, unittest.equals('foo')); |
| unittest.expect(o.parentDisplayName, unittest.equals('foo')); |
| unittest.expect(o.project, unittest.equals('foo')); |
| unittest.expect(o.projectDisplayName, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSecuritycenterV1p1beta1Resource--; |
| } |
| |
| core.int |
| buildCounterGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse = 0; |
| api.GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse |
| buildGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse() { |
| var o = api.GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse(); |
| buildCounterGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse++; |
| if (buildCounterGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse < |
| 3) { |
| o.duration = 'foo'; |
| o.state = 'foo'; |
| } |
| buildCounterGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse--; |
| return o; |
| } |
| |
| void checkGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse( |
| api.GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse o) { |
| buildCounterGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse++; |
| if (buildCounterGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse < |
| 3) { |
| unittest.expect(o.duration, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed1496() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed1496(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 buildCounterGoogleCloudSecuritycenterV1p1beta1SecurityMarks = 0; |
| api.GoogleCloudSecuritycenterV1p1beta1SecurityMarks |
| buildGoogleCloudSecuritycenterV1p1beta1SecurityMarks() { |
| var o = api.GoogleCloudSecuritycenterV1p1beta1SecurityMarks(); |
| buildCounterGoogleCloudSecuritycenterV1p1beta1SecurityMarks++; |
| if (buildCounterGoogleCloudSecuritycenterV1p1beta1SecurityMarks < 3) { |
| o.marks = buildUnnamed1496(); |
| o.name = 'foo'; |
| } |
| buildCounterGoogleCloudSecuritycenterV1p1beta1SecurityMarks--; |
| return o; |
| } |
| |
| void checkGoogleCloudSecuritycenterV1p1beta1SecurityMarks( |
| api.GoogleCloudSecuritycenterV1p1beta1SecurityMarks o) { |
| buildCounterGoogleCloudSecuritycenterV1p1beta1SecurityMarks++; |
| if (buildCounterGoogleCloudSecuritycenterV1p1beta1SecurityMarks < 3) { |
| checkUnnamed1496(o.marks); |
| unittest.expect(o.name, unittest.equals('foo')); |
| } |
| buildCounterGoogleCloudSecuritycenterV1p1beta1SecurityMarks--; |
| } |
| |
| core.int buildCounterGroupAssetsRequest = 0; |
| api.GroupAssetsRequest buildGroupAssetsRequest() { |
| var o = api.GroupAssetsRequest(); |
| buildCounterGroupAssetsRequest++; |
| if (buildCounterGroupAssetsRequest < 3) { |
| o.compareDuration = 'foo'; |
| o.filter = 'foo'; |
| o.groupBy = 'foo'; |
| o.pageSize = 42; |
| o.pageToken = 'foo'; |
| o.readTime = 'foo'; |
| } |
| buildCounterGroupAssetsRequest--; |
| return o; |
| } |
| |
| void checkGroupAssetsRequest(api.GroupAssetsRequest o) { |
| buildCounterGroupAssetsRequest++; |
| if (buildCounterGroupAssetsRequest < 3) { |
| unittest.expect(o.compareDuration, unittest.equals('foo')); |
| unittest.expect(o.filter, unittest.equals('foo')); |
| unittest.expect(o.groupBy, unittest.equals('foo')); |
| unittest.expect(o.pageSize, unittest.equals(42)); |
| unittest.expect(o.pageToken, unittest.equals('foo')); |
| unittest.expect(o.readTime, unittest.equals('foo')); |
| } |
| buildCounterGroupAssetsRequest--; |
| } |
| |
| core.List<api.GroupResult> buildUnnamed1497() { |
| var o = <api.GroupResult>[]; |
| o.add(buildGroupResult()); |
| o.add(buildGroupResult()); |
| return o; |
| } |
| |
| void checkUnnamed1497(core.List<api.GroupResult> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGroupResult(o[0]); |
| checkGroupResult(o[1]); |
| } |
| |
| core.int buildCounterGroupAssetsResponse = 0; |
| api.GroupAssetsResponse buildGroupAssetsResponse() { |
| var o = api.GroupAssetsResponse(); |
| buildCounterGroupAssetsResponse++; |
| if (buildCounterGroupAssetsResponse < 3) { |
| o.groupByResults = buildUnnamed1497(); |
| o.nextPageToken = 'foo'; |
| o.readTime = 'foo'; |
| o.totalSize = 42; |
| } |
| buildCounterGroupAssetsResponse--; |
| return o; |
| } |
| |
| void checkGroupAssetsResponse(api.GroupAssetsResponse o) { |
| buildCounterGroupAssetsResponse++; |
| if (buildCounterGroupAssetsResponse < 3) { |
| checkUnnamed1497(o.groupByResults); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| unittest.expect(o.readTime, unittest.equals('foo')); |
| unittest.expect(o.totalSize, unittest.equals(42)); |
| } |
| buildCounterGroupAssetsResponse--; |
| } |
| |
| core.int buildCounterGroupFindingsRequest = 0; |
| api.GroupFindingsRequest buildGroupFindingsRequest() { |
| var o = api.GroupFindingsRequest(); |
| buildCounterGroupFindingsRequest++; |
| if (buildCounterGroupFindingsRequest < 3) { |
| o.compareDuration = 'foo'; |
| o.filter = 'foo'; |
| o.groupBy = 'foo'; |
| o.pageSize = 42; |
| o.pageToken = 'foo'; |
| o.readTime = 'foo'; |
| } |
| buildCounterGroupFindingsRequest--; |
| return o; |
| } |
| |
| void checkGroupFindingsRequest(api.GroupFindingsRequest o) { |
| buildCounterGroupFindingsRequest++; |
| if (buildCounterGroupFindingsRequest < 3) { |
| unittest.expect(o.compareDuration, unittest.equals('foo')); |
| unittest.expect(o.filter, unittest.equals('foo')); |
| unittest.expect(o.groupBy, unittest.equals('foo')); |
| unittest.expect(o.pageSize, unittest.equals(42)); |
| unittest.expect(o.pageToken, unittest.equals('foo')); |
| unittest.expect(o.readTime, unittest.equals('foo')); |
| } |
| buildCounterGroupFindingsRequest--; |
| } |
| |
| core.List<api.GroupResult> buildUnnamed1498() { |
| var o = <api.GroupResult>[]; |
| o.add(buildGroupResult()); |
| o.add(buildGroupResult()); |
| return o; |
| } |
| |
| void checkUnnamed1498(core.List<api.GroupResult> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGroupResult(o[0]); |
| checkGroupResult(o[1]); |
| } |
| |
| core.int buildCounterGroupFindingsResponse = 0; |
| api.GroupFindingsResponse buildGroupFindingsResponse() { |
| var o = api.GroupFindingsResponse(); |
| buildCounterGroupFindingsResponse++; |
| if (buildCounterGroupFindingsResponse < 3) { |
| o.groupByResults = buildUnnamed1498(); |
| o.nextPageToken = 'foo'; |
| o.readTime = 'foo'; |
| o.totalSize = 42; |
| } |
| buildCounterGroupFindingsResponse--; |
| return o; |
| } |
| |
| void checkGroupFindingsResponse(api.GroupFindingsResponse o) { |
| buildCounterGroupFindingsResponse++; |
| if (buildCounterGroupFindingsResponse < 3) { |
| checkUnnamed1498(o.groupByResults); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| unittest.expect(o.readTime, unittest.equals('foo')); |
| unittest.expect(o.totalSize, unittest.equals(42)); |
| } |
| buildCounterGroupFindingsResponse--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1499() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1499(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.int buildCounterGroupResult = 0; |
| api.GroupResult buildGroupResult() { |
| var o = api.GroupResult(); |
| buildCounterGroupResult++; |
| if (buildCounterGroupResult < 3) { |
| o.count = 'foo'; |
| o.properties = buildUnnamed1499(); |
| } |
| buildCounterGroupResult--; |
| return o; |
| } |
| |
| void checkGroupResult(api.GroupResult o) { |
| buildCounterGroupResult++; |
| if (buildCounterGroupResult < 3) { |
| unittest.expect(o.count, unittest.equals('foo')); |
| checkUnnamed1499(o.properties); |
| } |
| buildCounterGroupResult--; |
| } |
| |
| core.int buildCounterIamPolicy = 0; |
| api.IamPolicy buildIamPolicy() { |
| var o = api.IamPolicy(); |
| buildCounterIamPolicy++; |
| if (buildCounterIamPolicy < 3) { |
| o.policyBlob = 'foo'; |
| } |
| buildCounterIamPolicy--; |
| return o; |
| } |
| |
| void checkIamPolicy(api.IamPolicy o) { |
| buildCounterIamPolicy++; |
| if (buildCounterIamPolicy < 3) { |
| unittest.expect(o.policyBlob, unittest.equals('foo')); |
| } |
| buildCounterIamPolicy--; |
| } |
| |
| core.List<api.ListAssetsResult> buildUnnamed1500() { |
| var o = <api.ListAssetsResult>[]; |
| o.add(buildListAssetsResult()); |
| o.add(buildListAssetsResult()); |
| return o; |
| } |
| |
| void checkUnnamed1500(core.List<api.ListAssetsResult> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkListAssetsResult(o[0]); |
| checkListAssetsResult(o[1]); |
| } |
| |
| core.int buildCounterListAssetsResponse = 0; |
| api.ListAssetsResponse buildListAssetsResponse() { |
| var o = api.ListAssetsResponse(); |
| buildCounterListAssetsResponse++; |
| if (buildCounterListAssetsResponse < 3) { |
| o.listAssetsResults = buildUnnamed1500(); |
| o.nextPageToken = 'foo'; |
| o.readTime = 'foo'; |
| o.totalSize = 42; |
| } |
| buildCounterListAssetsResponse--; |
| return o; |
| } |
| |
| void checkListAssetsResponse(api.ListAssetsResponse o) { |
| buildCounterListAssetsResponse++; |
| if (buildCounterListAssetsResponse < 3) { |
| checkUnnamed1500(o.listAssetsResults); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| unittest.expect(o.readTime, unittest.equals('foo')); |
| unittest.expect(o.totalSize, unittest.equals(42)); |
| } |
| buildCounterListAssetsResponse--; |
| } |
| |
| core.int buildCounterListAssetsResult = 0; |
| api.ListAssetsResult buildListAssetsResult() { |
| var o = api.ListAssetsResult(); |
| buildCounterListAssetsResult++; |
| if (buildCounterListAssetsResult < 3) { |
| o.asset = buildAsset(); |
| o.stateChange = 'foo'; |
| } |
| buildCounterListAssetsResult--; |
| return o; |
| } |
| |
| void checkListAssetsResult(api.ListAssetsResult o) { |
| buildCounterListAssetsResult++; |
| if (buildCounterListAssetsResult < 3) { |
| checkAsset(o.asset); |
| unittest.expect(o.stateChange, unittest.equals('foo')); |
| } |
| buildCounterListAssetsResult--; |
| } |
| |
| core.List<api.ListFindingsResult> buildUnnamed1501() { |
| var o = <api.ListFindingsResult>[]; |
| o.add(buildListFindingsResult()); |
| o.add(buildListFindingsResult()); |
| return o; |
| } |
| |
| void checkUnnamed1501(core.List<api.ListFindingsResult> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkListFindingsResult(o[0]); |
| checkListFindingsResult(o[1]); |
| } |
| |
| core.int buildCounterListFindingsResponse = 0; |
| api.ListFindingsResponse buildListFindingsResponse() { |
| var o = api.ListFindingsResponse(); |
| buildCounterListFindingsResponse++; |
| if (buildCounterListFindingsResponse < 3) { |
| o.listFindingsResults = buildUnnamed1501(); |
| o.nextPageToken = 'foo'; |
| o.readTime = 'foo'; |
| o.totalSize = 42; |
| } |
| buildCounterListFindingsResponse--; |
| return o; |
| } |
| |
| void checkListFindingsResponse(api.ListFindingsResponse o) { |
| buildCounterListFindingsResponse++; |
| if (buildCounterListFindingsResponse < 3) { |
| checkUnnamed1501(o.listFindingsResults); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| unittest.expect(o.readTime, unittest.equals('foo')); |
| unittest.expect(o.totalSize, unittest.equals(42)); |
| } |
| buildCounterListFindingsResponse--; |
| } |
| |
| core.int buildCounterListFindingsResult = 0; |
| api.ListFindingsResult buildListFindingsResult() { |
| var o = api.ListFindingsResult(); |
| buildCounterListFindingsResult++; |
| if (buildCounterListFindingsResult < 3) { |
| o.finding = buildFinding(); |
| o.resource = buildResource(); |
| o.stateChange = 'foo'; |
| } |
| buildCounterListFindingsResult--; |
| return o; |
| } |
| |
| void checkListFindingsResult(api.ListFindingsResult o) { |
| buildCounterListFindingsResult++; |
| if (buildCounterListFindingsResult < 3) { |
| checkFinding(o.finding); |
| checkResource(o.resource); |
| unittest.expect(o.stateChange, unittest.equals('foo')); |
| } |
| buildCounterListFindingsResult--; |
| } |
| |
| core.List<api.NotificationConfig> buildUnnamed1502() { |
| var o = <api.NotificationConfig>[]; |
| o.add(buildNotificationConfig()); |
| o.add(buildNotificationConfig()); |
| return o; |
| } |
| |
| void checkUnnamed1502(core.List<api.NotificationConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkNotificationConfig(o[0]); |
| checkNotificationConfig(o[1]); |
| } |
| |
| core.int buildCounterListNotificationConfigsResponse = 0; |
| api.ListNotificationConfigsResponse buildListNotificationConfigsResponse() { |
| var o = api.ListNotificationConfigsResponse(); |
| buildCounterListNotificationConfigsResponse++; |
| if (buildCounterListNotificationConfigsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.notificationConfigs = buildUnnamed1502(); |
| } |
| buildCounterListNotificationConfigsResponse--; |
| return o; |
| } |
| |
| void checkListNotificationConfigsResponse( |
| api.ListNotificationConfigsResponse o) { |
| buildCounterListNotificationConfigsResponse++; |
| if (buildCounterListNotificationConfigsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed1502(o.notificationConfigs); |
| } |
| buildCounterListNotificationConfigsResponse--; |
| } |
| |
| core.List<api.Operation> buildUnnamed1503() { |
| var o = <api.Operation>[]; |
| o.add(buildOperation()); |
| o.add(buildOperation()); |
| return o; |
| } |
| |
| void checkUnnamed1503(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.int buildCounterListOperationsResponse = 0; |
| api.ListOperationsResponse buildListOperationsResponse() { |
| var o = api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed1503(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| void checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed1503(o.operations); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| core.List<api.Source> buildUnnamed1504() { |
| var o = <api.Source>[]; |
| o.add(buildSource()); |
| o.add(buildSource()); |
| return o; |
| } |
| |
| void checkUnnamed1504(core.List<api.Source> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSource(o[0]); |
| checkSource(o[1]); |
| } |
| |
| core.int buildCounterListSourcesResponse = 0; |
| api.ListSourcesResponse buildListSourcesResponse() { |
| var o = api.ListSourcesResponse(); |
| buildCounterListSourcesResponse++; |
| if (buildCounterListSourcesResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.sources = buildUnnamed1504(); |
| } |
| buildCounterListSourcesResponse--; |
| return o; |
| } |
| |
| void checkListSourcesResponse(api.ListSourcesResponse o) { |
| buildCounterListSourcesResponse++; |
| if (buildCounterListSourcesResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed1504(o.sources); |
| } |
| buildCounterListSourcesResponse--; |
| } |
| |
| core.int buildCounterNotificationConfig = 0; |
| api.NotificationConfig buildNotificationConfig() { |
| var o = api.NotificationConfig(); |
| buildCounterNotificationConfig++; |
| if (buildCounterNotificationConfig < 3) { |
| o.description = 'foo'; |
| o.name = 'foo'; |
| o.pubsubTopic = 'foo'; |
| o.serviceAccount = 'foo'; |
| o.streamingConfig = buildStreamingConfig(); |
| } |
| buildCounterNotificationConfig--; |
| return o; |
| } |
| |
| void checkNotificationConfig(api.NotificationConfig o) { |
| buildCounterNotificationConfig++; |
| if (buildCounterNotificationConfig < 3) { |
| unittest.expect(o.description, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.pubsubTopic, unittest.equals('foo')); |
| unittest.expect(o.serviceAccount, unittest.equals('foo')); |
| checkStreamingConfig(o.streamingConfig); |
| } |
| buildCounterNotificationConfig--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1505() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1505(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.Map<core.String, core.Object> buildUnnamed1506() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1506(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.int buildCounterOperation = 0; |
| api.Operation buildOperation() { |
| var o = api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed1505(); |
| o.name = 'foo'; |
| o.response = buildUnnamed1506(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| void checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done, unittest.isTrue); |
| checkStatus(o.error); |
| checkUnnamed1505(o.metadata); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed1506(o.response); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.int buildCounterOrganizationSettings = 0; |
| api.OrganizationSettings buildOrganizationSettings() { |
| var o = api.OrganizationSettings(); |
| buildCounterOrganizationSettings++; |
| if (buildCounterOrganizationSettings < 3) { |
| o.assetDiscoveryConfig = buildAssetDiscoveryConfig(); |
| o.enableAssetDiscovery = true; |
| o.name = 'foo'; |
| } |
| buildCounterOrganizationSettings--; |
| return o; |
| } |
| |
| void checkOrganizationSettings(api.OrganizationSettings o) { |
| buildCounterOrganizationSettings++; |
| if (buildCounterOrganizationSettings < 3) { |
| checkAssetDiscoveryConfig(o.assetDiscoveryConfig); |
| unittest.expect(o.enableAssetDiscovery, unittest.isTrue); |
| unittest.expect(o.name, unittest.equals('foo')); |
| } |
| buildCounterOrganizationSettings--; |
| } |
| |
| core.List<api.AuditConfig> buildUnnamed1507() { |
| var o = <api.AuditConfig>[]; |
| o.add(buildAuditConfig()); |
| o.add(buildAuditConfig()); |
| return o; |
| } |
| |
| void checkUnnamed1507(core.List<api.AuditConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAuditConfig(o[0]); |
| checkAuditConfig(o[1]); |
| } |
| |
| core.List<api.Binding> buildUnnamed1508() { |
| var o = <api.Binding>[]; |
| o.add(buildBinding()); |
| o.add(buildBinding()); |
| return o; |
| } |
| |
| void checkUnnamed1508(core.List<api.Binding> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBinding(o[0]); |
| checkBinding(o[1]); |
| } |
| |
| core.int buildCounterPolicy = 0; |
| api.Policy buildPolicy() { |
| var o = api.Policy(); |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| o.auditConfigs = buildUnnamed1507(); |
| o.bindings = buildUnnamed1508(); |
| o.etag = 'foo'; |
| o.version = 42; |
| } |
| buildCounterPolicy--; |
| return o; |
| } |
| |
| void checkPolicy(api.Policy o) { |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| checkUnnamed1507(o.auditConfigs); |
| checkUnnamed1508(o.bindings); |
| unittest.expect(o.etag, unittest.equals('foo')); |
| unittest.expect(o.version, unittest.equals(42)); |
| } |
| buildCounterPolicy--; |
| } |
| |
| core.int buildCounterResource = 0; |
| api.Resource buildResource() { |
| var o = api.Resource(); |
| buildCounterResource++; |
| if (buildCounterResource < 3) { |
| o.name = 'foo'; |
| o.parentDisplayName = 'foo'; |
| o.parentName = 'foo'; |
| o.projectDisplayName = 'foo'; |
| o.projectName = 'foo'; |
| } |
| buildCounterResource--; |
| return o; |
| } |
| |
| void checkResource(api.Resource o) { |
| buildCounterResource++; |
| if (buildCounterResource < 3) { |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.parentDisplayName, unittest.equals('foo')); |
| unittest.expect(o.parentName, unittest.equals('foo')); |
| unittest.expect(o.projectDisplayName, unittest.equals('foo')); |
| unittest.expect(o.projectName, unittest.equals('foo')); |
| } |
| buildCounterResource--; |
| } |
| |
| core.int buildCounterRunAssetDiscoveryRequest = 0; |
| api.RunAssetDiscoveryRequest buildRunAssetDiscoveryRequest() { |
| var o = api.RunAssetDiscoveryRequest(); |
| buildCounterRunAssetDiscoveryRequest++; |
| if (buildCounterRunAssetDiscoveryRequest < 3) {} |
| buildCounterRunAssetDiscoveryRequest--; |
| return o; |
| } |
| |
| void checkRunAssetDiscoveryRequest(api.RunAssetDiscoveryRequest o) { |
| buildCounterRunAssetDiscoveryRequest++; |
| if (buildCounterRunAssetDiscoveryRequest < 3) {} |
| buildCounterRunAssetDiscoveryRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed1509() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1509(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 buildCounterSecurityCenterProperties = 0; |
| api.SecurityCenterProperties buildSecurityCenterProperties() { |
| var o = api.SecurityCenterProperties(); |
| buildCounterSecurityCenterProperties++; |
| if (buildCounterSecurityCenterProperties < 3) { |
| o.resourceDisplayName = 'foo'; |
| o.resourceName = 'foo'; |
| o.resourceOwners = buildUnnamed1509(); |
| o.resourceParent = 'foo'; |
| o.resourceParentDisplayName = 'foo'; |
| o.resourceProject = 'foo'; |
| o.resourceProjectDisplayName = 'foo'; |
| o.resourceType = 'foo'; |
| } |
| buildCounterSecurityCenterProperties--; |
| return o; |
| } |
| |
| void checkSecurityCenterProperties(api.SecurityCenterProperties o) { |
| buildCounterSecurityCenterProperties++; |
| if (buildCounterSecurityCenterProperties < 3) { |
| unittest.expect(o.resourceDisplayName, unittest.equals('foo')); |
| unittest.expect(o.resourceName, unittest.equals('foo')); |
| checkUnnamed1509(o.resourceOwners); |
| unittest.expect(o.resourceParent, unittest.equals('foo')); |
| unittest.expect(o.resourceParentDisplayName, unittest.equals('foo')); |
| unittest.expect(o.resourceProject, unittest.equals('foo')); |
| unittest.expect(o.resourceProjectDisplayName, unittest.equals('foo')); |
| unittest.expect(o.resourceType, unittest.equals('foo')); |
| } |
| buildCounterSecurityCenterProperties--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed1510() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed1510(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 buildCounterSecurityMarks = 0; |
| api.SecurityMarks buildSecurityMarks() { |
| var o = api.SecurityMarks(); |
| buildCounterSecurityMarks++; |
| if (buildCounterSecurityMarks < 3) { |
| o.marks = buildUnnamed1510(); |
| o.name = 'foo'; |
| } |
| buildCounterSecurityMarks--; |
| return o; |
| } |
| |
| void checkSecurityMarks(api.SecurityMarks o) { |
| buildCounterSecurityMarks++; |
| if (buildCounterSecurityMarks < 3) { |
| checkUnnamed1510(o.marks); |
| unittest.expect(o.name, unittest.equals('foo')); |
| } |
| buildCounterSecurityMarks--; |
| } |
| |
| core.int buildCounterSetFindingStateRequest = 0; |
| api.SetFindingStateRequest buildSetFindingStateRequest() { |
| var o = api.SetFindingStateRequest(); |
| buildCounterSetFindingStateRequest++; |
| if (buildCounterSetFindingStateRequest < 3) { |
| o.startTime = 'foo'; |
| o.state = 'foo'; |
| } |
| buildCounterSetFindingStateRequest--; |
| return o; |
| } |
| |
| void checkSetFindingStateRequest(api.SetFindingStateRequest o) { |
| buildCounterSetFindingStateRequest++; |
| if (buildCounterSetFindingStateRequest < 3) { |
| unittest.expect(o.startTime, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| } |
| buildCounterSetFindingStateRequest--; |
| } |
| |
| core.int buildCounterSetIamPolicyRequest = 0; |
| api.SetIamPolicyRequest buildSetIamPolicyRequest() { |
| var 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() { |
| var o = api.Source(); |
| buildCounterSource++; |
| if (buildCounterSource < 3) { |
| o.description = 'foo'; |
| o.displayName = 'foo'; |
| o.name = 'foo'; |
| } |
| buildCounterSource--; |
| return o; |
| } |
| |
| void checkSource(api.Source o) { |
| buildCounterSource++; |
| if (buildCounterSource < 3) { |
| unittest.expect(o.description, unittest.equals('foo')); |
| unittest.expect(o.displayName, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| } |
| buildCounterSource--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1511() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1511(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted13 = (o['x']) as core.Map; |
| unittest.expect(casted13, unittest.hasLength(3)); |
| unittest.expect(casted13['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted13['bool'], unittest.equals(true)); |
| unittest.expect(casted13['string'], unittest.equals('foo')); |
| var casted14 = (o['y']) as core.Map; |
| unittest.expect(casted14, unittest.hasLength(3)); |
| unittest.expect(casted14['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted14['bool'], unittest.equals(true)); |
| unittest.expect(casted14['string'], unittest.equals('foo')); |
| } |
| |
| core.List<core.Map<core.String, core.Object>> buildUnnamed1512() { |
| var o = <core.Map<core.String, core.Object>>[]; |
| o.add(buildUnnamed1511()); |
| o.add(buildUnnamed1511()); |
| return o; |
| } |
| |
| void checkUnnamed1512(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed1511(o[0]); |
| checkUnnamed1511(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| api.Status buildStatus() { |
| var o = api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed1512(); |
| o.message = 'foo'; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| void checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect(o.code, unittest.equals(42)); |
| checkUnnamed1512(o.details); |
| unittest.expect(o.message, unittest.equals('foo')); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.int buildCounterStreamingConfig = 0; |
| api.StreamingConfig buildStreamingConfig() { |
| var o = api.StreamingConfig(); |
| buildCounterStreamingConfig++; |
| if (buildCounterStreamingConfig < 3) { |
| o.filter = 'foo'; |
| } |
| buildCounterStreamingConfig--; |
| return o; |
| } |
| |
| void checkStreamingConfig(api.StreamingConfig o) { |
| buildCounterStreamingConfig++; |
| if (buildCounterStreamingConfig < 3) { |
| unittest.expect(o.filter, unittest.equals('foo')); |
| } |
| buildCounterStreamingConfig--; |
| } |
| |
| core.List<core.String> buildUnnamed1513() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1513(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() { |
| var o = api.TestIamPermissionsRequest(); |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| o.permissions = buildUnnamed1513(); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| checkUnnamed1513(o.permissions); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed1514() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1514(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() { |
| var o = api.TestIamPermissionsResponse(); |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| o.permissions = buildUnnamed1514(); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| checkUnnamed1514(o.permissions); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| } |
| |
| void main() { |
| unittest.group('obj-schema-Asset', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildAsset(); |
| var od = api.Asset.fromJson(o.toJson()); |
| checkAsset(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AssetDiscoveryConfig', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildAssetDiscoveryConfig(); |
| var od = api.AssetDiscoveryConfig.fromJson(o.toJson()); |
| checkAssetDiscoveryConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuditConfig', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildAuditConfig(); |
| var od = api.AuditConfig.fromJson(o.toJson()); |
| checkAuditConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AuditLogConfig', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildAuditLogConfig(); |
| var od = api.AuditLogConfig.fromJson(o.toJson()); |
| checkAuditLogConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Binding', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildBinding(); |
| var od = api.Binding.fromJson(o.toJson()); |
| checkBinding(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Empty', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildEmpty(); |
| var od = api.Empty.fromJson(o.toJson()); |
| checkEmpty(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Expr', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildExpr(); |
| var od = api.Expr.fromJson(o.toJson()); |
| checkExpr(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Finding', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildFinding(); |
| var od = api.Finding.fromJson(o.toJson()); |
| checkFinding(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GetIamPolicyRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGetIamPolicyRequest(); |
| var od = api.GetIamPolicyRequest.fromJson(o.toJson()); |
| checkGetIamPolicyRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GetPolicyOptions', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGetPolicyOptions(); |
| var od = api.GetPolicyOptions.fromJson(o.toJson()); |
| checkGetPolicyOptions(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudSecuritycenterV1NotificationMessage', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudSecuritycenterV1NotificationMessage(); |
| var od = api.GoogleCloudSecuritycenterV1NotificationMessage.fromJson( |
| o.toJson()); |
| checkGoogleCloudSecuritycenterV1NotificationMessage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudSecuritycenterV1Resource', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudSecuritycenterV1Resource(); |
| var od = api.GoogleCloudSecuritycenterV1Resource.fromJson(o.toJson()); |
| checkGoogleCloudSecuritycenterV1Resource(od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse(); |
| var od = |
| api.GoogleCloudSecuritycenterV1RunAssetDiscoveryResponse.fromJson( |
| o.toJson()); |
| checkGoogleCloudSecuritycenterV1RunAssetDiscoveryResponse(od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse(); |
| var od = api.GoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse |
| .fromJson(o.toJson()); |
| checkGoogleCloudSecuritycenterV1beta1RunAssetDiscoveryResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudSecuritycenterV1p1beta1Finding', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudSecuritycenterV1p1beta1Finding(); |
| var od = |
| api.GoogleCloudSecuritycenterV1p1beta1Finding.fromJson(o.toJson()); |
| checkGoogleCloudSecuritycenterV1p1beta1Finding(od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSecuritycenterV1p1beta1NotificationMessage', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudSecuritycenterV1p1beta1NotificationMessage(); |
| var od = |
| api.GoogleCloudSecuritycenterV1p1beta1NotificationMessage.fromJson( |
| o.toJson()); |
| checkGoogleCloudSecuritycenterV1p1beta1NotificationMessage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudSecuritycenterV1p1beta1Resource', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudSecuritycenterV1p1beta1Resource(); |
| var od = |
| api.GoogleCloudSecuritycenterV1p1beta1Resource.fromJson(o.toJson()); |
| checkGoogleCloudSecuritycenterV1p1beta1Resource(od); |
| }); |
| }); |
| |
| unittest.group( |
| 'obj-schema-GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = |
| buildGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse(); |
| var od = api.GoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse |
| .fromJson(o.toJson()); |
| checkGoogleCloudSecuritycenterV1p1beta1RunAssetDiscoveryResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GoogleCloudSecuritycenterV1p1beta1SecurityMarks', |
| () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGoogleCloudSecuritycenterV1p1beta1SecurityMarks(); |
| var od = api.GoogleCloudSecuritycenterV1p1beta1SecurityMarks.fromJson( |
| o.toJson()); |
| checkGoogleCloudSecuritycenterV1p1beta1SecurityMarks(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GroupAssetsRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGroupAssetsRequest(); |
| var od = api.GroupAssetsRequest.fromJson(o.toJson()); |
| checkGroupAssetsRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GroupAssetsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGroupAssetsResponse(); |
| var od = api.GroupAssetsResponse.fromJson(o.toJson()); |
| checkGroupAssetsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GroupFindingsRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGroupFindingsRequest(); |
| var od = api.GroupFindingsRequest.fromJson(o.toJson()); |
| checkGroupFindingsRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GroupFindingsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGroupFindingsResponse(); |
| var od = api.GroupFindingsResponse.fromJson(o.toJson()); |
| checkGroupFindingsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GroupResult', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGroupResult(); |
| var od = api.GroupResult.fromJson(o.toJson()); |
| checkGroupResult(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-IamPolicy', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildIamPolicy(); |
| var od = api.IamPolicy.fromJson(o.toJson()); |
| checkIamPolicy(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListAssetsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListAssetsResponse(); |
| var od = api.ListAssetsResponse.fromJson(o.toJson()); |
| checkListAssetsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListAssetsResult', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListAssetsResult(); |
| var od = api.ListAssetsResult.fromJson(o.toJson()); |
| checkListAssetsResult(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListFindingsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListFindingsResponse(); |
| var od = api.ListFindingsResponse.fromJson(o.toJson()); |
| checkListFindingsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListFindingsResult', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListFindingsResult(); |
| var od = api.ListFindingsResult.fromJson(o.toJson()); |
| checkListFindingsResult(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListNotificationConfigsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListNotificationConfigsResponse(); |
| var od = api.ListNotificationConfigsResponse.fromJson(o.toJson()); |
| checkListNotificationConfigsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListOperationsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListOperationsResponse(); |
| var od = api.ListOperationsResponse.fromJson(o.toJson()); |
| checkListOperationsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListSourcesResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListSourcesResponse(); |
| var od = api.ListSourcesResponse.fromJson(o.toJson()); |
| checkListSourcesResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-NotificationConfig', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildNotificationConfig(); |
| var od = api.NotificationConfig.fromJson(o.toJson()); |
| checkNotificationConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Operation', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildOperation(); |
| var od = api.Operation.fromJson(o.toJson()); |
| checkOperation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OrganizationSettings', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildOrganizationSettings(); |
| var od = api.OrganizationSettings.fromJson(o.toJson()); |
| checkOrganizationSettings(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Policy', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPolicy(); |
| var od = api.Policy.fromJson(o.toJson()); |
| checkPolicy(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Resource', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildResource(); |
| var od = api.Resource.fromJson(o.toJson()); |
| checkResource(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RunAssetDiscoveryRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildRunAssetDiscoveryRequest(); |
| var od = api.RunAssetDiscoveryRequest.fromJson(o.toJson()); |
| checkRunAssetDiscoveryRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SecurityCenterProperties', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSecurityCenterProperties(); |
| var od = api.SecurityCenterProperties.fromJson(o.toJson()); |
| checkSecurityCenterProperties(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SecurityMarks', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSecurityMarks(); |
| var od = api.SecurityMarks.fromJson(o.toJson()); |
| checkSecurityMarks(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SetFindingStateRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSetFindingStateRequest(); |
| var od = api.SetFindingStateRequest.fromJson(o.toJson()); |
| checkSetFindingStateRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SetIamPolicyRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSetIamPolicyRequest(); |
| var od = api.SetIamPolicyRequest.fromJson(o.toJson()); |
| checkSetIamPolicyRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Source', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSource(); |
| var od = api.Source.fromJson(o.toJson()); |
| checkSource(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Status', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildStatus(); |
| var od = api.Status.fromJson(o.toJson()); |
| checkStatus(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-StreamingConfig', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildStreamingConfig(); |
| var od = api.StreamingConfig.fromJson(o.toJson()); |
| checkStreamingConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTestIamPermissionsRequest(); |
| var od = api.TestIamPermissionsRequest.fromJson(o.toJson()); |
| checkTestIamPermissionsRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTestIamPermissionsResponse(); |
| var od = api.TestIamPermissionsResponse.fromJson(o.toJson()); |
| checkTestIamPermissionsResponse(od); |
| }); |
| }); |
| |
| unittest.group('resource-OrganizationsResourceApi', () { |
| unittest.test('method--getOrganizationSettings', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOrganizationSettings()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getOrganizationSettings(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOrganizationSettings(response); |
| }))); |
| }); |
| |
| unittest.test('method--updateOrganizationSettings', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations; |
| var arg_request = buildOrganizationSettings(); |
| var arg_name = 'foo'; |
| var arg_updateMask = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.OrganizationSettings.fromJson(json); |
| checkOrganizationSettings(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["updateMask"].first, unittest.equals(arg_updateMask)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOrganizationSettings()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .updateOrganizationSettings(arg_request, arg_name, |
| updateMask: arg_updateMask, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOrganizationSettings(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-OrganizationsAssetsResourceApi', () { |
| unittest.test('method--group', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.assets; |
| var arg_request = buildGroupAssetsRequest(); |
| var arg_parent = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.GroupAssetsRequest.fromJson(json); |
| checkGroupAssetsRequest(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildGroupAssetsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .group(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkGroupAssetsResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.assets; |
| var arg_parent = 'foo'; |
| var arg_compareDuration = 'foo'; |
| var arg_fieldMask = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_orderBy = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_readTime = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["compareDuration"].first, |
| unittest.equals(arg_compareDuration)); |
| unittest.expect( |
| queryMap["fieldMask"].first, unittest.equals(arg_fieldMask)); |
| 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["readTime"].first, unittest.equals(arg_readTime)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListAssetsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| compareDuration: arg_compareDuration, |
| fieldMask: arg_fieldMask, |
| filter: arg_filter, |
| orderBy: arg_orderBy, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| readTime: arg_readTime, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListAssetsResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--runDiscovery', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.assets; |
| var arg_request = buildRunAssetDiscoveryRequest(); |
| var arg_parent = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.RunAssetDiscoveryRequest.fromJson(json); |
| checkRunAssetDiscoveryRequest(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .runDiscovery(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test('method--updateSecurityMarks', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.assets; |
| var arg_request = buildSecurityMarks(); |
| var arg_name = 'foo'; |
| var arg_startTime = 'foo'; |
| var arg_updateMask = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.SecurityMarks.fromJson(json); |
| checkSecurityMarks(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["startTime"].first, unittest.equals(arg_startTime)); |
| unittest.expect( |
| queryMap["updateMask"].first, unittest.equals(arg_updateMask)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildSecurityMarks()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .updateSecurityMarks(arg_request, arg_name, |
| startTime: arg_startTime, |
| updateMask: arg_updateMask, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkSecurityMarks(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-OrganizationsNotificationConfigsResourceApi', () { |
| unittest.test('method--create', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.notificationConfigs; |
| var arg_request = buildNotificationConfig(); |
| var arg_parent = 'foo'; |
| var arg_configId = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.NotificationConfig.fromJson(json); |
| checkNotificationConfig(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["configId"].first, unittest.equals(arg_configId)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildNotificationConfig()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, |
| configId: arg_configId, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkNotificationConfig(response); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.notificationConfigs; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.notificationConfigs; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildNotificationConfig()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkNotificationConfig(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.notificationConfigs; |
| var arg_parent = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListNotificationConfigsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListNotificationConfigsResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--patch', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.notificationConfigs; |
| var arg_request = buildNotificationConfig(); |
| var arg_name = 'foo'; |
| var arg_updateMask = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.NotificationConfig.fromJson(json); |
| checkNotificationConfig(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["updateMask"].first, unittest.equals(arg_updateMask)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildNotificationConfig()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .patch(arg_request, arg_name, |
| updateMask: arg_updateMask, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkNotificationConfig(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-OrganizationsOperationsResourceApi', () { |
| unittest.test('method--cancel', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .cancel(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.operations; |
| var arg_name = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(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)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListOperationsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-OrganizationsSourcesResourceApi', () { |
| unittest.test('method--create', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources; |
| var arg_request = buildSource(); |
| var arg_parent = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.Source.fromJson(json); |
| checkSource(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildSource()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkSource(response); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildSource()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkSource(response); |
| }))); |
| }); |
| |
| unittest.test('method--getIamPolicy', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources; |
| var arg_parent = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListSourcesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListSourcesResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--patch', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources; |
| var arg_request = buildSource(); |
| var arg_name = 'foo'; |
| var arg_updateMask = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.Source.fromJson(json); |
| checkSource(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["updateMask"].first, unittest.equals(arg_updateMask)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildSource()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .patch(arg_request, arg_name, |
| updateMask: arg_updateMask, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkSource(response); |
| }))); |
| }); |
| |
| unittest.test('method--setIamPolicy', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test('method--testIamPermissions', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-OrganizationsSourcesFindingsResourceApi', () { |
| unittest.test('method--create', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources.findings; |
| var arg_request = buildFinding(); |
| var arg_parent = 'foo'; |
| var arg_findingId = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.Finding.fromJson(json); |
| checkFinding(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["findingId"].first, unittest.equals(arg_findingId)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildFinding()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, |
| findingId: arg_findingId, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkFinding(response); |
| }))); |
| }); |
| |
| unittest.test('method--group', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources.findings; |
| var arg_request = buildGroupFindingsRequest(); |
| var arg_parent = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.GroupFindingsRequest.fromJson(json); |
| checkGroupFindingsRequest(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildGroupFindingsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .group(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkGroupFindingsResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources.findings; |
| var arg_parent = 'foo'; |
| var arg_compareDuration = 'foo'; |
| var arg_fieldMask = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_orderBy = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_readTime = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["compareDuration"].first, |
| unittest.equals(arg_compareDuration)); |
| unittest.expect( |
| queryMap["fieldMask"].first, unittest.equals(arg_fieldMask)); |
| 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["readTime"].first, unittest.equals(arg_readTime)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListFindingsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| compareDuration: arg_compareDuration, |
| fieldMask: arg_fieldMask, |
| filter: arg_filter, |
| orderBy: arg_orderBy, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| readTime: arg_readTime, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListFindingsResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--patch', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources.findings; |
| var arg_request = buildFinding(); |
| var arg_name = 'foo'; |
| var arg_updateMask = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.Finding.fromJson(json); |
| checkFinding(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["updateMask"].first, unittest.equals(arg_updateMask)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildFinding()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .patch(arg_request, arg_name, |
| updateMask: arg_updateMask, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkFinding(response); |
| }))); |
| }); |
| |
| unittest.test('method--setState', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources.findings; |
| var arg_request = buildSetFindingStateRequest(); |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.SetFindingStateRequest.fromJson(json); |
| checkSetFindingStateRequest(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildFinding()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setState(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkFinding(response); |
| }))); |
| }); |
| |
| unittest.test('method--updateSecurityMarks', () { |
| var mock = HttpServerMock(); |
| var res = api.SecuritycenterApi(mock).organizations.sources.findings; |
| var arg_request = buildSecurityMarks(); |
| var arg_name = 'foo'; |
| var arg_startTime = 'foo'; |
| var arg_updateMask = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.SecurityMarks.fromJson(json); |
| checkSecurityMarks(obj); |
| |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var 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('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["startTime"].first, unittest.equals(arg_startTime)); |
| unittest.expect( |
| queryMap["updateMask"].first, unittest.equals(arg_updateMask)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildSecurityMarks()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .updateSecurityMarks(arg_request, arg_name, |
| startTime: arg_startTime, |
| updateMask: arg_updateMask, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkSecurityMarks(response); |
| }))); |
| }); |
| }); |
| } |