google-cloud-pubsub 0.20.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +5 -5
  2. data/.yardopts +18 -0
  3. data/AUTHENTICATION.md +178 -0
  4. data/CHANGELOG.md +659 -0
  5. data/CODE_OF_CONDUCT.md +40 -0
  6. data/CONTRIBUTING.md +187 -0
  7. data/EMULATOR.md +37 -0
  8. data/LICENSE +201 -0
  9. data/LOGGING.md +32 -0
  10. data/OVERVIEW.md +528 -0
  11. data/TROUBLESHOOTING.md +31 -0
  12. data/lib/google/cloud/pubsub/async_publisher/batch.rb +310 -0
  13. data/lib/google/cloud/pubsub/async_publisher.rb +402 -0
  14. data/lib/google/cloud/pubsub/batch_publisher.rb +100 -0
  15. data/lib/google/cloud/pubsub/convert.rb +91 -0
  16. data/lib/google/cloud/pubsub/credentials.rb +26 -10
  17. data/lib/google/cloud/pubsub/errors.rb +85 -0
  18. data/lib/google/cloud/pubsub/message.rb +82 -20
  19. data/lib/google/cloud/pubsub/policy.rb +40 -61
  20. data/lib/google/cloud/pubsub/project.rb +405 -265
  21. data/lib/google/cloud/pubsub/publish_result.rb +103 -0
  22. data/lib/google/cloud/pubsub/received_message.rb +165 -30
  23. data/lib/google/cloud/pubsub/retry_policy.rb +88 -0
  24. data/lib/google/cloud/pubsub/schema/list.rb +180 -0
  25. data/lib/google/cloud/pubsub/schema.rb +310 -0
  26. data/lib/google/cloud/pubsub/service.rb +304 -162
  27. data/lib/google/cloud/pubsub/snapshot/list.rb +178 -0
  28. data/lib/google/cloud/pubsub/snapshot.rb +205 -0
  29. data/lib/google/cloud/pubsub/subscriber/enumerator_queue.rb +54 -0
  30. data/lib/google/cloud/pubsub/subscriber/inventory.rb +173 -0
  31. data/lib/google/cloud/pubsub/subscriber/sequencer.rb +115 -0
  32. data/lib/google/cloud/pubsub/subscriber/stream.rb +400 -0
  33. data/lib/google/cloud/pubsub/subscriber/timed_unary_buffer.rb +230 -0
  34. data/lib/google/cloud/pubsub/subscriber.rb +417 -0
  35. data/lib/google/cloud/pubsub/subscription/list.rb +38 -43
  36. data/lib/google/cloud/pubsub/subscription/push_config.rb +268 -0
  37. data/lib/google/cloud/pubsub/subscription.rb +1040 -210
  38. data/lib/google/cloud/pubsub/topic/list.rb +32 -37
  39. data/lib/google/cloud/pubsub/topic.rb +726 -177
  40. data/lib/google/cloud/pubsub/version.rb +6 -4
  41. data/lib/google/cloud/pubsub.rb +138 -413
  42. data/lib/google-cloud-pubsub.rb +60 -42
  43. metadata +88 -39
  44. data/lib/google/cloud/pubsub/topic/publisher.rb +0 -87
  45. data/lib/google/iam/v1/iam_policy.rb +0 -33
  46. data/lib/google/iam/v1/iam_policy_services.rb +0 -30
  47. data/lib/google/iam/v1/policy.rb +0 -25
  48. data/lib/google/pubsub/v1/pubsub_pb.rb +0 -129
  49. data/lib/google/pubsub/v1/pubsub_services_pb.rb +0 -117
