Reference documentation and code samples for the Essential Contacts V1 API class Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.
Client for the EssentialContactsService service.
Manages contacts for important Google Cloud notifications.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the EssentialContactsService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all EssentialContactsService clients ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.configure do |config| config.timeout = 10.0 end
#compute_contacts
def compute_contacts(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>
def compute_contacts(parent: nil, notification_categories: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>
Lists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.
def compute_contacts(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>
compute_contacts
via a request object, either of type
ComputeContactsRequest or an equivalent Hash.
- request (::Google::Cloud::EssentialContacts::V1::ComputeContactsRequest, ::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 compute_contacts(parent: nil, notification_categories: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>
compute_contacts
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).
- parent (::String) — Required. The name of the resource to compute contacts for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}
- notification_categories (::Array<::Google::Cloud::EssentialContacts::V1::NotificationCategory>) — The categories of notifications to compute contacts for. If ALL is included in this list, contacts subscribed to any notification category will be returned.
-
page_size (::Integer) — Optional. The maximum number of results to return from this request.
Non-positive values are ignored. The presence of
next_page_token
in the response indicates that more results might be available. If not specified, the default page_size is 100. -
page_token (::String) — Optional. If present, retrieves the next batch of results from the
preceding call to this method.
page_token
must be the value ofnext_page_token
from the previous response. The values of other method parameters should be identical to those in the previous call.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/essential_contacts/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::EssentialContacts::V1::ComputeContactsRequest.new # Call the compute_contacts method. result = client.compute_contacts 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::EssentialContacts::V1::Contact. p item end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the EssentialContactsService 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_contact
def create_contact(request, options = nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
def create_contact(parent: nil, contact: nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
Adds a new contact for a resource.
def create_contact(request, options = nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
create_contact
via a request object, either of type
CreateContactRequest or an equivalent Hash.
- request (::Google::Cloud::EssentialContacts::V1::CreateContactRequest, ::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 create_contact(parent: nil, contact: nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
create_contact
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).
- parent (::String) — Required. The resource to save this contact for. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}
- contact (::Google::Cloud::EssentialContacts::V1::Contact, ::Hash) — Required. The contact to create. Must specify an email address and language tag.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::EssentialContacts::V1::Contact)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/essential_contacts/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::EssentialContacts::V1::CreateContactRequest.new # Call the create_contact method. result = client.create_contact request # The returned object is of type Google::Cloud::EssentialContacts::V1::Contact. p result
#delete_contact
def delete_contact(request, options = nil) -> ::Google::Protobuf::Empty
def delete_contact(name: nil) -> ::Google::Protobuf::Empty
Deletes a contact.
def delete_contact(request, options = nil) -> ::Google::Protobuf::Empty
delete_contact
via a request object, either of type
DeleteContactRequest or an equivalent Hash.
- request (::Google::Cloud::EssentialContacts::V1::DeleteContactRequest, ::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 delete_contact(name: nil) -> ::Google::Protobuf::Empty
delete_contact
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).
- name (::String) — Required. The name of the contact to delete. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/essential_contacts/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::EssentialContacts::V1::DeleteContactRequest.new # Call the delete_contact method. result = client.delete_contact request # The returned object is of type Google::Protobuf::Empty. p result
#get_contact
def get_contact(request, options = nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
def get_contact(name: nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
Gets a single contact.
def get_contact(request, options = nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
get_contact
via a request object, either of type
GetContactRequest or an equivalent Hash.
- request (::Google::Cloud::EssentialContacts::V1::GetContactRequest, ::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_contact(name: nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
get_contact
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).
- name (::String) — Required. The name of the contact to retrieve. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::EssentialContacts::V1::Contact)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/essential_contacts/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::EssentialContacts::V1::GetContactRequest.new # Call the get_contact method. result = client.get_contact request # The returned object is of type Google::Cloud::EssentialContacts::V1::Contact. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new EssentialContactsService client object.
- (config) — Configure the EssentialContactsService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new do |config| config.timeout = 10.0 end
#list_contacts
def list_contacts(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>
def list_contacts(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>
Lists the contacts that have been set on a resource.
def list_contacts(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>
list_contacts
via a request object, either of type
ListContactsRequest or an equivalent Hash.
- request (::Google::Cloud::EssentialContacts::V1::ListContactsRequest, ::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_contacts(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>
list_contacts
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).
- parent (::String) — Required. The parent resource name. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}
-
page_size (::Integer) — Optional. The maximum number of results to return from this request.
Non-positive values are ignored. The presence of
next_page_token
in the response indicates that more results might be available. If not specified, the default page_size is 100. -
page_token (::String) — Optional. If present, retrieves the next batch of results from the
preceding call to this method.
page_token
must be the value ofnext_page_token
from the previous response. The values of other method parameters should be identical to those in the previous call.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::EssentialContacts::V1::Contact>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/essential_contacts/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::EssentialContacts::V1::ListContactsRequest.new # Call the list_contacts method. result = client.list_contacts 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::EssentialContacts::V1::Contact. p item end
#logger
def logger() -> Logger
The logger used for request/response debug logging.
- (Logger)
#send_test_message
def send_test_message(request, options = nil) -> ::Google::Protobuf::Empty
def send_test_message(contacts: nil, resource: nil, notification_category: nil) -> ::Google::Protobuf::Empty
Allows a contact admin to send a test message to contact to verify that it has been configured correctly.
def send_test_message(request, options = nil) -> ::Google::Protobuf::Empty
send_test_message
via a request object, either of type
SendTestMessageRequest or an equivalent Hash.
- request (::Google::Cloud::EssentialContacts::V1::SendTestMessageRequest, ::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 send_test_message(contacts: nil, resource: nil, notification_category: nil) -> ::Google::Protobuf::Empty
send_test_message
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).
- contacts (::Array<::String>) — Required. The list of names of the contacts to send a test message to. Format: organizations/{organization_id}/contacts/{contact_id}, folders/{folder_id}/contacts/{contact_id} or projects/{project_id}/contacts/{contact_id}
- resource (::String) — Required. The name of the resource to send the test message for. All contacts must either be set directly on this resource or inherited from another resource that is an ancestor of this one. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}
- notification_category (::Google::Cloud::EssentialContacts::V1::NotificationCategory) — Required. The notification category to send the test message for. All contacts must be subscribed to this category.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/essential_contacts/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::EssentialContacts::V1::SendTestMessageRequest.new # Call the send_test_message method. result = client.send_test_message request # The returned object is of type Google::Protobuf::Empty. p result
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)
#update_contact
def update_contact(request, options = nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
def update_contact(contact: nil, update_mask: nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
Updates a contact. Note: A contact's email address cannot be changed.
def update_contact(request, options = nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
update_contact
via a request object, either of type
UpdateContactRequest or an equivalent Hash.
- request (::Google::Cloud::EssentialContacts::V1::UpdateContactRequest, ::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_contact(contact: nil, update_mask: nil) -> ::Google::Cloud::EssentialContacts::V1::Contact
update_contact
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).
- contact (::Google::Cloud::EssentialContacts::V1::Contact, ::Hash) — Required. The contact resource to replace the existing saved contact. Note: the email address of the contact cannot be modified.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. The update mask applied to the resource. For the
FieldMask
definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::EssentialContacts::V1::Contact)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/essential_contacts/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::EssentialContacts::V1::UpdateContactRequest.new # Call the update_contact method. result = client.update_contact request # The returned object is of type Google::Cloud::EssentialContacts::V1::Contact. p result