google-cloud-pubsub-v1 0.1.2 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -96,7 +96,7 @@ module Google
96
96
 
97
97
  "projects/#{project}/topics/#{topic}"
98
98
  end),
99
- "" => (proc do
99
+ "" => (proc do
100
100
  "_deleted-topic_"
101
101
  end)
102
102
  }
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module PubSub
23
23
  module V1
24
- VERSION = "0.1.2"
24
+ VERSION = "0.6.1"
25
25
  end
26
26
  end
27
27
  end
@@ -16,6 +16,7 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
+ require "google/cloud/pubsub/v1/schema_service"
19
20
  require "google/cloud/pubsub/v1/publisher"
20
21
  require "google/cloud/pubsub/v1/subscriber"
21
22
  require "google/cloud/pubsub/v1/iam_policy"
@@ -28,10 +29,13 @@ module Google
28
29
  # To load this package, including all its services, and instantiate a client:
29
30
  #
30
31
  # require "google/cloud/pubsub/v1"
31
- # client = ::Google::Cloud::PubSub::V1::Publisher::Client.new
32
+ # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new
32
33
  #
33
34
  module V1
34
35
  end
35
36
  end
36
37
  end
37
38
  end
39
+
40
+ helper_path = ::File.join __dir__, "v1", "_helpers.rb"
41
+ require "google/cloud/pubsub/v1/_helpers" if ::File.file? helper_path
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/pubsub/v1/pubsub.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -11,16 +9,26 @@ require 'google/protobuf/duration_pb'
11
9
  require 'google/protobuf/empty_pb'
12
10
  require 'google/protobuf/field_mask_pb'
13
11
  require 'google/protobuf/timestamp_pb'
12
+ require 'google/pubsub/v1/schema_pb'
13
+ require 'google/protobuf'
14
+
14
15
  Google::Protobuf::DescriptorPool.generated_pool.build do
15
16
  add_file("google/pubsub/v1/pubsub.proto", :syntax => :proto3) do
16
17
  add_message "google.pubsub.v1.MessageStoragePolicy" do
17
18
  repeated :allowed_persistence_regions, :string, 1
18
19
  end
20
+ add_message "google.pubsub.v1.SchemaSettings" do
21
+ optional :schema, :string, 1
22
+ optional :encoding, :enum, 2, "google.pubsub.v1.Encoding"
23
+ end
19
24
  add_message "google.pubsub.v1.Topic" do
20
25
  optional :name, :string, 1
21
26
  map :labels, :string, :string, 2
22
27
  optional :message_storage_policy, :message, 3, "google.pubsub.v1.MessageStoragePolicy"
23
28
  optional :kms_key_name, :string, 5
29
+ optional :schema_settings, :message, 6, "google.pubsub.v1.SchemaSettings"
30
+ optional :satisfies_pzs, :bool, 7
31
+ optional :message_retention_duration, :message, 8, "google.protobuf.Duration"
24
32
  end
25
33
  add_message "google.pubsub.v1.PubsubMessage" do
26
34
  optional :data, :bytes, 1
@@ -92,6 +100,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
92
100
  optional :dead_letter_policy, :message, 13, "google.pubsub.v1.DeadLetterPolicy"
93
101
  optional :retry_policy, :message, 14, "google.pubsub.v1.RetryPolicy"
94
102
  optional :detached, :bool, 15
103
+ optional :topic_message_retention_duration, :message, 17, "google.protobuf.Duration"
95
104
  end
96
105
  add_message "google.pubsub.v1.RetryPolicy" do
97
106
  optional :minimum_backoff, :message, 1, "google.protobuf.Duration"
@@ -172,6 +181,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
172
181
  end
173
182
  add_message "google.pubsub.v1.StreamingPullResponse" do
174
183
  repeated :received_messages, :message, 1, "google.pubsub.v1.ReceivedMessage"
