Retrieve the S3 Access Grants instance that contains a particular prefix.
- Permissions
-
You must have the s3:GetAccessGrantsInstanceForPrefix permission for the caller account to use this operation.
- Additional Permissions
-
The prefix owner account must grant you the following permissions to their S3 Access Grants instance: s3:GetAccessGrantsInstanceForPrefix.
Parameters:
-
account_id
(AccountId)
–
The ID of the Amazon Web Services account that is making this request.
-
s3_prefix
(S3Prefix)
–
The S3 prefix of the access grants that you would like to retrieve.
Raises:
Source code in docs_src/capo_s3_control/_services/async_s3_control.py
| async def get_access_grants_instance_for_prefix(
self,
account_id: "capo_s3_control.types.account_id.AccountId",
s3_prefix: "capo_s3_control.types.s3_prefix.S3Prefix",
*,
config_overrides: Optional[AsyncS3ControlClientConfig] = None,
) -> "capo_s3_control.types.get_access_grants_instance_for_prefix_result.GetAccessGrantsInstanceForPrefixResult":
"""<p>Retrieve the S3 Access Grants instance that contains a particular prefix. </p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3:GetAccessGrantsInstanceForPrefix</code> permission for the caller account to use this operation. </p> </dd> <dt>Additional Permissions</dt> <dd> <p>The prefix owner account must grant you the following permissions to their S3 Access Grants instance: <code>s3:GetAccessGrantsInstanceForPrefix</code>. </p> </dd> </dl>
Args:
account_id: <p>The ID of the Amazon Web Services account that is making this request.</p>
s3_prefix: <p>The S3 prefix of the access grants that you would like to retrieve.</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_grants_instance_for_prefix_request.GetAccessGrantsInstanceForPrefixRequest]",
) -> AsyncOperationResponse[
"capo_s3_control.types.get_access_grants_instance_for_prefix_result.GetAccessGrantsInstanceForPrefixResult"
]:
import capo_s3_control._operations.awss3_control_service_v20180820.get_access_grants_instance_for_prefix
(
output,
http_response,
) = await capo_s3_control._operations.awss3_control_service_v20180820.get_access_grants_instance_for_prefix.async_get_access_grants_instance_for_prefix(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetAccessGrantsInstanceForPrefix")
)
input_: capo_s3_control.types.get_access_grants_instance_for_prefix_request.GetAccessGrantsInstanceForPrefixRequest = {
"account_id": account_id,
"s3_prefix": s3_prefix,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|