createAddonInstance method

Future<CreateAddonInstanceResponse> createAddonInstance({
  1. required String addonSubscriptionId,
  2. String? clientToken,
  3. List<Tag>? tags,
})

Creates an Add On instance for the subscription indicated in the request. The resulting Amazon Resource Name (ARN) can be used in a conditional statement for a rule set or traffic policy.

May throw ConflictException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter addonSubscriptionId : The unique ID of a previously created subscription that an Add On instance is created for. You can only have one instance per subscription.

Parameter clientToken : A unique token that Amazon SES uses to recognize subsequent retries of the same request.

Parameter tags : The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.

Implementation

Future<CreateAddonInstanceResponse> createAddonInstance({
  required String addonSubscriptionId,
  String? clientToken,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'MailManagerSvc.CreateAddonInstance'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AddonSubscriptionId': addonSubscriptionId,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateAddonInstanceResponse.fromJson(jsonResponse.body);
}