associateInstanceStorageConfig method

Future<AssociateInstanceStorageConfigResponse> associateInstanceStorageConfig({
  1. required String instanceId,
  2. required InstanceStorageResourceType resourceType,
  3. required InstanceStorageConfig storageConfig,
  4. String? clientToken,
})

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

Associates a storage resource type for the first time. You can only associate one type of storage configuration in a single call. This means, for example, that you can't define an instance with multiple S3 buckets for storing chat transcripts.

This API does not create a resource that doesn't exist. It only associates it to the instance. Ensure that the resource being specified in the storage configuration, like an S3 bucket, exists when being used for association.

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

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter resourceType : A valid resource type. To enable streaming for real-time analysis of contacts, use the following types:

  • For chat contacts, use REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS.
  • For voice contacts, use REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS.

Implementation

Future<AssociateInstanceStorageConfigResponse>
    associateInstanceStorageConfig({
  required String instanceId,
  required InstanceStorageResourceType resourceType,
  required InstanceStorageConfig storageConfig,
  String? clientToken,
}) async {
  final $payload = <String, dynamic>{
    'ResourceType': resourceType.value,
    'StorageConfig': storageConfig,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/instance/${Uri.encodeComponent(instanceId)}/storage-config',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateInstanceStorageConfigResponse.fromJson(response);
}