184
+ optional :subscription_properties, :message, 4, "google.pubsub.v1.StreamingPullResponse.SubscriptionProperties"
185
+ end
186
+ add_message "google.pubsub.v1.StreamingPullResponse.SubscriptionProperties" do
187
+ optional :message_ordering_enabled, :bool, 2
175
188
  end
176
189
  add_message "google.pubsub.v1.CreateSnapshotRequest" do
177
190
  optional :name, :string, 1
@@ -220,6 +233,7 @@ module Google
220
233
  module PubSub
221
234
  module V1
222
235
  MessageStoragePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.MessageStoragePolicy").msgclass
236
+ SchemaSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SchemaSettings").msgclass
223
237
  Topic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Topic").msgclass
224
238
  PubsubMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PubsubMessage").msgclass
225
239
  GetTopicRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetTopicRequest").msgclass
@@ -254,6 +268,7 @@ module Google
254
268
  AcknowledgeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.AcknowledgeRequest").msgclass
255
269
  StreamingPullRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullRequest").msgclass
256
270
  StreamingPullResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse").msgclass
271
+ StreamingPullResponse::SubscriptionProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse.SubscriptionProperties").msgclass
257
272
  CreateSnapshotRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CreateSnapshotRequest").msgclass
258
273
  UpdateSnapshotRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.UpdateSnapshotRequest").msgclass
259
274
  Snapshot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Snapshot").msgclass
@@ -28,44 +28,44 @@ module Google
28
28
  # messages to a topic.
29
29
  class Service
30
30
 
31
- include GRPC::GenericService
31
+ include ::GRPC::GenericService
32
32
 
33
33
  self.marshal_class_method = :encode
34
34
  self.unmarshal_class_method = :decode
35
35
  self.service_name = 'google.pubsub.v1.Publisher'
36
36
 
37
- # Creates the given topic with the given name. See the [resource name rules](
38
- # https://cloud.google.com/pubsub/docs/admin#resource_names).
39
- rpc :CreateTopic, Google::Cloud::PubSub::V1::Topic, Google::Cloud::PubSub::V1::Topic
37
+ # Creates the given topic with the given name. See the [resource name rules]
38
+ # (https://cloud.google.com/pubsub/docs/admin#resource_names).
39
+ rpc :CreateTopic, ::Google::Cloud::PubSub::V1::Topic, ::Google::Cloud::PubSub::V1::Topic
40
40
  # Updates an existing topic. Note that certain properties of a
41
41
  # topic are not modifiable.
42
- rpc :UpdateTopic, Google::Cloud::PubSub::V1::UpdateTopicRequest, Google::Cloud::PubSub::V1::Topic
42
+ rpc :UpdateTopic, ::Google::Cloud::PubSub::V1::UpdateTopicRequest, ::Google::Cloud::PubSub::V1::Topic
43
43
  # Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
44
44
  # does not exist.
45
- rpc :Publish, Google::Cloud::PubSub::V1::PublishRequest, Google::Cloud::PubSub::V1::PublishResponse
45
+ rpc :Publish, ::Google::Cloud::PubSub::V1::PublishRequest, ::Google::Cloud::PubSub::V1::PublishResponse
46
46
  # Gets the configuration of a topic.
47
- rpc :GetTopic, Google::Cloud::PubSub::V1::GetTopicRequest, Google::Cloud::PubSub::V1::Topic
47
+ rpc :GetTopic, ::Google::Cloud::PubSub::V1::GetTopicRequest, ::Google::Cloud::PubSub::V1::Topic
48
48
  # Lists matching topics.
49
- rpc :ListTopics, Google::Cloud::PubSub::V1::ListTopicsRequest, Google::Cloud::PubSub::V1::ListTopicsResponse
49
+ rpc :ListTopics, ::Google::Cloud::PubSub::V1::ListTopicsRequest, ::Google::Cloud::PubSub::V1::ListTopicsResponse
50
50
  # Lists the names of the attached subscriptions on this topic.
