associateSecurityKey method

Future<AssociateSecurityKeyResponse> associateSecurityKey({
  1. required String instanceId,
  2. required String key,
})

This API is in preview release for Amazon Connect and is subject to change.

Associates a security key to the instance.

May throw ResourceNotFoundException. May throw ResourceConflictException. May throw InternalServiceException. May throw InvalidRequestException. May throw InvalidParameterException. May throw ServiceQuotaExceededException. May throw ThrottlingException.

Parameter instanceId : The identifier of the Amazon Connect instance.

Parameter key : A valid security key in PEM format.

Implementation

Future<AssociateSecurityKeyResponse> associateSecurityKey({
  required String instanceId,
  required String key,
}) async {
  ArgumentError.checkNotNull(instanceId, 'instanceId');
  _s.validateStringLength(
    'instanceId',
    instanceId,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(key, 'key');
  _s.validateStringLength(
    'key',
    key,
    1,
    1024,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'Key': key,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/instance/${Uri.encodeComponent(instanceId)}/security-key',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateSecurityKeyResponse.fromJson(response);
}