// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/essentialcontacts.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const essentialcontacts = google.essentialcontacts('v1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await essentialcontacts.folders.contacts.delete({
// 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\}
name: 'folders/my-folder/contacts/my-contact',
});
console.log(res.data);
// Example response
// {}
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/essentialcontacts.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const essentialcontacts = google.essentialcontacts('v1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await essentialcontacts.organizations.contacts.patch({
// The identifier for the contact. Format: {resource_type\}/{resource_id\}/contacts/{contact_id\}
name: 'organizations/my-organization/contacts/my-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
updateMask: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "email": "my_email",
// "languageTag": "my_languageTag",
// "name": "my_name",
// "notificationCategorySubscriptions": [],
// "validateTime": "my_validateTime",
// "validationState": "my_validationState"
// }
},
});
console.log(res.data);
// Example response
// {
// "email": "my_email",
// "languageTag": "my_languageTag",
// "name": "my_name",
// "notificationCategorySubscriptions": [],
// "validateTime": "my_validateTime",
// "validationState": "my_validationState"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/essentialcontacts.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const essentialcontacts = google.essentialcontacts('v1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await essentialcontacts.projects.contacts.patch({
// The identifier for the contact. Format: {resource_type\}/{resource_id\}/contacts/{contact_id\}
name: 'projects/my-project/contacts/my-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
updateMask: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "email": "my_email",
// "languageTag": "my_languageTag",
// "name": "my_name",
// "notificationCategorySubscriptions": [],
// "validateTime": "my_validateTime",
// "validationState": "my_validationState"
// }
},
});
console.log(res.data);
// Example response
// {
// "email": "my_email",
// "languageTag": "my_languageTag",
// "name": "my_name",
// "notificationCategorySubscriptions": [],
// "validateTime": "my_validateTime",
// "validationState": "my_validationState"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/essentialcontacts.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const essentialcontacts = google.essentialcontacts('v1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await essentialcontacts.projects.contacts.get({
// 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\}
name: 'projects/my-project/contacts/my-contact',
});
console.log(res.data);
// Example response
// {
// "email": "my_email",
// "languageTag": "my_languageTag",
// "name": "my_name",
// "notificationCategorySubscriptions": [],
// "validateTime": "my_validateTime",
// "validationState": "my_validationState"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/essentialcontacts.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const essentialcontacts = google.essentialcontacts('v1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await essentialcontacts.projects.contacts.sendTestMessage({
// 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\}
resource: 'projects/my-project',
// Request body metadata
requestBody: {
// request body parameters
// {
// "contacts": [],
// "notificationCategory": "my_notificationCategory"
// }
},
});
console.log(res.data);
// Example response
// {}
}
main().catch(e => {
console.error(e);
throw e;
});