delete_access_request

UsersApi.delete_access_request(role_id, request_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Delete a pending access request

Deletes a pending access request. Loads the request by RequestId then validates role authorization for its ResourceType. Only the original RequestedBy user may delete it, and RequestStatus must be requested (else AUTH-1021). Missing request returns GE-1080. Success Message is “Successfully deleted access request.” Not idempotent after delete (subsequent calls return GE-1080).

Parameters:
  • role_id (str) – Amorphic role ID used for authorization. Must allow the resource-type list action for the request’s ResourceType. (required)

  • request_id (str) – UUID of the access request to delete. GE-1080 if it does not exist. (required)

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

DeleteAccessRequestResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: DELETE /access-requests/{request_id}

Success (HTTP 200)

Access request deleted. Body is Message only (DeleteAccessRequestResponse).

Deleted pending request

{
  "Message": "Successfully deleted access request."
}

Errors

Documented error codes: GE-1080, AUTH-1021, GE-1085, EMF-1001.

HTTP 400

Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: GE-1080 (request does not exist), AUTH-1021 (not requester or status is not requested).

Access request missing

{
  "Message": "GE-1080 - Access request does not exists."
}

Not requester or not pending

{
  "Message": "AUTH-1021 - User is unauthorized to delete the access request."
}

HTTP 500

Backend failure. Body is {“Message”: “<CODE> - <text>”} (typically GE-1085 via EMF-1001).

Unexpected failure

{
  "Message": "GE-1085 - <exception text>"
}