Class: Google::Apis::PubsubV1beta1a::PubsubService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::PubsubV1beta1a::PubsubService
- Defined in:
- lib/google/apis/pubsub_v1beta1a/service.rb
Overview
Cloud Pub/Sub API
Provides reliable, many-to-many, asynchronous messaging between applications.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://pubsub.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
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.
Constructor Details
#initialize ⇒ PubsubService
Returns a new instance of PubsubService.
47 48 49 50 51 52 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-pubsub_v1beta1a', client_version: Google::Apis::PubsubV1beta1a::GEM_VERSION) @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.
40 41 42 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 40 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.
45 46 47 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 45 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.
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 77 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.
111 112 113 114 115 116 117 118 119 120 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 111 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 'lib/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.
143 144 145 146 147 148 149 150 151 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 143 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.
398 399 400 401 402 403 404 405 406 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 398 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.
173 174 175 176 177 178 179 180 181 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 173 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.
430 431 432 433 434 435 436 437 438 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 430 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.
207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 207 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.
464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 464 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.
238 239 240 241 242 243 244 245 246 247 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 238 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.
271 272 273 274 275 276 277 278 279 280 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 271 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.
495 496 497 498 499 500 501 502 503 504 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 495 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.
526 527 528 529 530 531 532 533 534 535 |
# File 'lib/google/apis/pubsub_v1beta1a/service.rb', line 526 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 'lib/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 'lib/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 |