51
- rpc :ListTopicSubscriptions, Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest, Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse
51
+ rpc :ListTopicSubscriptions, ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest, ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse
52
52
  # Lists the names of the snapshots on this topic. Snapshots are used in
53
53
  # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
54
54
  # which allow you to manage message acknowledgments in bulk. That is, you can
55
55
  # set the acknowledgment state of messages in an existing subscription to the
56
56
  # state captured by a snapshot.
57
- rpc :ListTopicSnapshots, Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest, Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse
57
+ rpc :ListTopicSnapshots, ::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest, ::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse
58
58
  # Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
59
59
  # does not exist. After a topic is deleted, a new topic may be created with
60
60
  # the same name; this is an entirely new topic with none of the old
61
61
  # configuration or subscriptions. Existing subscriptions to this topic are
62
62
  # not deleted, but their `topic` field is set to `_deleted-topic_`.
63
- rpc :DeleteTopic, Google::Cloud::PubSub::V1::DeleteTopicRequest, Google::Protobuf::Empty
63
+ rpc :DeleteTopic, ::Google::Cloud::PubSub::V1::DeleteTopicRequest, ::Google::Protobuf::Empty
64
64
  # Detaches a subscription from this topic. All messages retained in the
65
65
  # subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
66
66
  # will return FAILED_PRECONDITION. If the subscription is a push
67
67
  # subscription, pushes to the endpoint will stop.
68
- rpc :DetachSubscription, Google::Cloud::PubSub::V1::DetachSubscriptionRequest, Google::Cloud::PubSub::V1::DetachSubscriptionResponse
68
+ rpc :DetachSubscription, ::Google::Cloud::PubSub::V1::DetachSubscriptionRequest, ::Google::Cloud::PubSub::V1::DetachSubscriptionResponse
69
69
  end
70
70
 
71
71
  Stub = Service.rpc_stub_class
@@ -76,7 +76,7 @@ module Google
76
76
  # establishing a bi-directional stream using the `StreamingPull` method.
77
77
  class Service
78
78
 
79
- include GRPC::GenericService
79
+ include ::GRPC::GenericService
80
80
 
81
81
  self.marshal_class_method = :encode
82
82
  self.unmarshal_class_method = :decode
@@ -93,26 +93,26 @@ module Google
93
93
  # (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated
94
94
  # name is populated in the returned Subscription object. Note that for REST
95
95
  # API requests, you must specify a name in the request.
96
- rpc :CreateSubscription, Google::Cloud::PubSub::V1::Subscription, Google::Cloud::PubSub::V1::Subscription
96
+ rpc :CreateSubscription, ::Google::Cloud::PubSub::V1::Subscription, ::Google::Cloud::PubSub::V1::Subscription
97
97
  # Gets the configuration details of a subscription.
98
- rpc :GetSubscription, Google::Cloud::PubSub::V1::GetSubscriptionRequest, Google::Cloud::PubSub::V1::Subscription
98
+ rpc :GetSubscription, ::Google::Cloud::PubSub::V1::GetSubscriptionRequest, ::Google::Cloud::PubSub::V1::Subscription
99
99
  # Updates an existing subscription. Note that certain properties of a
100
100
  # subscription, such as its topic, are not modifiable.
101
- rpc :UpdateSubscription, Google::Cloud::PubSub::V1::UpdateSubscriptionRequest, Google::Cloud::PubSub::V1::Subscription
101
+ rpc :UpdateSubscription, ::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest, ::Google::Cloud::PubSub::V1::Subscription
102
102
  # Lists matching subscriptions.
103
- rpc :ListSubscriptions, Google::Cloud::PubSub::V1::ListSubscriptionsRequest, Google::Cloud::PubSub::V1::ListSubscriptionsResponse
103
+ rpc :ListSubscriptions, ::Google::Cloud::PubSub::V1::ListSubscriptionsRequest, ::Google::Cloud::PubSub::V1::ListSubscriptionsResponse
104
104
  # Deletes an existing subscription. All messages retained in the subscription
105
105
  # are immediately dropped. Calls to `Pull` after deletion will return
106
106
  # `NOT_FOUND`. After a subscription is deleted, a new one may be created with
107
107
  # the same name, but the new one has no association with the old
108
108
  # subscription or its topic unless the same topic is specified.
109
- rpc :DeleteSubscription, Google::Cloud::PubSub::V1::DeleteSubscriptionRequest, Google::Protobuf::Empty
109
+ rpc :DeleteSubscription, ::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest, ::Google::Protobuf::Empty
110
110
  # Modifies the ack deadline for a specific message. This method is useful
111
111
  # to indicate that more time is needed to process a message by the
112
112
  # subscriber, or to make the message available for redelivery if the
113
113
  # processing was interrupted. Note that this does not modify the
114
114
  # subscription-level `ackDeadlineSeconds` used for subsequent messages.
115
- rpc :ModifyAckDeadline, Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest, Google::Protobuf::Empty
115
+ rpc :ModifyAckDeadline, ::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest, ::Google::Protobuf::Empty
116
116
  # Acknowledges the messages associated with the `ack_ids` in the
117
117
  # `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
118
118
  # from the subscription.
@@ -120,11 +120,11 @@ module Google
120
120
  # Acknowledging a message whose ack deadline has expired may succeed,
121
121
  # but such a message may be redelivered later. Acknowledging a message more
122
122
  # than once will not result in an error.
123
- rpc :Acknowledge, Google::Cloud::PubSub::V1::AcknowledgeRequest, Google::Protobuf::Empty
123
+ rpc :Acknowledge, ::Google::Cloud::PubSub::V1::AcknowledgeRequest, ::Google::Protobuf::Empty
124
124
  # Pulls messages from the server. The server may return `UNAVAILABLE` if
125
125
  # there are too many concurrent pull requests pending for the given
126
126
  # subscription.
127
- rpc :Pull, Google::Cloud::PubSub::V1::PullRequest, Google::Cloud::PubSub::V1::PullResponse
127
+ rpc :Pull, ::Google::Cloud::PubSub::V1::PullRequest, ::Google::Cloud::PubSub::V1::PullResponse
128
128
  # Establishes a stream with the server, which sends messages down to the
129
129
  # client. The client streams acknowledgements and ack deadline modifications
130
130
  # back to the server. The server will close the stream and return the status
@@ -132,26 +132,26 @@ module Google
132
132
  # reassign server-side resources, in which case, the client should
133
133
  # re-establish the stream. Flow control can be achieved by configuring the
134
134
  # underlying RPC channel.
135
- rpc :StreamingPull, stream(Google::Cloud::PubSub::V1::StreamingPullRequest), stream(Google::Cloud::PubSub::V1::StreamingPullResponse)
135
+ rpc :StreamingPull, stream(::Google::Cloud::PubSub::V1::StreamingPullRequest), stream(::Google::Cloud::PubSub::V1::StreamingPullResponse)
136
136
  # Modifies the `PushConfig` for a specified subscription.
137
137
  #
138
138
  # This may be used to change a push subscription to a pull one (signified by
139
139
  # an empty `PushConfig`) or vice versa, or change the endpoint URL and other
140
140
  # attributes of a push subscription. Messages will accumulate for delivery
141
141
  # continuously through the call regardless of changes to the `PushConfig`.
142
- rpc :ModifyPushConfig, Google::Cloud::PubSub::V1::ModifyPushConfigRequest, Google::Protobuf::Empty
142
+ rpc :ModifyPushConfig, ::Google::Cloud::PubSub::V1::ModifyPushConfigRequest, ::Google::Protobuf::Empty
143
143
  # Gets the configuration details of a snapshot. Snapshots are used in
144
144
  # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
145
145
  # operations, which allow you to manage message acknowledgments in bulk. That
