Deletes the specified sending authorization policy for the given identity (an email address or a domain). This operation returns successfully even if a policy with the specified name does not exist.
This operation is for the identity owner only. If you have not verified the identity, it returns 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:
-
identity
(Identity)
–
The identity that is associated with the policy to delete. You can specify the identity by using its name or by using its Amazon Resource Name (ARN). Examples: [email protected], example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com.
To successfully call this operation, you must own the identity.
-
policy_name
(PolicyName)
–
The name of the policy to be deleted.
Raises:
Examples:
DeleteIdentityPolicy
The following example deletes a sending authorization policy for an identity:
>>> client.delete_identity_policy(identity='[email protected]', policy_name='MyPolicy')
Source code in docs_src/capo_ses/_services/ses.py
| def delete_identity_policy(
self,
identity: "capo_ses.types.identity.Identity",
policy_name: "capo_ses.types.policy_name.PolicyName",
*,
config_overrides: Optional[SESClientConfig] = None,
) -> "capo_ses.types.delete_identity_policy_response.DeleteIdentityPolicyResponse":
"""<p>Deletes the specified sending authorization policy for the given identity (an email address or a domain). This operation returns successfully even if a policy with the specified name does not exist.</p> <note> <p>This operation is for the identity owner only. If you have not verified the identity, it returns 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/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p> <p>You can execute this operation no more than once per second.</p>
Args:
identity: <p>The identity that is associated with the policy to delete. You can specify the identity by using its name or by using its Amazon Resource Name (ARN). Examples: <code>[email protected]</code>, <code>example.com</code>, <code>arn:aws:ses:us-east-1:123456789012:identity/example.com</code>.</p> <p>To successfully call this operation, you must own the identity.</p>
policy_name: <p>The name of the policy to be deleted.</p>
Raises:
capo_ses.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
DeleteIdentityPolicy
The following example deletes a sending authorization policy for an identity:
>>> client.delete_identity_policy(identity='[email protected]', policy_name='MyPolicy')
"""
def _handler(
req: "OperationRequest[capo_ses.types.delete_identity_policy_request.DeleteIdentityPolicyRequest]",
) -> OperationResponse[
"capo_ses.types.delete_identity_policy_response.DeleteIdentityPolicyResponse"
]:
import capo_ses._operations.simple_email_service.delete_identity_policy
output, http_response = (
capo_ses._operations.simple_email_service.delete_identity_policy.delete_identity_policy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteIdentityPolicy")
)
input_: capo_ses.types.delete_identity_policy_request.DeleteIdentityPolicyRequest = {
"identity": identity,
"policy_name": policy_name,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|