Class AccessApprovalServiceClient (1.1.0)

public abstract class AccessApprovalServiceClient

AccessApprovalService client wrapper, for convenient use.

Inheritance

Object > AccessApprovalServiceClient

Namespace

Google.Cloud.AccessApproval.V1

Assembly

Google.Cloud.AccessApproval.V1.dll

Remarks

This API allows a customer to manage accesses to cloud resources by Google personnel. It defines the following resource model:

  • The API has a collection of [ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest] resources, named approvalRequests/{approval_request_id}
  • The API has top-level settings per Project/Folder/Organization, named accessApprovalSettings

The service also periodically emails a list of recipients, defined at the Project/Folder/Organization level in the accessApprovalSettings, when there is a pending ApprovalRequest for them to act on. The ApprovalRequests can also optionally be published to a Cloud Pub/Sub topic owned by the customer (for Beta, the Pub/Sub setup is managed manually).

ApprovalRequests can be approved or dismissed. Google personel can only access the indicated resource or resources if the request is approved (subject to some exclusions: https://cloud.google.com/access-approval/docs/overview#exclusions).

Note: Using Access Approval functionality will mean that Google may not be able to meet the SLAs for your chosen products, as any support response times may be dramatically increased. As such the SLAs do not apply to any service disruption to the extent impacted by Customer's use of Access Approval. Do not enable Access Approval for projects where you may require high service availability and rapid response by Google Cloud Support.

After a request is approved or dismissed, no further action may be taken on it. Requests with the requested_expiration in the past or with no activity for 14 days are considered dismissed. When an approval expires, the request is considered dismissed.

If a request is not approved or dismissed, we call it pending.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default AccessApprovalService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default AccessApprovalService scopes are:

GrpcClient

public virtual AccessApproval.AccessApprovalClient GrpcClient { get; }

The underlying gRPC AccessApprovalService client

Property Value
TypeDescription
AccessApproval.AccessApprovalClient

Methods

ApproveApprovalRequest(ApproveApprovalRequestMessage, CallSettings)

public virtual ApprovalRequest ApproveApprovalRequest(ApproveApprovalRequestMessage request, CallSettings callSettings = null)

Approves a request and returns the updated ApprovalRequest.

Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state.

Parameters
NameDescription
requestApproveApprovalRequestMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ApprovalRequest

The RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
ApproveApprovalRequestMessage request = new ApproveApprovalRequestMessage
{
    Name = "",
    ExpireTime = new Timestamp(),
};
// Make the request
ApprovalRequest response = accessApprovalServiceClient.ApproveApprovalRequest(request);

ApproveApprovalRequestAsync(ApproveApprovalRequestMessage, CallSettings)

public virtual Task<ApprovalRequest> ApproveApprovalRequestAsync(ApproveApprovalRequestMessage request, CallSettings callSettings = null)

Approves a request and returns the updated ApprovalRequest.

Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state.

Parameters
NameDescription
requestApproveApprovalRequestMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ApprovalRequest>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
ApproveApprovalRequestMessage request = new ApproveApprovalRequestMessage
{
    Name = "",
    ExpireTime = new Timestamp(),
};
// Make the request
ApprovalRequest response = await accessApprovalServiceClient.ApproveApprovalRequestAsync(request);

ApproveApprovalRequestAsync(ApproveApprovalRequestMessage, CancellationToken)

public virtual Task<ApprovalRequest> ApproveApprovalRequestAsync(ApproveApprovalRequestMessage request, CancellationToken cancellationToken)

Approves a request and returns the updated ApprovalRequest.

Returns NOT_FOUND if the request does not exist. Returns FAILED_PRECONDITION if the request exists but is not in a pending state.

Parameters
NameDescription
requestApproveApprovalRequestMessage

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ApprovalRequest>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
ApproveApprovalRequestMessage request = new ApproveApprovalRequestMessage
{
    Name = "",
    ExpireTime = new Timestamp(),
};
// Make the request
ApprovalRequest response = await accessApprovalServiceClient.ApproveApprovalRequestAsync(request);

Create()

public static AccessApprovalServiceClient Create()

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

Returns
TypeDescription
AccessApprovalServiceClient

The created AccessApprovalServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<AccessApprovalServiceClient>

The task representing the created AccessApprovalServiceClient.

DeleteAccessApprovalSettings(DeleteAccessApprovalSettingsMessage, CallSettings)

public virtual void DeleteAccessApprovalSettings(DeleteAccessApprovalSettingsMessage request, CallSettings callSettings = null)

Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited.

Parameters
NameDescription
requestDeleteAccessApprovalSettingsMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
DeleteAccessApprovalSettingsMessage request = new DeleteAccessApprovalSettingsMessage { Name = "", };
// Make the request
accessApprovalServiceClient.DeleteAccessApprovalSettings(request);

DeleteAccessApprovalSettings(String, CallSettings)

public virtual void DeleteAccessApprovalSettings(string name, CallSettings callSettings = null)

Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited.

Parameters
NameDescription
nameString

Name of the AccessApprovalSettings to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
accessApprovalServiceClient.DeleteAccessApprovalSettings(name);

DeleteAccessApprovalSettingsAsync(DeleteAccessApprovalSettingsMessage, CallSettings)

public virtual Task DeleteAccessApprovalSettingsAsync(DeleteAccessApprovalSettingsMessage request, CallSettings callSettings = null)

Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited.

Parameters
NameDescription
requestDeleteAccessApprovalSettingsMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAccessApprovalSettingsMessage request = new DeleteAccessApprovalSettingsMessage { Name = "", };
// Make the request
await accessApprovalServiceClient.DeleteAccessApprovalSettingsAsync(request);

DeleteAccessApprovalSettingsAsync(DeleteAccessApprovalSettingsMessage, CancellationToken)

public virtual Task DeleteAccessApprovalSettingsAsync(DeleteAccessApprovalSettingsMessage request, CancellationToken cancellationToken)

Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited.

Parameters
NameDescription
requestDeleteAccessApprovalSettingsMessage

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAccessApprovalSettingsMessage request = new DeleteAccessApprovalSettingsMessage { Name = "", };
// Make the request
await accessApprovalServiceClient.DeleteAccessApprovalSettingsAsync(request);

DeleteAccessApprovalSettingsAsync(String, CallSettings)

public virtual Task DeleteAccessApprovalSettingsAsync(string name, CallSettings callSettings = null)

Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited.

Parameters
NameDescription
nameString

Name of the AccessApprovalSettings to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
await accessApprovalServiceClient.DeleteAccessApprovalSettingsAsync(name);

DeleteAccessApprovalSettingsAsync(String, CancellationToken)

public virtual Task DeleteAccessApprovalSettingsAsync(string name, CancellationToken cancellationToken)

Deletes the settings associated with a project, folder, or organization. This will have the effect of disabling Access Approval for the project, folder, or organization, but only if all ancestors also have Access Approval disabled. If Access Approval is enabled at a higher level of the hierarchy, then Access Approval will still be enabled at this level as the settings are inherited.

Parameters
NameDescription
nameString

Name of the AccessApprovalSettings to delete.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
await accessApprovalServiceClient.DeleteAccessApprovalSettingsAsync(name);

DismissApprovalRequest(DismissApprovalRequestMessage, CallSettings)

public virtual ApprovalRequest DismissApprovalRequest(DismissApprovalRequestMessage request, CallSettings callSettings = null)

Dismisses a request. Returns the updated ApprovalRequest.

NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether.

Returns NOT_FOUND if the request does not exist.

Returns FAILED_PRECONDITION if the request exists but is not in a pending state.

Parameters
NameDescription
requestDismissApprovalRequestMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ApprovalRequest

The RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
DismissApprovalRequestMessage request = new DismissApprovalRequestMessage { Name = "", };
// Make the request
ApprovalRequest response = accessApprovalServiceClient.DismissApprovalRequest(request);

DismissApprovalRequestAsync(DismissApprovalRequestMessage, CallSettings)

public virtual Task<ApprovalRequest> DismissApprovalRequestAsync(DismissApprovalRequestMessage request, CallSettings callSettings = null)

Dismisses a request. Returns the updated ApprovalRequest.

NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether.

Returns NOT_FOUND if the request does not exist.

Returns FAILED_PRECONDITION if the request exists but is not in a pending state.

Parameters
NameDescription
requestDismissApprovalRequestMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ApprovalRequest>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
DismissApprovalRequestMessage request = new DismissApprovalRequestMessage { Name = "", };
// Make the request
ApprovalRequest response = await accessApprovalServiceClient.DismissApprovalRequestAsync(request);

DismissApprovalRequestAsync(DismissApprovalRequestMessage, CancellationToken)

public virtual Task<ApprovalRequest> DismissApprovalRequestAsync(DismissApprovalRequestMessage request, CancellationToken cancellationToken)

Dismisses a request. Returns the updated ApprovalRequest.

NOTE: This does not deny access to the resource if another request has been made and approved. It is equivalent in effect to ignoring the request altogether.

Returns NOT_FOUND if the request does not exist.

Returns FAILED_PRECONDITION if the request exists but is not in a pending state.

Parameters
NameDescription
requestDismissApprovalRequestMessage

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ApprovalRequest>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
DismissApprovalRequestMessage request = new DismissApprovalRequestMessage { Name = "", };
// Make the request
ApprovalRequest response = await accessApprovalServiceClient.DismissApprovalRequestAsync(request);

GetAccessApprovalSettings(GetAccessApprovalSettingsMessage, CallSettings)

public virtual AccessApprovalSettings GetAccessApprovalSettings(GetAccessApprovalSettingsMessage request, CallSettings callSettings = null)

Gets the settings associated with a project, folder, or organization.

Parameters
NameDescription
requestGetAccessApprovalSettingsMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AccessApprovalSettings

The RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
GetAccessApprovalSettingsMessage request = new GetAccessApprovalSettingsMessage { Name = "", };
// Make the request
AccessApprovalSettings response = accessApprovalServiceClient.GetAccessApprovalSettings(request);

GetAccessApprovalSettings(String, CallSettings)

public virtual AccessApprovalSettings GetAccessApprovalSettings(string name, CallSettings callSettings = null)

Gets the settings associated with a project, folder, or organization.

Parameters
NameDescription
nameString

Name of the AccessApprovalSettings to retrieve.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AccessApprovalSettings

The RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
AccessApprovalSettings response = accessApprovalServiceClient.GetAccessApprovalSettings(name);

GetAccessApprovalSettingsAsync(GetAccessApprovalSettingsMessage, CallSettings)

public virtual Task<AccessApprovalSettings> GetAccessApprovalSettingsAsync(GetAccessApprovalSettingsMessage request, CallSettings callSettings = null)

Gets the settings associated with a project, folder, or organization.

Parameters
NameDescription
requestGetAccessApprovalSettingsMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AccessApprovalSettings>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
GetAccessApprovalSettingsMessage request = new GetAccessApprovalSettingsMessage { Name = "", };
// Make the request
AccessApprovalSettings response = await accessApprovalServiceClient.GetAccessApprovalSettingsAsync(request);

GetAccessApprovalSettingsAsync(GetAccessApprovalSettingsMessage, CancellationToken)

public virtual Task<AccessApprovalSettings> GetAccessApprovalSettingsAsync(GetAccessApprovalSettingsMessage request, CancellationToken cancellationToken)

Gets the settings associated with a project, folder, or organization.

Parameters
NameDescription
requestGetAccessApprovalSettingsMessage

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AccessApprovalSettings>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
GetAccessApprovalSettingsMessage request = new GetAccessApprovalSettingsMessage { Name = "", };
// Make the request
AccessApprovalSettings response = await accessApprovalServiceClient.GetAccessApprovalSettingsAsync(request);

GetAccessApprovalSettingsAsync(String, CallSettings)

public virtual Task<AccessApprovalSettings> GetAccessApprovalSettingsAsync(string name, CallSettings callSettings = null)

Gets the settings associated with a project, folder, or organization.

Parameters
NameDescription
nameString

Name of the AccessApprovalSettings to retrieve.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AccessApprovalSettings>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
AccessApprovalSettings response = await accessApprovalServiceClient.GetAccessApprovalSettingsAsync(name);

GetAccessApprovalSettingsAsync(String, CancellationToken)

public virtual Task<AccessApprovalSettings> GetAccessApprovalSettingsAsync(string name, CancellationToken cancellationToken)

Gets the settings associated with a project, folder, or organization.

Parameters
NameDescription
nameString

Name of the AccessApprovalSettings to retrieve.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AccessApprovalSettings>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
AccessApprovalSettings response = await accessApprovalServiceClient.GetAccessApprovalSettingsAsync(name);

GetApprovalRequest(GetApprovalRequestMessage, CallSettings)

public virtual ApprovalRequest GetApprovalRequest(GetApprovalRequestMessage request, CallSettings callSettings = null)

Gets an approval request. Returns NOT_FOUND if the request does not exist.

Parameters
NameDescription
requestGetApprovalRequestMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ApprovalRequest

The RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
GetApprovalRequestMessage request = new GetApprovalRequestMessage { Name = "", };
// Make the request
ApprovalRequest response = accessApprovalServiceClient.GetApprovalRequest(request);

GetApprovalRequest(String, CallSettings)

public virtual ApprovalRequest GetApprovalRequest(string name, CallSettings callSettings = null)

Gets an approval request. Returns NOT_FOUND if the request does not exist.

Parameters
NameDescription
nameString

Name of the approval request to retrieve.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ApprovalRequest

The RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
ApprovalRequest response = accessApprovalServiceClient.GetApprovalRequest(name);

GetApprovalRequestAsync(GetApprovalRequestMessage, CallSettings)

public virtual Task<ApprovalRequest> GetApprovalRequestAsync(GetApprovalRequestMessage request, CallSettings callSettings = null)

Gets an approval request. Returns NOT_FOUND if the request does not exist.

Parameters
NameDescription
requestGetApprovalRequestMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ApprovalRequest>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
GetApprovalRequestMessage request = new GetApprovalRequestMessage { Name = "", };
// Make the request
ApprovalRequest response = await accessApprovalServiceClient.GetApprovalRequestAsync(request);

GetApprovalRequestAsync(GetApprovalRequestMessage, CancellationToken)

public virtual Task<ApprovalRequest> GetApprovalRequestAsync(GetApprovalRequestMessage request, CancellationToken cancellationToken)

Gets an approval request. Returns NOT_FOUND if the request does not exist.

Parameters
NameDescription
requestGetApprovalRequestMessage

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ApprovalRequest>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
GetApprovalRequestMessage request = new GetApprovalRequestMessage { Name = "", };
// Make the request
ApprovalRequest response = await accessApprovalServiceClient.GetApprovalRequestAsync(request);

GetApprovalRequestAsync(String, CallSettings)

public virtual Task<ApprovalRequest> GetApprovalRequestAsync(string name, CallSettings callSettings = null)

Gets an approval request. Returns NOT_FOUND if the request does not exist.

Parameters
NameDescription
nameString

Name of the approval request to retrieve.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ApprovalRequest>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
ApprovalRequest response = await accessApprovalServiceClient.GetApprovalRequestAsync(name);

GetApprovalRequestAsync(String, CancellationToken)

public virtual Task<ApprovalRequest> GetApprovalRequestAsync(string name, CancellationToken cancellationToken)

Gets an approval request. Returns NOT_FOUND if the request does not exist.

Parameters
NameDescription
nameString

Name of the approval request to retrieve.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ApprovalRequest>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
ApprovalRequest response = await accessApprovalServiceClient.GetApprovalRequestAsync(name);

ListApprovalRequests(ListApprovalRequestsMessage, CallSettings)

public virtual PagedEnumerable<ListApprovalRequestsResponse, ApprovalRequest> ListApprovalRequests(ListApprovalRequestsMessage request, CallSettings callSettings = null)

Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological.

Parameters
NameDescription
requestListApprovalRequestsMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListApprovalRequestsResponse, ApprovalRequest>

A pageable sequence of ApprovalRequest resources.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
ListApprovalRequestsMessage request = new ListApprovalRequestsMessage
{
    Parent = "",
    Filter = "",
};
// Make the request
PagedEnumerable<ListApprovalRequestsResponse, ApprovalRequest> response = accessApprovalServiceClient.ListApprovalRequests(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (ApprovalRequest 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 (ListApprovalRequestsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ApprovalRequest 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<ApprovalRequest> 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 (ApprovalRequest 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;

ListApprovalRequests(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListApprovalRequestsResponse, ApprovalRequest> ListApprovalRequests(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological.

Parameters
NameDescription
parentString

The parent resource. This may be "projects/{project_id}", "folders/{folder_id}", or "organizations/{organization_id}".

pageTokenString

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

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListApprovalRequestsResponse, ApprovalRequest>

A pageable sequence of ApprovalRequest resources.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
string parent = "";
// Make the request
PagedEnumerable<ListApprovalRequestsResponse, ApprovalRequest> response = accessApprovalServiceClient.ListApprovalRequests(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (ApprovalRequest 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 (ListApprovalRequestsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ApprovalRequest 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<ApprovalRequest> 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 (ApprovalRequest 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;

ListApprovalRequestsAsync(ListApprovalRequestsMessage, CallSettings)

public virtual PagedAsyncEnumerable<ListApprovalRequestsResponse, ApprovalRequest> ListApprovalRequestsAsync(ListApprovalRequestsMessage request, CallSettings callSettings = null)

Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological.

Parameters
NameDescription
requestListApprovalRequestsMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListApprovalRequestsResponse, ApprovalRequest>

A pageable asynchronous sequence of ApprovalRequest resources.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
ListApprovalRequestsMessage request = new ListApprovalRequestsMessage
{
    Parent = "",
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListApprovalRequestsResponse, ApprovalRequest> response = accessApprovalServiceClient.ListApprovalRequestsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ApprovalRequest 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((ListApprovalRequestsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ApprovalRequest 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<ApprovalRequest> 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 (ApprovalRequest 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;

ListApprovalRequestsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListApprovalRequestsResponse, ApprovalRequest> ListApprovalRequestsAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological.

Parameters
NameDescription
parentString

The parent resource. This may be "projects/{project_id}", "folders/{folder_id}", or "organizations/{organization_id}".

pageTokenString

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

pageSizeNullable<Int32>

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListApprovalRequestsResponse, ApprovalRequest>

A pageable asynchronous sequence of ApprovalRequest resources.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "";
// Make the request
PagedAsyncEnumerable<ListApprovalRequestsResponse, ApprovalRequest> response = accessApprovalServiceClient.ListApprovalRequestsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ApprovalRequest 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((ListApprovalRequestsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ApprovalRequest 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<ApprovalRequest> 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 (ApprovalRequest 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
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

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

UpdateAccessApprovalSettings(AccessApprovalSettings, FieldMask, CallSettings)

public virtual AccessApprovalSettings UpdateAccessApprovalSettings(AccessApprovalSettings settings, FieldMask updateMask, CallSettings callSettings = null)

Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask.

Parameters
NameDescription
settingsAccessApprovalSettings

The new AccessApprovalSettings.

updateMaskFieldMask

The update mask applies to the settings. Only the top level fields of AccessApprovalSettings (notification_emails &amp; enrolled_services) are supported. For each field, if it is included, the currently stored value will be entirely overwritten with the value of the field passed in this request.

For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If this field is left unset, only the notification_emails field will be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AccessApprovalSettings

The RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
AccessApprovalSettings settings = new AccessApprovalSettings();
FieldMask updateMask = new FieldMask();
// Make the request
AccessApprovalSettings response = accessApprovalServiceClient.UpdateAccessApprovalSettings(settings, updateMask);

UpdateAccessApprovalSettings(UpdateAccessApprovalSettingsMessage, CallSettings)

public virtual AccessApprovalSettings UpdateAccessApprovalSettings(UpdateAccessApprovalSettingsMessage request, CallSettings callSettings = null)

Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask.

Parameters
NameDescription
requestUpdateAccessApprovalSettingsMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AccessApprovalSettings

The RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = AccessApprovalServiceClient.Create();
// Initialize request argument(s)
UpdateAccessApprovalSettingsMessage request = new UpdateAccessApprovalSettingsMessage
{
    Settings = new AccessApprovalSettings(),
    UpdateMask = new FieldMask(),
};
// Make the request
AccessApprovalSettings response = accessApprovalServiceClient.UpdateAccessApprovalSettings(request);

UpdateAccessApprovalSettingsAsync(AccessApprovalSettings, FieldMask, CallSettings)

public virtual Task<AccessApprovalSettings> UpdateAccessApprovalSettingsAsync(AccessApprovalSettings settings, FieldMask updateMask, CallSettings callSettings = null)

Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask.

Parameters
NameDescription
settingsAccessApprovalSettings

The new AccessApprovalSettings.

updateMaskFieldMask

The update mask applies to the settings. Only the top level fields of AccessApprovalSettings (notification_emails &amp; enrolled_services) are supported. For each field, if it is included, the currently stored value will be entirely overwritten with the value of the field passed in this request.

For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If this field is left unset, only the notification_emails field will be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AccessApprovalSettings>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
AccessApprovalSettings settings = new AccessApprovalSettings();
FieldMask updateMask = new FieldMask();
// Make the request
AccessApprovalSettings response = await accessApprovalServiceClient.UpdateAccessApprovalSettingsAsync(settings, updateMask);

UpdateAccessApprovalSettingsAsync(AccessApprovalSettings, FieldMask, CancellationToken)

public virtual Task<AccessApprovalSettings> UpdateAccessApprovalSettingsAsync(AccessApprovalSettings settings, FieldMask updateMask, CancellationToken cancellationToken)

Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask.

Parameters
NameDescription
settingsAccessApprovalSettings

The new AccessApprovalSettings.

updateMaskFieldMask

The update mask applies to the settings. Only the top level fields of AccessApprovalSettings (notification_emails &amp; enrolled_services) are supported. For each field, if it is included, the currently stored value will be entirely overwritten with the value of the field passed in this request.

For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If this field is left unset, only the notification_emails field will be updated.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AccessApprovalSettings>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
AccessApprovalSettings settings = new AccessApprovalSettings();
FieldMask updateMask = new FieldMask();
// Make the request
AccessApprovalSettings response = await accessApprovalServiceClient.UpdateAccessApprovalSettingsAsync(settings, updateMask);

UpdateAccessApprovalSettingsAsync(UpdateAccessApprovalSettingsMessage, CallSettings)

public virtual Task<AccessApprovalSettings> UpdateAccessApprovalSettingsAsync(UpdateAccessApprovalSettingsMessage request, CallSettings callSettings = null)

Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask.

Parameters
NameDescription
requestUpdateAccessApprovalSettingsMessage

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AccessApprovalSettings>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAccessApprovalSettingsMessage request = new UpdateAccessApprovalSettingsMessage
{
    Settings = new AccessApprovalSettings(),
    UpdateMask = new FieldMask(),
};
// Make the request
AccessApprovalSettings response = await accessApprovalServiceClient.UpdateAccessApprovalSettingsAsync(request);

UpdateAccessApprovalSettingsAsync(UpdateAccessApprovalSettingsMessage, CancellationToken)

public virtual Task<AccessApprovalSettings> UpdateAccessApprovalSettingsAsync(UpdateAccessApprovalSettingsMessage request, CancellationToken cancellationToken)

Updates the settings associated with a project, folder, or organization. Settings to update are determined by the value of field_mask.

Parameters
NameDescription
requestUpdateAccessApprovalSettingsMessage

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AccessApprovalSettings>

A Task containing the RPC response.

Example
// Create client
AccessApprovalServiceClient accessApprovalServiceClient = await AccessApprovalServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAccessApprovalSettingsMessage request = new UpdateAccessApprovalSettingsMessage
{
    Settings = new AccessApprovalSettings(),
    UpdateMask = new FieldMask(),
};
// Make the request
AccessApprovalSettings response = await accessApprovalServiceClient.UpdateAccessApprovalSettingsAsync(request);