Skip to content

Commit

Permalink
docs(samples): add auto-generated samples for Node with api short nam…
Browse files Browse the repository at this point in the history
…e in region tag (#30)

* docs(samples): add auto-generated samples for Node with api short name in region tag

PiperOrigin-RevId: 399287285

Source-Link: googleapis/googleapis@1575986

Source-Link: googleapis/googleapis-gen@b27fff6
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Sep 28, 2021
1 parent 661c846 commit 68d52f7
Show file tree
Hide file tree
Showing 5 changed files with 300 additions and 0 deletions.
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() {
// [START connectgateway_v1beta1_generated_GatewayService_DeleteResource_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The HTTP Content-Type header value specifying the content type of the body.
*/
// const contentType = 'abc123'
/**
* The HTTP request/response body as raw binary.
*/
// const data = 'Buffer.from('string')'
/**
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
*/
// const extensions = 1234

// Imports the Gateway library
const {GatewayServiceClient} =
require('@google-cloud/gke-connect-gateway').v1beta1;

// Instantiates a client
const gatewayClient = new GatewayServiceClient();

async function deleteResource() {
// Construct request
const request = {};

// Run request
const response = await gatewayClient.deleteResource(request);
console.log(response);
}

deleteResource();
// [END connectgateway_v1beta1_generated_GatewayService_DeleteResource_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() {
// [START connectgateway_v1beta1_generated_GatewayService_GetResource_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The HTTP Content-Type header value specifying the content type of the body.
*/
// const contentType = 'abc123'
/**
* The HTTP request/response body as raw binary.
*/
// const data = 'Buffer.from('string')'
/**
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
*/
// const extensions = 1234

// Imports the Gateway library
const {GatewayServiceClient} =
require('@google-cloud/gke-connect-gateway').v1beta1;

// Instantiates a client
const gatewayClient = new GatewayServiceClient();

async function getResource() {
// Construct request
const request = {};

// Run request
const response = await gatewayClient.getResource(request);
console.log(response);
}

getResource();
// [END connectgateway_v1beta1_generated_GatewayService_GetResource_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() {
// [START connectgateway_v1beta1_generated_GatewayService_PatchResource_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The HTTP Content-Type header value specifying the content type of the body.
*/
// const contentType = 'abc123'
/**
* The HTTP request/response body as raw binary.
*/
// const data = 'Buffer.from('string')'
/**
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
*/
// const extensions = 1234

// Imports the Gateway library
const {GatewayServiceClient} =
require('@google-cloud/gke-connect-gateway').v1beta1;

// Instantiates a client
const gatewayClient = new GatewayServiceClient();

async function patchResource() {
// Construct request
const request = {};

// Run request
const response = await gatewayClient.patchResource(request);
console.log(response);
}

patchResource();
// [END connectgateway_v1beta1_generated_GatewayService_PatchResource_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() {
// [START connectgateway_v1beta1_generated_GatewayService_PostResource_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The HTTP Content-Type header value specifying the content type of the body.
*/
// const contentType = 'abc123'
/**
* The HTTP request/response body as raw binary.
*/
// const data = 'Buffer.from('string')'
/**
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
*/
// const extensions = 1234

// Imports the Gateway library
const {GatewayServiceClient} =
require('@google-cloud/gke-connect-gateway').v1beta1;

// Instantiates a client
const gatewayClient = new GatewayServiceClient();

async function postResource() {
// Construct request
const request = {};

// Run request
const response = await gatewayClient.postResource(request);
console.log(response);
}

postResource();
// [END connectgateway_v1beta1_generated_GatewayService_PostResource_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() {
// [START connectgateway_v1beta1_generated_GatewayService_PutResource_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The HTTP Content-Type header value specifying the content type of the body.
*/
// const contentType = 'abc123'
/**
* The HTTP request/response body as raw binary.
*/
// const data = 'Buffer.from('string')'
/**
* Application specific response metadata. Must be set in the first response
* for streaming APIs.
*/
// const extensions = 1234

// Imports the Gateway library
const {GatewayServiceClient} =
require('@google-cloud/gke-connect-gateway').v1beta1;

// Instantiates a client
const gatewayClient = new GatewayServiceClient();

async function putResource() {
// Construct request
const request = {};

// Run request
const response = await gatewayClient.putResource(request);
console.log(response);
}

putResource();
// [END connectgateway_v1beta1_generated_GatewayService_PutResource_async]
}

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

0 comments on commit 68d52f7

Please sign in to comment.