createRoutingProfile method

Future<CreateRoutingProfileResponse> createRoutingProfile({
  1. required String defaultOutboundQueueId,
  2. required String description,
  3. required String instanceId,
  4. required List<MediaConcurrency> mediaConcurrencies,
  5. required String name,
  6. List<RoutingProfileQueueConfig>? queueConfigs,
  7. Map<String, String>? tags,
})

Creates a new routing profile.

May throw InvalidRequestException. May throw InvalidParameterException. May throw DuplicateResourceException. May throw ResourceNotFoundException. May throw LimitExceededException. May throw ThrottlingException. May throw InternalServiceException.

Parameter defaultOutboundQueueId : The default outbound queue for the routing profile.

Parameter description : Description of the routing profile. Must not be more than 250 characters.

Parameter instanceId : The identifier of the Amazon Connect instance.

Parameter mediaConcurrencies : The channels agents can handle in the Contact Control Panel (CCP) for this routing profile.

Parameter name : The name of the routing profile. Must not be more than 127 characters.

Parameter queueConfigs : The inbound queues associated with the routing profile. If no queue is added, the agent can only make outbound calls.

Parameter tags : One or more tags.

Implementation

Future<CreateRoutingProfileResponse> createRoutingProfile({
  required String defaultOutboundQueueId,
  required String description,
  required String instanceId,
  required List<MediaConcurrency> mediaConcurrencies,
  required String name,
  List<RoutingProfileQueueConfig>? queueConfigs,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(
      defaultOutboundQueueId, 'defaultOutboundQueueId');
  ArgumentError.checkNotNull(description, 'description');
  _s.validateStringLength(
    'description',
    description,
    1,
    250,
    isRequired: true,
  );
  ArgumentError.checkNotNull(instanceId, 'instanceId');
  _s.validateStringLength(
    'instanceId',
    instanceId,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(mediaConcurrencies, 'mediaConcurrencies');
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    127,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'DefaultOutboundQueueId': defaultOutboundQueueId,
    'Description': description,
    'MediaConcurrencies': mediaConcurrencies,
    'Name': name,
    if (queueConfigs != null) 'QueueConfigs': queueConfigs,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/routing-profiles/${Uri.encodeComponent(instanceId)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateRoutingProfileResponse.fromJson(response);
}