Skip to content

Commit

Permalink
feat: Update Hub API
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 504700327

Source-Link: googleapis/googleapis@91b494f

Source-Link: googleapis/googleapis-gen@9af0d4f
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuTmV0d29ya0Nvbm5lY3Rpdml0eS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiOWFmMGQ0ZmU3OWI2MGM5ZmNiODUzOTQ5N2QxOGExNGY1OTE3ZDk1MiJ9
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Jan 26, 2023
1 parent e4901eb commit 49cf881
Show file tree
Hide file tree
Showing 39 changed files with 9,622 additions and 812 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 Google.Cloud.NetworkConnectivity.V1.Snippets
{
// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_async_flattened]
using Google.Cloud.NetworkConnectivity.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedPolicyBasedRoutingServiceClientSnippets
{
/// <summary>Snippet for CreatePolicyBasedRouteAsync</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 CreatePolicyBasedRouteAsync()
{
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
PolicyBasedRoute policyBasedRoute = new PolicyBasedRoute();
string policyBasedRouteId = "";
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = await policyBasedRoutingServiceClient.CreatePolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBasedRoute 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<PolicyBasedRoute, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}
}
}
// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_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 Google.Cloud.NetworkConnectivity.V1.Snippets
{
// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_async]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.NetworkConnectivity.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedPolicyBasedRoutingServiceClientSnippets
{
/// <summary>Snippet for CreatePolicyBasedRouteAsync</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 CreatePolicyBasedRouteRequestObjectAsync()
{
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
CreatePolicyBasedRouteRequest request = new CreatePolicyBasedRouteRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
PolicyBasedRouteId = "",
PolicyBasedRoute = new PolicyBasedRoute(),
RequestId = "",
};
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = await policyBasedRoutingServiceClient.CreatePolicyBasedRouteAsync(request);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBasedRoute 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<PolicyBasedRoute, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}
}
}
// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_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 Google.Cloud.NetworkConnectivity.V1.Snippets
{
// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_sync]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.NetworkConnectivity.V1;
using Google.LongRunning;

public sealed partial class GeneratedPolicyBasedRoutingServiceClientSnippets
{
/// <summary>Snippet for CreatePolicyBasedRoute</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 CreatePolicyBasedRouteRequestObject()
{
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
CreatePolicyBasedRouteRequest request = new CreatePolicyBasedRouteRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
PolicyBasedRouteId = "",
PolicyBasedRoute = new PolicyBasedRoute(),
RequestId = "",
};
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = policyBasedRoutingServiceClient.CreatePolicyBasedRoute(request);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBasedRoute 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<PolicyBasedRoute, OperationMetadata> retrievedResponse = policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRoute(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}
}
}
// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_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 Google.Cloud.NetworkConnectivity.V1.Snippets
{
// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_async_flattened_resourceNames]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.NetworkConnectivity.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedPolicyBasedRoutingServiceClientSnippets
{
/// <summary>Snippet for CreatePolicyBasedRouteAsync</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 CreatePolicyBasedRouteResourceNamesAsync()
{
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = await PolicyBasedRoutingServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
PolicyBasedRoute policyBasedRoute = new PolicyBasedRoute();
string policyBasedRouteId = "";
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = await policyBasedRoutingServiceClient.CreatePolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId);

// Poll until the returned long-running operation is complete
Operation<PolicyBasedRoute, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBasedRoute 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<PolicyBasedRoute, OperationMetadata> retrievedResponse = await policyBasedRoutingServiceClient.PollOnceCreatePolicyBasedRouteAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBasedRoute retrievedResult = retrievedResponse.Result;
}
}
}
// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_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 Google.Cloud.NetworkConnectivity.V1.Snippets
{
// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_sync_flattened_resourceNames]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.NetworkConnectivity.V1;
using Google.LongRunning;

public sealed partial class GeneratedPolicyBasedRoutingServiceClientSnippets
{
/// <summary>Snippet for CreatePolicyBasedRoute</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 CreatePolicyBasedRouteResourceNames()
{
// Create client
PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = PolicyBasedRoutingServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
PolicyBasedRoute policyBasedRoute = new PolicyBasedRoute();
string policyBasedRouteId = "";
// Make the request
Operation<PolicyBasedRoute, OperationMetadata> response = policyBasedRoutingServiceClient.CreatePolicyBasedRoute(parent, policyBasedRoute, policyBasedRouteId);

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

0 comments on commit 49cf881

Please sign in to comment.