146
146
  # is, you can set the acknowledgment state of messages in an existing
147
147
  # subscription to the state captured by a snapshot.
148
- rpc :GetSnapshot, Google::Cloud::PubSub::V1::GetSnapshotRequest, Google::Cloud::PubSub::V1::Snapshot
148
+ rpc :GetSnapshot, ::Google::Cloud::PubSub::V1::GetSnapshotRequest, ::Google::Cloud::PubSub::V1::Snapshot
149
149
  # Lists the existing snapshots. Snapshots are used in [Seek](
150
150
  # https://cloud.google.com/pubsub/docs/replay-overview) operations, which
151
151
  # allow you to manage message acknowledgments in bulk. That is, you can set
152
152
  # the acknowledgment state of messages in an existing subscription to the
153
153
  # state captured by a snapshot.
154
- rpc :ListSnapshots, Google::Cloud::PubSub::V1::ListSnapshotsRequest, Google::Cloud::PubSub::V1::ListSnapshotsResponse
154
+ rpc :ListSnapshots, ::Google::Cloud::PubSub::V1::ListSnapshotsRequest, ::Google::Cloud::PubSub::V1::ListSnapshotsResponse
155
155
  # Creates a snapshot from the requested subscription. Snapshots are used in
156
156
  # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
157
157
  # which allow you to manage message acknowledgments in bulk. That is, you can
@@ -168,14 +168,14 @@ module Google
168
168
  # (https://cloud.google.com/pubsub/docs/admin#resource_names). The
169
169
  # generated name is populated in the returned Snapshot object. Note that for
170
170
  # REST API requests, you must specify a name in the request.
171
- rpc :CreateSnapshot, Google::Cloud::PubSub::V1::CreateSnapshotRequest, Google::Cloud::PubSub::V1::Snapshot
171
+ rpc :CreateSnapshot, ::Google::Cloud::PubSub::V1::CreateSnapshotRequest, ::Google::Cloud::PubSub::V1::Snapshot
172
172
  # Updates an existing snapshot. Snapshots are used in
173
173
  # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a>
174
174
  # operations, which allow
175
175
  # you to manage message acknowledgments in bulk. That is, you can set the
176
176
  # acknowledgment state of messages in an existing subscription to the state
177
177
  # captured by a snapshot.
178
- rpc :UpdateSnapshot, Google::Cloud::PubSub::V1::UpdateSnapshotRequest, Google::Cloud::PubSub::V1::Snapshot
178
+ rpc :UpdateSnapshot, ::Google::Cloud::PubSub::V1::UpdateSnapshotRequest, ::Google::Cloud::PubSub::V1::Snapshot
179
179
  # Removes an existing snapshot. Snapshots are used in [Seek]
180
180
  # (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
181
181
  # allow you to manage message acknowledgments in bulk. That is, you can set
@@ -185,15 +185,15 @@ module Google
185
185
  # are immediately dropped. After a snapshot is deleted, a new one may be
186
186
  # created with the same name, but the new one has no association with the old
187
187
  # snapshot or its subscription, unless the same subscription is specified.
188
- rpc :DeleteSnapshot, Google::Cloud::PubSub::V1::DeleteSnapshotRequest, Google::Protobuf::Empty
188
+ rpc :DeleteSnapshot, ::Google::Cloud::PubSub::V1::DeleteSnapshotRequest, ::Google::Protobuf::Empty
189
189
  # Seeks an existing subscription to a point in time or to a given snapshot,
190
- # whichever is provided in the request. Snapshots are used in [Seek](
191
- # https://cloud.google.com/pubsub/docs/replay-overview) operations, which
190
+ # whichever is provided in the request. Snapshots are used in [Seek]
191
+ # (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
192
192
  # allow you to manage message acknowledgments in bulk. That is, you can set
193
193
  # the acknowledgment state of messages in an existing subscription to the
194
194
  # state captured by a snapshot. Note that both the subscription and the
