Identity and Access Management (IAM) v3beta API - Class AccessPoliciesClient (1.0.0-beta03)

public abstract class AccessPoliciesClient

Reference documentation and code samples for the Identity and Access Management (IAM) v3beta API class AccessPoliciesClient.

AccessPolicies client wrapper, for convenient use.

Inheritance

object > AccessPoliciesClient

Derived Types

Namespace

Google.Cloud.Iam.V3Beta

Assembly

Google.Cloud.Iam.V3Beta.dll

Remarks

Manages Identity and Access Management (IAM) access policies.

Properties

CreateAccessPolicyOperationsClient

public virtual OperationsClient CreateAccessPolicyOperationsClient { get; }

The long-running operations client for CreateAccessPolicy.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the AccessPolicies service, which is a host of "iam.googleapis.com" and a port of 443.

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default AccessPolicies scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default AccessPolicies scopes are:

DeleteAccessPolicyOperationsClient

public virtual OperationsClient DeleteAccessPolicyOperationsClient { get; }

The long-running operations client for DeleteAccessPolicy.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual AccessPolicies.AccessPoliciesClient GrpcClient { get; }

The underlying gRPC AccessPolicies client

Property Value
Type Description
AccessPoliciesAccessPoliciesClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

UpdateAccessPolicyOperationsClient

public virtual OperationsClient UpdateAccessPolicyOperationsClient { get; }

The long-running operations client for UpdateAccessPolicy.

Property Value
Type Description
OperationsClient

Methods

Create()

public static AccessPoliciesClient Create()

Synchronously creates a AccessPoliciesClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AccessPoliciesClientBuilder.

Returns
Type Description
AccessPoliciesClient

The created AccessPoliciesClient.

CreateAccessPolicy(LocationName, AccessPolicy, string, CallSettings)

public virtual Operation<AccessPolicy, OperationMetadata> CreateAccessPolicy(LocationName parent, AccessPolicy accessPolicy, string accessPolicyId, CallSettings callSettings = null)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent LocationName

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAccessPolicyOperationMetadata

The RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[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;
}

CreateAccessPolicy(CreateAccessPolicyRequest, CallSettings)

public virtual Operation<AccessPolicy, OperationMetadata> CreateAccessPolicy(CreateAccessPolicyRequest request, CallSettings callSettings = null)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
request CreateAccessPolicyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAccessPolicyOperationMetadata

The RPC response.

Example
// 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;
}

CreateAccessPolicy(FolderLocationName, AccessPolicy, string, CallSettings)

public virtual Operation<AccessPolicy, OperationMetadata> CreateAccessPolicy(FolderLocationName parent, AccessPolicy accessPolicy, string accessPolicyId, CallSettings callSettings = null)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent FolderLocationName

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAccessPolicyOperationMetadata

The RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[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;
}

CreateAccessPolicy(OrganizationLocationName, AccessPolicy, string, CallSettings)

public virtual Operation<AccessPolicy, OperationMetadata> CreateAccessPolicy(OrganizationLocationName parent, AccessPolicy accessPolicy, string accessPolicyId, CallSettings callSettings = null)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent OrganizationLocationName

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAccessPolicyOperationMetadata

The RPC response.

Example
// 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;
}

CreateAccessPolicy(string, AccessPolicy, string, CallSettings)

public virtual Operation<AccessPolicy, OperationMetadata> CreateAccessPolicy(string parent, AccessPolicy accessPolicy, string accessPolicyId, CallSettings callSettings = null)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent string

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAccessPolicyOperationMetadata

The RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[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;
}

CreateAccessPolicyAsync(LocationName, AccessPolicy, string, CallSettings)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> CreateAccessPolicyAsync(LocationName parent, AccessPolicy accessPolicy, string accessPolicyId, CallSettings callSettings = null)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent LocationName

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[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;
}

CreateAccessPolicyAsync(LocationName, AccessPolicy, string, CancellationToken)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> CreateAccessPolicyAsync(LocationName parent, AccessPolicy accessPolicy, string accessPolicyId, CancellationToken cancellationToken)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent LocationName

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[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;
}

CreateAccessPolicyAsync(CreateAccessPolicyRequest, CallSettings)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> CreateAccessPolicyAsync(CreateAccessPolicyRequest request, CallSettings callSettings = null)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
request CreateAccessPolicyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// 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;
}

