Creates the specified sending authorization policy for the given identity (an email address or a domain).
This API is for the identity owner only. If you have not verified the identity, this API will return an error.
Sending authorization is a feature that enables an identity owner to authorize other senders to use its identities. For information about using sending authorization, see the Amazon SES Developer Guide.
You can execute this operation no more than once per second.
Parameters:
-
email_identity
(Identity)
–
-
policy_name
(PolicyName)
–
The name of the policy.
The policy name cannot exceed 64 characters and can only include alphanumeric characters, dashes, and underscores.
-
policy
(Policy)
–
The text of the policy in JSON format. The policy cannot exceed 4 KB.
For information about the syntax of sending authorization policies, see the Amazon SES Developer Guide.
Raises:
Source code in docs_src/capo_sesv2/_services/se_sv2.py
| def create_email_identity_policy(
self,
email_identity: "capo_sesv2.types.identity.Identity",
policy_name: "capo_sesv2.types.policy_name.PolicyName",
policy: "capo_sesv2.types.policy.Policy",
*,
config_overrides: Optional[SESv2ClientConfig] = None,
) -> "capo_sesv2.types.create_email_identity_policy_response.CreateEmailIdentityPolicyResponse":
"""<p>Creates the specified sending authorization policy for the given identity (an email address or a domain).</p> <note> <p>This API is for the identity owner only. If you have not verified the identity, this API will return an error.</p> </note> <p>Sending authorization is a feature that enables an identity owner to authorize other senders to use its identities. For information about using sending authorization, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html">Amazon SES Developer Guide</a>.</p> <p>You can execute this operation no more than once per second.</p>
Args:
email_identity: <p>The email identity.</p>
policy_name: <p>The name of the policy.</p> <p>The policy name cannot exceed 64 characters and can only include alphanumeric characters, dashes, and underscores.</p>
policy: <p>The text of the policy in JSON format. The policy cannot exceed 4 KB.</p> <p>For information about the syntax of sending authorization policies, see the <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-policies.html">Amazon SES Developer Guide</a>.</p>
Raises:
capo_sesv2.errors.already_exists_exception.AlreadyExistsException: <p>The resource specified in your request already exists.</p>
capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
capo_sesv2.errors.limit_exceeded_exception.LimitExceededException: <p>There are too many instances of the specified resource type.</p>
capo_sesv2.errors.not_found_exception.NotFoundException: <p>The resource you attempted to access doesn't exist.</p>
capo_sesv2.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
capo_sesv2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_sesv2.types.create_email_identity_policy_request.CreateEmailIdentityPolicyRequest]",
) -> OperationResponse[
"capo_sesv2.types.create_email_identity_policy_response.CreateEmailIdentityPolicyResponse"
]:
import capo_sesv2._operations.simple_email_service_v2.create_email_identity_policy
output, http_response = (
capo_sesv2._operations.simple_email_service_v2.create_email_identity_policy.create_email_identity_policy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateEmailIdentityPolicy")
)
input_: capo_sesv2.types.create_email_identity_policy_request.CreateEmailIdentityPolicyRequest = {
"email_identity": email_identity,
"policy_name": policy_name,
"policy": policy,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|