Class: Google::Apis::PubsubV1beta1a::PubsubService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/pubsub_v1beta1a/service.rb

Overview

Cloud Pub/Sub API

Provides reliable, many-to-many, asynchronous messaging between applications.

Examples:

require 'google/apis/pubsub_v1beta1a'

Pubsub = Google::Apis::PubsubV1beta1a # Alias the module
service = Pubsub::PubsubService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://pubsub.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePubsubService

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

#keyString

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.

Returns:

  • (String)

    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_userString

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.

Returns:

  • (String)

    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.

Parameters:

  • acknowledge_request_object (Google::Apis::PubsubV1beta1a::AcknowledgeRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • subscription_object (Google::Apis::PubsubV1beta1a::Subscription) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • topic_object (Google::Apis::PubsubV1beta1a::Topic) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • subscription (String)

    The subscription to delete.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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}', options)
  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.

Parameters:

  • topic (String)

    Name of the topic to delete.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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}', options)
  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.

Parameters:

  • subscription (String)

    The name of the subscription to get.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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}', options)
  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.

Parameters:

  • topic (String)

    The name of the topic to get.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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}', options)
  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.

Parameters:

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of subscriptions to return.

  • page_token (String) (defaults to: nil)

    The value obtained in the last ListSubscriptionsResponse for continuation.

  • query (String) (defaults to: nil)

    A valid label query expression.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of topics to return.

  • page_token (String) (defaults to: nil)

    The value obtained in the last ListTopicsResponse for continuation.

  • query (String) (defaults to: nil)

    A valid label query expression.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • modify_ack_deadline_request_object (Google::Apis::PubsubV1beta1a::ModifyAckDeadlineRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • modify_push_config_request_object (Google::Apis::PubsubV1beta1a::ModifyPushConfigRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • publish_request_object (Google::Apis::PubsubV1beta1a::PublishRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • publish_batch_request_object (Google::Apis::PubsubV1beta1a::PublishBatchRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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).

Parameters:

  • pull_request_object (Google::Apis::PubsubV1beta1a::PullRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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.

Parameters:

  • pull_batch_request_object (Google::Apis::PubsubV1beta1a::PullBatchRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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', options)
  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