Class: Google::Apis::MerchantapiReviewsV1beta::MerchantService

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

Overview

Merchant API

Programmatically manage your Merchant Center Accounts.

Examples:

require 'google/apis/merchantapi_reviews_v1beta'

Merchantapi = Google::Apis::MerchantapiReviewsV1beta # Alias the module
service = Merchantapi::MerchantService.new

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMerchantService

Returns a new instance of MerchantService.



47
48
49
50
51
52
# File 'lib/google/apis/merchantapi_reviews_v1beta/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-merchantapi_reviews_v1beta',
        client_version: Google::Apis::MerchantapiReviewsV1beta::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/merchantapi_reviews_v1beta/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/merchantapi_reviews_v1beta/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#delete_account_merchant_review(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiReviewsV1beta::Empty

Deletes merchant review.

Parameters:

  • name (String)

    Required. The ID of the merchant review. Format: accounts/account/ merchantReviews/merchantReview

  • 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



75
76
77
78
79
80
81
82
83
# File 'lib/google/apis/merchantapi_reviews_v1beta/service.rb', line 75

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'reviews/v1beta/{+name}', options)
  command.response_representation = Google::Apis::MerchantapiReviewsV1beta::Empty::Representation
  command.response_class = Google::Apis::MerchantapiReviewsV1beta::Empty
  command.params['name'] = name unless name.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_account_product_review(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiReviewsV1beta::Empty

Deletes a product review.

Parameters:

  • name (String)

    Required. The ID of the Product review. Format: accounts/account/ productReviews/productReview

  • 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



218
219
220
221
222
223
224
225
226
# File 'lib/google/apis/merchantapi_reviews_v1beta/service.rb', line 218

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'reviews/v1beta/{+name}', options)
  command.response_representation = Google::Apis::MerchantapiReviewsV1beta::Empty::Representation
  command.response_class = Google::Apis::MerchantapiReviewsV1beta::Empty
  command.params['name'] = name unless name.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_account_merchant_review(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiReviewsV1beta::MerchantReview

Gets a merchant review.

Parameters:

  • name (String)

    Required. The ID of the merchant review. Format: accounts/account/ merchantReviews/merchantReview

  • 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



106
107
108
109
110
111
112
113
114
# File 'lib/google/apis/merchantapi_reviews_v1beta/service.rb', line 106

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'reviews/v1beta/{+name}', options)
  command.response_representation = Google::Apis::MerchantapiReviewsV1beta::MerchantReview::Representation
  command.response_class = Google::Apis::MerchantapiReviewsV1beta::MerchantReview
  command.params['name'] = name unless name.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_account_product_review(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiReviewsV1beta::ProductReview

Gets a product review.

Parameters:

  • name (String)

    Required. The ID of the merchant review. Format: accounts/account/ productReviews/productReview

  • 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



249
250
251
252
253
254
255
256
257
# File 'lib/google/apis/merchantapi_reviews_v1beta/service.rb', line 249

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'reviews/v1beta/{+name}', options)
  command.response_representation = Google::Apis::MerchantapiReviewsV1beta::ProductReview::Representation
  command.response_class = Google::Apis::MerchantapiReviewsV1beta::ProductReview
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#insert_account_merchant_review(parent, merchant_review_object = nil, data_source: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiReviewsV1beta::MerchantReview

Inserts a review for your Merchant Center account. If the review already exists, then the review is replaced with the new instance.

Parameters:

  • parent (String)

    Required. The account where the merchant review will be inserted. Format: accounts/account

  • merchant_review_object (Google::Apis::MerchantapiReviewsV1beta::MerchantReview) (defaults to: nil)
  • data_source (String) (defaults to: nil)

    Required. The data source of the merchantreview Format: accounts/ account/dataSources/datasource``.

  • 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
152
153
154
# File 'lib/google/apis/merchantapi_reviews_v1beta/service.rb', line 143

def (parent, merchant_review_object = nil, data_source: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'reviews/v1beta/{+parent}/merchantReviews:insert', options)
  command.request_representation = Google::Apis::MerchantapiReviewsV1beta::MerchantReview::Representation
  command.request_object = merchant_review_object
  command.response_representation = Google::Apis::MerchantapiReviewsV1beta::MerchantReview::Representation
  command.response_class = Google::Apis::MerchantapiReviewsV1beta::MerchantReview
  command.params['parent'] = parent unless parent.nil?
  command.query['dataSource'] = data_source unless data_source.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#insert_account_product_review(parent, product_review_object = nil, data_source: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiReviewsV1beta::ProductReview

Inserts a product review.

Parameters:

  • parent (String)

    Required. The account where the product review will be inserted. Format: accounts/account

  • product_review_object (Google::Apis::MerchantapiReviewsV1beta::ProductReview) (defaults to: nil)
  • data_source (String) (defaults to: nil)

    Required. Format: accounts/account/dataSources/datasource``.

  • 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



283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/google/apis/merchantapi_reviews_v1beta/service.rb', line 283

def (parent, product_review_object = nil, data_source: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'reviews/v1beta/{+parent}/productReviews:insert', options)
  command.request_representation = Google::Apis::MerchantapiReviewsV1beta::ProductReview::Representation
  command.request_object = product_review_object
  command.response_representation = Google::Apis::MerchantapiReviewsV1beta::ProductReview::Representation
  command.response_class = Google::Apis::MerchantapiReviewsV1beta::ProductReview
  command.params['parent'] = parent unless parent.nil?
  command.query['dataSource'] = data_source unless data_source.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_account_merchant_reviews(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiReviewsV1beta::ListMerchantReviewsResponse

Lists merchant reviews.

Parameters:

  • parent (String)

    Required. The account to list merchant reviews for. Format: accounts/account

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of merchant reviews to return. The service can return fewer than this value. The maximum value is 1000; values above 1000 are coerced to 1000. If unspecified, the maximum number of reviews is returned.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous ListMerchantReviews call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListMerchantReviews must match the call that provided the page token.

  • 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



185
186
187
188
189
190
191
192
193
194
195
# File 'lib/google/apis/merchantapi_reviews_v1beta/service.rb', line 185

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'reviews/v1beta/{+parent}/merchantReviews', options)
  command.response_representation = Google::Apis::MerchantapiReviewsV1beta::ListMerchantReviewsResponse::Representation
  command.response_class = Google::Apis::MerchantapiReviewsV1beta::ListMerchantReviewsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.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_account_product_reviews(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiReviewsV1beta::ListProductReviewsResponse

Lists product reviews.

Parameters:

  • parent (String)

    Required. The account to list product reviews for. Format: accounts/account

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of products to return. The service may return fewer than this value.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous ListProductReviews call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListProductReviews must match the call that provided the page token.

  • 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



324
325
326
327
328
329
330
331
332
333
334
# File 'lib/google/apis/merchantapi_reviews_v1beta/service.rb', line 324

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'reviews/v1beta/{+parent}/productReviews', options)
  command.response_representation = Google::Apis::MerchantapiReviewsV1beta::ListProductReviewsResponse::Representation
  command.response_class = Google::Apis::MerchantapiReviewsV1beta::ListProductReviewsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end