Skip to content

update_benefit_application async

update_benefit_application(
    catalog: CatalogName,
    client_token: str,
    identifier: BenefitApplicationIdentifier,
    revision: str,
    *,
    config_overrides: Optional[AsyncPartnerCentralBenefitsClientConfig] = None,
    name: Optional[BenefitApplicationName] = None,
    description: Optional[BenefitApplicationDescription] = None,
    benefit_application_details: Optional[object] = None,
    partner_contacts: Optional[Contacts] = None,
    file_details: Optional[FileInputDetails] = None,
) -> UpdateBenefitApplicationOutput

Updates an existing benefit application with new information while maintaining revision control.

Parameters:

  • catalog (CatalogName) –

    The catalog identifier that specifies which benefit catalog the application belongs to.

  • client_token (str) –

    A unique, case-sensitive identifier to ensure idempotent processing of the update request.

  • name (Optional[BenefitApplicationName], default: None ) –

    The updated human-readable name for the benefit application.

  • description (Optional[BenefitApplicationDescription], default: None ) –

    The updated detailed description of the benefit application.

  • identifier (BenefitApplicationIdentifier) –

    The unique identifier of the benefit application to update.

  • revision (str) –

    The current revision number of the benefit application to ensure optimistic concurrency control.

  • benefit_application_details (Optional[object], default: None ) –

    Updated detailed information and requirements specific to the benefit being requested.

  • partner_contacts (Optional[Contacts], default: None ) –

    Updated contact information for partner representatives responsible for this benefit application.

  • file_details (Optional[FileInputDetails], default: None ) –

    Updated supporting documents and files attached to the benefit application.

Raises:

  • AccessDeniedException –

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

  • ConflictException –

    Thrown when the request conflicts with the current state of the resource, such as attempting to modify a resource that has been changed by another process.

  • 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 update_benefit_application(
    self,
    catalog: "capo_partnercentral_benefits.types.catalog_name.CatalogName",
    client_token: str,
    identifier: "capo_partnercentral_benefits.types.benefit_application_identifier.BenefitApplicationIdentifier",
    revision: str,
    *,
    config_overrides: Optional[AsyncPartnerCentralBenefitsClientConfig] = None,
    name: Optional[
        "capo_partnercentral_benefits.types.benefit_application_name.BenefitApplicationName"
    ] = None,
    description: Optional[
        "capo_partnercentral_benefits.types.benefit_application_description.BenefitApplicationDescription"
    ] = None,
    benefit_application_details: Optional[object] = None,
    partner_contacts: Optional[
        "capo_partnercentral_benefits.types.contacts.Contacts"
    ] = None,
    file_details: Optional[
        "capo_partnercentral_benefits.types.file_input_details.FileInputDetails"
    ] = None,
) -> "capo_partnercentral_benefits.types.update_benefit_application_output.UpdateBenefitApplicationOutput":
    """<p>Updates an existing benefit application with new information while maintaining revision control.</p>

    Args:
        catalog: <p>The catalog identifier that specifies which benefit catalog the application belongs to.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure idempotent processing of the update request.</p>
        name: <p>The updated human-readable name for the benefit application.</p>
        description: <p>The updated detailed description of the benefit application.</p>
        identifier: <p>The unique identifier of the benefit application to update.</p>
        revision: <p>The current revision number of the benefit application to ensure optimistic concurrency control.</p>
        benefit_application_details: <p>Updated detailed information and requirements specific to the benefit being requested.</p>
        partner_contacts: <p>Updated contact information for partner representatives responsible for this benefit application.</p>
        file_details: <p>Updated supporting documents and files attached to the benefit application.</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.conflict_exception.ConflictException: <p>Thrown when the request conflicts with the current state of the resource, such as attempting to modify a resource that has been changed by another process.</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.update_benefit_application_input.UpdateBenefitApplicationInput]",
    ) -> AsyncOperationResponse[
        "capo_partnercentral_benefits.types.update_benefit_application_output.UpdateBenefitApplicationOutput"
    ]:
        import capo_partnercentral_benefits._operations.partner_central_benefits_service.update_benefit_application

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

    def _redact_input(
        input_: "capo_partnercentral_benefits.types.update_benefit_application_input.UpdateBenefitApplicationInput",
    ) -> dict[str, Any]:
        import capo_partnercentral_benefits.types.update_benefit_application_input

        return capo_partnercentral_benefits.types.update_benefit_application_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateBenefitApplication", redact_input=_redact_input),
    )
    input_: capo_partnercentral_benefits.types.update_benefit_application_input.UpdateBenefitApplicationInput = {
        "catalog": catalog,
        "client_token": client_token,
        "identifier": identifier,
        "revision": revision,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if benefit_application_details is not None:
        input_["benefit_application_details"] = benefit_application_details
    if partner_contacts is not None:
        input_["partner_contacts"] = partner_contacts
    if file_details is not None:
        input_["file_details"] = file_details

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