CreateAccessPolicyAsync(CreateAccessPolicyRequest, CancellationToken)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> CreateAccessPolicyAsync(CreateAccessPolicyRequest request, CancellationToken cancellationToken)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
request CreateAccessPolicyRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// 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;
}

CreateAccessPolicyAsync(FolderLocationName, AccessPolicy, string, CallSettings)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> CreateAccessPolicyAsync(FolderLocationName parent, AccessPolicy accessPolicy, string accessPolicyId, CallSettings callSettings = null)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent FolderLocationName

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[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;
}

CreateAccessPolicyAsync(FolderLocationName, AccessPolicy, string, CancellationToken)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> CreateAccessPolicyAsync(FolderLocationName parent, AccessPolicy accessPolicy, string accessPolicyId, CancellationToken cancellationToken)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent FolderLocationName

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[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;
}

CreateAccessPolicyAsync(OrganizationLocationName, AccessPolicy, string, CallSettings)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> CreateAccessPolicyAsync(OrganizationLocationName parent, AccessPolicy accessPolicy, string accessPolicyId, CallSettings callSettings = null)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent OrganizationLocationName

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// 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;
}

CreateAccessPolicyAsync(OrganizationLocationName, AccessPolicy, string, CancellationToken)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> CreateAccessPolicyAsync(OrganizationLocationName parent, AccessPolicy accessPolicy, string accessPolicyId, CancellationToken cancellationToken)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent OrganizationLocationName

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// 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;
}

CreateAccessPolicyAsync(string, AccessPolicy, string, CallSettings)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> CreateAccessPolicyAsync(string parent, AccessPolicy accessPolicy, string accessPolicyId, CallSettings callSettings = null)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent string

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// 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;
}

CreateAccessPolicyAsync(string, AccessPolicy, string, CancellationToken)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> CreateAccessPolicyAsync(string parent, AccessPolicy accessPolicy, string accessPolicyId, CancellationToken cancellationToken)

Creates an access policy, and returns a long running operation.

Parameters
Name Description
parent string

Required. The parent resource where this access policy will be created.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

accessPolicy AccessPolicy

Required. The access policy to create.

accessPolicyId string

Required. The ID to use for the access policy, which will become the final component of the access policy's resource name.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.

This value must be unique among all access policies with the same parent.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// 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;
}

CreateAsync(CancellationToken)

public static Task<AccessPoliciesClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a AccessPoliciesClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AccessPoliciesClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskAccessPoliciesClient

The task representing the created AccessPoliciesClient.

DeleteAccessPolicy(AccessPolicyName, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteAccessPolicy(AccessPolicyName name, CallSettings callSettings = null)

Deletes an access policy.

Parameters
Name Description
name AccessPolicyName

Required. The name of the access policy to delete.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
AccessPolicyName name = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]");
// Make the request
Operation<Empty, OperationMetadata> response = accessPoliciesClient.DeleteAccessPolicy(name);

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

DeleteAccessPolicy(DeleteAccessPolicyRequest, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteAccessPolicy(DeleteAccessPolicyRequest request, CallSettings callSettings = null)

Deletes an access policy.

Parameters
Name Description
request DeleteAccessPolicyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
DeleteAccessPolicyRequest request = new DeleteAccessPolicyRequest
{
    AccessPolicyName = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]"),
    Etag = "",
    ValidateOnly = false,
    Force = false,
};
// Make the request
Operation<Empty, OperationMetadata> response = accessPoliciesClient.DeleteAccessPolicy(request);

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

