Skip to content
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
2 changes: 2 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@
"apis/Google.Cloud.Workflows.V1Beta/Google.Cloud.Workflows.V1Beta/**",
"apis/Google.Cloud.WorkloadManager.V1/Google.Cloud.WorkloadManager.V1/**",
"apis/Google.Cloud.Workstations.V1/Google.Cloud.Workstations.V1/**",
"apis/Google.Developers.Knowledge.V1/Google.Developers.Knowledge.V1/**",
"apis/Google.Geo.Type/Google.Geo.Type/**",
"apis/Google.Identity.AccessContextManager.Type/Google.Identity.AccessContextManager.Type/**",
"apis/Google.Identity.AccessContextManager.V1/Google.Identity.AccessContextManager.V1/**",
Expand All @@ -315,6 +316,7 @@
"apis/Google.Maps.FleetEngine.Delivery.V1/Google.Maps.FleetEngine.Delivery.V1/**",
"apis/Google.Maps.FleetEngine.V1/Google.Maps.FleetEngine.V1/**",
"apis/Google.Maps.Geocode.V4/Google.Maps.Geocode.V4/**",
"apis/Google.Maps.MapManagement.V2Beta/Google.Maps.MapManagement.V2Beta/**",
"apis/Google.Maps.MapsPlatformDatasets.V1/Google.Maps.MapsPlatformDatasets.V1/**",
"apis/Google.Maps.Places.V1/Google.Maps.Places.V1/**",
"apis/Google.Maps.RouteOptimization.V1/Google.Maps.RouteOptimization.V1/**",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2026 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 iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_async_flattened]
using Google.Cloud.Iam.V3Beta;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedAccessPoliciesClientSnippets
{
/// <summary>Snippet for CreateAccessPolicyAsync</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 CreateAccessPolicyAsync()
{
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
AccessPolicy accessPolicy = new AccessPolicy();
string accessPolicyId = "";
// Make the request
Operation<AccessPolicy, OperationMetadata> response = await accessPoliciesClient.CreateAccessPolicyAsync(parent, accessPolicy, accessPolicyId);

// Poll until the returned long-running operation is complete
Operation<AccessPolicy, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AccessPolicy 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<AccessPolicy, OperationMetadata> retrievedResponse = await accessPoliciesClient.PollOnceCreateAccessPolicyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AccessPolicy retrievedResult = retrievedResponse.Result;
}
}
}
// [END iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright 2026 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 iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_async]
using Google.Cloud.Iam.V3Beta;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedAccessPoliciesClientSnippets
{
/// <summary>Snippet for CreateAccessPolicyAsync</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 CreateAccessPolicyRequestObjectAsync()
{
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
CreateAccessPolicyRequest request = new CreateAccessPolicyRequest
{
ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
AccessPolicyId = "",
AccessPolicy = new AccessPolicy(),
ValidateOnly = false,
};
// Make the request
Operation<AccessPolicy, OperationMetadata> response = await accessPoliciesClient.CreateAccessPolicyAsync(request);

// Poll until the returned long-running operation is complete
Operation<AccessPolicy, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AccessPolicy 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<AccessPolicy, OperationMetadata> retrievedResponse = await accessPoliciesClient.PollOnceCreateAccessPolicyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AccessPolicy retrievedResult = retrievedResponse.Result;
}
}
}
// [END iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2026 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 iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_sync]
using Google.Cloud.Iam.V3Beta;
using Google.LongRunning;

public sealed partial class GeneratedAccessPoliciesClientSnippets
{
/// <summary>Snippet for CreateAccessPolicy</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 CreateAccessPolicyRequestObject()
{
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
CreateAccessPolicyRequest request = new CreateAccessPolicyRequest
{
ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
AccessPolicyId = "",
AccessPolicy = new AccessPolicy(),
ValidateOnly = false,
};
// Make the request
Operation<AccessPolicy, OperationMetadata> response = accessPoliciesClient.CreateAccessPolicy(request);

// Poll until the returned long-running operation is complete
Operation<AccessPolicy, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AccessPolicy 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<AccessPolicy, OperationMetadata> retrievedResponse = accessPoliciesClient.PollOnceCreateAccessPolicy(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AccessPolicy retrievedResult = retrievedResponse.Result;
}
}
}
// [END iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2026 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 iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_async_flattened_resourceNames1]
using Google.Cloud.Iam.V3Beta;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedAccessPoliciesClientSnippets
{
/// <summary>Snippet for CreateAccessPolicyAsync</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 CreateAccessPolicyResourceNames1Async()
{
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
AccessPolicy accessPolicy = new AccessPolicy();
string accessPolicyId = "";
// Make the request
Operation<AccessPolicy, OperationMetadata> response = await accessPoliciesClient.CreateAccessPolicyAsync(parent, accessPolicy, accessPolicyId);

// Poll until the returned long-running operation is complete
Operation<AccessPolicy, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AccessPolicy 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<AccessPolicy, OperationMetadata> retrievedResponse = await accessPoliciesClient.PollOnceCreateAccessPolicyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
AccessPolicy retrievedResult = retrievedResponse.Result;
}
}
}
// [END iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_async_flattened_resourceNames1]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright 2026 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 iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_sync_flattened_resourceNames1]
using Google.Cloud.Iam.V3Beta;
using Google.LongRunning;

public sealed partial class GeneratedAccessPoliciesClientSnippets
{
/// <summary>Snippet for CreateAccessPolicy</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 CreateAccessPolicyResourceNames1()
{
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
AccessPolicy accessPolicy = new AccessPolicy();
string accessPolicyId = "";
// Make the request
Operation<AccessPolicy, OperationMetadata> response = accessPoliciesClient.CreateAccessPolicy(parent, accessPolicy, accessPolicyId);

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