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

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

Overview

Advisory Notifications API

Examples:

require 'google/apis/advisorynotifications_v1'

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

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAdvisorynotificationsService

Returns a new instance of AdvisorynotificationsService.



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

def initialize
  super('https://advisorynotifications.googleapis.com/', '',
        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.



38
39
40
# File 'lib/google/apis/advisorynotifications_v1/service.rb', line 38

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.



43
44
45
# File 'lib/google/apis/advisorynotifications_v1/service.rb', line 43

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.

  • 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



79
80
81
82
83
84
85
86
87
88
# File 'lib/google/apis/advisorynotifications_v1/service.rb', line 79

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

#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".

  • 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



128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/google/apis/advisorynotifications_v1/service.rb', line 128

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