| // ignore_for_file: camel_case_types |
| // ignore_for_file: comment_references |
| // ignore_for_file: file_names |
| // ignore_for_file: library_names |
| // ignore_for_file: lines_longer_than_80_chars |
| // ignore_for_file: non_constant_identifier_names |
| // ignore_for_file: prefer_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 |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert; |
| import 'dart:core' as core; |
| |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| import 'package:googleapis_beta/pubsub/v1beta2.dart' as api; |
| |
| import '../test_shared.dart'; |
| |
| core.List<core.String> buildUnnamed6836() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6836(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 buildCounterAcknowledgeRequest = 0; |
| api.AcknowledgeRequest buildAcknowledgeRequest() { |
| var o = api.AcknowledgeRequest(); |
| buildCounterAcknowledgeRequest++; |
| if (buildCounterAcknowledgeRequest < 3) { |
| o.ackIds = buildUnnamed6836(); |
| } |
| buildCounterAcknowledgeRequest--; |
| return o; |
| } |
| |
| void checkAcknowledgeRequest(api.AcknowledgeRequest o) { |
| buildCounterAcknowledgeRequest++; |
| if (buildCounterAcknowledgeRequest < 3) { |
| checkUnnamed6836(o.ackIds); |
| } |
| buildCounterAcknowledgeRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed6837() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6837(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.bindingId = 'foo'; |
| o.condition = buildExpr(); |
| o.members = buildUnnamed6837(); |
| o.role = 'foo'; |
| } |
| buildCounterBinding--; |
| return o; |
| } |
| |
| void checkBinding(api.Binding o) { |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| unittest.expect(o.bindingId, unittest.equals('foo')); |
| checkExpr(o.condition as api.Expr); |
| checkUnnamed6837(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.List<api.Subscription> buildUnnamed6838() { |
| var o = <api.Subscription>[]; |
| o.add(buildSubscription()); |
| o.add(buildSubscription()); |
| return o; |
| } |
| |
| void checkUnnamed6838(core.List<api.Subscription> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSubscription(o[0] as api.Subscription); |
| checkSubscription(o[1] as api.Subscription); |
| } |
| |
| core.int buildCounterListSubscriptionsResponse = 0; |
| api.ListSubscriptionsResponse buildListSubscriptionsResponse() { |
| var o = api.ListSubscriptionsResponse(); |
| buildCounterListSubscriptionsResponse++; |
| if (buildCounterListSubscriptionsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.subscriptions = buildUnnamed6838(); |
| } |
| buildCounterListSubscriptionsResponse--; |
| return o; |
| } |
| |
| void checkListSubscriptionsResponse(api.ListSubscriptionsResponse o) { |
| buildCounterListSubscriptionsResponse++; |
| if (buildCounterListSubscriptionsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed6838(o.subscriptions); |
| } |
| buildCounterListSubscriptionsResponse--; |
| } |
| |
| core.List<core.String> buildUnnamed6839() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6839(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 buildCounterListTopicSubscriptionsResponse = 0; |
| api.ListTopicSubscriptionsResponse buildListTopicSubscriptionsResponse() { |
| var o = api.ListTopicSubscriptionsResponse(); |
| buildCounterListTopicSubscriptionsResponse++; |
| if (buildCounterListTopicSubscriptionsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.subscriptions = buildUnnamed6839(); |
| } |
| buildCounterListTopicSubscriptionsResponse--; |
| return o; |
| } |
| |
| void checkListTopicSubscriptionsResponse(api.ListTopicSubscriptionsResponse o) { |
| buildCounterListTopicSubscriptionsResponse++; |
| if (buildCounterListTopicSubscriptionsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed6839(o.subscriptions); |
| } |
| buildCounterListTopicSubscriptionsResponse--; |
| } |
| |
| core.List<api.Topic> buildUnnamed6840() { |
| var o = <api.Topic>[]; |
| o.add(buildTopic()); |
| o.add(buildTopic()); |
| return o; |
| } |
| |
| void checkUnnamed6840(core.List<api.Topic> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkTopic(o[0] as api.Topic); |
| checkTopic(o[1] as api.Topic); |
| } |
| |
| core.int buildCounterListTopicsResponse = 0; |
| api.ListTopicsResponse buildListTopicsResponse() { |
| var o = api.ListTopicsResponse(); |
| buildCounterListTopicsResponse++; |
| if (buildCounterListTopicsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.topics = buildUnnamed6840(); |
| } |
| buildCounterListTopicsResponse--; |
| return o; |
| } |
| |
| void checkListTopicsResponse(api.ListTopicsResponse o) { |
| buildCounterListTopicsResponse++; |
| if (buildCounterListTopicsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed6840(o.topics); |
| } |
| buildCounterListTopicsResponse--; |
| } |
| |
| core.List<core.String> buildUnnamed6841() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6841(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 buildCounterModifyAckDeadlineRequest = 0; |
| api.ModifyAckDeadlineRequest buildModifyAckDeadlineRequest() { |
| var o = api.ModifyAckDeadlineRequest(); |
| buildCounterModifyAckDeadlineRequest++; |
| if (buildCounterModifyAckDeadlineRequest < 3) { |
| o.ackDeadlineSeconds = 42; |
| o.ackId = 'foo'; |
| o.ackIds = buildUnnamed6841(); |
| } |
| buildCounterModifyAckDeadlineRequest--; |
| return o; |
| } |
| |
| void checkModifyAckDeadlineRequest(api.ModifyAckDeadlineRequest o) { |
| buildCounterModifyAckDeadlineRequest++; |
| if (buildCounterModifyAckDeadlineRequest < 3) { |
| unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); |
| unittest.expect(o.ackId, unittest.equals('foo')); |
| checkUnnamed6841(o.ackIds); |
| } |
| buildCounterModifyAckDeadlineRequest--; |
| } |
| |
| core.int buildCounterModifyPushConfigRequest = 0; |
| api.ModifyPushConfigRequest buildModifyPushConfigRequest() { |
| var o = api.ModifyPushConfigRequest(); |
| buildCounterModifyPushConfigRequest++; |
| if (buildCounterModifyPushConfigRequest < 3) { |
| o.pushConfig = buildPushConfig(); |
| } |
| buildCounterModifyPushConfigRequest--; |
| return o; |
| } |
| |
| void checkModifyPushConfigRequest(api.ModifyPushConfigRequest o) { |
| buildCounterModifyPushConfigRequest++; |
| if (buildCounterModifyPushConfigRequest < 3) { |
| checkPushConfig(o.pushConfig as api.PushConfig); |
| } |
| buildCounterModifyPushConfigRequest--; |
| } |
| |
| core.int buildCounterOidcToken = 0; |
| api.OidcToken buildOidcToken() { |
| var o = api.OidcToken(); |
| buildCounterOidcToken++; |
| if (buildCounterOidcToken < 3) { |
| o.audience = 'foo'; |
| o.serviceAccountEmail = 'foo'; |
| } |
| buildCounterOidcToken--; |
| return o; |
| } |
| |
| void checkOidcToken(api.OidcToken o) { |
| buildCounterOidcToken++; |
| if (buildCounterOidcToken < 3) { |
| unittest.expect(o.audience, unittest.equals('foo')); |
| unittest.expect(o.serviceAccountEmail, unittest.equals('foo')); |
| } |
| buildCounterOidcToken--; |
| } |
| |
| core.List<api.Binding> buildUnnamed6842() { |
| var o = <api.Binding>[]; |
| o.add(buildBinding()); |
| o.add(buildBinding()); |
| return o; |
| } |
| |
| void checkUnnamed6842(core.List<api.Binding> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBinding(o[0] as api.Binding); |
| checkBinding(o[1] as api.Binding); |
| } |
| |
| core.int buildCounterPolicy = 0; |
| api.Policy buildPolicy() { |
| var o = api.Policy(); |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| o.bindings = buildUnnamed6842(); |
| o.etag = 'foo'; |
| o.version = 42; |
| } |
| buildCounterPolicy--; |
| return o; |
| } |
| |
| void checkPolicy(api.Policy o) { |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| checkUnnamed6842(o.bindings); |
| unittest.expect(o.etag, unittest.equals('foo')); |
| unittest.expect(o.version, unittest.equals(42)); |
| } |
| buildCounterPolicy--; |
| } |
| |
| core.List<api.PubsubMessage> buildUnnamed6843() { |
| var o = <api.PubsubMessage>[]; |
| o.add(buildPubsubMessage()); |
| o.add(buildPubsubMessage()); |
| return o; |
| } |
| |
| void checkUnnamed6843(core.List<api.PubsubMessage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPubsubMessage(o[0] as api.PubsubMessage); |
| checkPubsubMessage(o[1] as api.PubsubMessage); |
| } |
| |
| core.int buildCounterPublishRequest = 0; |
| api.PublishRequest buildPublishRequest() { |
| var o = api.PublishRequest(); |
| buildCounterPublishRequest++; |
| if (buildCounterPublishRequest < 3) { |
| o.messages = buildUnnamed6843(); |
| } |
| buildCounterPublishRequest--; |
| return o; |
| } |
| |
| void checkPublishRequest(api.PublishRequest o) { |
| buildCounterPublishRequest++; |
| if (buildCounterPublishRequest < 3) { |
| checkUnnamed6843(o.messages); |
| } |
| buildCounterPublishRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed6844() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6844(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 buildCounterPublishResponse = 0; |
| api.PublishResponse buildPublishResponse() { |
| var o = api.PublishResponse(); |
| buildCounterPublishResponse++; |
| if (buildCounterPublishResponse < 3) { |
| o.messageIds = buildUnnamed6844(); |
| } |
| buildCounterPublishResponse--; |
| return o; |
| } |
| |
| void checkPublishResponse(api.PublishResponse o) { |
| buildCounterPublishResponse++; |
| if (buildCounterPublishResponse < 3) { |
| checkUnnamed6844(o.messageIds); |
| } |
| buildCounterPublishResponse--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed6845() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6845(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 buildCounterPubsubMessage = 0; |
| api.PubsubMessage buildPubsubMessage() { |
| var o = api.PubsubMessage(); |
| buildCounterPubsubMessage++; |
| if (buildCounterPubsubMessage < 3) { |
| o.attributes = buildUnnamed6845(); |
| o.data = 'foo'; |
| o.messageId = 'foo'; |
| o.publishTime = 'foo'; |
| } |
| buildCounterPubsubMessage--; |
| return o; |
| } |
| |
| void checkPubsubMessage(api.PubsubMessage o) { |
| buildCounterPubsubMessage++; |
| if (buildCounterPubsubMessage < 3) { |
| checkUnnamed6845(o.attributes); |
| unittest.expect(o.data, unittest.equals('foo')); |
| unittest.expect(o.messageId, unittest.equals('foo')); |
| unittest.expect(o.publishTime, unittest.equals('foo')); |
| } |
| buildCounterPubsubMessage--; |
| } |
| |
| core.int buildCounterPullRequest = 0; |
| api.PullRequest buildPullRequest() { |
| var o = api.PullRequest(); |
| buildCounterPullRequest++; |
| if (buildCounterPullRequest < 3) { |
| o.maxMessages = 42; |
| o.returnImmediately = true; |
| } |
| buildCounterPullRequest--; |
| return o; |
| } |
| |
| void checkPullRequest(api.PullRequest o) { |
| buildCounterPullRequest++; |
| if (buildCounterPullRequest < 3) { |
| unittest.expect(o.maxMessages, unittest.equals(42)); |
| unittest.expect(o.returnImmediately, unittest.isTrue); |
| } |
| buildCounterPullRequest--; |
| } |
| |
| core.List<api.ReceivedMessage> buildUnnamed6846() { |
| var o = <api.ReceivedMessage>[]; |
| o.add(buildReceivedMessage()); |
| o.add(buildReceivedMessage()); |
| return o; |
| } |
| |
| void checkUnnamed6846(core.List<api.ReceivedMessage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkReceivedMessage(o[0] as api.ReceivedMessage); |
| checkReceivedMessage(o[1] as api.ReceivedMessage); |
| } |
| |
| core.int buildCounterPullResponse = 0; |
| api.PullResponse buildPullResponse() { |
| var o = api.PullResponse(); |
| buildCounterPullResponse++; |
| if (buildCounterPullResponse < 3) { |
| o.receivedMessages = buildUnnamed6846(); |
| } |
| buildCounterPullResponse--; |
| return o; |
| } |
| |
| void checkPullResponse(api.PullResponse o) { |
| buildCounterPullResponse++; |
| if (buildCounterPullResponse < 3) { |
| checkUnnamed6846(o.receivedMessages); |
| } |
| buildCounterPullResponse--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed6847() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed6847(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 buildCounterPushConfig = 0; |
| api.PushConfig buildPushConfig() { |
| var o = api.PushConfig(); |
| buildCounterPushConfig++; |
| if (buildCounterPushConfig < 3) { |
| o.attributes = buildUnnamed6847(); |
| o.oidcToken = buildOidcToken(); |
| o.pushEndpoint = 'foo'; |
| } |
| buildCounterPushConfig--; |
| return o; |
| } |
| |
| void checkPushConfig(api.PushConfig o) { |
| buildCounterPushConfig++; |
| if (buildCounterPushConfig < 3) { |
| checkUnnamed6847(o.attributes); |
| checkOidcToken(o.oidcToken as api.OidcToken); |
| unittest.expect(o.pushEndpoint, unittest.equals('foo')); |
| } |
| buildCounterPushConfig--; |
| } |
| |
| core.int buildCounterReceivedMessage = 0; |
| api.ReceivedMessage buildReceivedMessage() { |
| var o = api.ReceivedMessage(); |
| buildCounterReceivedMessage++; |
| if (buildCounterReceivedMessage < 3) { |
| o.ackId = 'foo'; |
| o.message = buildPubsubMessage(); |
| } |
| buildCounterReceivedMessage--; |
| return o; |
| } |
| |
| void checkReceivedMessage(api.ReceivedMessage o) { |
| buildCounterReceivedMessage++; |
| if (buildCounterReceivedMessage < 3) { |
| unittest.expect(o.ackId, unittest.equals('foo')); |
| checkPubsubMessage(o.message as api.PubsubMessage); |
| } |
| buildCounterReceivedMessage--; |
| } |
| |
| core.int buildCounterSetIamPolicyRequest = 0; |
| api.SetIamPolicyRequest buildSetIamPolicyRequest() { |
| var o = api.SetIamPolicyRequest(); |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| o.policy = buildPolicy(); |
| } |
| buildCounterSetIamPolicyRequest--; |
| return o; |
| } |
| |
| void checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| checkPolicy(o.policy as api.Policy); |
| } |
| buildCounterSetIamPolicyRequest--; |
| } |
| |
| core.int buildCounterSubscription = 0; |
| api.Subscription buildSubscription() { |
| var o = api.Subscription(); |
| buildCounterSubscription++; |
| if (buildCounterSubscription < 3) { |
| o.ackDeadlineSeconds = 42; |
| o.name = 'foo'; |
| o.pushConfig = buildPushConfig(); |
| o.topic = 'foo'; |
| } |
| buildCounterSubscription--; |
| return o; |
| } |
| |
| void checkSubscription(api.Subscription o) { |
| buildCounterSubscription++; |
| if (buildCounterSubscription < 3) { |
| unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkPushConfig(o.pushConfig as api.PushConfig); |
| unittest.expect(o.topic, unittest.equals('foo')); |
| } |
| buildCounterSubscription--; |
| } |
| |
| core.List<core.String> buildUnnamed6848() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6848(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 = buildUnnamed6848(); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| checkUnnamed6848(o.permissions); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed6849() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed6849(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 = buildUnnamed6849(); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| checkUnnamed6849(o.permissions); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| } |
| |
| core.int buildCounterTopic = 0; |
| api.Topic buildTopic() { |
| var o = api.Topic(); |
| buildCounterTopic++; |
| if (buildCounterTopic < 3) { |
| o.name = 'foo'; |
| } |
| buildCounterTopic--; |
| return o; |
| } |
| |
| void checkTopic(api.Topic o) { |
| buildCounterTopic++; |
| if (buildCounterTopic < 3) { |
| unittest.expect(o.name, unittest.equals('foo')); |
| } |
| buildCounterTopic--; |
| } |
| |
| void main() { |
| unittest.group('obj-schema-AcknowledgeRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildAcknowledgeRequest(); |
| var od = api.AcknowledgeRequest.fromJson(o.toJson()); |
| checkAcknowledgeRequest(od as api.AcknowledgeRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Binding', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildBinding(); |
| var od = api.Binding.fromJson(o.toJson()); |
| checkBinding(od as api.Binding); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Empty', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildEmpty(); |
| var od = api.Empty.fromJson(o.toJson()); |
| checkEmpty(od as api.Empty); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Expr', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildExpr(); |
| var od = api.Expr.fromJson(o.toJson()); |
| checkExpr(od as api.Expr); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListSubscriptionsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListSubscriptionsResponse(); |
| var od = api.ListSubscriptionsResponse.fromJson(o.toJson()); |
| checkListSubscriptionsResponse(od as api.ListSubscriptionsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListTopicSubscriptionsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListTopicSubscriptionsResponse(); |
| var od = api.ListTopicSubscriptionsResponse.fromJson(o.toJson()); |
| checkListTopicSubscriptionsResponse( |
| od as api.ListTopicSubscriptionsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListTopicsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListTopicsResponse(); |
| var od = api.ListTopicsResponse.fromJson(o.toJson()); |
| checkListTopicsResponse(od as api.ListTopicsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ModifyAckDeadlineRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildModifyAckDeadlineRequest(); |
| var od = api.ModifyAckDeadlineRequest.fromJson(o.toJson()); |
| checkModifyAckDeadlineRequest(od as api.ModifyAckDeadlineRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ModifyPushConfigRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildModifyPushConfigRequest(); |
| var od = api.ModifyPushConfigRequest.fromJson(o.toJson()); |
| checkModifyPushConfigRequest(od as api.ModifyPushConfigRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OidcToken', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildOidcToken(); |
| var od = api.OidcToken.fromJson(o.toJson()); |
| checkOidcToken(od as api.OidcToken); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Policy', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPolicy(); |
| var od = api.Policy.fromJson(o.toJson()); |
| checkPolicy(od as api.Policy); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PublishRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPublishRequest(); |
| var od = api.PublishRequest.fromJson(o.toJson()); |
| checkPublishRequest(od as api.PublishRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PublishResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPublishResponse(); |
| var od = api.PublishResponse.fromJson(o.toJson()); |
| checkPublishResponse(od as api.PublishResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PubsubMessage', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPubsubMessage(); |
| var od = api.PubsubMessage.fromJson(o.toJson()); |
| checkPubsubMessage(od as api.PubsubMessage); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PullRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPullRequest(); |
| var od = api.PullRequest.fromJson(o.toJson()); |
| checkPullRequest(od as api.PullRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PullResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPullResponse(); |
| var od = api.PullResponse.fromJson(o.toJson()); |
| checkPullResponse(od as api.PullResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PushConfig', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPushConfig(); |
| var od = api.PushConfig.fromJson(o.toJson()); |
| checkPushConfig(od as api.PushConfig); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ReceivedMessage', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildReceivedMessage(); |
| var od = api.ReceivedMessage.fromJson(o.toJson()); |
| checkReceivedMessage(od as api.ReceivedMessage); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SetIamPolicyRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSetIamPolicyRequest(); |
| var od = api.SetIamPolicyRequest.fromJson(o.toJson()); |
| checkSetIamPolicyRequest(od as api.SetIamPolicyRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Subscription', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSubscription(); |
| var od = api.Subscription.fromJson(o.toJson()); |
| checkSubscription(od as api.Subscription); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTestIamPermissionsRequest(); |
| var od = api.TestIamPermissionsRequest.fromJson(o.toJson()); |
| checkTestIamPermissionsRequest(od as api.TestIamPermissionsRequest); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTestIamPermissionsResponse(); |
| var od = api.TestIamPermissionsResponse.fromJson(o.toJson()); |
| checkTestIamPermissionsResponse(od as api.TestIamPermissionsResponse); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Topic', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTopic(); |
| var od = api.Topic.fromJson(o.toJson()); |
| checkTopic(od as api.Topic); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsSubscriptionsResource', () { |
| unittest.test('method--acknowledge', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| var arg_request = buildAcknowledgeRequest(); |
| var arg_subscription = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.AcknowledgeRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkAcknowledgeRequest(obj as api.AcknowledgeRequest); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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 |
| .acknowledge(arg_request, arg_subscription, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response as api.Empty); |
| }))); |
| }); |
| |
| unittest.test('method--create', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| var arg_request = buildSubscription(); |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.Subscription.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkSubscription(obj as api.Subscription); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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(buildSubscription()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkSubscription(response as api.Subscription); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| var arg_subscription = '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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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_subscription, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response as api.Empty); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| var arg_subscription = '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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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(buildSubscription()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_subscription, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkSubscription(response as api.Subscription); |
| }))); |
| }); |
| |
| unittest.test('method--getIamPolicy', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| var arg_resource = 'foo'; |
| var arg_options_requestedPolicyVersion = 42; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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["options.requestedPolicyVersion"].first), |
| unittest.equals(arg_options_requestedPolicyVersion)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_resource, |
| options_requestedPolicyVersion: |
| arg_options_requestedPolicyVersion, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response as api.Policy); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| var arg_project = '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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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(buildListSubscriptionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_project, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListSubscriptionsResponse( |
| response as api.ListSubscriptionsResponse); |
| }))); |
| }); |
| |
| unittest.test('method--modifyAckDeadline', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| var arg_request = buildModifyAckDeadlineRequest(); |
| var arg_subscription = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ModifyAckDeadlineRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkModifyAckDeadlineRequest(obj as api.ModifyAckDeadlineRequest); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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 |
| .modifyAckDeadline(arg_request, arg_subscription, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response as api.Empty); |
| }))); |
| }); |
| |
| unittest.test('method--modifyPushConfig', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| var arg_request = buildModifyPushConfigRequest(); |
| var arg_subscription = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ModifyPushConfigRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkModifyPushConfigRequest(obj as api.ModifyPushConfigRequest); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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 |
| .modifyPushConfig(arg_request, arg_subscription, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response as api.Empty); |
| }))); |
| }); |
| |
| unittest.test('method--pull', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| var arg_request = buildPullRequest(); |
| var arg_subscription = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.PullRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkPullRequest(obj as api.PullRequest); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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(buildPullResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .pull(arg_request, arg_subscription, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPullResponse(response as api.PullResponse); |
| }))); |
| }); |
| |
| unittest.test('method--setIamPolicy', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| 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 as core.Map<core.String, core.dynamic>); |
| checkSetIamPolicyRequest(obj as api.SetIamPolicyRequest); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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 as api.Policy); |
| }))); |
| }); |
| |
| unittest.test('method--testIamPermissions', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.subscriptions; |
| 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 as core.Map<core.String, core.dynamic>); |
| checkTestIamPermissionsRequest(obj as api.TestIamPermissionsRequest); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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 as api.TestIamPermissionsResponse); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsTopicsResource', () { |
| unittest.test('method--create', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.topics; |
| var arg_request = buildTopic(); |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = |
| api.Topic.fromJson(json as core.Map<core.String, core.dynamic>); |
| checkTopic(obj as api.Topic); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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(buildTopic()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTopic(response as api.Topic); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.topics; |
| var arg_topic = '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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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_topic, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response as api.Empty); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.topics; |
| var arg_topic = '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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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(buildTopic()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_topic, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTopic(response as api.Topic); |
| }))); |
| }); |
| |
| unittest.test('method--getIamPolicy', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.topics; |
| var arg_resource = 'foo'; |
| var arg_options_requestedPolicyVersion = 42; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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["options.requestedPolicyVersion"].first), |
| unittest.equals(arg_options_requestedPolicyVersion)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_resource, |
| options_requestedPolicyVersion: |
| arg_options_requestedPolicyVersion, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response as api.Policy); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.topics; |
| var arg_project = '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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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(buildListTopicsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_project, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListTopicsResponse(response as api.ListTopicsResponse); |
| }))); |
| }); |
| |
| unittest.test('method--publish', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.topics; |
| var arg_request = buildPublishRequest(); |
| var arg_topic = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.PublishRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>); |
| checkPublishRequest(obj as api.PublishRequest); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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(buildPublishResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .publish(arg_request, arg_topic, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPublishResponse(response as api.PublishResponse); |
| }))); |
| }); |
| |
| unittest.test('method--setIamPolicy', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.topics; |
| 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 as core.Map<core.String, core.dynamic>); |
| checkSetIamPolicyRequest(obj as api.SetIamPolicyRequest); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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 as api.Policy); |
| }))); |
| }); |
| |
| unittest.test('method--testIamPermissions', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.topics; |
| 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 as core.Map<core.String, core.dynamic>); |
| checkTestIamPermissionsRequest(obj as api.TestIamPermissionsRequest); |
| |
| 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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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 as api.TestIamPermissionsResponse); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsTopicsSubscriptionsResource', () { |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| var res = api.PubsubApi(mock).projects.topics.subscriptions; |
| var arg_topic = '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 + 8), |
| unittest.equals("v1beta2/")); |
| pathOffset += 8; |
| // 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(buildListTopicSubscriptionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_topic, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListTopicSubscriptionsResponse( |
| response as api.ListTopicSubscriptionsResponse); |
| }))); |
| }); |
| }); |
| } |