Class EssentialContactsServiceClient (2.24.0)

Manages contacts for important Google Cloud notifications.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

EssentialContactsServiceClient(EssentialContactsServiceClient const &)

Copy and move support

Parameter
Name Description
EssentialContactsServiceClient const &

EssentialContactsServiceClient(EssentialContactsServiceClient &&)

Copy and move support

Parameter
Name Description
EssentialContactsServiceClient &&

EssentialContactsServiceClient(std::shared_ptr< EssentialContactsServiceConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< EssentialContactsServiceConnection >
opts Options

Operators

operator=(EssentialContactsServiceClient const &)

Copy and move support

Parameter
Name Description
EssentialContactsServiceClient const &
Returns
Type Description
EssentialContactsServiceClient &

operator=(EssentialContactsServiceClient &&)

Copy and move support

Parameter
Name Description
EssentialContactsServiceClient &&
Returns
Type Description
EssentialContactsServiceClient &

Functions

CreateContact(std::string const &, google::cloud::essentialcontacts::v1::Contact const &, Options)

Adds a new contact for a resource.

Parameters
Name Description
parent std::string const &

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 const &

Required. The contact to create. Must specify an email address and language tag.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::essentialcontacts::v1::Contact >

the result of the RPC. The response message type (google.cloud.essentialcontacts.v1.Contact) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateContact(google::cloud::essentialcontacts::v1::CreateContactRequest const &, Options)

Adds a new contact for a resource.

Parameters
Name Description
request google::cloud::essentialcontacts::v1::CreateContactRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.essentialcontacts.v1.CreateContactRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::essentialcontacts::v1::Contact >

the result of the RPC. The response message type (google.cloud.essentialcontacts.v1.Contact) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateContact(google::cloud::essentialcontacts::v1::Contact const &, google::protobuf::FieldMask const &, Options)

Updates a contact.

Note: A contact's email address cannot be changed.

Parameters
Name Description
contact google::cloud::essentialcontacts::v1::Contact const &

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 const &

Optional. The update mask applied to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::essentialcontacts::v1::Contact >

the result of the RPC. The response message type (google.cloud.essentialcontacts.v1.Contact) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateContact(google::cloud::essentialcontacts::v1::UpdateContactRequest const &, Options)

Updates a contact.

Note: A contact's email address cannot be changed.

Parameters
Name Description
request google::cloud::essentialcontacts::v1::UpdateContactRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.essentialcontacts.v1.UpdateContactRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::essentialcontacts::v1::Contact >

the result of the RPC. The response message type (google.cloud.essentialcontacts.v1.Contact) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListContacts(std::string const &, Options)

Lists the contacts that have been set on a resource.

Parameters
Name Description
parent std::string const &

Required. The parent resource name. Format: organizations/{organization_id}, folders/{folder_id} or projects/{project_id}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::essentialcontacts::v1::Contact >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.essentialcontacts.v1.Contact, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListContacts(google::cloud::essentialcontacts::v1::ListContactsRequest, Options)

Lists the contacts that have been set on a resource.

Parameters
Name Description
request google::cloud::essentialcontacts::v1::ListContactsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.essentialcontacts.v1.ListContactsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::essentialcontacts::v1::Contact >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.essentialcontacts.v1.Contact, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetContact(std::string const &, Options)

Gets a single contact.

Parameters
Name Description
name std::string const &

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}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::essentialcontacts::v1::Contact >

the result of the RPC. The response message type (google.cloud.essentialcontacts.v1.Contact) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetContact(google::cloud::essentialcontacts::v1::GetContactRequest const &, Options)

Gets a single contact.

Parameters
Name Description
request google::cloud::essentialcontacts::v1::GetContactRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.essentialcontacts.v1.GetContactRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::essentialcontacts::v1::Contact >

the result of the RPC. The response message type (google.cloud.essentialcontacts.v1.Contact) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

DeleteContact(std::string const &, Options)

Deletes a contact.

Parameters
Name Description
name std::string const &

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}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteContact(google::cloud::essentialcontacts::v1::DeleteContactRequest const &, Options)

Deletes a contact.

Parameters
Name Description
request google::cloud::essentialcontacts::v1::DeleteContactRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.essentialcontacts.v1.DeleteContactRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

ComputeContacts(google::cloud::essentialcontacts::v1::ComputeContactsRequest, Options)

Lists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.

Parameters
Name Description
request google::cloud::essentialcontacts::v1::ComputeContactsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.essentialcontacts.v1.ComputeContactsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::essentialcontacts::v1::Contact >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.essentialcontacts.v1.Contact, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

SendTestMessage(google::cloud::essentialcontacts::v1::SendTestMessageRequest const &, Options)

Allows a contact admin to send a test message to contact to verify that it has been configured correctly.

Parameters
Name Description
request google::cloud::essentialcontacts::v1::SendTestMessageRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.essentialcontacts.v1.SendTestMessageRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.