Class: Google::Apis::MybusinessnotificationsV1::MyBusinessNotificationSettingsService

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

Overview

My Business Notifications API

The My Business Notification Settings API enables managing notification settings for business accounts. Note - If you have a quota of 0 after enabling the API, please request for GBP API access.

Examples:

require 'google/apis/mybusinessnotifications_v1'

Mybusinessnotifications = Google::Apis::MybusinessnotificationsV1 # Alias the module
service = Mybusinessnotifications::MyBusinessNotificationSettingsService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMyBusinessNotificationSettingsService

Returns a new instance of MyBusinessNotificationSettingsService.

[View source]

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

def initialize
  super('https://mybusinessnotifications.googleapis.com/', '',
        client_name: 'google-apis-mybusinessnotifications_v1',
        client_version: Google::Apis::MybusinessnotificationsV1::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/mybusinessnotifications_v1/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/mybusinessnotifications_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#get_account_notification_setting(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessnotificationsV1::NotificationSetting

Returns the pubsub notification settings for the account.

Parameters:

  • name (String)

    Required. The resource name of the notification setting we are trying to fetch.

  • 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

[View source]

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

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

#update_account_notification_setting(name, notification_setting_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessnotificationsV1::NotificationSetting

Sets the pubsub notification setting for the account informing Google which topic to send pubsub notifications for. Use the notification_types field within notification_setting to manipulate the events an account wants to subscribe to. An account will only have one notification setting resource, and only one pubsub topic can be set. To delete the setting, update with an empty notification_types

Parameters:

  • name (String)

    Required. The resource name this setting is for. This is of the form accounts/ account_id/notificationSetting.

  • notification_setting_object (Google::Apis::MybusinessnotificationsV1::NotificationSetting) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. The specific fields that should be updated. The only editable field is notification_setting.

  • 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

[View source]

114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/google/apis/mybusinessnotifications_v1/service.rb', line 114

def (name, notification_setting_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::MybusinessnotificationsV1::NotificationSetting::Representation
  command.request_object = notification_setting_object
  command.response_representation = Google::Apis::MybusinessnotificationsV1::NotificationSetting::Representation
  command.response_class = Google::Apis::MybusinessnotificationsV1::NotificationSetting
  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