associateCertificate method

Future<AssociateCertificateResponse> associateCertificate({
  1. required String acmCertificateArn,
  2. required String gatewayId,
  3. String? clientToken,
})

Associates an ACM certificate with a responder gateway.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter acmCertificateArn : The Amazon Resource Name (ARN) of the ACM certificate to associate.

Parameter gatewayId : The unique identifier of the gateway.

Parameter clientToken : Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.

If you don't provide this value, then Amazon Web Services generates a random one for you.

If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an IdempotentParameterMismatch error.

Implementation

Future<AssociateCertificateResponse> associateCertificate({
  required String acmCertificateArn,
  required String gatewayId,
  String? clientToken,
}) async {
  final $payload = <String, dynamic>{
    'acmCertificateArn': acmCertificateArn,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/responder-gateway/${Uri.encodeComponent(gatewayId)}/certificate',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateCertificateResponse.fromJson(response);
}