DeleteAccessPolicy(string, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteAccessPolicy(string name, CallSettings callSettings = null)

Deletes an access policy.

Parameters
Name Description
name string

Required. The name of the access policy to delete.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/accessPolicies/[ACCESS_POLICY]";
// Make the request
Operation<Empty, OperationMetadata> response = accessPoliciesClient.DeleteAccessPolicy(name);

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

DeleteAccessPolicyAsync(AccessPolicyName, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteAccessPolicyAsync(AccessPolicyName name, CallSettings callSettings = null)

Deletes an access policy.

Parameters
Name Description
name AccessPolicyName

Required. The name of the access policy to delete.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
AccessPolicyName name = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]");
// Make the request
Operation<Empty, OperationMetadata> response = await accessPoliciesClient.DeleteAccessPolicyAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await accessPoliciesClient.PollOnceDeleteAccessPolicyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteAccessPolicyAsync(AccessPolicyName, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteAccessPolicyAsync(AccessPolicyName name, CancellationToken cancellationToken)

Deletes an access policy.

Parameters
Name Description
name AccessPolicyName

Required. The name of the access policy to delete.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
AccessPolicyName name = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]");
// Make the request
Operation<Empty, OperationMetadata> response = await accessPoliciesClient.DeleteAccessPolicyAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await accessPoliciesClient.PollOnceDeleteAccessPolicyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteAccessPolicyAsync(DeleteAccessPolicyRequest, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteAccessPolicyAsync(DeleteAccessPolicyRequest request, CallSettings callSettings = null)

Deletes an access policy.

Parameters
Name Description
request DeleteAccessPolicyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
DeleteAccessPolicyRequest request = new DeleteAccessPolicyRequest
{
    AccessPolicyName = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]"),
    Etag = "",
    ValidateOnly = false,
    Force = false,
};
// Make the request
Operation<Empty, OperationMetadata> response = await accessPoliciesClient.DeleteAccessPolicyAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await accessPoliciesClient.PollOnceDeleteAccessPolicyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteAccessPolicyAsync(DeleteAccessPolicyRequest, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteAccessPolicyAsync(DeleteAccessPolicyRequest request, CancellationToken cancellationToken)

Deletes an access policy.

Parameters
Name Description
request DeleteAccessPolicyRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
DeleteAccessPolicyRequest request = new DeleteAccessPolicyRequest
{
    AccessPolicyName = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]"),
    Etag = "",
    ValidateOnly = false,
    Force = false,
};
// Make the request
Operation<Empty, OperationMetadata> response = await accessPoliciesClient.DeleteAccessPolicyAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await accessPoliciesClient.PollOnceDeleteAccessPolicyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteAccessPolicyAsync(string, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteAccessPolicyAsync(string name, CallSettings callSettings = null)

Deletes an access policy.

Parameters
Name Description
name string

Required. The name of the access policy to delete.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/accessPolicies/[ACCESS_POLICY]";
// Make the request
Operation<Empty, OperationMetadata> response = await accessPoliciesClient.DeleteAccessPolicyAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await accessPoliciesClient.PollOnceDeleteAccessPolicyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteAccessPolicyAsync(string, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteAccessPolicyAsync(string name, CancellationToken cancellationToken)

Deletes an access policy.

Parameters
Name Description
name string

Required. The name of the access policy to delete.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/accessPolicies/[ACCESS_POLICY]";
// Make the request
Operation<Empty, OperationMetadata> response = await accessPoliciesClient.DeleteAccessPolicyAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await accessPoliciesClient.PollOnceDeleteAccessPolicyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

GetAccessPolicy(AccessPolicyName, CallSettings)

public virtual AccessPolicy GetAccessPolicy(AccessPolicyName name, CallSettings callSettings = null)

Gets an access policy.

Parameters
Name Description
name AccessPolicyName

Required. The name of the access policy to retrieve.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AccessPolicy

The RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
AccessPolicyName name = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]");
// Make the request
AccessPolicy response = accessPoliciesClient.GetAccessPolicy(name);

GetAccessPolicy(GetAccessPolicyRequest, CallSettings)

public virtual AccessPolicy GetAccessPolicy(GetAccessPolicyRequest request, CallSettings callSettings = null)

Gets an access policy.

Parameters
Name Description
request GetAccessPolicyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AccessPolicy

The RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
GetAccessPolicyRequest request = new GetAccessPolicyRequest
{
    AccessPolicyName = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]"),
};
// Make the request
AccessPolicy response = accessPoliciesClient.GetAccessPolicy(request);

GetAccessPolicy(string, CallSettings)

public virtual AccessPolicy GetAccessPolicy(string name, CallSettings callSettings = null)

Gets an access policy.

Parameters
Name Description
name string

Required. The name of the access policy to retrieve.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AccessPolicy

The RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/accessPolicies/[ACCESS_POLICY]";
// Make the request
AccessPolicy response = accessPoliciesClient.GetAccessPolicy(name);

GetAccessPolicyAsync(AccessPolicyName, CallSettings)

public virtual Task<AccessPolicy> GetAccessPolicyAsync(AccessPolicyName name, CallSettings callSettings = null)

Gets an access policy.

Parameters
Name Description
name AccessPolicyName

Required. The name of the access policy to retrieve.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAccessPolicy

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
AccessPolicyName name = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]");
// Make the request
AccessPolicy response = await accessPoliciesClient.GetAccessPolicyAsync(name);

