associateInstanceStorageConfig method

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

This API is in preview release for Amazon Connect 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 Amazon S3 bucket, exists when being used for association.

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

Parameter instanceId : The identifier of the Amazon Connect instance.

Parameter resourceType : A valid resource type.

Parameter storageConfig : A valid storage type.

Implementation

Future<AssociateInstanceStorageConfigResponse>
    associateInstanceStorageConfig({
  required String instanceId,
  required InstanceStorageResourceType resourceType,
  required InstanceStorageConfig storageConfig,
}) async {
  ArgumentError.checkNotNull(instanceId, 'instanceId');
  _s.validateStringLength(
    'instanceId',
    instanceId,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(resourceType, 'resourceType');
  ArgumentError.checkNotNull(storageConfig, 'storageConfig');
  final $payload = <String, dynamic>{
    'ResourceType': resourceType.toValue(),
    'StorageConfig': storageConfig,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/instance/${Uri.encodeComponent(instanceId)}/storage-config',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateInstanceStorageConfigResponse.fromJson(response);
}