diff --git a/generated,README.md/generated/v1/game_server_clusters_service.create_game_server_cluster.js b/generated,README.md/generated/v1/game_server_clusters_service.create_game_server_cluster.js new file mode 100644 index 0000000000..86db5d71b1 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_clusters_service.create_game_server_cluster.js @@ -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(parent, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}/realms/{realm-id}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server cluster resource to be created. + */ + // const gameServerClusterId = 'abc123' + /** + * Required. The game server cluster resource to be created. + */ + // const gameServerCluster = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function createGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const [operation] = await gamingClient.createGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_clusters_service.delete_game_server_cluster.js b/generated,README.md/generated/v1/game_server_clusters_service.delete_game_server_cluster.js new file mode 100644 index 0000000000..fb1fc07618 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_clusters_service.delete_game_server_cluster.js @@ -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 gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server cluster to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function deleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_clusters_service.get_game_server_cluster.js b/generated,README.md/generated/v1/game_server_clusters_service.get_game_server_cluster.js new file mode 100644 index 0000000000..c74cc5ccc7 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_clusters_service.get_game_server_cluster.js @@ -0,0 +1,63 @@ +// 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 gameservices_v1_generated_GameServerClustersService_GetGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server cluster to retrieve, in the following form: + * `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + /** + * Optional. View for the returned GameServerCluster objects. When `FULL` is + * specified, the `cluster_state` field is also returned in the + * GameServerCluster object, which includes the state of the referenced + * Kubernetes cluster such as versions and provider info. The default/unset + * value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does + * not return the `cluster_state` field. + */ + // const view = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function getGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerCluster(request); + console.log(response); + } + + getGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_GetGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_clusters_service.list_game_server_clusters.js b/generated,README.md/generated/v1/game_server_clusters_service.list_game_server_clusters.js new file mode 100644 index 0000000000..4d78ff56fb --- /dev/null +++ b/generated,README.md/generated/v1/game_server_clusters_service.list_game_server_clusters.js @@ -0,0 +1,86 @@ +// 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) { + // [START gameservices_v1_generated_GameServerClustersService_ListGameServerClusters_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, in the following form: + * "projects/{project}/locations/{location}/realms/{realm}". + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, the server + * will pick an appropriate default. The server may return fewer items than + * requested. A caller should only rely on response's + * [next_page_token][google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token] to + * determine if there are more GameServerClusters left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + /** + * Optional. View for the returned GameServerCluster objects. When `FULL` is + * specified, the `cluster_state` field is also returned in the + * GameServerCluster object, which includes the state of the referenced + * Kubernetes cluster such as versions and provider info. The default/unset + * value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does + * not return the `cluster_state` field. + */ + // const view = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function listGameServerClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerClusters(); + // [END gameservices_v1_generated_GameServerClustersService_ListGameServerClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js b/generated,README.md/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js new file mode 100644 index 0000000000..43871a8423 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js @@ -0,0 +1,73 @@ +// 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, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server cluster resource to be created. + */ + // const gameServerClusterId = 'abc123' + /** + * Required. The game server cluster resource to be created. + */ + // const gameServerCluster = '' + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = '' + /** + * Optional. This field is deprecated, preview will always return + * KubernetesClusterState. + */ + // const view = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function previewCreateGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const response = await gamingClient.previewCreateGameServerCluster(request); + console.log(response); + } + + previewCreateGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js b/generated,README.md/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js new file mode 100644 index 0000000000..00e7ddfb63 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js @@ -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(name) { + // [START gameservices_v1_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server cluster to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function previewDeleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.previewDeleteGameServerCluster(request); + console.log(response); + } + + previewDeleteGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js b/generated,README.md/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js new file mode 100644 index 0000000000..5393942098 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js @@ -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(gameServerCluster, updateMask) { + // [START gameservices_v1_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The game server cluster to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerCluster = '' + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function previewUpdateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const response = await gamingClient.previewUpdateGameServerCluster(request); + console.log(response); + } + + previewUpdateGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_clusters_service.update_game_server_cluster.js b/generated,README.md/generated/v1/game_server_clusters_service.update_game_server_cluster.js new file mode 100644 index 0000000000..839dcdb280 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_clusters_service.update_game_server_cluster.js @@ -0,0 +1,62 @@ +// 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(gameServerCluster, updateMask) { + // [START gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The game server cluster to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerCluster = '' + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function updateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_configs_service.create_game_server_config.js b/generated,README.md/generated/v1/game_server_configs_service.create_game_server_config.js new file mode 100644 index 0000000000..1bba873787 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_configs_service.create_game_server_config.js @@ -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(parent, configId, gameServerConfig) { + // [START gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server config resource to be created. + */ + // const configId = 'abc123' + /** + * Required. The game server config resource to be created. + */ + // const gameServerConfig = '' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function createGameServerConfig() { + // Construct request + const request = { + parent, + configId, + gameServerConfig, + }; + + // Run request + const [operation] = await gamingClient.createGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerConfig(); + // [END gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_configs_service.delete_game_server_config.js b/generated,README.md/generated/v1/game_server_configs_service.delete_game_server_config.js new file mode 100644 index 0000000000..338f504ec0 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_configs_service.delete_game_server_config.js @@ -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 gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server config to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function deleteGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerConfig(); + // [END gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_configs_service.get_game_server_config.js b/generated,README.md/generated/v1/game_server_configs_service.get_game_server_config.js new file mode 100644 index 0000000000..f49e46065d --- /dev/null +++ b/generated,README.md/generated/v1/game_server_configs_service.get_game_server_config.js @@ -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 gameservices_v1_generated_GameServerConfigsService_GetGameServerConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server config to retrieve, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function getGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerConfig(request); + console.log(response); + } + + getGameServerConfig(); + // [END gameservices_v1_generated_GameServerConfigsService_GetGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_configs_service.list_game_server_configs.js b/generated,README.md/generated/v1/game_server_configs_service.list_game_server_configs.js new file mode 100644 index 0000000000..8cd6207c2f --- /dev/null +++ b/generated,README.md/generated/v1/game_server_configs_service.list_game_server_configs.js @@ -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) { + // [START gameservices_v1_generated_GameServerConfigsService_ListGameServerConfigs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * [next_page_token][google.cloud.gaming.v1.ListGameServerConfigsResponse.next_page_token] to + * determine if there are more GameServerConfigs left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous list request, if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function listGameServerConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerConfigs(); + // [END gameservices_v1_generated_GameServerConfigsService_ListGameServerConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_deployments_service.create_game_server_deployment.js b/generated,README.md/generated/v1/game_server_deployments_service.create_game_server_deployment.js new file mode 100644 index 0000000000..49404fc822 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_deployments_service.create_game_server_deployment.js @@ -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(parent, deploymentId, gameServerDeployment) { + // [START gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server delpoyment resource to be created. + */ + // const deploymentId = 'abc123' + /** + * Required. The game server delpoyment resource to be created. + */ + // const gameServerDeployment = '' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function createGameServerDeployment() { + // Construct request + const request = { + parent, + deploymentId, + gameServerDeployment, + }; + + // Run request + const [operation] = await gamingClient.createGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerDeployment(); + // [END gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_deployments_service.delete_game_server_deployment.js b/generated,README.md/generated/v1/game_server_deployments_service.delete_game_server_deployment.js new file mode 100644 index 0000000000..7490fae313 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_deployments_service.delete_game_server_deployment.js @@ -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 gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server delpoyment to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function deleteGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerDeployment(); + // [END gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_deployments_service.fetch_deployment_state.js b/generated,README.md/generated/v1/game_server_deployments_service.fetch_deployment_state.js new file mode 100644 index 0000000000..bbc19ee785 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_deployments_service.fetch_deployment_state.js @@ -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 gameservices_v1_generated_GameServerDeploymentsService_FetchDeploymentState_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server delpoyment, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function fetchDeploymentState() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.fetchDeploymentState(request); + console.log(response); + } + + fetchDeploymentState(); + // [END gameservices_v1_generated_GameServerDeploymentsService_FetchDeploymentState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_deployments_service.get_game_server_deployment.js b/generated,README.md/generated/v1/game_server_deployments_service.get_game_server_deployment.js new file mode 100644 index 0000000000..3137207f20 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_deployments_service.get_game_server_deployment.js @@ -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 gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeployment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server delpoyment to retrieve, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function getGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeployment(request); + console.log(response); + } + + getGameServerDeployment(); + // [END gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js b/generated,README.md/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js new file mode 100644 index 0000000000..596aeeb55d --- /dev/null +++ b/generated,README.md/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js @@ -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 gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server delpoyment to retrieve, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function getGameServerDeploymentRollout() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeploymentRollout(request); + console.log(response); + } + + getGameServerDeploymentRollout(); + // [END gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_deployments_service.list_game_server_deployments.js b/generated,README.md/generated/v1/game_server_deployments_service.list_game_server_deployments.js new file mode 100644 index 0000000000..122ff09ded --- /dev/null +++ b/generated,README.md/generated/v1/game_server_deployments_service.list_game_server_deployments.js @@ -0,0 +1,78 @@ +// 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) { + // [START gameservices_v1_generated_GameServerDeploymentsService_ListGameServerDeployments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, the server + * will pick an appropriate default. The server may return fewer items than + * requested. A caller should only rely on response's + * [next_page_token][google.cloud.gaming.v1.ListGameServerDeploymentsResponse.next_page_token] to + * determine if there are more GameServerDeployments left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function listGameServerDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerDeployments(); + // [END gameservices_v1_generated_GameServerDeploymentsService_ListGameServerDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js b/generated,README.md/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js new file mode 100644 index 0000000000..f17b9bf4a0 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js @@ -0,0 +1,67 @@ +// 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(rollout) { + // [START gameservices_v1_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The game server deployment rollout to be updated. + * Only fields specified in update_mask are updated. + */ + // const rollout = '' + /** + * Optional. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + /** + * Optional. The target timestamp to compute the preview. Defaults to the immediately + * after the proposed rollout completes. + */ + // const previewTime = '' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function previewGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + }; + + // Run request + const response = await gamingClient.previewGameServerDeploymentRollout( + request + ); + console.log(response); + } + + previewGameServerDeploymentRollout(); + // [END gameservices_v1_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_deployments_service.update_game_server_deployment.js b/generated,README.md/generated/v1/game_server_deployments_service.update_game_server_deployment.js new file mode 100644 index 0000000000..4e9a5482e8 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_deployments_service.update_game_server_deployment.js @@ -0,0 +1,62 @@ +// 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(gameServerDeployment, updateMask) { + // [START gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The game server delpoyment to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerDeployment = '' + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function updateGameServerDeployment() { + // Construct request + const request = { + gameServerDeployment, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerDeployment(); + // [END gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js b/generated,README.md/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js new file mode 100644 index 0000000000..44d9a90797 --- /dev/null +++ b/generated,README.md/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js @@ -0,0 +1,64 @@ +// 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(rollout, updateMask) { + // [START gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The game server delpoyment rollout to be updated. + * Only fields specified in update_mask are updated. + */ + // const rollout = '' + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function updateGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeploymentRollout( + request + ); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerDeploymentRollout(); + // [END gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/realms_service.create_realm.js b/generated,README.md/generated/v1/realms_service.create_realm.js new file mode 100644 index 0000000000..1cf5a86c92 --- /dev/null +++ b/generated,README.md/generated/v1/realms_service.create_realm.js @@ -0,0 +1,64 @@ +// 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, realmId, realm) { + // [START gameservices_v1_generated_RealmsService_CreateRealm_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the realm resource to be created. + */ + // const realmId = 'abc123' + /** + * Required. The realm resource to be created. + */ + // const realm = '' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function createRealm() { + // Construct request + const request = { + parent, + realmId, + realm, + }; + + // Run request + const [operation] = await gamingClient.createRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + createRealm(); + // [END gameservices_v1_generated_RealmsService_CreateRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/realms_service.delete_realm.js b/generated,README.md/generated/v1/realms_service.delete_realm.js new file mode 100644 index 0000000000..dcfcd99bf3 --- /dev/null +++ b/generated,README.md/generated/v1/realms_service.delete_realm.js @@ -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 gameservices_v1_generated_RealmsService_DeleteRealm_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the realm to delete, in the following form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function deleteRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteRealm(); + // [END gameservices_v1_generated_RealmsService_DeleteRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/realms_service.get_realm.js b/generated,README.md/generated/v1/realms_service.get_realm.js new file mode 100644 index 0000000000..9858e1d77a --- /dev/null +++ b/generated,README.md/generated/v1/realms_service.get_realm.js @@ -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(name) { + // [START gameservices_v1_generated_RealmsService_GetRealm_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the realm to retrieve, in the following form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function getRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getRealm(request); + console.log(response); + } + + getRealm(); + // [END gameservices_v1_generated_RealmsService_GetRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/realms_service.list_realms.js b/generated,README.md/generated/v1/realms_service.list_realms.js new file mode 100644 index 0000000000..c78d60d790 --- /dev/null +++ b/generated,README.md/generated/v1/realms_service.list_realms.js @@ -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) { + // [START gameservices_v1_generated_RealmsService_ListRealms_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * [next_page_token][google.cloud.gaming.v1.ListRealmsResponse.next_page_token] to + * determine if there are more realms left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function listRealms() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listRealmsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listRealms(); + // [END gameservices_v1_generated_RealmsService_ListRealms_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/realms_service.preview_realm_update.js b/generated,README.md/generated/v1/realms_service.preview_realm_update.js new file mode 100644 index 0000000000..e0d48f2206 --- /dev/null +++ b/generated,README.md/generated/v1/realms_service.preview_realm_update.js @@ -0,0 +1,64 @@ +// 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(realm, updateMask) { + // [START gameservices_v1_generated_RealmsService_PreviewRealmUpdate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The realm to be updated. + * Only fields specified in update_mask are updated. + */ + // const realm = '' + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = '' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function previewRealmUpdate() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const response = await gamingClient.previewRealmUpdate(request); + console.log(response); + } + + previewRealmUpdate(); + // [END gameservices_v1_generated_RealmsService_PreviewRealmUpdate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1/realms_service.update_realm.js b/generated,README.md/generated/v1/realms_service.update_realm.js new file mode 100644 index 0000000000..e6d6bae74d --- /dev/null +++ b/generated,README.md/generated/v1/realms_service.update_realm.js @@ -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(realm, updateMask) { + // [START gameservices_v1_generated_RealmsService_UpdateRealm_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The realm to be updated. + * Only fields specified in update_mask are updated. + */ + // const realm = '' + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function updateRealm() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateRealm(); + // [END gameservices_v1_generated_RealmsService_UpdateRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js b/generated,README.md/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js new file mode 100644 index 0000000000..2ee63e6712 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js @@ -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(parent, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1beta_generated_GameServerClustersService_CreateGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm-id}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server cluster resource to be created. + */ + // const gameServerClusterId = 'abc123' + /** + * Required. The game server cluster resource to be created. + */ + // const gameServerCluster = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function createGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const [operation] = await gamingClient.createGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_CreateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js b/generated,README.md/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js new file mode 100644 index 0000000000..082e32d1c8 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js @@ -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 gameservices_v1beta_generated_GameServerClustersService_DeleteGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server cluster to delete. Uses the form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function deleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_DeleteGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js b/generated,README.md/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js new file mode 100644 index 0000000000..1d3b65cd00 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js @@ -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 gameservices_v1beta_generated_GameServerClustersService_GetGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server cluster to retrieve. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function getGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerCluster(request); + console.log(response); + } + + getGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_GetGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js b/generated,README.md/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js new file mode 100644 index 0000000000..39fdeb1a32 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js @@ -0,0 +1,78 @@ +// 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) { + // [START gameservices_v1beta_generated_GameServerClustersService_ListGameServerClusters_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. Uses the form: + * "projects/{project}/locations/{location}/realms/{realm}". + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, the + * server will pick an appropriate default. The server may return fewer items + * than requested. A caller should only rely on response's + * [next_page_token][google.cloud.gaming.v1beta.ListGameServerClustersResponse.next_page_token] + * to determine if there are more GameServerClusters left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function listGameServerClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerClusters(); + // [END gameservices_v1beta_generated_GameServerClustersService_ListGameServerClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js b/generated,README.md/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js new file mode 100644 index 0000000000..b0db2425fb --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js @@ -0,0 +1,68 @@ +// 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, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1beta_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server cluster resource to be created. + */ + // const gameServerClusterId = 'abc123' + /** + * Required. The game server cluster resource to be created. + */ + // const gameServerCluster = '' + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function previewCreateGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const response = await gamingClient.previewCreateGameServerCluster(request); + console.log(response); + } + + previewCreateGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js b/generated,README.md/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js new file mode 100644 index 0000000000..343ce92397 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js @@ -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(name) { + // [START gameservices_v1beta_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server cluster to delete. Uses the form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function previewDeleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.previewDeleteGameServerCluster(request); + console.log(response); + } + + previewDeleteGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js b/generated,README.md/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js new file mode 100644 index 0000000000..4b8c891903 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js @@ -0,0 +1,67 @@ +// 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(gameServerCluster, updateMask) { + // [START gameservices_v1beta_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The game server cluster to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerCluster = '' + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function previewUpdateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const response = await gamingClient.previewUpdateGameServerCluster(request); + console.log(response); + } + + previewUpdateGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js b/generated,README.md/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js new file mode 100644 index 0000000000..f876ea73c3 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js @@ -0,0 +1,64 @@ +// 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(gameServerCluster, updateMask) { + // [START gameservices_v1beta_generated_GameServerClustersService_UpdateGameServerCluster_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The game server cluster to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerCluster = '' + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function updateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_UpdateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_configs_service.create_game_server_config.js b/generated,README.md/generated/v1beta/game_server_configs_service.create_game_server_config.js new file mode 100644 index 0000000000..a1f8b4aadf --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_configs_service.create_game_server_config.js @@ -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(parent, configId, gameServerConfig) { + // [START gameservices_v1beta_generated_GameServerConfigsService_CreateGameServerConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server config resource to be created. + */ + // const configId = 'abc123' + /** + * Required. The game server config resource to be created. + */ + // const gameServerConfig = '' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function createGameServerConfig() { + // Construct request + const request = { + parent, + configId, + gameServerConfig, + }; + + // Run request + const [operation] = await gamingClient.createGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerConfig(); + // [END gameservices_v1beta_generated_GameServerConfigsService_CreateGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_configs_service.delete_game_server_config.js b/generated,README.md/generated/v1beta/game_server_configs_service.delete_game_server_config.js new file mode 100644 index 0000000000..cf3e70ff6e --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_configs_service.delete_game_server_config.js @@ -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 gameservices_v1beta_generated_GameServerConfigsService_DeleteGameServerConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server config to delete. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function deleteGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerConfig(); + // [END gameservices_v1beta_generated_GameServerConfigsService_DeleteGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_configs_service.get_game_server_config.js b/generated,README.md/generated/v1beta/game_server_configs_service.get_game_server_config.js new file mode 100644 index 0000000000..3d6415c031 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_configs_service.get_game_server_config.js @@ -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 gameservices_v1beta_generated_GameServerConfigsService_GetGameServerConfig_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server config to retrieve. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function getGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerConfig(request); + console.log(response); + } + + getGameServerConfig(); + // [END gameservices_v1beta_generated_GameServerConfigsService_GetGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_configs_service.list_game_server_configs.js b/generated,README.md/generated/v1beta/game_server_configs_service.list_game_server_configs.js new file mode 100644 index 0000000000..fa8c9cc0d2 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_configs_service.list_game_server_configs.js @@ -0,0 +1,78 @@ +// 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) { + // [START gameservices_v1beta_generated_GameServerConfigsService_ListGameServerConfigs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * [next_page_token][google.cloud.gaming.v1beta.ListGameServerConfigsResponse.next_page_token] + * to determine if there are more GameServerConfigs left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous list request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function listGameServerConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerConfigs(); + // [END gameservices_v1beta_generated_GameServerConfigsService_ListGameServerConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js b/generated,README.md/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js new file mode 100644 index 0000000000..bace431d64 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js @@ -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(parent, deploymentId, gameServerDeployment) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server delpoyment resource to be created. + */ + // const deploymentId = 'abc123' + /** + * Required. The game server delpoyment resource to be created. + */ + // const gameServerDeployment = '' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function createGameServerDeployment() { + // Construct request + const request = { + parent, + deploymentId, + gameServerDeployment, + }; + + // Run request + const [operation] = await gamingClient.createGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerDeployment(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js b/generated,README.md/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js new file mode 100644 index 0000000000..ecc1cad27d --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js @@ -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 gameservices_v1beta_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server delpoyment to delete. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function deleteGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerDeployment(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js b/generated,README.md/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js new file mode 100644 index 0000000000..f869cfb4f9 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js @@ -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 gameservices_v1beta_generated_GameServerDeploymentsService_FetchDeploymentState_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server delpoyment. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function fetchDeploymentState() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.fetchDeploymentState(request); + console.log(response); + } + + fetchDeploymentState(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_FetchDeploymentState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js b/generated,README.md/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js new file mode 100644 index 0000000000..d50635d386 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js @@ -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 gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeployment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server delpoyment to retrieve. Uses the + * form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function getGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeployment(request); + console.log(response); + } + + getGameServerDeployment(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js b/generated,README.md/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js new file mode 100644 index 0000000000..3eb5c2cc60 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js @@ -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 gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the game server delpoyment to retrieve. Uses the + * form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function getGameServerDeploymentRollout() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeploymentRollout(request); + console.log(response); + } + + getGameServerDeploymentRollout(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js b/generated,README.md/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js new file mode 100644 index 0000000000..5b63f101ec --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js @@ -0,0 +1,78 @@ +// 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) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_ListGameServerDeployments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, the + * server will pick an appropriate default. The server may return fewer items + * than requested. A caller should only rely on response's + * [next_page_token][google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.next_page_token] + * to determine if there are more GameServerDeployments left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function listGameServerDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerDeployments(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_ListGameServerDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js b/generated,README.md/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js new file mode 100644 index 0000000000..234c777e01 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js @@ -0,0 +1,69 @@ +// 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(rollout) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The game server deployment rollout to be updated. + * Only fields specified in update_mask are updated. + */ + // const rollout = '' + /** + * Optional. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + /** + * Optional. The target timestamp to compute the preview. Defaults to the + * immediately after the proposed rollout completes. + */ + // const previewTime = '' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function previewGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + }; + + // Run request + const response = await gamingClient.previewGameServerDeploymentRollout( + request + ); + console.log(response); + } + + previewGameServerDeploymentRollout(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_deployments_service.update_game_server_deployment.js b/generated,README.md/generated/v1beta/game_server_deployments_service.update_game_server_deployment.js new file mode 100644 index 0000000000..46ac791964 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_deployments_service.update_game_server_deployment.js @@ -0,0 +1,64 @@ +// 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(gameServerDeployment, updateMask) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The game server delpoyment to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerDeployment = '' + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function updateGameServerDeployment() { + // Construct request + const request = { + gameServerDeployment, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerDeployment(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js b/generated,README.md/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js new file mode 100644 index 0000000000..3599b1b373 --- /dev/null +++ b/generated,README.md/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js @@ -0,0 +1,66 @@ +// 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(rollout, updateMask) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The game server delpoyment rollout to be updated. + * Only fields specified in update_mask are updated. + */ + // const rollout = '' + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = + require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function updateGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeploymentRollout( + request + ); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerDeploymentRollout(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/realms_service.create_realm.js b/generated,README.md/generated/v1beta/realms_service.create_realm.js new file mode 100644 index 0000000000..7f57922ea2 --- /dev/null +++ b/generated,README.md/generated/v1beta/realms_service.create_realm.js @@ -0,0 +1,64 @@ +// 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, realmId, realm) { + // [START gameservices_v1beta_generated_RealmsService_CreateRealm_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the realm resource to be created. + */ + // const realmId = 'abc123' + /** + * Required. The realm resource to be created. + */ + // const realm = '' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function createRealm() { + // Construct request + const request = { + parent, + realmId, + realm, + }; + + // Run request + const [operation] = await gamingClient.createRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + createRealm(); + // [END gameservices_v1beta_generated_RealmsService_CreateRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/realms_service.delete_realm.js b/generated,README.md/generated/v1beta/realms_service.delete_realm.js new file mode 100644 index 0000000000..6fac763ee6 --- /dev/null +++ b/generated,README.md/generated/v1beta/realms_service.delete_realm.js @@ -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 gameservices_v1beta_generated_RealmsService_DeleteRealm_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the realm to delete. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function deleteRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteRealm(); + // [END gameservices_v1beta_generated_RealmsService_DeleteRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/realms_service.get_realm.js b/generated,README.md/generated/v1beta/realms_service.get_realm.js new file mode 100644 index 0000000000..c730f3260c --- /dev/null +++ b/generated,README.md/generated/v1beta/realms_service.get_realm.js @@ -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(name) { + // [START gameservices_v1beta_generated_RealmsService_GetRealm_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the realm to retrieve. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function getRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getRealm(request); + console.log(response); + } + + getRealm(); + // [END gameservices_v1beta_generated_RealmsService_GetRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/realms_service.list_realms.js b/generated,README.md/generated/v1beta/realms_service.list_realms.js new file mode 100644 index 0000000000..bd56b4deff --- /dev/null +++ b/generated,README.md/generated/v1beta/realms_service.list_realms.js @@ -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) { + // [START gameservices_v1beta_generated_RealmsService_ListRealms_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * [next_page_token][google.cloud.gaming.v1beta.ListRealmsResponse.next_page_token] + * to determine if there are more realms left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function listRealms() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listRealmsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listRealms(); + // [END gameservices_v1beta_generated_RealmsService_ListRealms_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/realms_service.preview_realm_update.js b/generated,README.md/generated/v1beta/realms_service.preview_realm_update.js new file mode 100644 index 0000000000..1958e72b10 --- /dev/null +++ b/generated,README.md/generated/v1beta/realms_service.preview_realm_update.js @@ -0,0 +1,66 @@ +// 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(realm, updateMask) { + // [START gameservices_v1beta_generated_RealmsService_PreviewRealmUpdate_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The realm to be updated. + * Only fields specified in update_mask are updated. + */ + // const realm = '' + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = '' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function previewRealmUpdate() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const response = await gamingClient.previewRealmUpdate(request); + console.log(response); + } + + previewRealmUpdate(); + // [END gameservices_v1beta_generated_RealmsService_PreviewRealmUpdate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/generated/v1beta/realms_service.update_realm.js b/generated,README.md/generated/v1beta/realms_service.update_realm.js new file mode 100644 index 0000000000..cbcceb69a6 --- /dev/null +++ b/generated,README.md/generated/v1beta/realms_service.update_realm.js @@ -0,0 +1,63 @@ +// 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(realm, updateMask) { + // [START gameservices_v1beta_generated_RealmsService_UpdateRealm_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The realm to be updated. + * Only fields specified in update_mask are updated. + */ + // const realm = '' + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = '' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function updateRealm() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateRealm(); + // [END gameservices_v1beta_generated_RealmsService_UpdateRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/generated,README.md/package.json b/generated,README.md/package.json index 2ea3f59a0b..589bce6b6a 100644 --- a/generated,README.md/package.json +++ b/generated,README.md/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=8" + "node": ">=10" }, "files": [ "*.js"