Skip to content

Commit

Permalink
feat: Adding private connection CRUD, updating management subnets and…
Browse files Browse the repository at this point in the history
… time-limited PC features

PiperOrigin-RevId: 538382998

Source-Link: googleapis/googleapis@e51050b
  • Loading branch information
jskeet committed Jun 12, 2023
1 parent 1b68871 commit 9a97ef1
Show file tree
Hide file tree
Showing 53 changed files with 18,752 additions and 5,315 deletions.
@@ -0,0 +1,63 @@
// Copyright 2023 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!

namespace GoogleCSharpSnippets
{
// [START vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async_flattened]
using Google.Cloud.VmwareEngine.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedVmwareEngineClientSnippets
{
/// <summary>Snippet for CreatePrivateConnectionAsync</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 CreatePrivateConnectionAsync()
{
// Create client
VmwareEngineClient vmwareEngineClient = await VmwareEngineClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
PrivateConnection privateConnection = new PrivateConnection();
string privateConnectionId = "";
// Make the request
Operation<PrivateConnection, OperationMetadata> response = await vmwareEngineClient.CreatePrivateConnectionAsync(parent, privateConnection, privateConnectionId);

// Poll until the returned long-running operation is complete
Operation<PrivateConnection, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PrivateConnection 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
Operation<PrivateConnection, OperationMetadata> retrievedResponse = await vmwareEngineClient.PollOnceCreatePrivateConnectionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PrivateConnection retrievedResult = retrievedResponse.Result;
}
}
}
// [END vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async_flattened]
}
@@ -0,0 +1,68 @@
// Copyright 2023 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!

namespace GoogleCSharpSnippets
{
// [START vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.VmwareEngine.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedVmwareEngineClientSnippets
{
/// <summary>Snippet for CreatePrivateConnectionAsync</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 CreatePrivateConnectionRequestObjectAsync()
{
// Create client
VmwareEngineClient vmwareEngineClient = await VmwareEngineClient.CreateAsync();
// Initialize request argument(s)
CreatePrivateConnectionRequest request = new CreatePrivateConnectionRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
PrivateConnectionId = "",
PrivateConnection = new PrivateConnection(),
RequestId = "",
};
// Make the request
Operation<PrivateConnection, OperationMetadata> response = await vmwareEngineClient.CreatePrivateConnectionAsync(request);

// Poll until the returned long-running operation is complete
Operation<PrivateConnection, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PrivateConnection 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
Operation<PrivateConnection, OperationMetadata> retrievedResponse = await vmwareEngineClient.PollOnceCreatePrivateConnectionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PrivateConnection retrievedResult = retrievedResponse.Result;
}
}
}
// [END vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async]
}
@@ -0,0 +1,67 @@
// Copyright 2023 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!

namespace GoogleCSharpSnippets
{
// [START vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.VmwareEngine.V1;
using Google.LongRunning;

public sealed partial class GeneratedVmwareEngineClientSnippets
{
/// <summary>Snippet for CreatePrivateConnection</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 CreatePrivateConnectionRequestObject()
{
// Create client
VmwareEngineClient vmwareEngineClient = VmwareEngineClient.Create();
// Initialize request argument(s)
CreatePrivateConnectionRequest request = new CreatePrivateConnectionRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
PrivateConnectionId = "",
PrivateConnection = new PrivateConnection(),
RequestId = "",
};
// Make the request
Operation<PrivateConnection, OperationMetadata> response = vmwareEngineClient.CreatePrivateConnection(request);

// Poll until the returned long-running operation is complete
Operation<PrivateConnection, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PrivateConnection 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
Operation<PrivateConnection, OperationMetadata> retrievedResponse = vmwareEngineClient.PollOnceCreatePrivateConnection(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PrivateConnection retrievedResult = retrievedResponse.Result;
}
}
}
// [END vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync]
}
@@ -0,0 +1,64 @@
// Copyright 2023 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!

namespace GoogleCSharpSnippets
{
// [START vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async_flattened_resourceNames]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.VmwareEngine.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedVmwareEngineClientSnippets
{
/// <summary>Snippet for CreatePrivateConnectionAsync</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 CreatePrivateConnectionResourceNamesAsync()
{
// Create client
VmwareEngineClient vmwareEngineClient = await VmwareEngineClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
PrivateConnection privateConnection = new PrivateConnection();
string privateConnectionId = "";
// Make the request
Operation<PrivateConnection, OperationMetadata> response = await vmwareEngineClient.CreatePrivateConnectionAsync(parent, privateConnection, privateConnectionId);

// Poll until the returned long-running operation is complete
Operation<PrivateConnection, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PrivateConnection 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
Operation<PrivateConnection, OperationMetadata> retrievedResponse = await vmwareEngineClient.PollOnceCreatePrivateConnectionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PrivateConnection retrievedResult = retrievedResponse.Result;
}
}
}
// [END vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_async_flattened_resourceNames]
}
@@ -0,0 +1,63 @@
// Copyright 2023 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!

namespace GoogleCSharpSnippets
{
// [START vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync_flattened_resourceNames]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.VmwareEngine.V1;
using Google.LongRunning;

public sealed partial class GeneratedVmwareEngineClientSnippets
{
/// <summary>Snippet for CreatePrivateConnection</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 CreatePrivateConnectionResourceNames()
{
// Create client
VmwareEngineClient vmwareEngineClient = VmwareEngineClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
PrivateConnection privateConnection = new PrivateConnection();
string privateConnectionId = "";
// Make the request
Operation<PrivateConnection, OperationMetadata> response = vmwareEngineClient.CreatePrivateConnection(parent, privateConnection, privateConnectionId);

// Poll until the returned long-running operation is complete
Operation<PrivateConnection, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PrivateConnection 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
Operation<PrivateConnection, OperationMetadata> retrievedResponse = vmwareEngineClient.PollOnceCreatePrivateConnection(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PrivateConnection retrievedResult = retrievedResponse.Result;
}
}
}
// [END vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync_flattened_resourceNames]
}
@@ -0,0 +1,62 @@
// Copyright 2023 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!

namespace GoogleCSharpSnippets
{
// [START vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync_flattened]
using Google.Cloud.VmwareEngine.V1;
using Google.LongRunning;

public sealed partial class GeneratedVmwareEngineClientSnippets
{
/// <summary>Snippet for CreatePrivateConnection</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 CreatePrivateConnection()
{
// Create client
VmwareEngineClient vmwareEngineClient = VmwareEngineClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
PrivateConnection privateConnection = new PrivateConnection();
string privateConnectionId = "";
// Make the request
Operation<PrivateConnection, OperationMetadata> response = vmwareEngineClient.CreatePrivateConnection(parent, privateConnection, privateConnectionId);

// Poll until the returned long-running operation is complete
Operation<PrivateConnection, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PrivateConnection 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
Operation<PrivateConnection, OperationMetadata> retrievedResponse = vmwareEngineClient.PollOnceCreatePrivateConnection(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PrivateConnection retrievedResult = retrievedResponse.Result;
}
}
}
// [END vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync_flattened]
}

0 comments on commit 9a97ef1

Please sign in to comment.