195
195
  # snapshot must be on the same topic.
196
- rpc :Seek, Google::Cloud::PubSub::V1::SeekRequest, Google::Cloud::PubSub::V1::SeekResponse
196
+ rpc :Seek, ::Google::Cloud::PubSub::V1::SeekRequest, ::Google::Cloud::PubSub::V1::SeekResponse
197
197
  end
198
198
 
199
199
  Stub = Service.rpc_stub_class
@@ -0,0 +1,95 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/pubsub/v1/schema.proto
3
+
4
+ require 'google/api/annotations_pb'
5
+ require 'google/api/client_pb'
6
+ require 'google/api/field_behavior_pb'
7
+ require 'google/api/resource_pb'
8
+ require 'google/protobuf/empty_pb'
9
+ require 'google/protobuf'
10
+
11
+ Google::Protobuf::DescriptorPool.generated_pool.build do
12
+ add_file("google/pubsub/v1/schema.proto", :syntax => :proto3) do
13
+ add_message "google.pubsub.v1.Schema" do
14
+ optional :name, :string, 1
15
+ optional :type, :enum, 2, "google.pubsub.v1.Schema.Type"
16
+ optional :definition, :string, 3
17
+ end
18
+ add_enum "google.pubsub.v1.Schema.Type" do
19
+ value :TYPE_UNSPECIFIED, 0
20
+ value :PROTOCOL_BUFFER, 1
21
+ value :AVRO, 2
22
+ end
23
+ add_message "google.pubsub.v1.CreateSchemaRequest" do
24
+ optional :parent, :string, 1
25
+ optional :schema, :message, 2, "google.pubsub.v1.Schema"
26
+ optional :schema_id, :string, 3
27
+ end
28
+ add_message "google.pubsub.v1.GetSchemaRequest" do
29
+ optional :name, :string, 1
30
+ optional :view, :enum, 2, "google.pubsub.v1.SchemaView"
31
+ end
32
+ add_message "google.pubsub.v1.ListSchemasRequest" do
33
+ optional :parent, :string, 1
34
+ optional :view, :enum, 2, "google.pubsub.v1.SchemaView"
35
+ optional :page_size, :int32, 3
36
+ optional :page_token, :string, 4
37
+ end
38
+ add_message "google.pubsub.v1.ListSchemasResponse" do
39
+ repeated :schemas, :message, 1, "google.pubsub.v1.Schema"
40
+ optional :next_page_token, :string, 2
41
+ end
42
+ add_message "google.pubsub.v1.DeleteSchemaRequest" do
43
+ optional :name, :string, 1
44
+ end
45
+ add_message "google.pubsub.v1.ValidateSchemaRequest" do
46
+ optional :parent, :string, 1
47
+ optional :schema, :message, 2, "google.pubsub.v1.Schema"
48
+ end
49
+ add_message "google.pubsub.v1.ValidateSchemaResponse" do
50
+ end
51
+ add_message "google.pubsub.v1.ValidateMessageRequest" do
52
+ optional :parent, :string, 1
53
+ optional :message, :bytes, 4
54
+ optional :encoding, :enum, 5, "google.pubsub.v1.Encoding"
55
+ oneof :schema_spec do
56
+ optional :name, :string, 2
57
+ optional :schema, :message, 3, "google.pubsub.v1.Schema"
58
+ end
59
+ end
60
+ add_message "google.pubsub.v1.ValidateMessageResponse" do
61
+ end
62
+ add_enum "google.pubsub.v1.SchemaView" do
63
+ value :SCHEMA_VIEW_UNSPECIFIED, 0
64
+ value :BASIC, 1
65
+ value :FULL, 2
66
+ end
67
+ add_enum "google.pubsub.v1.Encoding" do
68
+ value :ENCODING_UNSPECIFIED, 0
69
+ value :JSON, 1
70
+ value :BINARY, 2
71
+ end
72
+ end
73
+ end
74
+
75
+ module Google
76
+ module Cloud
77
+ module PubSub
78
+ module V1
79
+ Schema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Schema").msgclass
80
+ Schema::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Schema.Type").enummodule
81
+ CreateSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CreateSchemaRequest").msgclass
82
+ GetSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetSchemaRequest").msgclass
83
+ ListSchemasRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSchemasRequest").msgclass
84
+ ListSchemasResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSchemasResponse").msgclass
85
+ DeleteSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSchemaRequest").msgclass
86
+ ValidateSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateSchemaRequest").msgclass
87
+ ValidateSchemaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateSchemaResponse").msgclass
88
+ ValidateMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateMessageRequest").msgclass
89
+ ValidateMessageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateMessageResponse").msgclass
90
+ SchemaView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SchemaView").enummodule
91
+ Encoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Encoding").enummodule
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,55 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/pubsub/v1/schema.proto for package 'Google.Cloud.PubSub.V1'
3
+ # Original file comments:
4
+ # Copyright 2020 Google LLC
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/schema_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module PubSub
25
+ module V1
26
+ module SchemaService
27
+ # Service for doing schema-related operations.
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.SchemaService'
35
+
36
+ # Creates a schema.
37
+ rpc :CreateSchema, ::Google::Cloud::PubSub::V1::CreateSchemaRequest, ::Google::Cloud::PubSub::V1::Schema
38
+ # Gets a schema.
39
+ rpc :GetSchema, ::Google::Cloud::PubSub::V1::GetSchemaRequest, ::Google::Cloud::PubSub::V1::Schema
40
+ # Lists schemas in a project.
41
+ rpc :ListSchemas, ::Google::Cloud::PubSub::V1::ListSchemasRequest, ::Google::Cloud::PubSub::V1::ListSchemasResponse
42
+ # Deletes a schema.
43
+ rpc :DeleteSchema, ::Google::Cloud::PubSub::V1::DeleteSchemaRequest, ::Google::Protobuf::Empty
44
+ # Validates a schema.
45
+ rpc :ValidateSchema, ::Google::Cloud::PubSub::V1::ValidateSchemaRequest, ::Google::Cloud::PubSub::V1::ValidateSchemaResponse
46
+ # Validates a message against a schema.
47
+ rpc :ValidateMessage, ::Google::Cloud::PubSub::V1::ValidateMessageRequest, ::Google::Cloud::PubSub::V1::ValidateMessageResponse
48
+ end
49
+
50
+ Stub = Service.rpc_stub_class
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -54,6 +54,18 @@ module Google
54
54
  # This indicates that the field may be set once in a request to create a
