revokeSigningProfile method

Future<void> revokeSigningProfile({
  1. required DateTime effectiveTime,
  2. required String profileName,
  3. required String profileVersion,
  4. required String reason,
})

Changes the state of a signing profile to REVOKED. This indicates that signatures generated using the signing profile after an effective start date are no longer valid.

May throw ValidationException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw TooManyRequestsException. May throw InternalServiceErrorException.

Parameter effectiveTime : A timestamp for when revocation of a Signing Profile should become effective. Signatures generated using the signing profile after this timestamp are not trusted.

Parameter profileName : The name of the signing profile to be revoked.

Parameter profileVersion : The version of the signing profile to be revoked.

Parameter reason : The reason for revoking a signing profile.

Implementation

Future<void> revokeSigningProfile({
  required DateTime effectiveTime,
  required String profileName,
  required String profileVersion,
  required String reason,
}) async {
  ArgumentError.checkNotNull(effectiveTime, 'effectiveTime');
  ArgumentError.checkNotNull(profileName, 'profileName');
  _s.validateStringLength(
    'profileName',
    profileName,
    2,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(profileVersion, 'profileVersion');
  _s.validateStringLength(
    'profileVersion',
    profileVersion,
    10,
    10,
    isRequired: true,
  );
  ArgumentError.checkNotNull(reason, 'reason');
  _s.validateStringLength(
    'reason',
    reason,
    1,
    500,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'effectiveTime': unixTimestampToJson(effectiveTime),
    'profileVersion': profileVersion,
    'reason': reason,
  };
  await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/signing-profiles/${Uri.encodeComponent(profileName)}/revoke',
    exceptionFnMap: _exceptionFns,
  );
}