Skip to content

update_whats_app_flow async

update_whats_app_flow(
    id: LinkedWhatsAppBusinessAccountId,
    flow_id: MetaFlowId,
    *,
    config_overrides: Optional[AsyncSocialMessagingClientConfig] = None,
    flow_name: Optional[MetaFlowName] = None,
    categories: Optional[MetaFlowCategoryList] = None,
    endpoint_uri: Optional[MetaFlowEndpointUri] = None,
    meta_app_id: Optional[MetaFlowApplicationId] = None,
) -> UpdateWhatsAppFlowOutput

Updates the metadata of a WhatsApp Flow, such as its name or categories. This does not update the Flow JSON definition. Use UpdateWhatsAppFlowAssets to update the Flow JSON.

Parameters:

Raises:

Source code in docs_src/capo_socialmessaging/_services/async_social_messaging.py
async def update_whats_app_flow(
    self,
    id: "capo_socialmessaging.types.linked_whats_app_business_account_id.LinkedWhatsAppBusinessAccountId",
    flow_id: "capo_socialmessaging.types.meta_flow_id.MetaFlowId",
    *,
    config_overrides: Optional[AsyncSocialMessagingClientConfig] = None,
    flow_name: Optional[
        "capo_socialmessaging.types.meta_flow_name.MetaFlowName"
    ] = None,
    categories: Optional[
        "capo_socialmessaging.types.meta_flow_category_list.MetaFlowCategoryList"
    ] = None,
    endpoint_uri: Optional[
        "capo_socialmessaging.types.meta_flow_endpoint_uri.MetaFlowEndpointUri"
    ] = None,
    meta_app_id: Optional[
        "capo_socialmessaging.types.meta_flow_application_id.MetaFlowApplicationId"
    ] = None,
) -> "capo_socialmessaging.types.update_whats_app_flow_output.UpdateWhatsAppFlowOutput":
    """<p>Updates the metadata of a WhatsApp Flow, such as its name or categories. This does not update the Flow JSON definition. Use <a href="https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_UpdateWhatsAppFlowAssets.html">UpdateWhatsAppFlowAssets</a> to update the Flow JSON.</p>

    Args:
        id: <p>The ID of the WhatsApp Business Account associated with this Flow.</p>
        flow_id: <p>The unique identifier of the Flow to update.</p>
        flow_name: <p>The updated name for the Flow.</p>
        categories: <p>The updated categories for the Flow.</p>
        endpoint_uri: <p>The updated HTTPS endpoint for a data exchange Flow.</p>
        meta_app_id: <p>The ID of the Meta application to attach to the Flow.</p>

    Raises:
        capo_socialmessaging.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_socialmessaging.errors.validation_exception.ValidationException: <p>The request contains an invalid parameter value. </p>
        capo_socialmessaging.errors.access_denied_by_meta_exception.AccessDeniedByMetaException: <p>You do not have sufficient access to perform this action.</p>
        capo_socialmessaging.errors.dependency_exception.DependencyException: <p>Thrown when performing an action because a dependency would be broken.</p>
        capo_socialmessaging.errors.internal_service_exception.InternalServiceException: <p>The request processing has failed because of an unknown error, exception, or failure.</p>
        capo_socialmessaging.errors.invalid_parameters_exception.InvalidParametersException: <p>One or more parameters provided to the action are not valid.</p>
        capo_socialmessaging.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found.</p>
        capo_socialmessaging.errors.throttled_request_exception.ThrottledRequestException: <p>The request was denied due to request throttling.</p>
        capo_socialmessaging.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_socialmessaging.types.update_whats_app_flow_input.UpdateWhatsAppFlowInput]",
    ) -> AsyncOperationResponse[
        "capo_socialmessaging.types.update_whats_app_flow_output.UpdateWhatsAppFlowOutput"
    ]:
        import capo_socialmessaging._operations.social_messaging.update_whats_app_flow

        (
            output,
            http_response,
        ) = await capo_socialmessaging._operations.social_messaging.update_whats_app_flow.async_update_whats_app_flow(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateWhatsAppFlow")
    )
    input_: capo_socialmessaging.types.update_whats_app_flow_input.UpdateWhatsAppFlowInput = {
        "id": id,
        "flow_id": flow_id,
    }
    if flow_name is not None:
        input_["flow_name"] = flow_name
    if categories is not None:
        input_["categories"] = categories
    if endpoint_uri is not None:
        input_["endpoint_uri"] = endpoint_uri
    if meta_app_id is not None:
        input_["meta_app_id"] = meta_app_id

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