// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/domains.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 domains = google.domains('v1beta1');
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 domains.projects.locations.registrations.configureManagementSettings({
// Required. The name of the `Registration` whose management settings are being updated, in the format `projects/x/locations/x/registrations/x`.
registration:
'projects/my-project/locations/my-location/registrations/my-registration',
// Request body metadata
requestBody: {
// request body parameters
// {
// "managementSettings": {},
// "updateMask": "my_updateMask"
// }
},
});
console.log(res.data);
// Example response
// {
// "done": false,
// "error": {},
// "metadata": {},
// "name": "my_name",
// "response": {}
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/domains.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 domains = google.domains('v1alpha2');
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 domains.projects.locations.registrations.configureContactSettings({
// Required. The name of the `Registration` whose contact settings are being updated, in the format `projects/x/locations/x/registrations/x`.
registration:
'projects/my-project/locations/my-location/registrations/my-registration',
// Request body metadata
requestBody: {
// request body parameters
// {
// "contactNotices": [],
// "contactSettings": {},
// "updateMask": "my_updateMask",
// "validateOnly": false
// }
},
});
console.log(res.data);
// Example response
// {
// "done": false,
// "error": {},
// "metadata": {},
// "name": "my_name",
// "response": {}
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/domains.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 domains = google.domains('v1beta1');
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 domains.projects.locations.registrations.configureContactSettings({
// Required. The name of the `Registration` whose contact settings are being updated, in the format `projects/x/locations/x/registrations/x`.
registration:
'projects/my-project/locations/my-location/registrations/my-registration',
// Request body metadata
requestBody: {
// request body parameters
// {
// "contactNotices": [],
// "contactSettings": {},
// "updateMask": "my_updateMask",
// "validateOnly": false
// }
},
});
console.log(res.data);
// Example response
// {
// "done": false,
// "error": {},
// "metadata": {},
// "name": "my_name",
// "response": {}
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/domains.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 domains = google.domains('v1alpha2');
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 domains.projects.locations.registrations.patch({
// Output only. Name of the `Registration` resource, in the format `projects/x/locations/x/registrations/`.
name: 'projects/my-project/locations/my-location/registrations/my-registration',
// Required. The field mask describing which fields to update as a comma-separated list. For example, if only the labels are being updated, the `update_mask` would be `"labels"`.
updateMask: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "contactSettings": {},
// "createTime": "my_createTime",
// "dnsSettings": {},
// "domainName": "my_domainName",
// "expireTime": "my_expireTime",
// "issues": [],
// "labels": {},
// "managementSettings": {},
// "name": "my_name",
// "pendingContactSettings": {},
// "state": "my_state",
// "supportedPrivacy": []
// }
},
});
console.log(res.data);
// Example response
// {
// "done": false,
// "error": {},
// "metadata": {},
// "name": "my_name",
// "response": {}
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/domains.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 domains = google.domains('v1alpha2');
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 domains.projects.locations.registrations.retrieveAuthorizationCode({
// Required. The name of the `Registration` whose authorization code is being retrieved, in the format `projects/x/locations/x/registrations/x`.
registration:
'projects/my-project/locations/my-location/registrations/my-registration',
});
console.log(res.data);
// Example response
// {
// "code": "my_code"
// }
}
main().catch(e => {
console.error(e);
throw e;
});