Class: Google::Apis::MerchantapiNotificationsV1beta::MerchantService

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

Overview

Merchant API

Programmatically manage your Merchant Center Accounts.

Examples:

require 'google/apis/merchantapi_notifications_v1beta'

Merchantapi = Google::Apis::MerchantapiNotificationsV1beta # 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_notifications_v1beta/service.rb', line 47

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

def quota_user
  @quota_user
end

Instance Method Details

#create_account_notificationsubscription(parent, notification_subscription_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription

Creates a notification subscription for a business. For standalone or subaccounts accounts, the business can create a subscription for self. For MCAs, the business can create a subscription for all managed accounts or for a specific subaccount. We will allow the following types of notification subscriptions to exist together (per business as a subscriber per event type):

  1. Subscription for all managed accounts + subscription for self. 2. Multiple " partial" subscriptions for managed accounts + subscription for self. we will not allow (per business as a subscriber per event type): 1. Multiple self subscriptions. 2. Multiple "all managed accounts" subscriptions. 3. "All managed accounts" subscription and partial subscriptions at the same time. 4. Multiple partial subscriptions for the same target account.

Parameters:

  • parent (String)

    Required. The merchant account that owns the new notification subscription. Format: accounts/account``

  • notification_subscription_object (Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription) (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



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/google/apis/merchantapi_notifications_v1beta/service.rb', line 86

def (parent, notification_subscription_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'notifications/v1beta/{+parent}/notificationsubscriptions', options)
  command.request_representation = Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription::Representation
  command.request_object = notification_subscription_object
  command.response_representation = Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription::Representation
  command.response_class = Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription
  command.params['parent'] = parent unless parent.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_notificationsubscription(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiNotificationsV1beta::Empty

Deletes a notification subscription for a merchant.

Parameters:

  • name (String)

    Required. The name of the notification subscription to be deleted.

  • 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



118
119
120
121
122
123
124
125
126
# File 'lib/google/apis/merchantapi_notifications_v1beta/service.rb', line 118

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'notifications/v1beta/{+name}', options)
  command.response_representation = Google::Apis::MerchantapiNotificationsV1beta::Empty::Representation
  command.response_class = Google::Apis::MerchantapiNotificationsV1beta::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_notificationsubscription(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription

Gets notification subscriptions for an account.

Parameters:

  • name (String)

    Required. The name of the notification subscription.

  • 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



148
149
150
151
152
153
154
155
156
# File 'lib/google/apis/merchantapi_notifications_v1beta/service.rb', line 148

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'notifications/v1beta/{+name}', options)
  command.response_representation = Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription::Representation
  command.response_class = Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription
  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

#list_account_notificationsubscriptions(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiNotificationsV1beta::ListNotificationSubscriptionsResponse

Gets all the notification subscriptions for a merchant.

Parameters:

  • parent (String)

    Required. The merchant account who owns the notification subscriptions. Format: accounts/account``

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of notification subscriptions to return in a page. The default value for page_size is 100. The maximum value is 200. Values above 200 will be coerced to 200.

  • page_token (String) (defaults to: nil)

    Token (if provided) to retrieve the subsequent page. All other parameters must match the original 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



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

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'notifications/v1beta/{+parent}/notificationsubscriptions', options)
  command.response_representation = Google::Apis::MerchantapiNotificationsV1beta::ListNotificationSubscriptionsResponse::Representation
  command.response_class = Google::Apis::MerchantapiNotificationsV1beta::ListNotificationSubscriptionsResponse
  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

#patch_account_notificationsubscription(name, notification_subscription_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription

Updates an existing notification subscription for a merchant.

Parameters:

  • name (String)

    Output only. The name of the notification configuration. Generated by the Content API upon creation of a new NotificationSubscription. The account represents the merchant ID of the merchant that owns the configuration. Format: accounts/account/notificationsubscriptions/notification_subscription``

  • notification_subscription_object (Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    List of fields being updated.

  • 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



224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/google/apis/merchantapi_notifications_v1beta/service.rb', line 224

def (name, notification_subscription_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'notifications/v1beta/{+name}', options)
  command.request_representation = Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription::Representation
  command.request_object = notification_subscription_object
  command.response_representation = Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription::Representation
  command.response_class = Google::Apis::MerchantapiNotificationsV1beta::NotificationSubscription
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end