@@ -1,33 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/iam/v1/iam_policy.proto
3
-
4
- require 'google/protobuf'
5
-
6
- require 'google/iam/v1/policy'
7
- Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_message "google.iam.v1.SetIamPolicyRequest" do
9
- optional :resource, :string, 1
10
- optional :policy, :message, 2, "google.iam.v1.Policy"
11
- end
12
- add_message "google.iam.v1.GetIamPolicyRequest" do
13
- optional :resource, :string, 1
14
- end
15
- add_message "google.iam.v1.TestIamPermissionsRequest" do
16
- optional :resource, :string, 1
17
- repeated :permissions, :string, 2
18
- end
19
- add_message "google.iam.v1.TestIamPermissionsResponse" do
20
- repeated :permissions, :string, 1
21
- end
22
- end
23
-
24
- module Google
25
- module Iam
26
- module V1
27
- SetIamPolicyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.SetIamPolicyRequest").msgclass
28
- GetIamPolicyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.GetIamPolicyRequest").msgclass
29
- TestIamPermissionsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.TestIamPermissionsRequest").msgclass
30
- TestIamPermissionsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.TestIamPermissionsResponse").msgclass
31
- end
32
- end
33
- end
@@ -1,30 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/iam/v1/iam_policy.proto for package 'google.iam.v1'
3
-
4
- require 'grpc'
5
- require 'google/iam/v1/iam_policy'
6
-
7
- module Google
8
- module Iam
9
- module V1
10
- module IAMPolicy
11
-
12
- # TODO: add proto service documentation here
13
- class Service
14
-
15
- include GRPC::GenericService
16
-
17
- self.marshal_class_method = :encode
18
- self.unmarshal_class_method = :decode
19
- self.service_name = 'google.iam.v1.IAMPolicy'
20
-
21
- rpc :SetIamPolicy, SetIamPolicyRequest, Policy
22
- rpc :GetIamPolicy, GetIamPolicyRequest, Policy
23
- rpc :TestIamPermissions, TestIamPermissionsRequest, TestIamPermissionsResponse
24
- end
25
-
26
- Stub = Service.rpc_stub_class
27
- end
28
- end
29
- end
30
- end
@@ -1,25 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/iam/v1/policy.proto
3
-
4
- require 'google/protobuf'
5
-
6
- Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "google.iam.v1.Policy" do
8
- optional :version, :int32, 1
9
- repeated :bindings, :message, 4, "google.iam.v1.Binding"
10
- optional :etag, :bytes, 3
11
- end
12
- add_message "google.iam.v1.Binding" do
13
- optional :role, :string, 1
14
- repeated :members, :string, 2
15
- end
16
- end
17
-
18
- module Google
19
- module Iam
20
- module V1
21
- Policy = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.Policy").msgclass
22
- Binding = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.Binding").msgclass
23
- end
24
- end
25
- end
@@ -1,129 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/pubsub/v1/pubsub.proto
3
-
4
- require 'google/protobuf'
5
-
6
- require 'google/api/annotations_pb'
7
- require 'google/protobuf/empty_pb'
8
- require 'google/protobuf/timestamp_pb'
9
- Google::Protobuf::DescriptorPool.generated_pool.build do
10
- add_message "google.pubsub.v1.Topic" do
11
- optional :name, :string, 1
12
- end
13
- add_message "google.pubsub.v1.PubsubMessage" do
14
- optional :data, :bytes, 1
15
- map :attributes, :string, :string, 2
16
- optional :message_id, :string, 3
17
- optional :publish_time, :message, 4, "google.protobuf.Timestamp"
18
- end
19
- add_message "google.pubsub.v1.GetTopicRequest" do
20
- optional :topic, :string, 1
21
- end
22
- add_message "google.pubsub.v1.PublishRequest" do
23
- optional :topic, :string, 1
24
- repeated :messages, :message, 2, "google.pubsub.v1.PubsubMessage"
25
- end
26
- add_message "google.pubsub.v1.PublishResponse" do
27
- repeated :message_ids, :string, 1
28
- end
29
- add_message "google.pubsub.v1.ListTopicsRequest" do
30
- optional :project, :string, 1
31
- optional :page_size, :int32, 2
32
- optional :page_token, :string, 3
33
- end
34
- add_message "google.pubsub.v1.ListTopicsResponse" do
35
- repeated :topics, :message, 1, "google.pubsub.v1.Topic"
36
- optional :next_page_token, :string, 2
37
- end
38
- add_message "google.pubsub.v1.ListTopicSubscriptionsRequest" do
39
- optional :topic, :string, 1
40
- optional :page_size, :int32, 2
41
- optional :page_token, :string, 3
42
- end
43
- add_message "google.pubsub.v1.ListTopicSubscriptionsResponse" do
44
- repeated :subscriptions, :string, 1
45
- optional :next_page_token, :string, 2
46
- end
47
- add_message "google.pubsub.v1.DeleteTopicRequest" do
48
- optional :topic, :string, 1
49
- end
50
- add_message "google.pubsub.v1.Subscription" do
51
- optional :name, :string, 1
52
- optional :topic, :string, 2
53
- optional :push_config, :message, 4, "google.pubsub.v1.PushConfig"
54
- optional :ack_deadline_seconds, :int32, 5
55
- end
56
- add_message "google.pubsub.v1.PushConfig" do
57
- optional :push_endpoint, :string, 1
58
- map :attributes, :string, :string, 2
59
- end
60
- add_message "google.pubsub.v1.ReceivedMessage" do
61
- optional :ack_id, :string, 1
62
- optional :message, :message, 2, "google.pubsub.v1.PubsubMessage"
63
- end
64
- add_message "google.pubsub.v1.GetSubscriptionRequest" do
65
- optional :subscription, :string, 1
66
- end
67
- add_message "google.pubsub.v1.ListSubscriptionsRequest" do
68
- optional :project, :string, 1
69
- optional :page_size, :int32, 2
70
- optional :page_token, :string, 3
71
- end
72
- add_message "google.pubsub.v1.ListSubscriptionsResponse" do
73
- repeated :subscriptions, :message, 1, "google.pubsub.v1.Subscription"
74
- optional :next_page_token, :string, 2
75
- end
76
- add_message "google.pubsub.v1.DeleteSubscriptionRequest" do
77
- optional :subscription, :string, 1
78
- end
79
- add_message "google.pubsub.v1.ModifyPushConfigRequest" do
80
- optional :subscription, :string, 1
81
- optional :push_config, :message, 2, "google.pubsub.v1.PushConfig"
82
- end
83
- add_message "google.pubsub.v1.PullRequest" do
84
- optional :subscription, :string, 1
85
- optional :return_immediately, :bool, 2
86
- optional :max_messages, :int32, 3
87
- end
88
- add_message "google.pubsub.v1.PullResponse" do
89
- repeated :received_messages, :message, 1, "google.pubsub.v1.ReceivedMessage"
90
- end
91
- add_message "google.pubsub.v1.ModifyAckDeadlineRequest" do
92
- optional :subscription, :string, 1
93
- repeated :ack_ids, :string, 4
94
- optional :ack_deadline_seconds, :int32, 3
95
- end
96
- add_message "google.pubsub.v1.AcknowledgeRequest" do
97
- optional :subscription, :string, 1
98
- repeated :ack_ids, :string, 2
99
- end
100
- end
101
-
102
- module Google
103
- module Pubsub
104
- module V1
105
- Topic = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Topic").msgclass
106
- PubsubMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PubsubMessage").msgclass
107
- GetTopicRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetTopicRequest").msgclass
108
- PublishRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PublishRequest").msgclass
109
- PublishResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PublishResponse").msgclass
110
- ListTopicsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicsRequest").msgclass
111
- ListTopicsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicsResponse").msgclass
112
- ListTopicSubscriptionsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSubscriptionsRequest").msgclass
113
- ListTopicSubscriptionsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSubscriptionsResponse").msgclass
114
- DeleteTopicRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteTopicRequest").msgclass
115
- Subscription = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Subscription").msgclass
116
- PushConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PushConfig").msgclass
117
- ReceivedMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ReceivedMessage").msgclass
118
- GetSubscriptionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetSubscriptionRequest").msgclass
119
- ListSubscriptionsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSubscriptionsRequest").msgclass
120
- ListSubscriptionsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSubscriptionsResponse").msgclass
121
- DeleteSubscriptionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSubscriptionRequest").msgclass
122
- ModifyPushConfigRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ModifyPushConfigRequest").msgclass
123
- PullRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PullRequest").msgclass
124
- PullResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PullResponse").msgclass
125
- ModifyAckDeadlineRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ModifyAckDeadlineRequest").msgclass
126
- AcknowledgeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.AcknowledgeRequest").msgclass
127
- end
128
- end
129
- end
@@ -1,117 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/pubsub/v1/pubsub.proto for package 'google.pubsub.v1'
3
- # Original file comments:
4
- # Copyright (c) 2015, Google Inc.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require 'grpc'
20
- require 'google/pubsub/v1/pubsub_pb'
21
-
22
- module Google
23
- module Pubsub
24
- module V1
25
- module Subscriber
26
- # The service that an application uses to manipulate subscriptions and to
27
- # consume messages from a subscription via the `Pull` method.
28
- class Service
29
-
30
- include GRPC::GenericService
31
-
32
- self.marshal_class_method = :encode
33
- self.unmarshal_class_method = :decode
34
- self.service_name = 'google.pubsub.v1.Subscriber'
35
-
36
- # Creates a subscription to a given topic for a given subscriber.
37
- # If the subscription already exists, returns `ALREADY_EXISTS`.
38
- # If the corresponding topic doesn't exist, returns `NOT_FOUND`.
39
- #
40
- # If the name is not provided in the request, the server will assign a random
41
- # name for this subscription on the same project as the topic.
42
- rpc :CreateSubscription, Subscription, Subscription
43
- # Gets the configuration details of a subscription.
44
- rpc :GetSubscription, GetSubscriptionRequest, Subscription
45
- # Lists matching subscriptions.
46
- rpc :ListSubscriptions, ListSubscriptionsRequest, ListSubscriptionsResponse
47
- # Deletes an existing subscription. All pending messages in the subscription
48
- # are immediately dropped. Calls to `Pull` after deletion will return
49
- # `NOT_FOUND`. After a subscription is deleted, a new one may be created with
50
- # the same name, but the new one has no association with the old
51
- # subscription, or its topic unless the same topic is specified.
52
- rpc :DeleteSubscription, DeleteSubscriptionRequest, Google::Protobuf::Empty
53
- # Modifies the ack deadline for a specific message. This method is useful
54
- # to indicate that more time is needed to process a message by the
55
- # subscriber, or to make the message available for redelivery if the
56
- # processing was interrupted.
57
- rpc :ModifyAckDeadline, ModifyAckDeadlineRequest, Google::Protobuf::Empty
58
- # Acknowledges the messages associated with the `ack_ids` in the
59
- # `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
60
- # from the subscription.
61
- #
62
- # Acknowledging a message whose ack deadline has expired may succeed,
63
- # but such a message may be redelivered later. Acknowledging a message more
64
- # than once will not result in an error.
65
- rpc :Acknowledge, AcknowledgeRequest, Google::Protobuf::Empty
66
- # Pulls messages from the server. Returns an empty list if there are no
67
- # messages available in the backlog. The server may return `UNAVAILABLE` if
68
- # there are too many concurrent pull requests pending for the given
69
- # subscription.
70
- rpc :Pull, PullRequest, PullResponse
71
- # Modifies the `PushConfig` for a specified subscription.
72
- #
73
- # This may be used to change a push subscription to a pull one (signified by
74
- # an empty `PushConfig`) or vice versa, or change the endpoint URL and other
75
- # attributes of a push subscription. Messages will accumulate for delivery
76
- # continuously through the call regardless of changes to the `PushConfig`.
77
- rpc :ModifyPushConfig, ModifyPushConfigRequest, Google::Protobuf::Empty
78
- end
79
-
80
- Stub = Service.rpc_stub_class
81
- end
82
- module Publisher
83
- # The service that an application uses to manipulate topics, and to send
84
- # messages to a topic.
85
- class Service
86
-
87
- include GRPC::GenericService
88
-
89
- self.marshal_class_method = :encode
90
- self.unmarshal_class_method = :decode
91
- self.service_name = 'google.pubsub.v1.Publisher'
92
-
93
- # Creates the given topic with the given name.
94
- rpc :CreateTopic, Topic, Topic
95
- # Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
96
- # does not exist. The message payload must not be empty; it must contain
97
- # either a non-empty data field, or at least one attribute.
98
- rpc :Publish, PublishRequest, PublishResponse
99
- # Gets the configuration of a topic.
100
- rpc :GetTopic, GetTopicRequest, Topic
101
- # Lists matching topics.
102
- rpc :ListTopics, ListTopicsRequest, ListTopicsResponse
103
- # Lists the name of the subscriptions for this topic.
104
- rpc :ListTopicSubscriptions, ListTopicSubscriptionsRequest, ListTopicSubscriptionsResponse
105
- # Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
106
- # does not exist. After a topic is deleted, a new topic may be created with
107
- # the same name; this is an entirely new topic with none of the old
108
- # configuration or subscriptions. Existing subscriptions to this topic are
109
- # not deleted, but their `topic` field is set to `_deleted-topic_`.
110
- rpc :DeleteTopic, DeleteTopicRequest, Google::Protobuf::Empty
111
- end
112
-
113
- Stub = Service.rpc_stub_class
114
- end
115
- end
116
- end
117
- end