// 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.export({
// Required. The name of the `Registration` to export, in the format `projects/x/locations/x/registrations/x`.
name: 'projects/my-project/locations/my-location/registrations/my-registration',
// Request body metadata
requestBody: {
// request body parameters
// {}
},
});
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.export({
// Required. The name of the `Registration` to export, in the format `projects/x/locations/x/registrations/x`.
name: 'projects/my-project/locations/my-location/registrations/my-registration',
// Request body metadata
requestBody: {
// request body parameters
// {}
},
});
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.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;
});
// 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.delete({
// Required. The name of the `Registration` to delete, in the format `projects/x/locations/x/registrations/x`.
name: 'projects/my-project/locations/my-location/registrations/my-registration',
});
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;
});