putIdentityPolicy method

Future<void> putIdentityPolicy({
  1. required String identity,
  2. required String policy,
  3. required String policyName,
})

Adds or updates a sending authorization policy for the specified identity (an email address or a domain). 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.

May throw InvalidPolicyException.

Parameter identity : The identity that the policy will apply to. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: user@example.com, example.com, arn:aws:ses:us-east-1:123456789012:identity/example.com.

To successfully call this API, you must own the identity.

Parameter 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.

Parameter policyName : The name of the policy.

The policy name cannot exceed 64 characters and can only include alphanumeric characters, dashes, and underscores.

Implementation

Future<void> putIdentityPolicy({
  required String identity,
  required String policy,
  required String policyName,
}) async {
  ArgumentError.checkNotNull(identity, 'identity');
  ArgumentError.checkNotNull(policy, 'policy');
  _s.validateStringLength(
    'policy',
    policy,
    1,
    1152921504606846976,
    isRequired: true,
  );
  ArgumentError.checkNotNull(policyName, 'policyName');
  _s.validateStringLength(
    'policyName',
    policyName,
    1,
    64,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['Identity'] = identity;
  $request['Policy'] = policy;
  $request['PolicyName'] = policyName;
  await _protocol.send(
    $request,
    action: 'PutIdentityPolicy',
    version: '2010-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['PutIdentityPolicyRequest'],
    shapes: shapes,
    resultWrapper: 'PutIdentityPolicyResult',
  );
}