createSegmentSnapshot method
Triggers a job to export a segment to a specified destination.
May throw AccessDeniedException.
May throw BadRequestException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter dataFormat :
The format in which the segment will be exported.
Parameter domainName :
The unique name of the domain.
Parameter segmentDefinitionName :
The name of the segment definition used in this snapshot request.
Parameter destinationUri :
The destination to which the segment will be exported. This field must be
provided if the request is not submitted from the Connect Customer Admin
Website.
Parameter encryptionKey :
The Amazon Resource Name (ARN) of the KMS key used to encrypt the exported
segment.
Parameter roleArn :
The Amazon Resource Name (ARN) of the IAM role that allows Customer
Profiles service principal to assume the role for conducting KMS and S3
operations.
Implementation
Future<CreateSegmentSnapshotResponse> createSegmentSnapshot({
required DataFormat dataFormat,
required String domainName,
required String segmentDefinitionName,
String? destinationUri,
String? encryptionKey,
String? roleArn,
}) async {
final $payload = <String, dynamic>{
'DataFormat': dataFormat.value,
if (destinationUri != null) 'DestinationUri': destinationUri,
if (encryptionKey != null) 'EncryptionKey': encryptionKey,
if (roleArn != null) 'RoleArn': roleArn,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/domains/${Uri.encodeComponent(domainName)}/segments/${Uri.encodeComponent(segmentDefinitionName)}/snapshots',
exceptionFnMap: _exceptionFns,
);
return CreateSegmentSnapshotResponse.fromJson(response);
}