rejectCertificateTransfer method

Future<void> rejectCertificateTransfer({
  1. required String certificateId,
  2. String? rejectReason,
})

Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, the certificate status changes from PENDING_TRANSFER to INACTIVE.

To check for pending certificate transfers, call ListCertificates to enumerate your certificates.

This operation can only be called by the transfer destination. After it is called, the certificate will be returned to the source's account in the INACTIVE state.

May throw ResourceNotFoundException. May throw TransferAlreadyCompletedException. May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException.

Parameter certificateId : The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)

Parameter rejectReason : The reason the certificate transfer was rejected.

Implementation

Future<void> rejectCertificateTransfer({
  required String certificateId,
  String? rejectReason,
}) async {
  ArgumentError.checkNotNull(certificateId, 'certificateId');
  _s.validateStringLength(
    'certificateId',
    certificateId,
    64,
    64,
    isRequired: true,
  );
  _s.validateStringLength(
    'rejectReason',
    rejectReason,
    0,
    128,
  );
  final $payload = <String, dynamic>{
    if (rejectReason != null) 'rejectReason': rejectReason,
  };
  await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/reject-certificate-transfer/${Uri.encodeComponent(certificateId)}',
    exceptionFnMap: _exceptionFns,
  );
}