Skip to content

Commit

Permalink
docs(samples): add example tags to generated samples (#94)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 408439482

Source-Link: googleapis/googleapis@b9f6184

Source-Link: googleapis/googleapis-gen@eb888bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
  • Loading branch information
gcf-owl-bot[bot] authored Nov 10, 2021
1 parent 8ff61a4 commit d52d094
Show file tree
Hide file tree
Showing 23 changed files with 1,762 additions and 583 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"img.shields.io"
],
"silent": true,
"concurrency": 10
"concurrency": 5
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(name, trust) {
// [START managedidentities_v1_generated_ManagedIdentitiesService_AttachTrust_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource domain name, project name and location using the form:
* `projects/{project_id}/locations/global/domains/{domain_name}`
*/
// const name = 'abc123'
/**
* Required. The domain trust resource.
*/
// const trust = {}

// Imports the Managedidentities library
const {ManagedIdentitiesServiceClient} =
require('@google-cloud/managed-identities').v1;

// Instantiates a client
const managedidentitiesClient = new ManagedIdentitiesServiceClient();

async function callAttachTrust() {
// Construct request
const request = {
name,
trust,
};

// Run request
const [operation] = await managedidentitiesClient.attachTrust(request);
const [response] = await operation.promise();
console.log(response);
}

callAttachTrust();
// [END managedidentities_v1_generated_ManagedIdentitiesService_AttachTrust_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(parent, domainName, domain) {
// [START managedidentities_v1_generated_ManagedIdentitiesService_CreateMicrosoftAdDomain_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource project name and location using the form:
* `projects/{project_id}/locations/global`
*/
// const parent = 'abc123'
/**
* Required. The fully qualified domain name.
* e.g. mydomain.myorganization.com, with the following restrictions:
* * Must contain only lowercase letters, numbers, periods and hyphens.
* * Must start with a letter.
* * Must contain between 2-64 characters.
* * Must end with a number or a letter.
* * Must not start with period.
* * First segement length (mydomain form example above) shouldn't exceed
* 15 chars.
* * The last segment cannot be fully numeric.
* * Must be unique within the customer project.
*/
// const domainName = 'abc123'
/**
* Required. A Managed Identity domain resource.
*/
// const domain = {}

// Imports the Managedidentities library
const {ManagedIdentitiesServiceClient} =
require('@google-cloud/managed-identities').v1;

// Instantiates a client
const managedidentitiesClient = new ManagedIdentitiesServiceClient();

async function callCreateMicrosoftAdDomain() {
// Construct request
const request = {
parent,
domainName,
domain,
};

// Run request
const [operation] = await managedidentitiesClient.createMicrosoftAdDomain(
request
);
const [response] = await operation.promise();
console.log(response);
}

callCreateMicrosoftAdDomain();
// [END managedidentities_v1_generated_ManagedIdentitiesService_CreateMicrosoftAdDomain_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(name) {
// [START managedidentities_v1_generated_ManagedIdentitiesService_DeleteDomain_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The domain resource name using the form:
* `projects/{project_id}/locations/global/domains/{domain_name}`
*/
// const name = 'abc123'

// Imports the Managedidentities library
const {ManagedIdentitiesServiceClient} =
require('@google-cloud/managed-identities').v1;

// Instantiates a client
const managedidentitiesClient = new ManagedIdentitiesServiceClient();

async function callDeleteDomain() {
// Construct request
const request = {
name,
};

// Run request
const [operation] = await managedidentitiesClient.deleteDomain(request);
const [response] = await operation.promise();
console.log(response);
}

callDeleteDomain();
// [END managedidentities_v1_generated_ManagedIdentitiesService_DeleteDomain_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(name, trust) {
// [START managedidentities_v1_generated_ManagedIdentitiesService_DetachTrust_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource domain name, project name, and location using the form:
* `projects/{project_id}/locations/global/domains/{domain_name}`
*/
// const name = 'abc123'
/**
* Required. The domain trust resource to removed.
*/
// const trust = {}

// Imports the Managedidentities library
const {ManagedIdentitiesServiceClient} =
require('@google-cloud/managed-identities').v1;

// Instantiates a client
const managedidentitiesClient = new ManagedIdentitiesServiceClient();

async function callDetachTrust() {
// Construct request
const request = {
name,
trust,
};

// Run request
const [operation] = await managedidentitiesClient.detachTrust(request);
const [response] = await operation.promise();
console.log(response);
}

callDetachTrust();
// [END managedidentities_v1_generated_ManagedIdentitiesService_DetachTrust_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(name) {
// [START managedidentities_v1_generated_ManagedIdentitiesService_GetDomain_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The domain resource name using the form:
* `projects/{project_id}/locations/global/domains/{domain_name}`
*/
// const name = 'abc123'

// Imports the Managedidentities library
const {ManagedIdentitiesServiceClient} =
require('@google-cloud/managed-identities').v1;

// Instantiates a client
const managedidentitiesClient = new ManagedIdentitiesServiceClient();

async function callGetDomain() {
// Construct request
const request = {
name,
};

// Run request
const response = await managedidentitiesClient.getDomain(request);
console.log(response);
}

callGetDomain();
// [END managedidentities_v1_generated_ManagedIdentitiesService_GetDomain_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Loading

0 comments on commit d52d094

Please sign in to comment.