Class: Google::Apis::PubsubV1beta1a::PubsubService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::PubsubV1beta1a::PubsubService
- Defined in:
- generated/google/apis/pubsub_v1beta1a/service.rb
Overview
Google Cloud Pub/Sub API
Provides reliable, many-to-many, asynchronous messaging between applications.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#acknowledge_subscription(acknowledge_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription.
-
#create_subscription(subscription_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Subscription
Creates a subscription on a given topic for a given subscriber.
-
#create_topic(topic_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Topic
Creates the given topic with the given name.
-
#delete_subscription(subscription, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Deletes an existing subscription.
-
#delete_topic(topic, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Deletes the topic with the given name.
-
#get_subscription(subscription, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Subscription
Gets the configuration details of a subscription.
-
#get_topic(topic, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Topic
Gets the configuration of a topic.
-
#initialize ⇒ PubsubService
constructor
A new instance of PubsubService.
-
#list_subscriptions(max_results: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::ListSubscriptionsResponse
Lists matching subscriptions.
-
#list_topics(max_results: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::ListTopicsResponse
Lists matching topics.
-
#modify_subscription_ack_deadline(modify_ack_deadline_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Modifies the Ack deadline for a message received from a pull request.
-
#modify_subscription_push_config(modify_push_config_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Modifies the
PushConfig
for a specified subscription. -
#publish_topic(publish_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Adds a message to the topic.
-
#publish_topic_batch(publish_batch_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::PublishBatchResponse
Adds one or more messages to the topic.
-
#pull_subscription(pull_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::PullResponse
Pulls a single message from the server.
-
#pull_subscription_batch(pull_batch_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::PullBatchResponse
Pulls messages from the server.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ PubsubService
Returns a new instance of PubsubService
45 46 47 48 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 45 def initialize super('https://pubsub.googleapis.com/', '') @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
38 39 40 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 38 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
43 44 45 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 43 def quota_user @quota_user end |
Instance Method Details
#acknowledge_subscription(acknowledge_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.
73 74 75 76 77 78 79 80 81 82 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 73 def acknowledge_subscription(acknowledge_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta1a/subscriptions/acknowledge', ) command.request_representation = Google::Apis::PubsubV1beta1a::AcknowledgeRequest::Representation command.request_object = acknowledge_request_object command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation command.response_class = Google::Apis::PubsubV1beta1a::Empty command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_subscription(subscription_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Subscription
Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.
107 108 109 110 111 112 113 114 115 116 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 107 def create_subscription(subscription_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta1a/subscriptions', ) command.request_representation = Google::Apis::PubsubV1beta1a::Subscription::Representation command.request_object = subscription_object command.response_representation = Google::Apis::PubsubV1beta1a::Subscription::Representation command.response_class = Google::Apis::PubsubV1beta1a::Subscription command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_topic(topic_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Topic
Creates the given topic with the given name.
366 367 368 369 370 371 372 373 374 375 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 366 def create_topic(topic_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta1a/topics', ) command.request_representation = Google::Apis::PubsubV1beta1a::Topic::Representation command.request_object = topic_object command.response_representation = Google::Apis::PubsubV1beta1a::Topic::Representation command.response_class = Google::Apis::PubsubV1beta1a::Topic command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_subscription(subscription, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.
140 141 142 143 144 145 146 147 148 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 140 def delete_subscription(subscription, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1beta1a/subscriptions/{+subscription}', ) command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation command.response_class = Google::Apis::PubsubV1beta1a::Empty command.params['subscription'] = subscription unless subscription.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_topic(topic, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name.
399 400 401 402 403 404 405 406 407 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 399 def delete_topic(topic, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1beta1a/topics/{+topic}', ) command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation command.response_class = Google::Apis::PubsubV1beta1a::Empty command.params['topic'] = topic unless topic.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_subscription(subscription, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Subscription
Gets the configuration details of a subscription.
170 171 172 173 174 175 176 177 178 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 170 def get_subscription(subscription, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1beta1a/subscriptions/{+subscription}', ) command.response_representation = Google::Apis::PubsubV1beta1a::Subscription::Representation command.response_class = Google::Apis::PubsubV1beta1a::Subscription command.params['subscription'] = subscription unless subscription.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_topic(topic, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Topic
Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the future, they will be returned here.
431 432 433 434 435 436 437 438 439 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 431 def get_topic(topic, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1beta1a/topics/{+topic}', ) command.response_representation = Google::Apis::PubsubV1beta1a::Topic::Representation command.response_class = Google::Apis::PubsubV1beta1a::Topic command.params['topic'] = topic unless topic.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_subscriptions(max_results: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::ListSubscriptionsResponse
Lists matching subscriptions.
205 206 207 208 209 210 211 212 213 214 215 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 205 def list_subscriptions(max_results: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1beta1a/subscriptions', ) command.response_representation = Google::Apis::PubsubV1beta1a::ListSubscriptionsResponse::Representation command.response_class = Google::Apis::PubsubV1beta1a::ListSubscriptionsResponse command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['query'] = query unless query.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_topics(max_results: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::ListTopicsResponse
Lists matching topics.
466 467 468 469 470 471 472 473 474 475 476 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 466 def list_topics(max_results: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1beta1a/topics', ) command.response_representation = Google::Apis::PubsubV1beta1a::ListTopicsResponse::Representation command.response_class = Google::Apis::PubsubV1beta1a::ListTopicsResponse command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['query'] = query unless query.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#modify_subscription_ack_deadline(modify_ack_deadline_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Modifies the Ack deadline for a message received from a pull request.
236 237 238 239 240 241 242 243 244 245 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 236 def modify_subscription_ack_deadline(modify_ack_deadline_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta1a/subscriptions/modifyAckDeadline', ) command.request_representation = Google::Apis::PubsubV1beta1a::ModifyAckDeadlineRequest::Representation command.request_object = modify_ack_deadline_request_object command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation command.response_class = Google::Apis::PubsubV1beta1a::Empty command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#modify_subscription_push_config(modify_push_config_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Modifies the PushConfig
for a specified subscription.
This method can be used to suspend the flow of messages to an endpoint
by clearing the PushConfig
field in the request. Messages
will be accumulated for delivery even if no push configuration is
defined or while the configuration is modified.
270 271 272 273 274 275 276 277 278 279 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 270 def modify_subscription_push_config(modify_push_config_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta1a/subscriptions/modifyPushConfig', ) command.request_representation = Google::Apis::PubsubV1beta1a::ModifyPushConfigRequest::Representation command.request_object = modify_push_config_request_object command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation command.response_class = Google::Apis::PubsubV1beta1a::Empty command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#publish_topic(publish_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::Empty
Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.
498 499 500 501 502 503 504 505 506 507 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 498 def publish_topic(publish_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta1a/topics/publish', ) command.request_representation = Google::Apis::PubsubV1beta1a::PublishRequest::Representation command.request_object = publish_request_object command.response_representation = Google::Apis::PubsubV1beta1a::Empty::Representation command.response_class = Google::Apis::PubsubV1beta1a::Empty command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#publish_topic_batch(publish_batch_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::PublishBatchResponse
Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.
529 530 531 532 533 534 535 536 537 538 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 529 def publish_topic_batch(publish_batch_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta1a/topics/publishBatch', ) command.request_representation = Google::Apis::PubsubV1beta1a::PublishBatchRequest::Representation command.request_object = publish_batch_request_object command.response_representation = Google::Apis::PubsubV1beta1a::PublishBatchResponse::Representation command.response_class = Google::Apis::PubsubV1beta1a::PublishBatchResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#pull_subscription(pull_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::PullResponse
Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).
304 305 306 307 308 309 310 311 312 313 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 304 def pull_subscription(pull_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta1a/subscriptions/pull', ) command.request_representation = Google::Apis::PubsubV1beta1a::PullRequest::Representation command.request_object = pull_request_object command.response_representation = Google::Apis::PubsubV1beta1a::PullResponse::Representation command.response_class = Google::Apis::PubsubV1beta1a::PullResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#pull_subscription_batch(pull_batch_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::PubsubV1beta1a::PullBatchResponse
Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.
336 337 338 339 340 341 342 343 344 345 |
# File 'generated/google/apis/pubsub_v1beta1a/service.rb', line 336 def pull_subscription_batch(pull_batch_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1beta1a/subscriptions/pullBatch', ) command.request_representation = Google::Apis::PubsubV1beta1a::PullBatchRequest::Representation command.request_object = pull_batch_request_object command.response_representation = Google::Apis::PubsubV1beta1a::PullBatchResponse::Representation command.response_class = Google::Apis::PubsubV1beta1a::PullBatchResponse command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |