public abstract class PolicyBindingsClient
Reference documentation and code samples for the Identity and Access Management (IAM) v3beta API class PolicyBindingsClient.
PolicyBindings client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Iam.V3BetaAssembly
Google.Cloud.Iam.V3Beta.dll
Remarks
An interface for managing Identity and Access Management (IAM) policy bindings.
Properties
CreatePolicyBindingOperationsClient
public virtual OperationsClient CreatePolicyBindingOperationsClient { get; }
The long-running operations client for CreatePolicyBinding
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the PolicyBindings 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 PolicyBindings scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default PolicyBindings scopes are:
DeletePolicyBindingOperationsClient
public virtual OperationsClient DeletePolicyBindingOperationsClient { get; }
The long-running operations client for DeletePolicyBinding
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
GrpcClient
public virtual PolicyBindings.PolicyBindingsClient GrpcClient { get; }
The underlying gRPC PolicyBindings client
Property Value | |
---|---|
Type | Description |
PolicyBindingsPolicyBindingsClient |
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 |
UpdatePolicyBindingOperationsClient
public virtual OperationsClient UpdatePolicyBindingOperationsClient { get; }
The long-running operations client for UpdatePolicyBinding
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
Methods
Create()
public static PolicyBindingsClient Create()
Synchronously creates a PolicyBindingsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use PolicyBindingsClientBuilder.
Returns | |
---|---|
Type | Description |
PolicyBindingsClient |
The created PolicyBindingsClient. |
CreateAsync(CancellationToken)
public static Task<PolicyBindingsClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a PolicyBindingsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use PolicyBindingsClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken |
CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskPolicyBindingsClient |
The task representing the created PolicyBindingsClient. |
CreatePolicyBinding(LocationName, PolicyBinding, string, CallSettings)
public virtual Operation<PolicyBinding, OperationMetadata> CreatePolicyBinding(LocationName parent, PolicyBinding policyBinding, string policyBindingId, CallSettings callSettings = null)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
LocationName Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationPolicyBindingOperationMetadata |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = policyBindingsClient.CreatePolicyBinding(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = policyBindingsClient.PollOnceCreatePolicyBinding(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBinding(CreatePolicyBindingRequest, CallSettings)
public virtual Operation<PolicyBinding, OperationMetadata> CreatePolicyBinding(CreatePolicyBindingRequest request, CallSettings callSettings = null)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
request |
CreatePolicyBindingRequest 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 |
OperationPolicyBindingOperationMetadata |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
CreatePolicyBindingRequest request = new CreatePolicyBindingRequest
{
ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
PolicyBindingId = "",
PolicyBinding = new PolicyBinding(),
ValidateOnly = false,
};
// Make the request
Operation<PolicyBinding, OperationMetadata> response = policyBindingsClient.CreatePolicyBinding(request);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = policyBindingsClient.PollOnceCreatePolicyBinding(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBinding(FolderLocationName, PolicyBinding, string, CallSettings)
public virtual Operation<PolicyBinding, OperationMetadata> CreatePolicyBinding(FolderLocationName parent, PolicyBinding policyBinding, string policyBindingId, CallSettings callSettings = null)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
FolderLocationName Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationPolicyBindingOperationMetadata |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[LOCATION]");
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = policyBindingsClient.CreatePolicyBinding(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = policyBindingsClient.PollOnceCreatePolicyBinding(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBinding(OrganizationLocationName, PolicyBinding, string, CallSettings)
public virtual Operation<PolicyBinding, OperationMetadata> CreatePolicyBinding(OrganizationLocationName parent, PolicyBinding policyBinding, string policyBindingId, CallSettings callSettings = null)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
OrganizationLocationName Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationPolicyBindingOperationMetadata |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = policyBindingsClient.CreatePolicyBinding(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = policyBindingsClient.PollOnceCreatePolicyBinding(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBinding(string, PolicyBinding, string, CallSettings)
public virtual Operation<PolicyBinding, OperationMetadata> CreatePolicyBinding(string parent, PolicyBinding policyBinding, string policyBindingId, CallSettings callSettings = null)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationPolicyBindingOperationMetadata |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = policyBindingsClient.CreatePolicyBinding(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = policyBindingsClient.PollOnceCreatePolicyBinding(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBindingAsync(LocationName, PolicyBinding, string, CallSettings)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> CreatePolicyBindingAsync(LocationName parent, PolicyBinding policyBinding, string policyBindingId, CallSettings callSettings = null)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
LocationName Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.CreatePolicyBindingAsync(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceCreatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBindingAsync(LocationName, PolicyBinding, string, CancellationToken)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> CreatePolicyBindingAsync(LocationName parent, PolicyBinding policyBinding, string policyBindingId, CancellationToken cancellationToken)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
LocationName Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.CreatePolicyBindingAsync(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceCreatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBindingAsync(CreatePolicyBindingRequest, CallSettings)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> CreatePolicyBindingAsync(CreatePolicyBindingRequest request, CallSettings callSettings = null)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
request |
CreatePolicyBindingRequest 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 |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
CreatePolicyBindingRequest request = new CreatePolicyBindingRequest
{
ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
PolicyBindingId = "",
PolicyBinding = new PolicyBinding(),
ValidateOnly = false,
};
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.CreatePolicyBindingAsync(request);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceCreatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBindingAsync(CreatePolicyBindingRequest, CancellationToken)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> CreatePolicyBindingAsync(CreatePolicyBindingRequest request, CancellationToken cancellationToken)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
request |
CreatePolicyBindingRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
CreatePolicyBindingRequest request = new CreatePolicyBindingRequest
{
ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
PolicyBindingId = "",
PolicyBinding = new PolicyBinding(),
ValidateOnly = false,
};
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.CreatePolicyBindingAsync(request);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceCreatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBindingAsync(FolderLocationName, PolicyBinding, string, CallSettings)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> CreatePolicyBindingAsync(FolderLocationName parent, PolicyBinding policyBinding, string policyBindingId, CallSettings callSettings = null)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
FolderLocationName Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[LOCATION]");
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.CreatePolicyBindingAsync(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceCreatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBindingAsync(FolderLocationName, PolicyBinding, string, CancellationToken)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> CreatePolicyBindingAsync(FolderLocationName parent, PolicyBinding policyBinding, string policyBindingId, CancellationToken cancellationToken)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
FolderLocationName Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[LOCATION]");
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.CreatePolicyBindingAsync(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceCreatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBindingAsync(OrganizationLocationName, PolicyBinding, string, CallSettings)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> CreatePolicyBindingAsync(OrganizationLocationName parent, PolicyBinding policyBinding, string policyBindingId, CallSettings callSettings = null)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
OrganizationLocationName Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.CreatePolicyBindingAsync(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceCreatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBindingAsync(OrganizationLocationName, PolicyBinding, string, CancellationToken)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> CreatePolicyBindingAsync(OrganizationLocationName parent, PolicyBinding policyBinding, string policyBindingId, CancellationToken cancellationToken)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
OrganizationLocationName Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.CreatePolicyBindingAsync(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceCreatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBindingAsync(string, PolicyBinding, string, CallSettings)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> CreatePolicyBindingAsync(string parent, PolicyBinding policyBinding, string policyBindingId, CallSettings callSettings = null)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.CreatePolicyBindingAsync(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceCreatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
CreatePolicyBindingAsync(string, PolicyBinding, string, CancellationToken)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> CreatePolicyBindingAsync(string parent, PolicyBinding policyBinding, string policyBindingId, CancellationToken cancellationToken)
Creates a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is created, the policy is applied to the target.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent resource where this policy binding will be created. The binding parent is the closest Resource Manager resource (project, folder or organization) to the binding target. Format:
|
policyBinding |
PolicyBinding Required. The policy binding to create. |
policyBindingId |
string Required. The ID to use for the policy binding, which will become the final component of the policy binding'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}/. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
PolicyBinding policyBinding = new PolicyBinding();
string policyBindingId = "";
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.CreatePolicyBindingAsync(parent, policyBinding, policyBindingId);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceCreatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
DeletePolicyBinding(DeletePolicyBindingRequest, CallSettings)
public virtual Operation<Empty, OperationMetadata> DeletePolicyBinding(DeletePolicyBindingRequest request, CallSettings callSettings = null)
Deletes a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is deleted, the policy no longer applies to the target.
Parameters | |
---|---|
Name | Description |
request |
DeletePolicyBindingRequest 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. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
DeletePolicyBindingRequest request = new DeletePolicyBindingRequest
{
PolicyBindingName = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]"),
Etag = "",
ValidateOnly = false,
};
// Make the request
Operation<Empty, OperationMetadata> response = policyBindingsClient.DeletePolicyBinding(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 = policyBindingsClient.PollOnceDeletePolicyBinding(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;
}
DeletePolicyBinding(PolicyBindingName, CallSettings)
public virtual Operation<Empty, OperationMetadata> DeletePolicyBinding(PolicyBindingName name, CallSettings callSettings = null)
Deletes a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is deleted, the policy no longer applies to the target.
Parameters | |
---|---|
Name | Description |
name |
PolicyBindingName Required. The name of the policy binding to delete. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationEmptyOperationMetadata |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
PolicyBindingName name = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]");
// Make the request
Operation<Empty, OperationMetadata> response = policyBindingsClient.DeletePolicyBinding(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 = policyBindingsClient.PollOnceDeletePolicyBinding(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;
}
DeletePolicyBinding(string, CallSettings)
public virtual Operation<Empty, OperationMetadata> DeletePolicyBinding(string name, CallSettings callSettings = null)
Deletes a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is deleted, the policy no longer applies to the target.
Parameters | |
---|---|
Name | Description |
name |
string Required. The name of the policy binding to delete. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationEmptyOperationMetadata |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/policyBindings/[POLICY_BINDING]";
// Make the request
Operation<Empty, OperationMetadata> response = policyBindingsClient.DeletePolicyBinding(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 = policyBindingsClient.PollOnceDeletePolicyBinding(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;
}
DeletePolicyBindingAsync(DeletePolicyBindingRequest, CallSettings)
public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBindingAsync(DeletePolicyBindingRequest request, CallSettings callSettings = null)
Deletes a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is deleted, the policy no longer applies to the target.
Parameters | |
---|---|
Name | Description |
request |
DeletePolicyBindingRequest 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. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
DeletePolicyBindingRequest request = new DeletePolicyBindingRequest
{
PolicyBindingName = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]"),
Etag = "",
ValidateOnly = false,
};
// Make the request
Operation<Empty, OperationMetadata> response = await policyBindingsClient.DeletePolicyBindingAsync(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 policyBindingsClient.PollOnceDeletePolicyBindingAsync(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;
}
DeletePolicyBindingAsync(DeletePolicyBindingRequest, CancellationToken)
public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBindingAsync(DeletePolicyBindingRequest request, CancellationToken cancellationToken)
Deletes a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is deleted, the policy no longer applies to the target.
Parameters | |
---|---|
Name | Description |
request |
DeletePolicyBindingRequest 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. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
DeletePolicyBindingRequest request = new DeletePolicyBindingRequest
{
PolicyBindingName = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]"),
Etag = "",
ValidateOnly = false,
};
// Make the request
Operation<Empty, OperationMetadata> response = await policyBindingsClient.DeletePolicyBindingAsync(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 policyBindingsClient.PollOnceDeletePolicyBindingAsync(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;
}
DeletePolicyBindingAsync(PolicyBindingName, CallSettings)
public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBindingAsync(PolicyBindingName name, CallSettings callSettings = null)
Deletes a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is deleted, the policy no longer applies to the target.
Parameters | |
---|---|
Name | Description |
name |
PolicyBindingName Required. The name of the policy binding to delete. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationEmptyOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
PolicyBindingName name = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]");
// Make the request
Operation<Empty, OperationMetadata> response = await policyBindingsClient.DeletePolicyBindingAsync(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 policyBindingsClient.PollOnceDeletePolicyBindingAsync(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;
}
DeletePolicyBindingAsync(PolicyBindingName, CancellationToken)
public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBindingAsync(PolicyBindingName name, CancellationToken cancellationToken)
Deletes a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is deleted, the policy no longer applies to the target.
Parameters | |
---|---|
Name | Description |
name |
PolicyBindingName Required. The name of the policy binding to delete. Format:
|
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationEmptyOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
PolicyBindingName name = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]");
// Make the request
Operation<Empty, OperationMetadata> response = await policyBindingsClient.DeletePolicyBindingAsync(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 policyBindingsClient.PollOnceDeletePolicyBindingAsync(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;
}
DeletePolicyBindingAsync(string, CallSettings)
public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBindingAsync(string name, CallSettings callSettings = null)
Deletes a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is deleted, the policy no longer applies to the target.
Parameters | |
---|---|
Name | Description |
name |
string Required. The name of the policy binding to delete. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationEmptyOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/policyBindings/[POLICY_BINDING]";
// Make the request
Operation<Empty, OperationMetadata> response = await policyBindingsClient.DeletePolicyBindingAsync(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 policyBindingsClient.PollOnceDeletePolicyBindingAsync(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;
}
DeletePolicyBindingAsync(string, CancellationToken)
public virtual Task<Operation<Empty, OperationMetadata>> DeletePolicyBindingAsync(string name, CancellationToken cancellationToken)
Deletes a policy binding and returns a long-running operation. Callers will need the IAM permissions on both the policy and target. Once the binding is deleted, the policy no longer applies to the target.
Parameters | |
---|---|
Name | Description |
name |
string Required. The name of the policy binding to delete. Format:
|
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationEmptyOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/policyBindings/[POLICY_BINDING]";
// Make the request
Operation<Empty, OperationMetadata> response = await policyBindingsClient.DeletePolicyBindingAsync(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 policyBindingsClient.PollOnceDeletePolicyBindingAsync(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;
}
GetPolicyBinding(GetPolicyBindingRequest, CallSettings)
public virtual PolicyBinding GetPolicyBinding(GetPolicyBindingRequest request, CallSettings callSettings = null)
Gets a policy binding.
Parameters | |
---|---|
Name | Description |
request |
GetPolicyBindingRequest 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 |
PolicyBinding |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
GetPolicyBindingRequest request = new GetPolicyBindingRequest
{
PolicyBindingName = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]"),
};
// Make the request
PolicyBinding response = policyBindingsClient.GetPolicyBinding(request);
GetPolicyBinding(PolicyBindingName, CallSettings)
public virtual PolicyBinding GetPolicyBinding(PolicyBindingName name, CallSettings callSettings = null)
Gets a policy binding.
Parameters | |
---|---|
Name | Description |
name |
PolicyBindingName Required. The name of the policy binding to retrieve. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PolicyBinding |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
PolicyBindingName name = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]");
// Make the request
PolicyBinding response = policyBindingsClient.GetPolicyBinding(name);
GetPolicyBinding(string, CallSettings)
public virtual PolicyBinding GetPolicyBinding(string name, CallSettings callSettings = null)
Gets a policy binding.
Parameters | |
---|---|
Name | Description |
name |
string Required. The name of the policy binding to retrieve. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PolicyBinding |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/policyBindings/[POLICY_BINDING]";
// Make the request
PolicyBinding response = policyBindingsClient.GetPolicyBinding(name);
GetPolicyBindingAsync(GetPolicyBindingRequest, CallSettings)
public virtual Task<PolicyBinding> GetPolicyBindingAsync(GetPolicyBindingRequest request, CallSettings callSettings = null)
Gets a policy binding.
Parameters | |
---|---|
Name | Description |
request |
GetPolicyBindingRequest 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 |
TaskPolicyBinding |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
GetPolicyBindingRequest request = new GetPolicyBindingRequest
{
PolicyBindingName = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]"),
};
// Make the request
PolicyBinding response = await policyBindingsClient.GetPolicyBindingAsync(request);
GetPolicyBindingAsync(GetPolicyBindingRequest, CancellationToken)
public virtual Task<PolicyBinding> GetPolicyBindingAsync(GetPolicyBindingRequest request, CancellationToken cancellationToken)
Gets a policy binding.
Parameters | |
---|---|
Name | Description |
request |
GetPolicyBindingRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPolicyBinding |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
GetPolicyBindingRequest request = new GetPolicyBindingRequest
{
PolicyBindingName = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]"),
};
// Make the request
PolicyBinding response = await policyBindingsClient.GetPolicyBindingAsync(request);
GetPolicyBindingAsync(PolicyBindingName, CallSettings)
public virtual Task<PolicyBinding> GetPolicyBindingAsync(PolicyBindingName name, CallSettings callSettings = null)
Gets a policy binding.
Parameters | |
---|---|
Name | Description |
name |
PolicyBindingName Required. The name of the policy binding to retrieve. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskPolicyBinding |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
PolicyBindingName name = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]");
// Make the request
PolicyBinding response = await policyBindingsClient.GetPolicyBindingAsync(name);
GetPolicyBindingAsync(PolicyBindingName, CancellationToken)
public virtual Task<PolicyBinding> GetPolicyBindingAsync(PolicyBindingName name, CancellationToken cancellationToken)
Gets a policy binding.
Parameters | |
---|---|
Name | Description |
name |
PolicyBindingName Required. The name of the policy binding to retrieve. Format:
|
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPolicyBinding |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
PolicyBindingName name = PolicyBindingName.FromOrganizationLocationPolicyBinding("[ORGANIZATION]", "[LOCATION]", "[POLICY_BINDING]");
// Make the request
PolicyBinding response = await policyBindingsClient.GetPolicyBindingAsync(name);
GetPolicyBindingAsync(string, CallSettings)
public virtual Task<PolicyBinding> GetPolicyBindingAsync(string name, CallSettings callSettings = null)
Gets a policy binding.
Parameters | |
---|---|
Name | Description |
name |
string Required. The name of the policy binding to retrieve. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskPolicyBinding |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/policyBindings/[POLICY_BINDING]";
// Make the request
PolicyBinding response = await policyBindingsClient.GetPolicyBindingAsync(name);
GetPolicyBindingAsync(string, CancellationToken)
public virtual Task<PolicyBinding> GetPolicyBindingAsync(string name, CancellationToken cancellationToken)
Gets a policy binding.
Parameters | |
---|---|
Name | Description |
name |
string Required. The name of the policy binding to retrieve. Format:
|
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPolicyBinding |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/policyBindings/[POLICY_BINDING]";
// Make the request
PolicyBinding response = await policyBindingsClient.GetPolicyBindingAsync(name);
ListPolicyBindings(LocationName, string, int?, CallSettings)
public virtual PagedEnumerable<ListPolicyBindingsResponse, PolicyBinding> ListPolicyBindings(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists policy bindings.
Parameters | |
---|---|
Name | Description |
parent |
LocationName Required. The parent resource, which owns the collection of policy bindings. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListPolicyBindingsResponsePolicyBinding |
A pageable sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.ListPolicyBindings(parent);
// 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 (ListPolicyBindingsResponse 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;
ListPolicyBindings(FolderLocationName, string, int?, CallSettings)
public virtual PagedEnumerable<ListPolicyBindingsResponse, PolicyBinding> ListPolicyBindings(FolderLocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists policy bindings.
Parameters | |
---|---|
Name | Description |
parent |
FolderLocationName Required. The parent resource, which owns the collection of policy bindings. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListPolicyBindingsResponsePolicyBinding |
A pageable sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[LOCATION]");
// Make the request
PagedEnumerable<ListPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.ListPolicyBindings(parent);
// 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 (ListPolicyBindingsResponse 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;
ListPolicyBindings(ListPolicyBindingsRequest, CallSettings)
public virtual PagedEnumerable<ListPolicyBindingsResponse, PolicyBinding> ListPolicyBindings(ListPolicyBindingsRequest request, CallSettings callSettings = null)
Lists policy bindings.
Parameters | |
---|---|
Name | Description |
request |
ListPolicyBindingsRequest 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 |
PagedEnumerableListPolicyBindingsResponsePolicyBinding |
A pageable sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
ListPolicyBindingsRequest request = new ListPolicyBindingsRequest
{
ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.ListPolicyBindings(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 (ListPolicyBindingsResponse 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;
ListPolicyBindings(OrganizationLocationName, string, int?, CallSettings)
public virtual PagedEnumerable<ListPolicyBindingsResponse, PolicyBinding> ListPolicyBindings(OrganizationLocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists policy bindings.
Parameters | |
---|---|
Name | Description |
parent |
OrganizationLocationName Required. The parent resource, which owns the collection of policy bindings. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListPolicyBindingsResponsePolicyBinding |
A pageable sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
PagedEnumerable<ListPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.ListPolicyBindings(parent);
// 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 (ListPolicyBindingsResponse 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;
ListPolicyBindings(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListPolicyBindingsResponse, PolicyBinding> ListPolicyBindings(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists policy bindings.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent resource, which owns the collection of policy bindings. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListPolicyBindingsResponsePolicyBinding |
A pageable sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.ListPolicyBindings(parent);
// 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 (ListPolicyBindingsResponse 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;
ListPolicyBindingsAsync(LocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListPolicyBindingsResponse, PolicyBinding> ListPolicyBindingsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists policy bindings.
Parameters | |
---|---|
Name | Description |
parent |
LocationName Required. The parent resource, which owns the collection of policy bindings. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListPolicyBindingsResponsePolicyBinding |
A pageable asynchronous sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.ListPolicyBindingsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PolicyBinding item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListPolicyBindingsResponse page) =>
{
// 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;
ListPolicyBindingsAsync(FolderLocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListPolicyBindingsResponse, PolicyBinding> ListPolicyBindingsAsync(FolderLocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists policy bindings.
Parameters | |
---|---|
Name | Description |
parent |
FolderLocationName Required. The parent resource, which owns the collection of policy bindings. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListPolicyBindingsResponsePolicyBinding |
A pageable asynchronous sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.ListPolicyBindingsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PolicyBinding item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListPolicyBindingsResponse page) =>
{
// 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;
ListPolicyBindingsAsync(ListPolicyBindingsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListPolicyBindingsResponse, PolicyBinding> ListPolicyBindingsAsync(ListPolicyBindingsRequest request, CallSettings callSettings = null)
Lists policy bindings.
Parameters | |
---|---|
Name | Description |
request |
ListPolicyBindingsRequest 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 |
PagedAsyncEnumerableListPolicyBindingsResponsePolicyBinding |
A pageable asynchronous sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
ListPolicyBindingsRequest request = new ListPolicyBindingsRequest
{
ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.ListPolicyBindingsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PolicyBinding item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListPolicyBindingsResponse page) =>
{
// 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;
ListPolicyBindingsAsync(OrganizationLocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListPolicyBindingsResponse, PolicyBinding> ListPolicyBindingsAsync(OrganizationLocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists policy bindings.
Parameters | |
---|---|
Name | Description |
parent |
OrganizationLocationName Required. The parent resource, which owns the collection of policy bindings. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListPolicyBindingsResponsePolicyBinding |
A pageable asynchronous sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.ListPolicyBindingsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PolicyBinding item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListPolicyBindingsResponse page) =>
{
// 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;
ListPolicyBindingsAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListPolicyBindingsResponse, PolicyBinding> ListPolicyBindingsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists policy bindings.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent resource, which owns the collection of policy bindings. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListPolicyBindingsResponsePolicyBinding |
A pageable asynchronous sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.ListPolicyBindingsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PolicyBinding item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListPolicyBindingsResponse page) =>
{
// 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;
PollOnceCreatePolicyBinding(string, CallSettings)
public virtual Operation<PolicyBinding, OperationMetadata> PollOnceCreatePolicyBinding(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of CreatePolicyBinding
.
Parameters | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationPolicyBindingOperationMetadata |
The result of polling the operation. |
PollOnceCreatePolicyBindingAsync(string, CallSettings)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> PollOnceCreatePolicyBindingAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
CreatePolicyBinding
.
Parameters | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A task representing the result of polling the operation. |
PollOnceDeletePolicyBinding(string, CallSettings)
public virtual Operation<Empty, OperationMetadata> PollOnceDeletePolicyBinding(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of DeletePolicyBinding
.
Parameters | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationEmptyOperationMetadata |
The result of polling the operation. |
PollOnceDeletePolicyBindingAsync(string, CallSettings)
public virtual Task<Operation<Empty, OperationMetadata>> PollOnceDeletePolicyBindingAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
DeletePolicyBinding
.
Parameters | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationEmptyOperationMetadata |
A task representing the result of polling the operation. |
PollOnceUpdatePolicyBinding(string, CallSettings)
public virtual Operation<PolicyBinding, OperationMetadata> PollOnceUpdatePolicyBinding(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of UpdatePolicyBinding
.
Parameters | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationPolicyBindingOperationMetadata |
The result of polling the operation. |
PollOnceUpdatePolicyBindingAsync(string, CallSettings)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> PollOnceUpdatePolicyBindingAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
UpdatePolicyBinding
.
Parameters | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A task representing the result of polling the operation. |
SearchTargetPolicyBindings(LocationName, string, string, int?, CallSettings)
public virtual PagedEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindings(LocationName parent, string target, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Search policy bindings by target. Returns all policy binding objects bound directly to target.
Parameters | |
---|---|
Name | Description |
parent |
LocationName Required. The parent resource where this search will be performed. This should be the nearest Resource Manager resource (project, folder, or organization) to the target. Format:
|
target |
string Required. The target resource, which is bound to the policy in the binding. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableSearchTargetPolicyBindingsResponsePolicyBinding |
A pageable sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string target = "";
// Make the request
PagedEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.SearchTargetPolicyBindings(parent, target);
// 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 (SearchTargetPolicyBindingsResponse 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;
SearchTargetPolicyBindings(FolderLocationName, string, string, int?, CallSettings)
public virtual PagedEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindings(FolderLocationName parent, string target, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Search policy bindings by target. Returns all policy binding objects bound directly to target.
Parameters | |
---|---|
Name | Description |
parent |
FolderLocationName Required. The parent resource where this search will be performed. This should be the nearest Resource Manager resource (project, folder, or organization) to the target. Format:
|
target |
string Required. The target resource, which is bound to the policy in the binding. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableSearchTargetPolicyBindingsResponsePolicyBinding |
A pageable sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[LOCATION]");
string target = "";
// Make the request
PagedEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.SearchTargetPolicyBindings(parent, target);
// 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 (SearchTargetPolicyBindingsResponse 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;
SearchTargetPolicyBindings(OrganizationLocationName, string, string, int?, CallSettings)
public virtual PagedEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindings(OrganizationLocationName parent, string target, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Search policy bindings by target. Returns all policy binding objects bound directly to target.
Parameters | |
---|---|
Name | Description |
parent |
OrganizationLocationName Required. The parent resource where this search will be performed. This should be the nearest Resource Manager resource (project, folder, or organization) to the target. Format:
|
target |
string Required. The target resource, which is bound to the policy in the binding. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableSearchTargetPolicyBindingsResponsePolicyBinding |
A pageable sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
string target = "";
// Make the request
PagedEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.SearchTargetPolicyBindings(parent, target);
// 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 (SearchTargetPolicyBindingsResponse 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;
SearchTargetPolicyBindings(SearchTargetPolicyBindingsRequest, CallSettings)
public virtual PagedEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindings(SearchTargetPolicyBindingsRequest request, CallSettings callSettings = null)
Search policy bindings by target. Returns all policy binding objects bound directly to target.
Parameters | |
---|---|
Name | Description |
request |
SearchTargetPolicyBindingsRequest 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 |
PagedEnumerableSearchTargetPolicyBindingsResponsePolicyBinding |
A pageable sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
SearchTargetPolicyBindingsRequest request = new SearchTargetPolicyBindingsRequest
{
Target = "",
ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.SearchTargetPolicyBindings(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 (SearchTargetPolicyBindingsResponse 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;
SearchTargetPolicyBindings(string, string, string, int?, CallSettings)
public virtual PagedEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindings(string parent, string target, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Search policy bindings by target. Returns all policy binding objects bound directly to target.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent resource where this search will be performed. This should be the nearest Resource Manager resource (project, folder, or organization) to the target. Format:
|
target |
string Required. The target resource, which is bound to the policy in the binding. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableSearchTargetPolicyBindingsResponsePolicyBinding |
A pageable sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
string target = "";
// Make the request
PagedEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.SearchTargetPolicyBindings(parent, target);
// 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 (SearchTargetPolicyBindingsResponse 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;
SearchTargetPolicyBindingsAsync(LocationName, string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindingsAsync(LocationName parent, string target, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Search policy bindings by target. Returns all policy binding objects bound directly to target.
Parameters | |
---|---|
Name | Description |
parent |
LocationName Required. The parent resource where this search will be performed. This should be the nearest Resource Manager resource (project, folder, or organization) to the target. Format:
|
target |
string Required. The target resource, which is bound to the policy in the binding. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableSearchTargetPolicyBindingsResponsePolicyBinding |
A pageable asynchronous sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string target = "";
// Make the request
PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.SearchTargetPolicyBindingsAsync(parent, target);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PolicyBinding item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchTargetPolicyBindingsResponse page) =>
{
// 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;
SearchTargetPolicyBindingsAsync(FolderLocationName, string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindingsAsync(FolderLocationName parent, string target, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Search policy bindings by target. Returns all policy binding objects bound directly to target.
Parameters | |
---|---|
Name | Description |
parent |
FolderLocationName Required. The parent resource where this search will be performed. This should be the nearest Resource Manager resource (project, folder, or organization) to the target. Format:
|
target |
string Required. The target resource, which is bound to the policy in the binding. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableSearchTargetPolicyBindingsResponsePolicyBinding |
A pageable asynchronous sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
FolderLocationName parent = FolderLocationName.FromFolderLocation("[FOLDER]", "[LOCATION]");
string target = "";
// Make the request
PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.SearchTargetPolicyBindingsAsync(parent, target);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PolicyBinding item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchTargetPolicyBindingsResponse page) =>
{
// 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;
SearchTargetPolicyBindingsAsync(OrganizationLocationName, string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindingsAsync(OrganizationLocationName parent, string target, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Search policy bindings by target. Returns all policy binding objects bound directly to target.
Parameters | |
---|---|
Name | Description |
parent |
OrganizationLocationName Required. The parent resource where this search will be performed. This should be the nearest Resource Manager resource (project, folder, or organization) to the target. Format:
|
target |
string Required. The target resource, which is bound to the policy in the binding. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableSearchTargetPolicyBindingsResponsePolicyBinding |
A pageable asynchronous sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
OrganizationLocationName parent = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
string target = "";
// Make the request
PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.SearchTargetPolicyBindingsAsync(parent, target);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PolicyBinding item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchTargetPolicyBindingsResponse page) =>
{
// 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;
SearchTargetPolicyBindingsAsync(SearchTargetPolicyBindingsRequest, CallSettings)
public virtual PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindingsAsync(SearchTargetPolicyBindingsRequest request, CallSettings callSettings = null)
Search policy bindings by target. Returns all policy binding objects bound directly to target.
Parameters | |
---|---|
Name | Description |
request |
SearchTargetPolicyBindingsRequest 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 |
PagedAsyncEnumerableSearchTargetPolicyBindingsResponsePolicyBinding |
A pageable asynchronous sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
SearchTargetPolicyBindingsRequest request = new SearchTargetPolicyBindingsRequest
{
Target = "",
ParentAsOrganizationLocationName = OrganizationLocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.SearchTargetPolicyBindingsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PolicyBinding item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchTargetPolicyBindingsResponse page) =>
{
// 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;
SearchTargetPolicyBindingsAsync(string, string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindingsAsync(string parent, string target, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Search policy bindings by target. Returns all policy binding objects bound directly to target.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent resource where this search will be performed. This should be the nearest Resource Manager resource (project, folder, or organization) to the target. Format:
|
target |
string Required. The target resource, which is bound to the policy in the binding. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableSearchTargetPolicyBindingsResponsePolicyBinding |
A pageable asynchronous sequence of PolicyBinding resources. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
string target = "";
// Make the request
PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> response = policyBindingsClient.SearchTargetPolicyBindingsAsync(parent, target);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PolicyBinding item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchTargetPolicyBindingsResponse page) =>
{
// 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. |
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.
UpdatePolicyBinding(PolicyBinding, FieldMask, CallSettings)
public virtual Operation<PolicyBinding, OperationMetadata> UpdatePolicyBinding(PolicyBinding policyBinding, FieldMask updateMask, CallSettings callSettings = null)
Updates a policy binding and returns a long-running operation. Callers will need the IAM permissions on the policy and target in the binding to update, and the IAM permission to remove the existing policy from the binding. Target is immutable and cannot be updated. Once the binding is updated, the new policy is applied to the target.
Parameters | |
---|---|
Name | Description |
policyBinding |
PolicyBinding Required. The policy binding to update. The policy binding's |
updateMask |
FieldMask Optional. The list of fields to update |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationPolicyBindingOperationMetadata |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
PolicyBinding policyBinding = new PolicyBinding();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<PolicyBinding, OperationMetadata> response = policyBindingsClient.UpdatePolicyBinding(policyBinding, updateMask);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = policyBindingsClient.PollOnceUpdatePolicyBinding(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
UpdatePolicyBinding(UpdatePolicyBindingRequest, CallSettings)
public virtual Operation<PolicyBinding, OperationMetadata> UpdatePolicyBinding(UpdatePolicyBindingRequest request, CallSettings callSettings = null)
Updates a policy binding and returns a long-running operation. Callers will need the IAM permissions on the policy and target in the binding to update, and the IAM permission to remove the existing policy from the binding. Target is immutable and cannot be updated. Once the binding is updated, the new policy is applied to the target.
Parameters | |
---|---|
Name | Description |
request |
UpdatePolicyBindingRequest 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 |
OperationPolicyBindingOperationMetadata |
The RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = PolicyBindingsClient.Create();
// Initialize request argument(s)
UpdatePolicyBindingRequest request = new UpdatePolicyBindingRequest
{
PolicyBinding = new PolicyBinding(),
ValidateOnly = false,
UpdateMask = new FieldMask(),
};
// Make the request
Operation<PolicyBinding, OperationMetadata> response = policyBindingsClient.UpdatePolicyBinding(request);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = policyBindingsClient.PollOnceUpdatePolicyBinding(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
UpdatePolicyBindingAsync(PolicyBinding, FieldMask, CallSettings)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> UpdatePolicyBindingAsync(PolicyBinding policyBinding, FieldMask updateMask, CallSettings callSettings = null)
Updates a policy binding and returns a long-running operation. Callers will need the IAM permissions on the policy and target in the binding to update, and the IAM permission to remove the existing policy from the binding. Target is immutable and cannot be updated. Once the binding is updated, the new policy is applied to the target.
Parameters | |
---|---|
Name | Description |
policyBinding |
PolicyBinding Required. The policy binding to update. The policy binding's |
updateMask |
FieldMask Optional. The list of fields to update |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
PolicyBinding policyBinding = new PolicyBinding();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.UpdatePolicyBindingAsync(policyBinding, updateMask);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceUpdatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
UpdatePolicyBindingAsync(PolicyBinding, FieldMask, CancellationToken)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> UpdatePolicyBindingAsync(PolicyBinding policyBinding, FieldMask updateMask, CancellationToken cancellationToken)
Updates a policy binding and returns a long-running operation. Callers will need the IAM permissions on the policy and target in the binding to update, and the IAM permission to remove the existing policy from the binding. Target is immutable and cannot be updated. Once the binding is updated, the new policy is applied to the target.
Parameters | |
---|---|
Name | Description |
policyBinding |
PolicyBinding Required. The policy binding to update. The policy binding's |
updateMask |
FieldMask Optional. The list of fields to update |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
PolicyBinding policyBinding = new PolicyBinding();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.UpdatePolicyBindingAsync(policyBinding, updateMask);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceUpdatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
UpdatePolicyBindingAsync(UpdatePolicyBindingRequest, CallSettings)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> UpdatePolicyBindingAsync(UpdatePolicyBindingRequest request, CallSettings callSettings = null)
Updates a policy binding and returns a long-running operation. Callers will need the IAM permissions on the policy and target in the binding to update, and the IAM permission to remove the existing policy from the binding. Target is immutable and cannot be updated. Once the binding is updated, the new policy is applied to the target.
Parameters | |
---|---|
Name | Description |
request |
UpdatePolicyBindingRequest 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 |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
UpdatePolicyBindingRequest request = new UpdatePolicyBindingRequest
{
PolicyBinding = new PolicyBinding(),
ValidateOnly = false,
UpdateMask = new FieldMask(),
};
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.UpdatePolicyBindingAsync(request);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceUpdatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}
UpdatePolicyBindingAsync(UpdatePolicyBindingRequest, CancellationToken)
public virtual Task<Operation<PolicyBinding, OperationMetadata>> UpdatePolicyBindingAsync(UpdatePolicyBindingRequest request, CancellationToken cancellationToken)
Updates a policy binding and returns a long-running operation. Callers will need the IAM permissions on the policy and target in the binding to update, and the IAM permission to remove the existing policy from the binding. Target is immutable and cannot be updated. Once the binding is updated, the new policy is applied to the target.
Parameters | |
---|---|
Name | Description |
request |
UpdatePolicyBindingRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationPolicyBindingOperationMetadata |
A Task containing the RPC response. |
// Create client
PolicyBindingsClient policyBindingsClient = await PolicyBindingsClient.CreateAsync();
// Initialize request argument(s)
UpdatePolicyBindingRequest request = new UpdatePolicyBindingRequest
{
PolicyBinding = new PolicyBinding(),
ValidateOnly = false,
UpdateMask = new FieldMask(),
};
// Make the request
Operation<PolicyBinding, OperationMetadata> response = await policyBindingsClient.UpdatePolicyBindingAsync(request);
// Poll until the returned long-running operation is complete
Operation<PolicyBinding, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PolicyBinding 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<PolicyBinding, OperationMetadata> retrievedResponse = await policyBindingsClient.PollOnceUpdatePolicyBindingAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
PolicyBinding retrievedResult = retrievedResponse.Result;
}