GetAccessPolicyAsync(AccessPolicyName, CancellationToken)

public virtual Task<AccessPolicy> GetAccessPolicyAsync(AccessPolicyName name, CancellationToken cancellationToken)

Gets an access policy.

Parameters
Name Description
name AccessPolicyName

Required. The name of the access policy to retrieve.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAccessPolicy

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
AccessPolicyName name = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]");
// Make the request
AccessPolicy response = await accessPoliciesClient.GetAccessPolicyAsync(name);

GetAccessPolicyAsync(GetAccessPolicyRequest, CallSettings)

public virtual Task<AccessPolicy> GetAccessPolicyAsync(GetAccessPolicyRequest request, CallSettings callSettings = null)

Gets an access policy.

Parameters
Name Description
request GetAccessPolicyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAccessPolicy

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
GetAccessPolicyRequest request = new GetAccessPolicyRequest
{
    AccessPolicyName = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]"),
};
// Make the request
AccessPolicy response = await accessPoliciesClient.GetAccessPolicyAsync(request);

GetAccessPolicyAsync(GetAccessPolicyRequest, CancellationToken)

public virtual Task<AccessPolicy> GetAccessPolicyAsync(GetAccessPolicyRequest request, CancellationToken cancellationToken)

Gets an access policy.

Parameters
Name Description
request GetAccessPolicyRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAccessPolicy

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
GetAccessPolicyRequest request = new GetAccessPolicyRequest
{
    AccessPolicyName = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]"),
};
// Make the request
AccessPolicy response = await accessPoliciesClient.GetAccessPolicyAsync(request);

GetAccessPolicyAsync(string, CallSettings)

public virtual Task<AccessPolicy> GetAccessPolicyAsync(string name, CallSettings callSettings = null)

Gets an access policy.

Parameters
Name Description
name string

Required. The name of the access policy to retrieve.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAccessPolicy

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/accessPolicies/[ACCESS_POLICY]";
// Make the request
AccessPolicy response = await accessPoliciesClient.GetAccessPolicyAsync(name);

GetAccessPolicyAsync(string, CancellationToken)

public virtual Task<AccessPolicy> GetAccessPolicyAsync(string name, CancellationToken cancellationToken)

Gets an access policy.

Parameters
Name Description
name string

Required. The name of the access policy to retrieve.

Format: projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAccessPolicy

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/accessPolicies/[ACCESS_POLICY]";
// Make the request
AccessPolicy response = await accessPoliciesClient.GetAccessPolicyAsync(name);

