Manages contacts for important Google Cloud notifications. v1
Package
@google-cloud/essential-contactsConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of EssentialContactsServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof gax.fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
essentialContactsServiceStub
essentialContactsServiceStub?: Promise<{
[name: string]: Function;
}>;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
close()
close(): Promise<void>;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns | |
---|---|
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
computeContacts(request, options)
computeContacts(request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, options?: CallOptions): Promise<[
protos.google.cloud.essentialcontacts.v1.IContact[],
protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest | null,
protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse
]>;
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 |
protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.essentialcontacts.v1.IContact[],
protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest | null,
protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
computeContacts(request, options, callback)
computeContacts(request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse | null | undefined, protos.google.cloud.essentialcontacts.v1.IContact>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse | null | undefined, protos.google.cloud.essentialcontacts.v1.IContact>
|
Returns | |
---|---|
Type | Description |
void |
computeContacts(request, callback)
computeContacts(request: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, callback: PaginationCallback<protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse | null | undefined, protos.google.cloud.essentialcontacts.v1.IContact>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest
|
callback |
PaginationCallback<protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, protos.google.cloud.essentialcontacts.v1.IComputeContactsResponse | null | undefined, protos.google.cloud.essentialcontacts.v1.IContact>
|
Returns | |
---|---|
Type | Description |
void |
computeContactsAsync(request, options)
computeContactsAsync(request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.essentialcontacts.v1.IContact>;
Equivalent to computeContacts
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.essentialcontacts.v1.IContact> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the resource to compute contacts for.
* Format: organizations/{organization_id},
* folders/{folder_id} or projects/{project_id}
*/
// const parent = 'abc123'
/**
* The categories of notifications to compute contacts for. If ALL is included
* in this list, contacts subscribed to any notification category will be
* returned.
*/
// const notificationCategories = 1234
/**
* 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.
*/
// const pageSize = 1234
/**
* Optional. If present, retrieves the next batch of results from the
* preceding call to this method. `page_token` must be the value of
* `next_page_token` from the previous response. The values of other method
* parameters should be identical to those in the previous call.
*/
// const pageToken = 'abc123'
// Imports the Essentialcontacts library
const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1;
// Instantiates a client
const essentialcontactsClient = new EssentialContactsServiceClient();
async function callComputeContacts() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await essentialcontactsClient.computeContactsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callComputeContacts();
computeContactsStream(request, options)
computeContactsStream(request?: protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IComputeContactsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
createContact(request, options)
createContact(request?: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, options?: CallOptions): Promise<[
protos.google.cloud.essentialcontacts.v1.IContact,
(protos.google.cloud.essentialcontacts.v1.ICreateContactRequest | undefined),
{} | undefined
]>;
Adds a new contact for a resource.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.ICreateContactRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.essentialcontacts.v1.IContact,
(protos.google.cloud.essentialcontacts.v1.ICreateContactRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource to save this contact for.
* Format: organizations/{organization_id}, folders/{folder_id} or
* projects/{project_id}
*/
// const parent = 'abc123'
/**
* Required. The contact to create. Must specify an email address and language
* tag.
*/
// const contact = {}
// Imports the Essentialcontacts library
const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1;
// Instantiates a client
const essentialcontactsClient = new EssentialContactsServiceClient();
async function callCreateContact() {
// Construct request
const request = {
parent,
contact,
};
// Run request
const response = await essentialcontactsClient.createContact(request);
console.log(response);
}
callCreateContact();
createContact(request, options, callback)
createContact(request: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, options: CallOptions, callback: Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.ICreateContactRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.ICreateContactRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.ICreateContactRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createContact(request, callback)
createContact(request: protos.google.cloud.essentialcontacts.v1.ICreateContactRequest, callback: Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.ICreateContactRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.ICreateContactRequest
|
callback |
Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.ICreateContactRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteContact(request, options)
deleteContact(request?: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest | undefined),
{} | undefined
]>;
Deletes a contact.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* 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}
*/
// const name = 'abc123'
// Imports the Essentialcontacts library
const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1;
// Instantiates a client
const essentialcontactsClient = new EssentialContactsServiceClient();
async function callDeleteContact() {
// Construct request
const request = {
name,
};
// Run request
const response = await essentialcontactsClient.deleteContact(request);
console.log(response);
}
callDeleteContact();
deleteContact(request, options, callback)
deleteContact(request: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteContact(request, callback)
deleteContact(request: protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.essentialcontacts.v1.IDeleteContactRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
folderContactPath(folder, contact)
folderContactPath(folder: string, contact: string): string;
Return a fully-qualified folderContact resource name string.
Parameters | |
---|---|
Name | Description |
folder |
string
|
contact |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
getContact(request, options)
getContact(request?: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, options?: CallOptions): Promise<[
protos.google.cloud.essentialcontacts.v1.IContact,
protos.google.cloud.essentialcontacts.v1.IGetContactRequest | undefined,
{} | undefined
]>;
Gets a single contact.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IGetContactRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.essentialcontacts.v1.IContact,
protos.google.cloud.essentialcontacts.v1.IGetContactRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* 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}
*/
// const name = 'abc123'
// Imports the Essentialcontacts library
const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1;
// Instantiates a client
const essentialcontactsClient = new EssentialContactsServiceClient();
async function callGetContact() {
// Construct request
const request = {
name,
};
// Run request
const response = await essentialcontactsClient.getContact(request);
console.log(response);
}
callGetContact();
getContact(request, options, callback)
getContact(request: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, options: CallOptions, callback: Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.IGetContactRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IGetContactRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.IGetContactRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getContact(request, callback)
getContact(request: protos.google.cloud.essentialcontacts.v1.IGetContactRequest, callback: Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.IGetContactRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IGetContactRequest
|
callback |
Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.IGetContactRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns | |
---|---|
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub. |
listContacts(request, options)
listContacts(request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, options?: CallOptions): Promise<[
protos.google.cloud.essentialcontacts.v1.IContact[],
protos.google.cloud.essentialcontacts.v1.IListContactsRequest | null,
protos.google.cloud.essentialcontacts.v1.IListContactsResponse
]>;
Lists the contacts that have been set on a resource.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IListContactsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.essentialcontacts.v1.IContact[],
protos.google.cloud.essentialcontacts.v1.IListContactsRequest | null,
protos.google.cloud.essentialcontacts.v1.IListContactsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listContacts(request, options, callback)
listContacts(request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.essentialcontacts.v1.IListContactsRequest, protos.google.cloud.essentialcontacts.v1.IListContactsResponse | null | undefined, protos.google.cloud.essentialcontacts.v1.IContact>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IListContactsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.essentialcontacts.v1.IListContactsRequest, protos.google.cloud.essentialcontacts.v1.IListContactsResponse | null | undefined, protos.google.cloud.essentialcontacts.v1.IContact>
|
Returns | |
---|---|
Type | Description |
void |
listContacts(request, callback)
listContacts(request: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, callback: PaginationCallback<protos.google.cloud.essentialcontacts.v1.IListContactsRequest, protos.google.cloud.essentialcontacts.v1.IListContactsResponse | null | undefined, protos.google.cloud.essentialcontacts.v1.IContact>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IListContactsRequest
|
callback |
PaginationCallback<protos.google.cloud.essentialcontacts.v1.IListContactsRequest, protos.google.cloud.essentialcontacts.v1.IListContactsResponse | null | undefined, protos.google.cloud.essentialcontacts.v1.IContact>
|
Returns | |
---|---|
Type | Description |
void |
listContactsAsync(request, options)
listContactsAsync(request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.essentialcontacts.v1.IContact>;
Equivalent to listContacts
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IListContactsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.essentialcontacts.v1.IContact> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource name.
* Format: organizations/{organization_id}, folders/{folder_id} or
* projects/{project_id}
*/
// const parent = 'abc123'
/**
* 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.
*/
// const pageSize = 1234
/**
* Optional. If present, retrieves the next batch of results from the
* preceding call to this method. `page_token` must be the value of
* `next_page_token` from the previous response. The values of other method
* parameters should be identical to those in the previous call.
*/
// const pageToken = 'abc123'
// Imports the Essentialcontacts library
const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1;
// Instantiates a client
const essentialcontactsClient = new EssentialContactsServiceClient();
async function callListContacts() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await essentialcontactsClient.listContactsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListContacts();
listContactsStream(request, options)
listContactsStream(request?: protos.google.cloud.essentialcontacts.v1.IListContactsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IListContactsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
matchContactFromFolderContactName(folderContactName)
matchContactFromFolderContactName(folderContactName: string): string | number;
Parse the contact from FolderContact resource.
Parameter | |
---|---|
Name | Description |
folderContactName |
string
A fully-qualified path representing folder_contact resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the contact. |
matchContactFromOrganizationContactName(organizationContactName)
matchContactFromOrganizationContactName(organizationContactName: string): string | number;
Parse the contact from OrganizationContact resource.
Parameter | |
---|---|
Name | Description |
organizationContactName |
string
A fully-qualified path representing organization_contact resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the contact. |
matchContactFromProjectContactName(projectContactName)
matchContactFromProjectContactName(projectContactName: string): string | number;
Parse the contact from ProjectContact resource.
Parameter | |
---|---|
Name | Description |
projectContactName |
string
A fully-qualified path representing project_contact resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the contact. |
matchFolderFromFolderContactName(folderContactName)
matchFolderFromFolderContactName(folderContactName: string): string | number;
Parse the folder from FolderContact resource.
Parameter | |
---|---|
Name | Description |
folderContactName |
string
A fully-qualified path representing folder_contact resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the folder. |
matchOrganizationFromOrganizationContactName(organizationContactName)
matchOrganizationFromOrganizationContactName(organizationContactName: string): string | number;
Parse the organization from OrganizationContact resource.
Parameter | |
---|---|
Name | Description |
organizationContactName |
string
A fully-qualified path representing organization_contact resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the organization. |
matchProjectFromProjectContactName(projectContactName)
matchProjectFromProjectContactName(projectContactName: string): string | number;
Parse the project from ProjectContact resource.
Parameter | |
---|---|
Name | Description |
projectContactName |
string
A fully-qualified path representing project_contact resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
Parameter | |
---|---|
Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
organizationContactPath(organization, contact)
organizationContactPath(organization: string, contact: string): string;
Return a fully-qualified organizationContact resource name string.
Parameters | |
---|---|
Name | Description |
organization |
string
|
contact |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectContactPath(project, contact)
projectContactPath(project: string, contact: string): string;
Return a fully-qualified projectContact resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
contact |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
Parameter | |
---|---|
Name | Description |
project |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
sendTestMessage(request, options)
sendTestMessage(request?: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest | undefined),
{} | undefined
]>;
Allows a contact admin to send a test message to contact to verify that it has been configured correctly.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* 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}
*/
// const contacts = 'abc123'
/**
* 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}
*/
// const resource = 'abc123'
/**
* Required. The notification category to send the test message for. All
* contacts must be subscribed to this category.
*/
// const notificationCategory = {}
// Imports the Essentialcontacts library
const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1;
// Instantiates a client
const essentialcontactsClient = new EssentialContactsServiceClient();
async function callSendTestMessage() {
// Construct request
const request = {
contacts,
resource,
notificationCategory,
};
// Run request
const response = await essentialcontactsClient.sendTestMessage(request);
console.log(response);
}
callSendTestMessage();
sendTestMessage(request, options, callback)
sendTestMessage(request: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
sendTestMessage(request, callback)
sendTestMessage(request: protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.essentialcontacts.v1.ISendTestMessageRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateContact(request, options)
updateContact(request?: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, options?: CallOptions): Promise<[
protos.google.cloud.essentialcontacts.v1.IContact,
(protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest | undefined),
{} | undefined
]>;
Updates a contact. Note: A contact's email address cannot be changed.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.essentialcontacts.v1.IContact,
(protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The contact resource to replace the existing saved contact. Note:
* the email address of the contact cannot be modified.
*/
// const contact = {}
/**
* Optional. The update mask applied to the resource. For the `FieldMask`
* definition, see
* https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
*/
// const updateMask = {}
// Imports the Essentialcontacts library
const {EssentialContactsServiceClient} = require('@google-cloud/essential-contacts').v1;
// Instantiates a client
const essentialcontactsClient = new EssentialContactsServiceClient();
async function callUpdateContact() {
// Construct request
const request = {
contact,
};
// Run request
const response = await essentialcontactsClient.updateContact(request);
console.log(response);
}
callUpdateContact();
updateContact(request, options, callback)
updateContact(request: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, options: CallOptions, callback: Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateContact(request, callback)
updateContact(request: protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest, callback: Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest
|
callback |
Callback<protos.google.cloud.essentialcontacts.v1.IContact, protos.google.cloud.essentialcontacts.v1.IUpdateContactRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |