Skip to content

get_access_grant async

get_access_grant(
    account_id: AccountId,
    access_grant_id: AccessGrantId,
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
) -> GetAccessGrantResult

Get the details of an access grant from your S3 Access Grants instance.

Permissions

You must have the s3:GetAccessGrant permission to use this operation.

Parameters:

  • account_id (AccountId) –

    The Amazon Web Services account ID of the S3 Access Grants instance.

  • access_grant_id (AccessGrantId) –

    The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.

Raises:

Source code in docs_src/capo_s3_control/_services/async_s3_control.py
async def get_access_grant(
    self,
    account_id: "capo_s3_control.types.account_id.AccountId",
    access_grant_id: "capo_s3_control.types.access_grant_id.AccessGrantId",
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
) -> "capo_s3_control.types.get_access_grant_result.GetAccessGrantResult":
    """<p>Get the details of an access grant from your S3 Access Grants instance.</p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3:GetAccessGrant</code> permission to use this operation. </p> </dd> </dl>

    Args:
        account_id: <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
        access_grant_id: <p>The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.</p>

    Raises:
        capo_s3_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_s3_control.types.get_access_grant_request.GetAccessGrantRequest]",
    ) -> AsyncOperationResponse[
        "capo_s3_control.types.get_access_grant_result.GetAccessGrantResult"
    ]:
        import capo_s3_control._operations.awss3_control_service_v20180820.get_access_grant

        (
            output,
            http_response,
        ) = await capo_s3_control._operations.awss3_control_service_v20180820.get_access_grant.async_get_access_grant(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAccessGrant")
    )
    input_: capo_s3_control.types.get_access_grant_request.GetAccessGrantRequest = {
        "account_id": account_id,
        "access_grant_id": access_grant_id,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output