Skip to content

list_benefit_allocations async

list_benefit_allocations(
    catalog: CatalogName,
    *,
    config_overrides: Optional[AsyncPartnerCentralBenefitsClientConfig] = None,
    fulfillment_types: Optional[FulfillmentTypes] = None,
    benefit_identifiers: Optional[BenefitIdentifiers] = None,
    benefit_application_identifiers: Optional[BenefitApplicationIdentifierList] = None,
    status: Optional[BenefitAllocationStatusList] = None,
    max_results: Optional[int] = None,
    next_token: Optional[str] = None,
) -> ListBenefitAllocationsOutput

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

Parameters:

  • catalog (CatalogName) –

    The catalog identifier to filter benefit allocations by catalog.

  • fulfillment_types (Optional[FulfillmentTypes], default: None ) –

    Filter benefit allocations by specific fulfillment types.

  • benefit_identifiers (Optional[BenefitIdentifiers], default: None ) –

    Filter benefit allocations by specific benefit identifiers.

  • benefit_application_identifiers (Optional[BenefitApplicationIdentifierList], default: None ) –

    Filter benefit allocations by specific benefit application identifiers.

  • status (Optional[BenefitAllocationStatusList], default: None ) –

    Filter benefit allocations by their current status.

  • max_results (Optional[int], default: None ) –

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

  • next_token (Optional[str], default: None ) –

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

Raises:

  • AccessDeniedException –

    Thrown when the caller does not have sufficient permissions to perform the requested operation.

  • InternalServerException –

    Thrown when an unexpected error occurs on the server side during request processing.

  • ResourceNotFoundException –

    Thrown when the requested resource cannot be found or does not exist.

  • ThrottlingException –

    Thrown when the request rate exceeds the allowed limits and the request is being throttled.

  • ValidationException –

    Thrown when the request contains invalid parameters or fails input validation requirements.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_partnercentral_benefits/_services/async_partner_central_benefits.py
async def list_benefit_allocations(
    self,
    catalog: "capo_partnercentral_benefits.types.catalog_name.CatalogName",
    *,
    config_overrides: Optional[AsyncPartnerCentralBenefitsClientConfig] = None,
    fulfillment_types: Optional[
        "capo_partnercentral_benefits.types.fulfillment_types.FulfillmentTypes"
    ] = None,
    benefit_identifiers: Optional[
        "capo_partnercentral_benefits.types.benefit_identifiers.BenefitIdentifiers"
    ] = None,
    benefit_application_identifiers: Optional[
        "capo_partnercentral_benefits.types.benefit_application_identifier_list.BenefitApplicationIdentifierList"
    ] = None,
    status: Optional[
        "capo_partnercentral_benefits.types.benefit_allocation_status_list.BenefitAllocationStatusList"
    ] = None,
    max_results: Optional[int] = None,
    next_token: Optional[str] = None,
) -> "capo_partnercentral_benefits.types.list_benefit_allocations_output.ListBenefitAllocationsOutput":
    """<p>Retrieves a paginated list of benefit allocations based on specified filter criteria.</p>

    Args:
        catalog: <p>The catalog identifier to filter benefit allocations by catalog.</p>
        fulfillment_types: <p>Filter benefit allocations by specific fulfillment types.</p>
        benefit_identifiers: <p>Filter benefit allocations by specific benefit identifiers.</p>
        benefit_application_identifiers: <p>Filter benefit allocations by specific benefit application identifiers.</p>
        status: <p>Filter benefit allocations by their current status.</p>
        max_results: <p>The maximum number of benefit allocations to return in a single response.</p>
        next_token: <p>A pagination token to retrieve the next set of results from a previous request.</p>

    Raises:
        capo_partnercentral_benefits.errors.access_denied_exception.AccessDeniedException: <p>Thrown when the caller does not have sufficient permissions to perform the requested operation.</p>
        capo_partnercentral_benefits.errors.internal_server_exception.InternalServerException: <p>Thrown when an unexpected error occurs on the server side during request processing.</p>
        capo_partnercentral_benefits.errors.resource_not_found_exception.ResourceNotFoundException: <p>Thrown when the requested resource cannot be found or does not exist.</p>
        capo_partnercentral_benefits.errors.throttling_exception.ThrottlingException: <p>Thrown when the request rate exceeds the allowed limits and the request is being throttled.</p>
        capo_partnercentral_benefits.errors.validation_exception.ValidationException: <p>Thrown when the request contains invalid parameters or fails input validation requirements.</p>
        capo_partnercentral_benefits.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_partnercentral_benefits.types.list_benefit_allocations_input.ListBenefitAllocationsInput]",
    ) -> AsyncOperationResponse[
        "capo_partnercentral_benefits.types.list_benefit_allocations_output.ListBenefitAllocationsOutput"
    ]:
        import capo_partnercentral_benefits._operations.partner_central_benefits_service.list_benefit_allocations

        (
            output,
            http_response,
        ) = await capo_partnercentral_benefits._operations.partner_central_benefits_service.list_benefit_allocations.async_list_benefit_allocations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListBenefitAllocations")
    )
    input_: capo_partnercentral_benefits.types.list_benefit_allocations_input.ListBenefitAllocationsInput = {
        "catalog": catalog
    }
    if fulfillment_types is not None:
        input_["fulfillment_types"] = fulfillment_types
    if benefit_identifiers is not None:
        input_["benefit_identifiers"] = benefit_identifiers
    if benefit_application_identifiers is not None:
        input_["benefit_application_identifiers"] = benefit_application_identifiers
    if status is not None:
        input_["status"] = status
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output