55
55
  # resource, but may not be changed thereafter.
56
56
  IMMUTABLE = 5
57
+
58
+ # Denotes that a (repeated) field is an unordered list.
59
+ # This indicates that the service may provide the elements of the list
60
+ # in any arbitrary order, rather than the order the user originally
61
+ # provided. Additionally, the list's order may or may not be stable.
62
+ UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
57
69
  end
58
70
  end
59
71
  end
@@ -43,12 +43,12 @@ module Google
43
43
  #
44
44
  # The ResourceDescriptor Yaml config will look like:
45
45
  #
46
- # resources:
47
- # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/\\{project}/topics/\\{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/\\{project}"
46
+ # resources:
47
+ # - type: "pubsub.googleapis.com/Topic"
48
+ # name_descriptor:
49
+ # - pattern: "projects/{project}/topics/{topic}"
50
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
+ # parent_name_extractor: "projects/{project}"
52
52
  #
53
53
  # Sometimes, resources have multiple patterns, typically because they can
54
54
  # live under multiple parents.
@@ -183,15 +183,24 @@ module Google
183
183
  # }
184
184
  # @!attribute [rw] plural
185
185
  # @return [::String]
186
- # The plural name used in the resource name, such as 'projects' for
187
- # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
- # field in k8s CRD spec
186
+ # The plural name used in the resource name and permission names, such as
187
+ # 'projects' for the resource name of 'projects/\\{project}' and the permission
188
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
189
+ # concept of the `plural` field in k8s CRD spec
189
190
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
191
+ #
192
+ # Note: The plural form is required even for singleton resources. See
193
+ # https://aip.dev/156
190
194
  # @!attribute [rw] singular
