google-apis-pubsublite_v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module PubsubliteV1
18
+ # Version of the google-apis-pubsublite_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200929"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,261 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module PubsubliteV1
24
+
25
+ class Capacity
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class ComputeMessageStatsRequest
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class ComputeMessageStatsResponse
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class Cursor
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class DeliveryConfig
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class Empty
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class ListPartitionCursorsResponse
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class ListSubscriptionsResponse
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class ListTopicSubscriptionsResponse
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class ListTopicsResponse
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class PartitionConfig
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class PartitionCursor
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class RetentionConfig
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class Subscription
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class Topic
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class TopicPartitions
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class Capacity
122
+ # @private
123
+ class Representation < Google::Apis::Core::JsonRepresentation
124
+ property :publish_mib_per_sec, as: 'publishMibPerSec'
125
+ property :subscribe_mib_per_sec, as: 'subscribeMibPerSec'
126
+ end
127
+ end
128
+
129
+ class ComputeMessageStatsRequest
130
+ # @private
131
+ class Representation < Google::Apis::Core::JsonRepresentation
132
+ property :end_cursor, as: 'endCursor', class: Google::Apis::PubsubliteV1::Cursor, decorator: Google::Apis::PubsubliteV1::Cursor::Representation
133
+
134
+ property :partition, :numeric_string => true, as: 'partition'
135
+ property :start_cursor, as: 'startCursor', class: Google::Apis::PubsubliteV1::Cursor, decorator: Google::Apis::PubsubliteV1::Cursor::Representation
136
+
137
+ end
138
+ end
139
+
140
+ class ComputeMessageStatsResponse
141
+ # @private
142
+ class Representation < Google::Apis::Core::JsonRepresentation
143
+ property :message_bytes, :numeric_string => true, as: 'messageBytes'
144
+ property :message_count, :numeric_string => true, as: 'messageCount'
145
+ property :minimum_event_time, as: 'minimumEventTime'
146
+ property :minimum_publish_time, as: 'minimumPublishTime'
147
+ end
148
+ end
149
+
150
+ class Cursor
151
+ # @private
152
+ class Representation < Google::Apis::Core::JsonRepresentation
153
+ property :offset, :numeric_string => true, as: 'offset'
154
+ end
155
+ end
156
+
157
+ class DeliveryConfig
158
+ # @private
159
+ class Representation < Google::Apis::Core::JsonRepresentation
160
+ property :delivery_requirement, as: 'deliveryRequirement'
161
+ end
162
+ end
163
+
164
+ class Empty
165
+ # @private
166
+ class Representation < Google::Apis::Core::JsonRepresentation
167
+ end
168
+ end
169
+
170
+ class ListPartitionCursorsResponse
171
+ # @private
172
+ class Representation < Google::Apis::Core::JsonRepresentation
173
+ property :next_page_token, as: 'nextPageToken'
174
+ collection :partition_cursors, as: 'partitionCursors', class: Google::Apis::PubsubliteV1::PartitionCursor, decorator: Google::Apis::PubsubliteV1::PartitionCursor::Representation
175
+
176
+ end
177
+ end
178
+
179
+ class ListSubscriptionsResponse
180
+ # @private
181
+ class Representation < Google::Apis::Core::JsonRepresentation
182
+ property :next_page_token, as: 'nextPageToken'
183
+ collection :subscriptions, as: 'subscriptions', class: Google::Apis::PubsubliteV1::Subscription, decorator: Google::Apis::PubsubliteV1::Subscription::Representation
184
+
185
+ end
186
+ end
187
+
188
+ class ListTopicSubscriptionsResponse
189
+ # @private
190
+ class Representation < Google::Apis::Core::JsonRepresentation
191
+ property :next_page_token, as: 'nextPageToken'
192
+ collection :subscriptions, as: 'subscriptions'
193
+ end
194
+ end
195
+
196
+ class ListTopicsResponse
197
+ # @private
198
+ class Representation < Google::Apis::Core::JsonRepresentation
199
+ property :next_page_token, as: 'nextPageToken'
200
+ collection :topics, as: 'topics', class: Google::Apis::PubsubliteV1::Topic, decorator: Google::Apis::PubsubliteV1::Topic::Representation
201
+
202
+ end
203
+ end
204
+
205
+ class PartitionConfig
206
+ # @private
207
+ class Representation < Google::Apis::Core::JsonRepresentation
208
+ property :capacity, as: 'capacity', class: Google::Apis::PubsubliteV1::Capacity, decorator: Google::Apis::PubsubliteV1::Capacity::Representation
209
+
210
+ property :count, :numeric_string => true, as: 'count'
211
+ property :scale, as: 'scale'
212
+ end
213
+ end
214
+
215
+ class PartitionCursor
216
+ # @private
217
+ class Representation < Google::Apis::Core::JsonRepresentation
218
+ property :cursor, as: 'cursor', class: Google::Apis::PubsubliteV1::Cursor, decorator: Google::Apis::PubsubliteV1::Cursor::Representation
219
+
220
+ property :partition, :numeric_string => true, as: 'partition'
221
+ end
222
+ end
223
+
224
+ class RetentionConfig
225
+ # @private
226
+ class Representation < Google::Apis::Core::JsonRepresentation
227
+ property :per_partition_bytes, :numeric_string => true, as: 'perPartitionBytes'
228
+ property :period, as: 'period'
229
+ end
230
+ end
231
+
232
+ class Subscription
233
+ # @private
234
+ class Representation < Google::Apis::Core::JsonRepresentation
235
+ property :delivery_config, as: 'deliveryConfig', class: Google::Apis::PubsubliteV1::DeliveryConfig, decorator: Google::Apis::PubsubliteV1::DeliveryConfig::Representation
236
+
237
+ property :name, as: 'name'
238
+ property :topic, as: 'topic'
239
+ end
240
+ end
241
+
242
+ class Topic
243
+ # @private
244
+ class Representation < Google::Apis::Core::JsonRepresentation
245
+ property :name, as: 'name'
246
+ property :partition_config, as: 'partitionConfig', class: Google::Apis::PubsubliteV1::PartitionConfig, decorator: Google::Apis::PubsubliteV1::PartitionConfig::Representation
247
+
248
+ property :retention_config, as: 'retentionConfig', class: Google::Apis::PubsubliteV1::RetentionConfig, decorator: Google::Apis::PubsubliteV1::RetentionConfig::Representation
249
+
250
+ end
251
+ end
252
+
253
+ class TopicPartitions
254
+ # @private
255
+ class Representation < Google::Apis::Core::JsonRepresentation
256
+ property :partition_count, :numeric_string => true, as: 'partitionCount'
257
+ end
258
+ end
259
+ end
260
+ end
261
+ end
@@ -0,0 +1,560 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module PubsubliteV1
23
+ # Pub/Sub Lite API
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/pubsublite_v1'
29
+ #
30
+ # Pubsublite = Google::Apis::PubsubliteV1 # Alias the module
31
+ # service = Pubsublite::PubsubLiteService.new
32
+ #
33
+ # @see https://cloud.google.com/pubsub/lite/docs
34
+ class PubsubLiteService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://pubsublite.googleapis.com/', '',
47
+ client_name: 'google-apis-pubsublite_v1',
48
+ client_version: Google::Apis::PubsubliteV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Creates a new subscription.
53
+ # @param [String] parent
54
+ # Required. The parent location in which to create the subscription. Structured
55
+ # like `projects/`project_number`/locations/`location``.
56
+ # @param [Google::Apis::PubsubliteV1::Subscription] subscription_object
57
+ # @param [String] subscription_id
58
+ # Required. The ID to use for the subscription, which will become the final
59
+ # component of the subscription's name. This value is structured like: `my-sub-
60
+ # name`.
61
+ # @param [String] fields
62
+ # Selector specifying which fields to include in a partial response.
63
+ # @param [String] quota_user
64
+ # Available to use for quota purposes for server-side applications. Can be any
65
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
66
+ # @param [Google::Apis::RequestOptions] options
67
+ # Request-specific options
68
+ #
69
+ # @yield [result, err] Result & error if block supplied
70
+ # @yieldparam result [Google::Apis::PubsubliteV1::Subscription] parsed result object
71
+ # @yieldparam err [StandardError] error object if request failed
72
+ #
73
+ # @return [Google::Apis::PubsubliteV1::Subscription]
74
+ #
75
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
76
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
77
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
78
+ def create_admin_project_location_subscription(parent, subscription_object = nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil, &block)
79
+ command = make_simple_command(:post, 'v1/admin/{+parent}/subscriptions', options)
80
+ command.request_representation = Google::Apis::PubsubliteV1::Subscription::Representation
81
+ command.request_object = subscription_object
82
+ command.response_representation = Google::Apis::PubsubliteV1::Subscription::Representation
83
+ command.response_class = Google::Apis::PubsubliteV1::Subscription
84
+ command.params['parent'] = parent unless parent.nil?
85
+ command.query['subscriptionId'] = subscription_id unless subscription_id.nil?
86
+ command.query['fields'] = fields unless fields.nil?
87
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
88
+ execute_or_queue_command(command, &block)
89
+ end
90
+
91
+ # Deletes the specified subscription.
92
+ # @param [String] name
93
+ # Required. The name of the subscription to delete.
94
+ # @param [String] fields
95
+ # Selector specifying which fields to include in a partial response.
96
+ # @param [String] quota_user
97
+ # Available to use for quota purposes for server-side applications. Can be any
98
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
99
+ # @param [Google::Apis::RequestOptions] options
100
+ # Request-specific options
101
+ #
102
+ # @yield [result, err] Result & error if block supplied
103
+ # @yieldparam result [Google::Apis::PubsubliteV1::Empty] parsed result object
104
+ # @yieldparam err [StandardError] error object if request failed
105
+ #
106
+ # @return [Google::Apis::PubsubliteV1::Empty]
107
+ #
108
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
109
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
110
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
111
+ def delete_admin_project_location_subscription(name, fields: nil, quota_user: nil, options: nil, &block)
112
+ command = make_simple_command(:delete, 'v1/admin/{+name}', options)
113
+ command.response_representation = Google::Apis::PubsubliteV1::Empty::Representation
114
+ command.response_class = Google::Apis::PubsubliteV1::Empty
115
+ command.params['name'] = name unless name.nil?
116
+ command.query['fields'] = fields unless fields.nil?
117
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
118
+ execute_or_queue_command(command, &block)
119
+ end
120
+
121
+ # Returns the subscription configuration.
122
+ # @param [String] name
123
+ # Required. The name of the subscription whose configuration to return.
124
+ # @param [String] fields
125
+ # Selector specifying which fields to include in a partial response.
126
+ # @param [String] quota_user
127
+ # Available to use for quota purposes for server-side applications. Can be any
128
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
129
+ # @param [Google::Apis::RequestOptions] options
130
+ # Request-specific options
131
+ #
132
+ # @yield [result, err] Result & error if block supplied
133
+ # @yieldparam result [Google::Apis::PubsubliteV1::Subscription] parsed result object
134
+ # @yieldparam err [StandardError] error object if request failed
135
+ #
136
+ # @return [Google::Apis::PubsubliteV1::Subscription]
137
+ #
138
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
139
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
140
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
141
+ def get_admin_project_location_subscription(name, fields: nil, quota_user: nil, options: nil, &block)
142
+ command = make_simple_command(:get, 'v1/admin/{+name}', options)
143
+ command.response_representation = Google::Apis::PubsubliteV1::Subscription::Representation
144
+ command.response_class = Google::Apis::PubsubliteV1::Subscription
145
+ command.params['name'] = name unless name.nil?
146
+ command.query['fields'] = fields unless fields.nil?
147
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
148
+ execute_or_queue_command(command, &block)
149
+ end
150
+
151
+ # Returns the list of subscriptions for the given project.
152
+ # @param [String] parent
153
+ # Required. The parent whose subscriptions are to be listed. Structured like `
154
+ # projects/`project_number`/locations/`location``.
155
+ # @param [Fixnum] page_size
156
+ # The maximum number of subscriptions to return. The service may return fewer
157
+ # than this value. If unset or zero, all subscriptions for the parent will be
158
+ # returned.
159
+ # @param [String] page_token
160
+ # A page token, received from a previous `ListSubscriptions` call. Provide this
161
+ # to retrieve the subsequent page. When paginating, all other parameters
162
+ # provided to `ListSubscriptions` must match the call that provided the page
163
+ # token.
164
+ # @param [String] fields
165
+ # Selector specifying which fields to include in a partial response.
166
+ # @param [String] quota_user
167
+ # Available to use for quota purposes for server-side applications. Can be any
168
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
169
+ # @param [Google::Apis::RequestOptions] options
170
+ # Request-specific options
171
+ #
172
+ # @yield [result, err] Result & error if block supplied
173
+ # @yieldparam result [Google::Apis::PubsubliteV1::ListSubscriptionsResponse] parsed result object
174
+ # @yieldparam err [StandardError] error object if request failed
175
+ #
176
+ # @return [Google::Apis::PubsubliteV1::ListSubscriptionsResponse]
177
+ #
178
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
179
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
180
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
181
+ def list_admin_project_location_subscriptions(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
182
+ command = make_simple_command(:get, 'v1/admin/{+parent}/subscriptions', options)
183
+ command.response_representation = Google::Apis::PubsubliteV1::ListSubscriptionsResponse::Representation
184
+ command.response_class = Google::Apis::PubsubliteV1::ListSubscriptionsResponse
185
+ command.params['parent'] = parent unless parent.nil?
186
+ command.query['pageSize'] = page_size unless page_size.nil?
187
+ command.query['pageToken'] = page_token unless page_token.nil?
188
+ command.query['fields'] = fields unless fields.nil?
189
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
190
+ execute_or_queue_command(command, &block)
191
+ end
192
+
193
+ # Updates properties of the specified subscription.
194
+ # @param [String] name
195
+ # The name of the subscription. Structured like: projects/`project_number`/
196
+ # locations/`location`/subscriptions/`subscription_id`
197
+ # @param [Google::Apis::PubsubliteV1::Subscription] subscription_object
198
+ # @param [String] update_mask
199
+ # Required. A mask specifying the subscription fields to change.
200
+ # @param [String] fields
201
+ # Selector specifying which fields to include in a partial response.
202
+ # @param [String] quota_user
203
+ # Available to use for quota purposes for server-side applications. Can be any
204
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
205
+ # @param [Google::Apis::RequestOptions] options
206
+ # Request-specific options
207
+ #
208
+ # @yield [result, err] Result & error if block supplied
209
+ # @yieldparam result [Google::Apis::PubsubliteV1::Subscription] parsed result object
210
+ # @yieldparam err [StandardError] error object if request failed
211
+ #
212
+ # @return [Google::Apis::PubsubliteV1::Subscription]
213
+ #
214
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
215
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
216
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
217
+ def patch_admin_project_location_subscription(name, subscription_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
218
+ command = make_simple_command(:patch, 'v1/admin/{+name}', options)
219
+ command.request_representation = Google::Apis::PubsubliteV1::Subscription::Representation
220
+ command.request_object = subscription_object
221
+ command.response_representation = Google::Apis::PubsubliteV1::Subscription::Representation
222
+ command.response_class = Google::Apis::PubsubliteV1::Subscription
223
+ command.params['name'] = name unless name.nil?
224
+ command.query['updateMask'] = update_mask unless update_mask.nil?
225
+ command.query['fields'] = fields unless fields.nil?
226
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
227
+ execute_or_queue_command(command, &block)
228
+ end
229
+
230
+ # Creates a new topic.
231
+ # @param [String] parent
232
+ # Required. The parent location in which to create the topic. Structured like `
233
+ # projects/`project_number`/locations/`location``.
234
+ # @param [Google::Apis::PubsubliteV1::Topic] topic_object
235
+ # @param [String] topic_id
236
+ # Required. The ID to use for the topic, which will become the final component
237
+ # of the topic's name. This value is structured like: `my-topic-name`.
238
+ # @param [String] fields
239
+ # Selector specifying which fields to include in a partial response.
240
+ # @param [String] quota_user
241
+ # Available to use for quota purposes for server-side applications. Can be any
242
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
243
+ # @param [Google::Apis::RequestOptions] options
244
+ # Request-specific options
245
+ #
246
+ # @yield [result, err] Result & error if block supplied
247
+ # @yieldparam result [Google::Apis::PubsubliteV1::Topic] parsed result object
248
+ # @yieldparam err [StandardError] error object if request failed
249
+ #
250
+ # @return [Google::Apis::PubsubliteV1::Topic]
251
+ #
252
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
253
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
254
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
255
+ def create_admin_project_location_topic(parent, topic_object = nil, topic_id: nil, fields: nil, quota_user: nil, options: nil, &block)
256
+ command = make_simple_command(:post, 'v1/admin/{+parent}/topics', options)
257
+ command.request_representation = Google::Apis::PubsubliteV1::Topic::Representation
258
+ command.request_object = topic_object
259
+ command.response_representation = Google::Apis::PubsubliteV1::Topic::Representation
260
+ command.response_class = Google::Apis::PubsubliteV1::Topic
261
+ command.params['parent'] = parent unless parent.nil?
262
+ command.query['topicId'] = topic_id unless topic_id.nil?
263
+ command.query['fields'] = fields unless fields.nil?
264
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
265
+ execute_or_queue_command(command, &block)
266
+ end
267
+
268
+ # Deletes the specified topic.
269
+ # @param [String] name
270
+ # Required. The name of the topic to delete.
271
+ # @param [String] fields
272
+ # Selector specifying which fields to include in a partial response.
273
+ # @param [String] quota_user
274
+ # Available to use for quota purposes for server-side applications. Can be any
275
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
276
+ # @param [Google::Apis::RequestOptions] options
277
+ # Request-specific options
278
+ #
279
+ # @yield [result, err] Result & error if block supplied
280
+ # @yieldparam result [Google::Apis::PubsubliteV1::Empty] parsed result object
281
+ # @yieldparam err [StandardError] error object if request failed
282
+ #
283
+ # @return [Google::Apis::PubsubliteV1::Empty]
284
+ #
285
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
286
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
287
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
288
+ def delete_admin_project_location_topic(name, fields: nil, quota_user: nil, options: nil, &block)
289
+ command = make_simple_command(:delete, 'v1/admin/{+name}', options)
290
+ command.response_representation = Google::Apis::PubsubliteV1::Empty::Representation
291
+ command.response_class = Google::Apis::PubsubliteV1::Empty
292
+ command.params['name'] = name unless name.nil?
293
+ command.query['fields'] = fields unless fields.nil?
294
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
295
+ execute_or_queue_command(command, &block)
296
+ end
297
+
298
+ # Returns the topic configuration.
299
+ # @param [String] name
300
+ # Required. The name of the topic whose configuration to return.
301
+ # @param [String] fields
302
+ # Selector specifying which fields to include in a partial response.
303
+ # @param [String] quota_user
304
+ # Available to use for quota purposes for server-side applications. Can be any
305
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
306
+ # @param [Google::Apis::RequestOptions] options
307
+ # Request-specific options
308
+ #
309
+ # @yield [result, err] Result & error if block supplied
310
+ # @yieldparam result [Google::Apis::PubsubliteV1::Topic] parsed result object
311
+ # @yieldparam err [StandardError] error object if request failed
312
+ #
313
+ # @return [Google::Apis::PubsubliteV1::Topic]
314
+ #
315
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
316
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
317
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
318
+ def get_admin_project_location_topic(name, fields: nil, quota_user: nil, options: nil, &block)
319
+ command = make_simple_command(:get, 'v1/admin/{+name}', options)
320
+ command.response_representation = Google::Apis::PubsubliteV1::Topic::Representation
321
+ command.response_class = Google::Apis::PubsubliteV1::Topic
322
+ command.params['name'] = name unless name.nil?
323
+ command.query['fields'] = fields unless fields.nil?
324
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
325
+ execute_or_queue_command(command, &block)
326
+ end
327
+
328
+ # Returns the partition information for the requested topic.
329
+ # @param [String] name
330
+ # Required. The topic whose partition information to return.
331
+ # @param [String] fields
332
+ # Selector specifying which fields to include in a partial response.
333
+ # @param [String] quota_user
334
+ # Available to use for quota purposes for server-side applications. Can be any
335
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
336
+ # @param [Google::Apis::RequestOptions] options
337
+ # Request-specific options
338
+ #
339
+ # @yield [result, err] Result & error if block supplied
340
+ # @yieldparam result [Google::Apis::PubsubliteV1::TopicPartitions] parsed result object
341
+ # @yieldparam err [StandardError] error object if request failed
342
+ #
343
+ # @return [Google::Apis::PubsubliteV1::TopicPartitions]
344
+ #
345
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
346
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
347
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
348
+ def get_admin_project_location_topic_partitions(name, fields: nil, quota_user: nil, options: nil, &block)
349
+ command = make_simple_command(:get, 'v1/admin/{+name}/partitions', options)
350
+ command.response_representation = Google::Apis::PubsubliteV1::TopicPartitions::Representation
351
+ command.response_class = Google::Apis::PubsubliteV1::TopicPartitions
352
+ command.params['name'] = name unless name.nil?
353
+ command.query['fields'] = fields unless fields.nil?
354
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
355
+ execute_or_queue_command(command, &block)
356
+ end
357
+
358
+ # Returns the list of topics for the given project.
359
+ # @param [String] parent
360
+ # Required. The parent whose topics are to be listed. Structured like `projects/`
361
+ # project_number`/locations/`location``.
362
+ # @param [Fixnum] page_size
363
+ # The maximum number of topics to return. The service may return fewer than this
364
+ # value. If unset or zero, all topics for the parent will be returned.
365
+ # @param [String] page_token
366
+ # A page token, received from a previous `ListTopics` call. Provide this to
367
+ # retrieve the subsequent page. When paginating, all other parameters provided
368
+ # to `ListTopics` must match the call that provided the page token.
369
+ # @param [String] fields
370
+ # Selector specifying which fields to include in a partial response.
371
+ # @param [String] quota_user
372
+ # Available to use for quota purposes for server-side applications. Can be any
373
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
374
+ # @param [Google::Apis::RequestOptions] options
375
+ # Request-specific options
376
+ #
377
+ # @yield [result, err] Result & error if block supplied
378
+ # @yieldparam result [Google::Apis::PubsubliteV1::ListTopicsResponse] parsed result object
379
+ # @yieldparam err [StandardError] error object if request failed
380
+ #
381
+ # @return [Google::Apis::PubsubliteV1::ListTopicsResponse]
382
+ #
383
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
384
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
385
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
386
+ def list_admin_project_location_topics(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
387
+ command = make_simple_command(:get, 'v1/admin/{+parent}/topics', options)
388
+ command.response_representation = Google::Apis::PubsubliteV1::ListTopicsResponse::Representation
389
+ command.response_class = Google::Apis::PubsubliteV1::ListTopicsResponse
390
+ command.params['parent'] = parent unless parent.nil?
391
+ command.query['pageSize'] = page_size unless page_size.nil?
392
+ command.query['pageToken'] = page_token unless page_token.nil?
393
+ command.query['fields'] = fields unless fields.nil?
394
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
395
+ execute_or_queue_command(command, &block)
396
+ end
397
+
398
+ # Updates properties of the specified topic.
399
+ # @param [String] name
400
+ # The name of the topic. Structured like: projects/`project_number`/locations/`
401
+ # location`/topics/`topic_id`
402
+ # @param [Google::Apis::PubsubliteV1::Topic] topic_object
403
+ # @param [String] update_mask
404
+ # Required. A mask specifying the topic fields to change.
405
+ # @param [String] fields
406
+ # Selector specifying which fields to include in a partial response.
407
+ # @param [String] quota_user
408
+ # Available to use for quota purposes for server-side applications. Can be any
409
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
410
+ # @param [Google::Apis::RequestOptions] options
411
+ # Request-specific options
412
+ #
413
+ # @yield [result, err] Result & error if block supplied
414
+ # @yieldparam result [Google::Apis::PubsubliteV1::Topic] parsed result object
415
+ # @yieldparam err [StandardError] error object if request failed
416
+ #
417
+ # @return [Google::Apis::PubsubliteV1::Topic]
418
+ #
419
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
420
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
421
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
422
+ def patch_admin_project_location_topic(name, topic_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
423
+ command = make_simple_command(:patch, 'v1/admin/{+name}', options)
424
+ command.request_representation = Google::Apis::PubsubliteV1::Topic::Representation
425
+ command.request_object = topic_object
426
+ command.response_representation = Google::Apis::PubsubliteV1::Topic::Representation
427
+ command.response_class = Google::Apis::PubsubliteV1::Topic
428
+ command.params['name'] = name unless name.nil?
429
+ command.query['updateMask'] = update_mask unless update_mask.nil?
430
+ command.query['fields'] = fields unless fields.nil?
431
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
432
+ execute_or_queue_command(command, &block)
433
+ end
434
+
435
+ # Lists the subscriptions attached to the specified topic.
436
+ # @param [String] name
437
+ # Required. The name of the topic whose subscriptions to list.
438
+ # @param [Fixnum] page_size
439
+ # The maximum number of subscriptions to return. The service may return fewer
440
+ # than this value. If unset or zero, all subscriptions for the given topic will
441
+ # be returned.
442
+ # @param [String] page_token
443
+ # A page token, received from a previous `ListTopicSubscriptions` call. Provide
444
+ # this to retrieve the subsequent page. When paginating, all other parameters
445
+ # provided to `ListTopicSubscriptions` must match the call that provided the
446
+ # page token.
447
+ # @param [String] fields
448
+ # Selector specifying which fields to include in a partial response.
449
+ # @param [String] quota_user
450
+ # Available to use for quota purposes for server-side applications. Can be any
451
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
452
+ # @param [Google::Apis::RequestOptions] options
453
+ # Request-specific options
454
+ #
455
+ # @yield [result, err] Result & error if block supplied
456
+ # @yieldparam result [Google::Apis::PubsubliteV1::ListTopicSubscriptionsResponse] parsed result object
457
+ # @yieldparam err [StandardError] error object if request failed
458
+ #
459
+ # @return [Google::Apis::PubsubliteV1::ListTopicSubscriptionsResponse]
460
+ #
461
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
462
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
463
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
464
+ def list_admin_project_location_topic_subscriptions(name, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
465
+ command = make_simple_command(:get, 'v1/admin/{+name}/subscriptions', options)
466
+ command.response_representation = Google::Apis::PubsubliteV1::ListTopicSubscriptionsResponse::Representation
467
+ command.response_class = Google::Apis::PubsubliteV1::ListTopicSubscriptionsResponse
468
+ command.params['name'] = name unless name.nil?
469
+ command.query['pageSize'] = page_size unless page_size.nil?
470
+ command.query['pageToken'] = page_token unless page_token.nil?
471
+ command.query['fields'] = fields unless fields.nil?
472
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
473
+ execute_or_queue_command(command, &block)
474
+ end
475
+
476
+ # Returns all committed cursor information for a subscription.
477
+ # @param [String] parent
478
+ # Required. The subscription for which to retrieve cursors. Structured like `
479
+ # projects/`project_number`/locations/`location`/subscriptions/`subscription_id``
480
+ # .
481
+ # @param [Fixnum] page_size
482
+ # The maximum number of cursors to return. The service may return fewer than
483
+ # this value. If unset or zero, all cursors for the parent will be returned.
484
+ # @param [String] page_token
485
+ # A page token, received from a previous `ListPartitionCursors` call. Provide
486
+ # this to retrieve the subsequent page. When paginating, all other parameters
487
+ # provided to `ListPartitionCursors` must match the call that provided the page
488
+ # token.
489
+ # @param [String] fields
490
+ # Selector specifying which fields to include in a partial response.
491
+ # @param [String] quota_user
492
+ # Available to use for quota purposes for server-side applications. Can be any
493
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
494
+ # @param [Google::Apis::RequestOptions] options
495
+ # Request-specific options
496
+ #
497
+ # @yield [result, err] Result & error if block supplied
498
+ # @yieldparam result [Google::Apis::PubsubliteV1::ListPartitionCursorsResponse] parsed result object
499
+ # @yieldparam err [StandardError] error object if request failed
500
+ #
501
+ # @return [Google::Apis::PubsubliteV1::ListPartitionCursorsResponse]
502
+ #
503
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
504
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
505
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
506
+ def list_cursor_project_location_subscription_cursors(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
507
+ command = make_simple_command(:get, 'v1/cursor/{+parent}/cursors', options)
508
+ command.response_representation = Google::Apis::PubsubliteV1::ListPartitionCursorsResponse::Representation
509
+ command.response_class = Google::Apis::PubsubliteV1::ListPartitionCursorsResponse
510
+ command.params['parent'] = parent unless parent.nil?
511
+ command.query['pageSize'] = page_size unless page_size.nil?
512
+ command.query['pageToken'] = page_token unless page_token.nil?
513
+ command.query['fields'] = fields unless fields.nil?
514
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
515
+ execute_or_queue_command(command, &block)
516
+ end
517
+
518
+ # Compute statistics about a range of messages in a given topic and partition.
519
+ # @param [String] topic
520
+ # Required. The topic for which we should compute message stats.
521
+ # @param [Google::Apis::PubsubliteV1::ComputeMessageStatsRequest] compute_message_stats_request_object
522
+ # @param [String] fields
523
+ # Selector specifying which fields to include in a partial response.
524
+ # @param [String] quota_user
525
+ # Available to use for quota purposes for server-side applications. Can be any
526
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
527
+ # @param [Google::Apis::RequestOptions] options
528
+ # Request-specific options
529
+ #
530
+ # @yield [result, err] Result & error if block supplied
531
+ # @yieldparam result [Google::Apis::PubsubliteV1::ComputeMessageStatsResponse] parsed result object
532
+ # @yieldparam err [StandardError] error object if request failed
533
+ #
534
+ # @return [Google::Apis::PubsubliteV1::ComputeMessageStatsResponse]
535
+ #
536
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
537
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
538
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
539
+ def compute_topic_message_stats(topic, compute_message_stats_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
540
+ command = make_simple_command(:post, 'v1/topicStats/{+topic}:computeMessageStats', options)
541
+ command.request_representation = Google::Apis::PubsubliteV1::ComputeMessageStatsRequest::Representation
542
+ command.request_object = compute_message_stats_request_object
543
+ command.response_representation = Google::Apis::PubsubliteV1::ComputeMessageStatsResponse::Representation
544
+ command.response_class = Google::Apis::PubsubliteV1::ComputeMessageStatsResponse
545
+ command.params['topic'] = topic unless topic.nil?
546
+ command.query['fields'] = fields unless fields.nil?
547
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
548
+ execute_or_queue_command(command, &block)
549
+ end
550
+
551
+ protected
552
+
553
+ def apply_command_defaults(command)
554
+ command.query['key'] = key unless key.nil?
555
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
556
+ end
557
+ end
558
+ end
559
+ end
560
+ end