createJourney method

Future<CreateJourneyResponse> createJourney({
  1. required String applicationId,
  2. required WriteJourneyRequest writeJourneyRequest,
})

Creates a journey for an application.

May throw BadRequestException. May throw InternalServerErrorException. May throw PayloadTooLargeException. May throw ForbiddenException. May throw NotFoundException. May throw MethodNotAllowedException. May throw TooManyRequestsException.

Parameter applicationId : The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.

Implementation

Future<CreateJourneyResponse> createJourney({
  required String applicationId,
  required WriteJourneyRequest writeJourneyRequest,
}) async {
  ArgumentError.checkNotNull(applicationId, 'applicationId');
  ArgumentError.checkNotNull(writeJourneyRequest, 'writeJourneyRequest');
  final response = await _protocol.sendRaw(
    payload: writeJourneyRequest,
    method: 'POST',
    requestUri: '/v1/apps/${Uri.encodeComponent(applicationId)}/journeys',
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return CreateJourneyResponse(
    journeyResponse: JourneyResponse.fromJson($json),
  );
}