updateCampaign method
Future<UpdateCampaignResponse>
updateCampaign({
- required String applicationId,
- required String campaignId,
- required WriteCampaignRequest writeCampaignRequest,
Updates the configuration and other settings for a campaign.
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.
Parameter campaignId
:
The unique identifier for the campaign.
Implementation
Future<UpdateCampaignResponse> updateCampaign({
required String applicationId,
required String campaignId,
required WriteCampaignRequest writeCampaignRequest,
}) async {
ArgumentError.checkNotNull(applicationId, 'applicationId');
ArgumentError.checkNotNull(campaignId, 'campaignId');
ArgumentError.checkNotNull(writeCampaignRequest, 'writeCampaignRequest');
final response = await _protocol.sendRaw(
payload: writeCampaignRequest,
method: 'PUT',
requestUri:
'/v1/apps/${Uri.encodeComponent(applicationId)}/campaigns/${Uri.encodeComponent(campaignId)}',
exceptionFnMap: _exceptionFns,
);
final $json = await _s.jsonFromResponse(response);
return UpdateCampaignResponse(
campaignResponse: CampaignResponse.fromJson($json),
);
}