listBenefitAllocations method

Future<ListBenefitAllocationsOutput> listBenefitAllocations({
  1. required String catalog,
  2. List<String>? benefitApplicationIdentifiers,
  3. List<String>? benefitIdentifiers,
  4. List<FulfillmentType>? fulfillmentTypes,
  5. int? maxResults,
  6. String? nextToken,
  7. List<BenefitAllocationStatus>? status,
})

Retrieves a paginated list of benefit allocations based on specified filter criteria.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter catalog : The catalog identifier to filter benefit allocations by catalog.

Parameter benefitApplicationIdentifiers : Filter benefit allocations by specific benefit application identifiers.

Parameter benefitIdentifiers : Filter benefit allocations by specific benefit identifiers.

Parameter fulfillmentTypes : Filter benefit allocations by specific fulfillment types.

Parameter maxResults : The maximum number of benefit allocations to return in a single response.

Parameter nextToken : A pagination token to retrieve the next set of results from a previous request.

Parameter status : Filter benefit allocations by their current status.

Implementation

Future<ListBenefitAllocationsOutput> listBenefitAllocations({
  required String catalog,
  List<String>? benefitApplicationIdentifiers,
  List<String>? benefitIdentifiers,
  List<FulfillmentType>? fulfillmentTypes,
  int? maxResults,
  String? nextToken,
  List<BenefitAllocationStatus>? status,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PartnerCentralBenefitsService.ListBenefitAllocations'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Catalog': catalog,
      if (benefitApplicationIdentifiers != null)
        'BenefitApplicationIdentifiers': benefitApplicationIdentifiers,
      if (benefitIdentifiers != null)
        'BenefitIdentifiers': benefitIdentifiers,
      if (fulfillmentTypes != null)
        'FulfillmentTypes': fulfillmentTypes.map((e) => e.value).toList(),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (status != null) 'Status': status.map((e) => e.value).toList(),
    },
  );

  return ListBenefitAllocationsOutput.fromJson(jsonResponse.body);
}