Skip to content

Commit

Permalink
docs(samples): add example tags to generated samples (#99)
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 8fd9a88 commit d2bd0da
Show file tree
Hide file tree
Showing 18 changed files with 1,423 additions and 515 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,53 @@
// 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(service) {
// [START servicemanagement_v1_generated_ServiceManager_CreateService_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Initial values for the service resource.
*/
// const service = {}

// Imports the Servicemanagement library
const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

// Instantiates a client
const servicemanagementClient = new ServiceManagerClient();

async function callCreateService() {
// Construct request
const request = {
service,
};

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

callCreateService();
// [END servicemanagement_v1_generated_ServiceManager_CreateService_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,58 @@
// 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(serviceName, serviceConfig) {
// [START servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the service. See the overview (https://cloud.google.com/service-management/overview)
* for naming requirements. For example: `example.googleapis.com`.
*/
// const serviceName = 'abc123'
/**
* Required. The service configuration resource.
*/
// const serviceConfig = {}

// Imports the Servicemanagement library
const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

// Instantiates a client
const servicemanagementClient = new ServiceManagerClient();

async function callCreateServiceConfig() {
// Construct request
const request = {
serviceName,
serviceConfig,
};

// Run request
const response = await servicemanagementClient.createServiceConfig(request);
console.log(response);
}

callCreateServiceConfig();
// [END servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_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,61 @@
// 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(serviceName, rollout) {
// [START servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the service. See the overview (https://cloud.google.com/service-management/overview)
* for naming requirements. For example: `example.googleapis.com`.
*/
// const serviceName = 'abc123'
/**
* Required. The rollout resource. The `service_name` field is output only.
*/
// const rollout = {}

// Imports the Servicemanagement library
const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

// Instantiates a client
const servicemanagementClient = new ServiceManagerClient();

async function callCreateServiceRollout() {
// Construct request
const request = {
serviceName,
rollout,
};

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

callCreateServiceRollout();
// [END servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_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(serviceName) {
// [START servicemanagement_v1_generated_ServiceManager_DeleteService_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the service. See the overview (https://cloud.google.com/service-management/overview)
* for naming requirements. For example: `example.googleapis.com`.
*/
// const serviceName = 'abc123'

// Imports the Servicemanagement library
const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

// Instantiates a client
const servicemanagementClient = new ServiceManagerClient();

async function callDeleteService() {
// Construct request
const request = {
serviceName,
};

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

callDeleteService();
// [END servicemanagement_v1_generated_ServiceManager_DeleteService_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,65 @@
// 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(serviceName, consumerId) {
// [START servicemanagement_v1_generated_ServiceManager_DisableService_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the service to disable. Specifying an unknown service name
* will cause the request to fail.
*/
// const serviceName = 'abc123'
/**
* Required. The identity of consumer resource which service disablement will be
* applied to.
* The Google Service Management implementation accepts the following
* forms:
* - "project:<project_id>"
* Note: this is made compatible with
* google.api.servicecontrol.v1.Operation.consumer_id.
*/
// const consumerId = 'abc123'

// Imports the Servicemanagement library
const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

// Instantiates a client
const servicemanagementClient = new ServiceManagerClient();

async function callDisableService() {
// Construct request
const request = {
serviceName,
consumerId,
};

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

callDisableService();
// [END servicemanagement_v1_generated_ServiceManager_DisableService_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,65 @@
// 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(serviceName, consumerId) {
// [START servicemanagement_v1_generated_ServiceManager_EnableService_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the service to enable. Specifying an unknown service name will
* cause the request to fail.
*/
// const serviceName = 'abc123'
/**
* Required. The identity of consumer resource which service enablement will be
* applied to.
* The Google Service Management implementation accepts the following
* forms:
* - "project:<project_id>"
* Note: this is made compatible with
* google.api.servicecontrol.v1.Operation.consumer_id.
*/
// const consumerId = 'abc123'

// Imports the Servicemanagement library
const {ServiceManagerClient} = require('@google-cloud/service-management').v1;

// Instantiates a client
const servicemanagementClient = new ServiceManagerClient();

async function callEnableService() {
// Construct request
const request = {
serviceName,
consumerId,
};

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

callEnableService();
// [END servicemanagement_v1_generated_ServiceManager_EnableService_async]
}

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

0 comments on commit d2bd0da

Please sign in to comment.