describeCampaign method
Describes the given campaign, including its status.
A campaign can be in one of the following states:
- CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
- DELETE PENDING > DELETE IN_PROGRESS
status
is CREATE FAILED
, the response
includes the failureReason
key, which describes why.
For more information on campaigns, see CreateCampaign.
May throw InvalidInputException. May throw ResourceNotFoundException.
Parameter campaignArn
:
The Amazon Resource Name (ARN) of the campaign.
Implementation
Future<DescribeCampaignResponse> describeCampaign({
required String campaignArn,
}) async {
ArgumentError.checkNotNull(campaignArn, 'campaignArn');
_s.validateStringLength(
'campaignArn',
campaignArn,
0,
256,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonPersonalize.DescribeCampaign'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'campaignArn': campaignArn,
},
);
return DescribeCampaignResponse.fromJson(jsonResponse.body);
}