191
195
  # @return [::String]
192
196
  # The same concept of the `singular` field in k8s CRD spec
193
197
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
198
  # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
199
+ # @!attribute [rw] style
200
+ # @return [::Array<::Google::Api::ResourceDescriptor::Style>]
201
+ # Style flag(s) for this resource.
202
+ # These indicate that a resource is expected to conform to a given
203
+ # style. See the specific style flags for additional information.
195
204
  class ResourceDescriptor
196
205
  include ::Google::Protobuf::MessageExts
197
206
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -211,6 +220,22 @@ module Google
211
220
  # that from being necessary once there are multiple patterns.)
212
221
  FUTURE_MULTI_PATTERN = 2
213
222
  end
223
+
224
+ # A flag representing a specific style that a resource claims to conform to.
225
+ module Style
226
+ # The unspecified value. Do not use.
227
+ STYLE_UNSPECIFIED = 0
228
+
229
+ # This resource is intended to be "declarative-friendly".
230
+ #
231
+ # Declarative-friendly resources must be more strictly consistent, and
232
+ # setting this to true communicates to tools that this resource should
233
+ # adhere to declarative-friendly expectations.
234
+ #
235
+ # Note: This is used by the API linter (linter.aip.dev) to enable
236
+ # additional checks.
237
+ DECLARATIVE_FRIENDLY = 1
238
+ end
214
239
  end
215
240
 
216
241
  # Defines a proto annotation that describes a string field that refers to
@@ -226,6 +251,17 @@ module Google
226
251
  # type: "pubsub.googleapis.com/Topic"
227
252
  # }];
228
253
  # }
254
+ #
255
+ # Occasionally, a field may reference an arbitrary resource. In this case,
256
+ # APIs use the special value * in their resource reference.
257
+ #
258
+ # Example:
259
+ #
260
+ # message GetIamPolicyRequest {
261
+ # string resource = 2 [(google.api.resource_reference) = {
262
+ # type: "*"
263
+ # }];
264
+ # }
229
265
  # @!attribute [rw] child_type
230
266
  # @return [::String]
231
267
  # The resource type of a child collection that the annotated field
@@ -234,11 +270,11 @@ module Google
234
270
  #
235
271
  # Example:
236
272
  #
237
- # message ListLogEntriesRequest {
238
- # string parent = 1 [(google.api.resource_reference) = {
239
- # child_type: "logging.googleapis.com/LogEntry"
240
- # };
241
- # }
273
+ # message ListLogEntriesRequest {
274
+ # string parent = 1 [(google.api.resource_reference) = {
275
+ # child_type: "logging.googleapis.com/LogEntry"
276
+ # };
277
+ # }
242
278
  class ResourceReference
243
279
  include ::Google::Protobuf::MessageExts
244
280
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -70,7 +70,16 @@ module Google
70
70
  # .setNanos((int) ((millis % 1000) * 1000000)).build();
71
71
  #
72
72
  #
73
- # Example 5: Compute Timestamp from current time in Python.
73
+ # Example 5: Compute Timestamp from Java `Instant.now()`.
74
+ #
75
+ # Instant now = Instant.now();
76
+ #
77
+ # Timestamp timestamp =
78
+ # Timestamp.newBuilder().setSeconds(now.getEpochSecond())
79
+ # .setNanos(now.getNano()).build();
80
+ #
81
+ #
82
+ # Example 6: Compute Timestamp from current time in Python.
74
83
  #
75
84
  # timestamp = Timestamp()
76
85
  # timestamp.GetCurrentTime()