Class: Google::Apis::AdvisorynotificationsV1::AdvisorynotificationsService

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

Overview

Advisory Notifications API

An API for accessing Advisory Notifications in Google Cloud

Examples:

require 'google/apis/advisorynotifications_v1'

Advisorynotifications = Google::Apis::AdvisorynotificationsV1 # Alias the module
service = Advisorynotifications::AdvisorynotificationsService.new

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAdvisorynotificationsService

Returns a new instance of AdvisorynotificationsService.



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

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

def quota_user
  @quota_user
end

Instance Method Details

#get_organization_location_notification(name, language_code: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Notification

Gets a notification.

Parameters:

  • name (String)

    Required. A name of the notification to retrieve. Format: organizations/ organization/locations/location/notifications/notification or projects/ projects/locations/location/notifications/notification.

  • language_code (String) (defaults to: nil)

    ISO code for requested localization language. If unset, will be interpereted as "en". If the requested language is valid, but not supported for this notification, English will be returned with an "Not applicable" LocalizationState. If the ISO code is invalid (i.e. not a real language), this RPC will throw an error.

  • 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



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

def get_organization_location_notification(name, language_code: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Notification::Representation
  command.response_class = Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Notification
  command.params['name'] = name unless name.nil?
  command.query['languageCode'] = language_code unless language_code.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_organization_location_settings(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Settings

Get notification settings.

Parameters:

  • name (String)

    Required. The resource name of the settings to retrieve. Format: organizations/ organization/locations/location/settings.

  • 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/advisorynotifications_v1/service.rb', line 75

def get_organization_location_settings(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Settings::Representation
  command.response_class = Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Settings
  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_project_location_notification(name, language_code: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Notification

Gets a notification.

Parameters:

  • name (String)

    Required. A name of the notification to retrieve. Format: organizations/ organization/locations/location/notifications/notification or projects/ projects/locations/location/notifications/notification.

  • language_code (String) (defaults to: nil)

    ISO code for requested localization language. If unset, will be interpereted as "en". If the requested language is valid, but not supported for this notification, English will be returned with an "Not applicable" LocalizationState. If the ISO code is invalid (i.e. not a real language), this RPC will throw an error.

  • 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



239
240
241
242
243
244
245
246
247
248
# File 'lib/google/apis/advisorynotifications_v1/service.rb', line 239

def get_project_location_notification(name, language_code: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Notification::Representation
  command.response_class = Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Notification
  command.params['name'] = name unless name.nil?
  command.query['languageCode'] = language_code unless language_code.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_organization_location_notifications(parent, language_code: nil, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1ListNotificationsResponse

Lists notifications under a given parent.

Parameters:

  • parent (String)

    Required. The parent, which owns this collection of notifications. Must be of the form "organizations/organization/locations/location" or "projects/ project/locations/location"

  • language_code (String) (defaults to: nil)

    ISO code for requested localization language. If unset, will be interpereted as "en". If the requested language is valid, but not supported for this notification, English will be returned with an "Not applicable" LocalizationState. If the ISO code is invalid (i.e. not a real language), this RPC will throw an error.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of notifications to return. The service may return fewer than this value. If unspecified or equal to 0, at most 50 notifications will be returned. The maximum value is 50; values above 50 will be coerced to 50.

  • page_token (String) (defaults to: nil)

    A page token returned from a previous request. When paginating, all other parameters provided in the request must match the call that returned the page token.

  • view (String) (defaults to: nil)

    Specifies which parts of the notification resource should be returned in the response.

  • 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



197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/google/apis/advisorynotifications_v1/service.rb', line 197

def list_organization_location_notifications(parent, language_code: nil, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/notifications', options)
  command.response_representation = Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1ListNotificationsResponse::Representation
  command.response_class = Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1ListNotificationsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['view'] = view unless view.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_project_location_notifications(parent, language_code: nil, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1ListNotificationsResponse

Lists notifications under a given parent.

Parameters:

  • parent (String)

    Required. The parent, which owns this collection of notifications. Must be of the form "organizations/organization/locations/location" or "projects/ project/locations/location"

  • language_code (String) (defaults to: nil)

    ISO code for requested localization language. If unset, will be interpereted as "en". If the requested language is valid, but not supported for this notification, English will be returned with an "Not applicable" LocalizationState. If the ISO code is invalid (i.e. not a real language), this RPC will throw an error.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of notifications to return. The service may return fewer than this value. If unspecified or equal to 0, at most 50 notifications will be returned. The maximum value is 50; values above 50 will be coerced to 50.

  • page_token (String) (defaults to: nil)

    A page token returned from a previous request. When paginating, all other parameters provided in the request must match the call that returned the page token.

  • view (String) (defaults to: nil)

    Specifies which parts of the notification resource should be returned in the response.

  • 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



289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/google/apis/advisorynotifications_v1/service.rb', line 289

def list_project_location_notifications(parent, language_code: nil, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/notifications', options)
  command.response_representation = Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1ListNotificationsResponse::Representation
  command.response_class = Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1ListNotificationsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['view'] = view unless view.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_organization_location_settings(name, google_cloud_advisorynotifications_v1_settings_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Settings

Update notification settings.

Parameters:

  • name (String)

    Identifier. The resource name of the settings to retrieve. Format: organizations/organization/locations/location/settings.

  • google_cloud_advisorynotifications_v1_settings_object (Google::Apis::AdvisorynotificationsV1::GoogleCloudAdvisorynotificationsV1Settings) (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



107
108
109
110
111
112
113
114
115
116
117
# File 'lib/google/apis/advisorynotifications_v1/service.rb', line 107

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