createInstance method

Future<CreateInstanceResponse> createInstance({
  1. required DirectoryType identityManagementType,
  2. required bool inboundCallsEnabled,
  3. required bool outboundCallsEnabled,
  4. String? clientToken,
  5. String? directoryId,
  6. String? instanceAlias,
  7. Map<String, String>? tags,
})

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

Initiates an Connect Customer instance with all the supported channels enabled. It does not attach any storage, such as Amazon Simple Storage Service (Amazon S3) or Amazon Kinesis. It also does not allow for any configurations on features, such as Contact Lens for Connect Customer.

For more information, see Create an Connect Customer instance in the Connect Customer Administrator Guide.

Connect Customer enforces a limit on the total number of instances that you can create or delete in 30 days. If you exceed this limit, you will get an error message indicating there has been an excessive number of attempts at creating or deleting instances. You must wait 30 days before you can restart creating and deleting instances in your account.

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

Parameter identityManagementType : The type of identity management for your Connect Customer users.

Parameter inboundCallsEnabled : Your contact center handles incoming contacts.

Parameter outboundCallsEnabled : Your contact center allows outbound calls.

Parameter clientToken : The idempotency token.

Parameter directoryId : The identifier for the directory.

Parameter instanceAlias : The name for your instance.

Parameter tags : The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.

Implementation

Future<CreateInstanceResponse> createInstance({
  required DirectoryType identityManagementType,
  required bool inboundCallsEnabled,
  required bool outboundCallsEnabled,
  String? clientToken,
  String? directoryId,
  String? instanceAlias,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'IdentityManagementType': identityManagementType.value,
    'InboundCallsEnabled': inboundCallsEnabled,
    'OutboundCallsEnabled': outboundCallsEnabled,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (directoryId != null) 'DirectoryId': directoryId,
    if (instanceAlias != null) 'InstanceAlias': instanceAlias,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/instance',
    exceptionFnMap: _exceptionFns,
  );
  return CreateInstanceResponse.fromJson(response);
}