createCampaign method

Future<CreateCampaignResponse> createCampaign({
  1. required String connectInstanceId,
  2. required DialerConfig dialerConfig,
  3. required String name,
  4. required OutboundCallConfig outboundCallConfig,
  5. Map<String, String>? tags,
})

Creates a campaign for the specified Amazon Connect account. This API is idempotent.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Implementation

Future<CreateCampaignResponse> createCampaign({
  required String connectInstanceId,
  required DialerConfig dialerConfig,
  required String name,
  required OutboundCallConfig outboundCallConfig,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'connectInstanceId': connectInstanceId,
    'dialerConfig': dialerConfig,
    'name': name,
    'outboundCallConfig': outboundCallConfig,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/campaigns',
    exceptionFnMap: _exceptionFns,
  );
  return CreateCampaignResponse.fromJson(response);
}