ListAccessPolicies(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListAccessPoliciesResponse, AccessPolicy> ListAccessPolicies(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists access policies.

Parameters
Name Description
parent LocationName

Required. The parent resource, which owns the collection of access policy resources.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAccessPoliciesResponseAccessPolicy

A pageable sequence of AccessPolicy resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListAccessPoliciesResponse, AccessPolicy> response = accessPoliciesClient.ListAccessPolicies(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AccessPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAccessPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AccessPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AccessPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AccessPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAccessPolicies(FolderLocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListAccessPoliciesResponse, AccessPolicy> ListAccessPolicies(FolderLocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists access policies.

Parameters
Name Description
parent FolderLocationName

Required. The parent resource, which owns the collection of access policy resources.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAccessPoliciesResponseAccessPolicy

A pageable sequence of AccessPolicy resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[LOCATION]");
// Make the request
PagedEnumerable<ListAccessPoliciesResponse, AccessPolicy> response = accessPoliciesClient.ListAccessPolicies(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AccessPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAccessPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AccessPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AccessPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AccessPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAccessPolicies(ListAccessPoliciesRequest, CallSettings)

public virtual PagedEnumerable<ListAccessPoliciesResponse, AccessPolicy> ListAccessPolicies(ListAccessPoliciesRequest request, CallSettings callSettings = null)

Lists access policies.

Parameters
Name Description
request ListAccessPoliciesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAccessPoliciesResponseAccessPolicy

A pageable sequence of AccessPolicy resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
ListAccessPoliciesRequest request = new ListAccessPoliciesRequest
{
    ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListAccessPoliciesResponse, AccessPolicy> response = accessPoliciesClient.ListAccessPolicies(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (AccessPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAccessPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AccessPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AccessPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AccessPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAccessPolicies(OrganizationLocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListAccessPoliciesResponse, AccessPolicy> ListAccessPolicies(OrganizationLocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists access policies.

Parameters
Name Description
parent OrganizationLocationName

Required. The parent resource, which owns the collection of access policy resources.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAccessPoliciesResponseAccessPolicy

A pageable sequence of AccessPolicy resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
PagedEnumerable<ListAccessPoliciesResponse, AccessPolicy> response = accessPoliciesClient.ListAccessPolicies(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AccessPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAccessPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AccessPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AccessPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AccessPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAccessPolicies(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListAccessPoliciesResponse, AccessPolicy> ListAccessPolicies(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists access policies.

Parameters
Name Description
parent string

Required. The parent resource, which owns the collection of access policy resources.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAccessPoliciesResponseAccessPolicy

A pageable sequence of AccessPolicy resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListAccessPoliciesResponse, AccessPolicy> response = accessPoliciesClient.ListAccessPolicies(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AccessPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAccessPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AccessPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AccessPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AccessPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAccessPoliciesAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAccessPoliciesResponse, AccessPolicy> ListAccessPoliciesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists access policies.

Parameters
Name Description
parent LocationName

Required. The parent resource, which owns the collection of access policy resources.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAccessPoliciesResponseAccessPolicy

A pageable asynchronous sequence of AccessPolicy resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListAccessPoliciesResponse, AccessPolicy> response = accessPoliciesClient.ListAccessPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AccessPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAccessPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AccessPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AccessPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AccessPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAccessPoliciesAsync(FolderLocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAccessPoliciesResponse, AccessPolicy> ListAccessPoliciesAsync(FolderLocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists access policies.

Parameters
Name Description
parent FolderLocationName

Required. The parent resource, which owns the collection of access policy resources.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAccessPoliciesResponseAccessPolicy

A pageable asynchronous sequence of AccessPolicy resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListAccessPoliciesResponse, AccessPolicy> response = accessPoliciesClient.ListAccessPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AccessPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAccessPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AccessPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AccessPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AccessPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAccessPoliciesAsync(ListAccessPoliciesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListAccessPoliciesResponse, AccessPolicy> ListAccessPoliciesAsync(ListAccessPoliciesRequest request, CallSettings callSettings = null)

Lists access policies.

Parameters
Name Description
request ListAccessPoliciesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAccessPoliciesResponseAccessPolicy

A pageable asynchronous sequence of AccessPolicy resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
ListAccessPoliciesRequest request = new ListAccessPoliciesRequest
{
    ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListAccessPoliciesResponse, AccessPolicy> response = accessPoliciesClient.ListAccessPoliciesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AccessPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAccessPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AccessPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AccessPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AccessPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAccessPoliciesAsync(OrganizationLocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAccessPoliciesResponse, AccessPolicy> ListAccessPoliciesAsync(OrganizationLocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists access policies.

Parameters
Name Description
parent OrganizationLocationName

Required. The parent resource, which owns the collection of access policy resources.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAccessPoliciesResponseAccessPolicy

A pageable asynchronous sequence of AccessPolicy resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListAccessPoliciesResponse, AccessPolicy> response = accessPoliciesClient.ListAccessPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AccessPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAccessPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AccessPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AccessPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AccessPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAccessPoliciesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAccessPoliciesResponse, AccessPolicy> ListAccessPoliciesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists access policies.

Parameters
Name Description
parent string

Required. The parent resource, which owns the collection of access policy resources.

Format: projects/{project_id}/locations/{location} projects/{project_number}/locations/{location} folders/{folder_id}/locations/{location} organizations/{organization_id}/locations/{location}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAccessPoliciesResponseAccessPolicy

A pageable asynchronous sequence of AccessPolicy resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListAccessPoliciesResponse, AccessPolicy> response = accessPoliciesClient.ListAccessPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AccessPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAccessPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AccessPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AccessPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AccessPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PollOnceCreateAccessPolicy(string, CallSettings)

public virtual Operation<AccessPolicy, OperationMetadata> PollOnceCreateAccessPolicy(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of CreateAccessPolicy .

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAccessPolicyOperationMetadata

The result of polling the operation.

PollOnceCreateAccessPolicyAsync(string, CallSettings)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> PollOnceCreateAccessPolicyAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of CreateAccessPolicy.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A task representing the result of polling the operation.

PollOnceDeleteAccessPolicy(string, CallSettings)

public virtual Operation<Empty, OperationMetadata> PollOnceDeleteAccessPolicy(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of DeleteAccessPolicy .

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyOperationMetadata

The result of polling the operation.

PollOnceDeleteAccessPolicyAsync(string, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> PollOnceDeleteAccessPolicyAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of DeleteAccessPolicy.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyOperationMetadata

A task representing the result of polling the operation.

PollOnceUpdateAccessPolicy(string, CallSettings)

public virtual Operation<AccessPolicy, OperationMetadata> PollOnceUpdateAccessPolicy(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of UpdateAccessPolicy .

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAccessPolicyOperationMetadata

The result of polling the operation.

PollOnceUpdateAccessPolicyAsync(string, CallSettings)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> PollOnceUpdateAccessPolicyAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of UpdateAccessPolicy.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A task representing the result of polling the operation.

SearchAccessPolicyBindings(AccessPolicyName, string, int?, CallSettings)

public virtual PagedEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> SearchAccessPolicyBindings(AccessPolicyName name, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings permission on that policy.

Parameters
Name Description
name AccessPolicyName

Required. The name of the access policy. Format: organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableSearchAccessPolicyBindingsResponsePolicyBinding

A pageable sequence of PolicyBinding resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
AccessPolicyName name = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]");
// Make the request
PagedEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> response = accessPoliciesClient.SearchAccessPolicyBindings(name);

// Iterate over all response items, lazily performing RPCs as required
foreach (PolicyBinding item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (SearchAccessPolicyBindingsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (PolicyBinding item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<PolicyBinding> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (PolicyBinding item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchAccessPolicyBindings(SearchAccessPolicyBindingsRequest, CallSettings)

public virtual PagedEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> SearchAccessPolicyBindings(SearchAccessPolicyBindingsRequest request, CallSettings callSettings = null)

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings permission on that policy.

Parameters
Name Description
request SearchAccessPolicyBindingsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableSearchAccessPolicyBindingsResponsePolicyBinding

A pageable sequence of PolicyBinding resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
SearchAccessPolicyBindingsRequest request = new SearchAccessPolicyBindingsRequest
{
    AccessPolicyName = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]"),
};
// Make the request
PagedEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> response = accessPoliciesClient.SearchAccessPolicyBindings(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (PolicyBinding item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (SearchAccessPolicyBindingsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (PolicyBinding item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<PolicyBinding> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (PolicyBinding item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchAccessPolicyBindings(string, string, int?, CallSettings)

public virtual PagedEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> SearchAccessPolicyBindings(string name, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings permission on that policy.

Parameters
Name Description
name string

Required. The name of the access policy. Format: organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableSearchAccessPolicyBindingsResponsePolicyBinding

A pageable sequence of PolicyBinding resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/accessPolicies/[ACCESS_POLICY]";
// Make the request
PagedEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> response = accessPoliciesClient.SearchAccessPolicyBindings(name);

// Iterate over all response items, lazily performing RPCs as required
foreach (PolicyBinding item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (SearchAccessPolicyBindingsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (PolicyBinding item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<PolicyBinding> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (PolicyBinding item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchAccessPolicyBindingsAsync(AccessPolicyName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> SearchAccessPolicyBindingsAsync(AccessPolicyName name, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings permission on that policy.

Parameters
Name Description
name AccessPolicyName

Required. The name of the access policy. Format: organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableSearchAccessPolicyBindingsResponsePolicyBinding

A pageable asynchronous sequence of PolicyBinding resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
AccessPolicyName name = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]");
// Make the request
PagedAsyncEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> response = accessPoliciesClient.SearchAccessPolicyBindingsAsync(name);

// Iterate over all response items, lazily performing RPCs as required
await foreach (PolicyBinding item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (SearchAccessPolicyBindingsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (PolicyBinding item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<PolicyBinding> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (PolicyBinding item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchAccessPolicyBindingsAsync(SearchAccessPolicyBindingsRequest, CallSettings)

public virtual PagedAsyncEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> SearchAccessPolicyBindingsAsync(SearchAccessPolicyBindingsRequest request, CallSettings callSettings = null)

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings permission on that policy.

Parameters
Name Description
request SearchAccessPolicyBindingsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableSearchAccessPolicyBindingsResponsePolicyBinding

A pageable asynchronous sequence of PolicyBinding resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
SearchAccessPolicyBindingsRequest request = new SearchAccessPolicyBindingsRequest
{
    AccessPolicyName = AccessPolicyName.FromOrganizationLocationAccessPolicy("[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]"),
};
// Make the request
PagedAsyncEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> response = accessPoliciesClient.SearchAccessPolicyBindingsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await foreach (PolicyBinding item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (SearchAccessPolicyBindingsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (PolicyBinding item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<PolicyBinding> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (PolicyBinding item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchAccessPolicyBindingsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> SearchAccessPolicyBindingsAsync(string name, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings permission on that policy.

Parameters
Name Description
name string

Required. The name of the access policy. Format: organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id} folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id} projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableSearchAccessPolicyBindingsResponsePolicyBinding

A pageable asynchronous sequence of PolicyBinding resources.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/accessPolicies/[ACCESS_POLICY]";
// Make the request
PagedAsyncEnumerable<SearchAccessPolicyBindingsResponse, PolicyBinding> response = accessPoliciesClient.SearchAccessPolicyBindingsAsync(name);

// Iterate over all response items, lazily performing RPCs as required
await foreach (PolicyBinding item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (SearchAccessPolicyBindingsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (PolicyBinding item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<PolicyBinding> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (PolicyBinding item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateAccessPolicy(UpdateAccessPolicyRequest, CallSettings)

public virtual Operation<AccessPolicy, OperationMetadata> UpdateAccessPolicy(UpdateAccessPolicyRequest request, CallSettings callSettings = null)

Updates an access policy.

Parameters
Name Description
request UpdateAccessPolicyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAccessPolicyOperationMetadata

The RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.Create();
// Initialize request argument(s)
UpdateAccessPolicyRequest request = new UpdateAccessPolicyRequest
{
    AccessPolicy = new AccessPolicy(),
    ValidateOnly = false,
};
// Make the request
Operation<AccessPolicy, OperationMetadata> response = accessPoliciesClient.UpdateAccessPolicy(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.PollOnceUpdateAccessPolicy(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;
}

UpdateAccessPolicyAsync(UpdateAccessPolicyRequest, CallSettings)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> UpdateAccessPolicyAsync(UpdateAccessPolicyRequest request, CallSettings callSettings = null)

Updates an access policy.

Parameters
Name Description
request UpdateAccessPolicyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
UpdateAccessPolicyRequest request = new UpdateAccessPolicyRequest
{
    AccessPolicy = new AccessPolicy(),
    ValidateOnly = false,
};
// Make the request
Operation<AccessPolicy, OperationMetadata> response = await accessPoliciesClient.UpdateAccessPolicyAsync(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.PollOnceUpdateAccessPolicyAsync(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;
}

UpdateAccessPolicyAsync(UpdateAccessPolicyRequest, CancellationToken)

public virtual Task<Operation<AccessPolicy, OperationMetadata>> UpdateAccessPolicyAsync(UpdateAccessPolicyRequest request, CancellationToken cancellationToken)

Updates an access policy.

Parameters
Name Description
request UpdateAccessPolicyRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAccessPolicyOperationMetadata

A Task containing the RPC response.

Example
// Create client
AccessPoliciesClient accessPoliciesClient = await AccessPoliciesClient.CreateAsync();
// Initialize request argument(s)
UpdateAccessPolicyRequest request = new UpdateAccessPolicyRequest
{
    AccessPolicy = new AccessPolicy(),
    ValidateOnly = false,
};
// Make the request
Operation<AccessPolicy, OperationMetadata> response = await accessPoliciesClient.UpdateAccessPolicyAsync(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.PollOnceUpdateAccessPolicyAsync(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;
}