createSegmentEstimate method

Future<CreateSegmentEstimateResponse> createSegmentEstimate({
  1. required String domainName,
  2. SegmentGroupStructure? segmentQuery,
  3. String? segmentSqlQuery,
})

Creates a segment estimate query.

May throw AccessDeniedException. May throw BadRequestException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter domainName : The unique name of the domain.

Parameter segmentQuery : The segment query for calculating a segment estimate.

Parameter segmentSqlQuery : The segment SQL query.

Implementation

Future<CreateSegmentEstimateResponse> createSegmentEstimate({
  required String domainName,
  SegmentGroupStructure? segmentQuery,
  String? segmentSqlQuery,
}) async {
  final $payload = <String, dynamic>{
    if (segmentQuery != null) 'SegmentQuery': segmentQuery,
    if (segmentSqlQuery != null) 'SegmentSqlQuery': segmentSqlQuery,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/domains/${Uri.encodeComponent(domainName)}/segment-estimates',
    exceptionFnMap: _exceptionFns,
  );
  return CreateSegmentEstimateResponse.fromJson(response);
}