Skip to content

get_benefit

get_benefit(
    catalog: CatalogName,
    identifier: str,
    *,
    config_overrides: Optional[PartnerCentralBenefitsClientConfig] = None,
) -> GetBenefitOutput

Retrieves detailed information about a specific benefit available in the partner catalog.

Parameters:

  • catalog (CatalogName) –

    The catalog identifier that specifies which benefit catalog to query.

  • identifier (str) –

    The unique identifier of the benefit to retrieve.

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/partner_central_benefits.py
def get_benefit(
    self,
    catalog: "capo_partnercentral_benefits.types.catalog_name.CatalogName",
    identifier: str,
    *,
    config_overrides: Optional[PartnerCentralBenefitsClientConfig] = None,
) -> "capo_partnercentral_benefits.types.get_benefit_output.GetBenefitOutput":
    """<p>Retrieves detailed information about a specific benefit available in the partner catalog.</p>

    Args:
        catalog: <p>The catalog identifier that specifies which benefit catalog to query.</p>
        identifier: <p>The unique identifier of the benefit to retrieve.</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.
    """

    def _handler(
        req: "OperationRequest[capo_partnercentral_benefits.types.get_benefit_input.GetBenefitInput]",
    ) -> OperationResponse[
        "capo_partnercentral_benefits.types.get_benefit_output.GetBenefitOutput"
    ]:
        import capo_partnercentral_benefits._operations.partner_central_benefits_service.get_benefit

        output, http_response = (
            capo_partnercentral_benefits._operations.partner_central_benefits_service.get_benefit.get_benefit(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetBenefit")
    )
    input_: capo_partnercentral_benefits.types.get_benefit_input.GetBenefitInput = {
        "catalog": catalog,
        "identifier": identifier,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output