Advisory Notifications V1 API - Class Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client (v0.6.0)

Reference documentation and code samples for the Advisory Notifications V1 API class Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.

Client for the AdvisoryNotificationsService service.

Service to manage Security and Privacy Notifications.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the AdvisoryNotificationsService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all AdvisoryNotificationsService clients
::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the AdvisoryNotificationsService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#get_notification

def get_notification(request, options = nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Notification
def get_notification(name: nil, language_code: nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Notification

Gets a notification.

Overloads
def get_notification(request, options = nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Notification
Pass arguments to get_notification via a request object, either of type GetNotificationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AdvisoryNotifications::V1::GetNotificationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_notification(name: nil, language_code: nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Notification
Pass arguments to get_notification via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. A name of the notification to retrieve. Format: organizations/{organization}/locations/{location}/notifications/{notification}.
  • language_code (::String) — 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/advisory_notifications/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AdvisoryNotifications::V1::GetNotificationRequest.new

# Call the get_notification method.
result = client.get_notification request

# The returned object is of type Google::Cloud::AdvisoryNotifications::V1::Notification.
p result

#get_settings

def get_settings(request, options = nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Settings
def get_settings(name: nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Settings

Get notification settings.

Overloads
def get_settings(request, options = nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Settings
Pass arguments to get_settings via a request object, either of type GetSettingsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AdvisoryNotifications::V1::GetSettingsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_settings(name: nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Settings
Pass arguments to get_settings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the settings to retrieve. Format: organizations/{organization}/locations/{location}/settings.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/advisory_notifications/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AdvisoryNotifications::V1::GetSettingsRequest.new

# Call the get_settings method.
result = client.get_settings request

# The returned object is of type Google::Cloud::AdvisoryNotifications::V1::Settings.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new AdvisoryNotificationsService client object.

Yields
  • (config) — Configure the AdvisoryNotificationsService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new do |config|
  config.timeout = 10.0
end

#list_notifications

def list_notifications(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AdvisoryNotifications::V1::Notification>
def list_notifications(parent: nil, page_size: nil, page_token: nil, view: nil, language_code: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AdvisoryNotifications::V1::Notification>

Lists notifications under a given parent.

Overloads
def list_notifications(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AdvisoryNotifications::V1::Notification>
Pass arguments to list_notifications via a request object, either of type ListNotificationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AdvisoryNotifications::V1::ListNotificationsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_notifications(parent: nil, page_size: nil, page_token: nil, view: nil, language_code: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AdvisoryNotifications::V1::Notification>
Pass arguments to list_notifications via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent, which owns this collection of notifications. Must be of the form "organizations/{organization}/locations/{location}".
  • page_size (::Integer) — 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) — 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 (::Google::Cloud::AdvisoryNotifications::V1::NotificationView) — Specifies which parts of the notification resource should be returned in the response.
  • language_code (::String) — 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/advisory_notifications/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AdvisoryNotifications::V1::ListNotificationsRequest.new

# Call the list_notifications method.
result = client.list_notifications request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::AdvisoryNotifications::V1::Notification.
  p item
end

#update_settings

def update_settings(request, options = nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Settings
def update_settings(settings: nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Settings

Update notification settings.

Overloads
def update_settings(request, options = nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Settings
Pass arguments to update_settings via a request object, either of type UpdateSettingsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AdvisoryNotifications::V1::UpdateSettingsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_settings(settings: nil) -> ::Google::Cloud::AdvisoryNotifications::V1::Settings
Pass arguments to update_settings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/advisory_notifications/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AdvisoryNotifications::V1::UpdateSettingsRequest.new

# Call the update_settings method.
result = client.update_settings request

# The returned object is of type Google::Cloud::AdvisoryNotifications::V1::Settings.
p result