Sets the permission policy for an application. For the list of actions supported for this operation, see Application Permissions .
Parameters:
Raises:
Source code in docs_src/capo_serverlessapplicationrepository/_services/async_serverless_application_repository.py
| async def put_application_policy(
self,
application_id: "capo_serverlessapplicationrepository.types.__string.__string",
*,
config_overrides: Optional[
AsyncServerlessApplicationRepositoryClientConfig
] = None,
statements: Optional[
"capo_serverlessapplicationrepository.types.__list_of_application_policy_statement.__listOfApplicationPolicyStatement"
] = None,
) -> "capo_serverlessapplicationrepository.types.put_application_policy_response.PutApplicationPolicyResponse":
"""<p>Sets the permission policy for an application. For the list of actions supported for this operation, see <a href="https://docs.aws.amazon.com/serverlessrepo/latest/devguide/access-control-resource-based.html#application-permissions">Application Permissions</a> .</p>
Args:
application_id: <p>The Amazon Resource Name (ARN) of the application.</p>
statements: <p>An array of policy statements applied to the application.</p>
Raises:
capo_serverlessapplicationrepository.errors.bad_request_exception.BadRequestException: <p>One of the parameters in the request is invalid.</p>
capo_serverlessapplicationrepository.errors.forbidden_exception.ForbiddenException: <p>The client is not authenticated.</p>
capo_serverlessapplicationrepository.errors.internal_server_error_exception.InternalServerErrorException: <p>The AWS Serverless Application Repository service encountered an internal error.</p>
capo_serverlessapplicationrepository.errors.not_found_exception.NotFoundException: <p>The resource (for example, an access policy statement) specified in the request doesn't exist.</p>
capo_serverlessapplicationrepository.errors.too_many_requests_exception.TooManyRequestsException: <p>The client is sending more than the allowed number of requests per unit of time.</p>
capo_serverlessapplicationrepository.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_serverlessapplicationrepository.types.put_application_policy_request.PutApplicationPolicyRequest]",
) -> AsyncOperationResponse[
"capo_serverlessapplicationrepository.types.put_application_policy_response.PutApplicationPolicyResponse"
]:
import capo_serverlessapplicationrepository._operations.serverless_application_repository.put_application_policy
(
output,
http_response,
) = await capo_serverlessapplicationrepository._operations.serverless_application_repository.put_application_policy.async_put_application_policy(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutApplicationPolicy")
)
input_: capo_serverlessapplicationrepository.types.put_application_policy_request.PutApplicationPolicyRequest = {
"application_id": application_id
}
if statements is not None:
input_["statements"] = statements
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|