Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [Google.Cloud.Compute.V1] Update Compute Engine API to revision 20241201 (#966) #13969

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2024 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
//
// https://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.

// Generated code. DO NOT EDIT!

#pragma warning disable CS8981

namespace GoogleCSharpSnippets
{
// [START compute_v1_generated_InstanceGroupManagers_ResumeInstances_async_flattened]
using Google.Cloud.Compute.V1;
using System.Threading.Tasks;
using lro = Google.LongRunning;

public sealed partial class GeneratedInstanceGroupManagersClientSnippets
{
/// <summary>Snippet for ResumeInstancesAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task ResumeInstancesAsync()
{
// Create client
InstanceGroupManagersClient instanceGroupManagersClient = await InstanceGroupManagersClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string instanceGroupManager = "";
InstanceGroupManagersResumeInstancesRequest instanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest();
// Make the request
lro::Operation<Operation, Operation> response = await instanceGroupManagersClient.ResumeInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersResumeInstancesRequestResource);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await instanceGroupManagersClient.PollOnceResumeInstancesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}
}
}
// [END compute_v1_generated_InstanceGroupManagers_ResumeInstances_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Copyright 2024 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
//
// https://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.

// Generated code. DO NOT EDIT!

#pragma warning disable CS8981

namespace GoogleCSharpSnippets
{
// [START compute_v1_generated_InstanceGroupManagers_ResumeInstances_async]
using Google.Cloud.Compute.V1;
using System.Threading.Tasks;
using lro = Google.LongRunning;

public sealed partial class GeneratedInstanceGroupManagersClientSnippets
{
/// <summary>Snippet for ResumeInstancesAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task ResumeInstancesRequestObjectAsync()
{
// Create client
InstanceGroupManagersClient instanceGroupManagersClient = await InstanceGroupManagersClient.CreateAsync();
// Initialize request argument(s)
ResumeInstancesInstanceGroupManagerRequest request = new ResumeInstancesInstanceGroupManagerRequest
{
Zone = "",
RequestId = "",
InstanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest(),
Project = "",
InstanceGroupManager = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await instanceGroupManagersClient.ResumeInstancesAsync(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await instanceGroupManagersClient.PollOnceResumeInstancesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}
}
}
// [END compute_v1_generated_InstanceGroupManagers_ResumeInstances_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Copyright 2024 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
//
// https://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.

// Generated code. DO NOT EDIT!

#pragma warning disable CS8981

namespace GoogleCSharpSnippets
{
// [START compute_v1_generated_InstanceGroupManagers_ResumeInstances_sync]
using Google.Cloud.Compute.V1;
using lro = Google.LongRunning;

public sealed partial class GeneratedInstanceGroupManagersClientSnippets
{
/// <summary>Snippet for ResumeInstances</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void ResumeInstancesRequestObject()
{
// Create client
InstanceGroupManagersClient instanceGroupManagersClient = InstanceGroupManagersClient.Create();
// Initialize request argument(s)
ResumeInstancesInstanceGroupManagerRequest request = new ResumeInstancesInstanceGroupManagerRequest
{
Zone = "",
RequestId = "",
InstanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest(),
Project = "",
InstanceGroupManager = "",
};
// Make the request
lro::Operation<Operation, Operation> response = instanceGroupManagersClient.ResumeInstances(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = instanceGroupManagersClient.PollOnceResumeInstances(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}
}
}
// [END compute_v1_generated_InstanceGroupManagers_ResumeInstances_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright 2024 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
//
// https://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.

// Generated code. DO NOT EDIT!

#pragma warning disable CS8981

namespace GoogleCSharpSnippets
{
// [START compute_v1_generated_InstanceGroupManagers_ResumeInstances_sync_flattened]
using Google.Cloud.Compute.V1;
using lro = Google.LongRunning;

public sealed partial class GeneratedInstanceGroupManagersClientSnippets
{
/// <summary>Snippet for ResumeInstances</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void ResumeInstances()
{
// Create client
InstanceGroupManagersClient instanceGroupManagersClient = InstanceGroupManagersClient.Create();
// Initialize request argument(s)
string project = "";
string zone = "";
string instanceGroupManager = "";
InstanceGroupManagersResumeInstancesRequest instanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest();
// Make the request
lro::Operation<Operation, Operation> response = instanceGroupManagersClient.ResumeInstances(project, zone, instanceGroupManager, instanceGroupManagersResumeInstancesRequestResource);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = instanceGroupManagersClient.PollOnceResumeInstances(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}
}
}
// [END compute_v1_generated_InstanceGroupManagers_ResumeInstances_sync_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2024 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
//
// https://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.

// Generated code. DO NOT EDIT!

#pragma warning disable CS8981

namespace GoogleCSharpSnippets
{
// [START compute_v1_generated_InstanceGroupManagers_StartInstances_async_flattened]
using Google.Cloud.Compute.V1;
using System.Threading.Tasks;
using lro = Google.LongRunning;

public sealed partial class GeneratedInstanceGroupManagersClientSnippets
{
/// <summary>Snippet for StartInstancesAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task StartInstancesAsync()
{
// Create client
InstanceGroupManagersClient instanceGroupManagersClient = await InstanceGroupManagersClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string zone = "";
string instanceGroupManager = "";
InstanceGroupManagersStartInstancesRequest instanceGroupManagersStartInstancesRequestResource = new InstanceGroupManagersStartInstancesRequest();
// Make the request
lro::Operation<Operation, Operation> response = await instanceGroupManagersClient.StartInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersStartInstancesRequestResource);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await instanceGroupManagersClient.PollOnceStartInstancesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}
}
}
// [END compute_v1_generated_InstanceGroupManagers_StartInstances_async_flattened]
}
Loading
Loading