Skip to main content

approval_requests

Creates, updates, deletes, gets or lists an approval_requests resource.

Overview

Nameapproval_requests
TypeResource
Idgoogle.accessapproval.approval_requests

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe resource name of the request. Format is "{projects|folders|organizations}/{id}/approvalRequests/{approval_request}".
approveobjectAccess was approved. (id: ApproveDecision)
dismissobjectThe request was dismissed. (id: DismissDecision)
requestTimestring (google-datetime)The time at which approval was requested.
requestedAugmentedInfoobjectThis field contains the augmented information of the request. (id: AugmentedInfo)
requestedDurationstring (google-duration)The requested access duration.
requestedExpirationstring (google-datetime)The original requested expiration for the approval. Calculated by adding the requested_duration to the request_time.
requestedLocationsobjectThe locations for which approval is being requested. (id: AccessLocations)
requestedReasonobjectThe justification for which approval is being requested. (id: AccessReason)
requestedResourceNamestringThe resource for which approval is being requested. The format of the resource name is defined at https://cloud.google.com/apis/design/resource_names. The resource name here may either be a "full" resource name (e.g. "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative" resource name (e.g. "shelves/shelf1/books/book2") as described in the resource name specification.
requestedResourcePropertiesobjectProperties related to the resource represented by requested_resource_name. (id: ResourceProperties)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_approval_requests_getselectprojectsId, approvalRequestsIdGets an approval request. Returns NOT_FOUND if the request does not exist.
folders_approval_requests_getselectfoldersId, approvalRequestsIdGets an approval request. Returns NOT_FOUND if the request does not exist.
organizations_approval_requests_getselectorganizationsId, approvalRequestsIdGets an approval request. Returns NOT_FOUND if the request does not exist.
projects_approval_requests_listselectprojectsIdfilter, pageSize, pageTokenLists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological.
folders_approval_requests_listselectfoldersIdfilter, pageSize, pageTokenLists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological.
organizations_approval_requests_listselectorganizationsIdfilter, pageSize, pageTokenLists approval requests associated with a project, folder, or organization. Approval requests can be filtered by state (pending, active, dismissed). The order is reverse chronological.
projects_approval_requests_approveexecprojectsId, approvalRequestsIdApproves 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.
projects_approval_requests_dismissexecprojectsId, approvalRequestsIdDismisses 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.
projects_approval_requests_invalidateexecprojectsId, approvalRequestsIdInvalidates an existing ApprovalRequest. Returns the updated ApprovalRequest. NOTE: This does not deny access to the resource if another request has been made and approved. It only invalidates a single approval. Returns FAILED_PRECONDITION if the request exists but is not in an approved state.
folders_approval_requests_approveexecfoldersId, approvalRequestsIdApproves 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.
folders_approval_requests_dismissexecfoldersId, approvalRequestsIdDismisses 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.
folders_approval_requests_invalidateexecfoldersId, approvalRequestsIdInvalidates an existing ApprovalRequest. Returns the updated ApprovalRequest. NOTE: This does not deny access to the resource if another request has been made and approved. It only invalidates a single approval. Returns FAILED_PRECONDITION if the request exists but is not in an approved state.
organizations_approval_requests_approveexecorganizationsId, approvalRequestsIdApproves 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.
organizations_approval_requests_dismissexecorganizationsId, approvalRequestsIdDismisses 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.
organizations_approval_requests_invalidateexecorganizationsId, approvalRequestsIdInvalidates an existing ApprovalRequest. Returns the updated ApprovalRequest. NOTE: This does not deny access to the resource if another request has been made and approved. It only invalidates a single approval. Returns FAILED_PRECONDITION if the request exists but is not in an approved state.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
approvalRequestsIdstring
foldersIdstring
organizationsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

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

SELECT
name,
approve,
dismiss,
requestTime,
requestedAugmentedInfo,
requestedDuration,
requestedExpiration,
requestedLocations,
requestedReason,
requestedResourceName,
requestedResourceProperties
FROM google.accessapproval.approval_requests
WHERE projectsId = '{{ projectsId }}' -- required
AND approvalRequestsId = '{{ approvalRequestsId }}' -- required;

Lifecycle Methods

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.

EXEC google.accessapproval.approval_requests.projects_approval_requests_approve 
@projectsId='{{ projectsId }}' --required,
@approvalRequestsId='{{ approvalRequestsId }}' --required
@@json=
'{
"expireTime": "{{ expireTime }}"
}';