Update dialog node.

        Update an existing dialog node with new or modified data.
        This operation is limited to 500 requests per 30 minutes. For more information,
        see **Rate limiting**.

        :param str workspace_id: Unique identifier of the workspace.
        :param str dialog_node: The dialog node ID (for example, `get_order`).
        :param str new_dialog_node: The dialog node ID. This string must conform to the
        following restrictions:
        - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
        characters.
        - It must be no longer than 1024 characters.
        :param str new_description: The description of the dialog node. This string cannot
        contain carriage return, newline, or tab characters, and it must be no longer than
        128 characters.
        :param str new_conditions: The condition that will trigger the dialog node. This
        string cannot contain carriage return, newline, or tab characters, and it must be
        no longer than 2048 characters.
        :param str new_parent: The ID of the parent dialog node. This property is omitted
        if the dialog node has no parent.
        :param str new_previous_sibling: The ID of the previous sibling dialog node. This
        property is omitted if the dialog node has no previous sibling.
        :param DialogNodeOutput new_output: The output of the dialog node. For more
        information about how to specify dialog node output, see the
        [documentation](https://cloud.ibm.com/docs/services/assistant/dialog-overview.html#dialog-overview-responses).
        :param dict new_context: The context for the dialog node.
        :param dict new_metadata: The metadata for the dialog node.
        :param DialogNodeNextStep new_next_step: The next step to execute following this
        dialog node.
        :param str new_title: The alias used to identify the dialog node. This string must
        conform to the following restrictions:
        - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
        characters.
        - It must be no longer than 64 characters.
        :param str new_node_type: How the dialog node is processed.
        :param str new_event_name: How an `event_handler` node is processed.
        :param str new_variable: The location in the dialog context where output is
        stored.
        :param list[DialogNodeAction] new_actions: An array of objects describing any
        actions to be invoked by the dialog node.
        :param str new_digress_in: Whether this top-level dialog node can be digressed
        into.
        :param str new_digress_out: Whether this dialog node can be returned to after a
        digression.
        :param str new_digress_out_slots: Whether the user can digress to top-level nodes
        while filling out slots.
        :param str new_user_label: A label that can be displayed externally to describe
        the purpose of the node to users. This string must be no longer than 512
        characters.
        :param dict headers: A `dict` containing the request headers
        :return: A `DetailedResponse` containing the result, headers and HTTP status code.
        :rtype: DetailedResponse

def update_dialog_node(self,
                           workspace_id,
                           dialog_node,
                           new_dialog_node=None,
                           new_description=None,
                           new_conditions=None,
                           new_parent=None,
                           new_previous_sibling=None,
                           new_output=None,
                           new_context=None,
                           new_metadata=None,
                           new_next_step=None,
                           new_title=None,
                           new_node_type=None,
                           new_event_name=None,
                           new_variable=None,
                           new_actions=None,
                           new_digress_in=None,
                           new_digress_out=None,
                           new_digress_out_slots=None,
                           new_user_label=None,
                           **kwargs):
        """
        Update dialog node.

        Update an existing dialog node with new or modified data.
        This operation is limited to 500 requests per 30 minutes. For more information,
        see **Rate limiting**.

        :param str workspace_id: Unique identifier of the workspace.
        :param str dialog_node: The dialog node ID (for example, `get_order`).
        :param str new_dialog_node: The dialog node ID. This string must conform to the
        following restrictions:
        - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
        characters.
        - It must be no longer than 1024 characters.
        :param str new_description: The description of the dialog node. This string cannot
        contain carriage return, newline, or tab characters, and it must be no longer than
        128 characters.
        :param str new_conditions: The condition that will trigger the dialog node. This
        string cannot contain carriage return, newline, or tab characters, and it must be
        no longer than 2048 characters.
        :param str new_parent: The ID of the parent dialog node. This property is omitted
        if the dialog node has no parent.
        :param str new_previous_sibling: The ID of the previous sibling dialog node. This
        property is omitted if the dialog node has no previous sibling.
        :param DialogNodeOutput new_output: The output of the dialog node. For more
        information about how to specify dialog node output, see the
        [documentation](https://cloud.ibm.com/docs/services/assistant/dialog-overview.html#dialog-overview-responses).
        :param dict new_context: The context for the dialog node.
        :param dict new_metadata: The metadata for the dialog node.
        :param DialogNodeNextStep new_next_step: The next step to execute following this
        dialog node.
        :param str new_title: The alias used to identify the dialog node. This string must
        conform to the following restrictions:
        - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
        characters.
        - It must be no longer than 64 characters.
        :param str new_node_type: How the dialog node is processed.
        :param str new_event_name: How an `event_handler` node is processed.
        :param str new_variable: The location in the dialog context where output is
        stored.
        :param list[DialogNodeAction] new_actions: An array of objects describing any
        actions to be invoked by the dialog node.
        :param str new_digress_in: Whether this top-level dialog node can be digressed
        into.
        :param str new_digress_out: Whether this dialog node can be returned to after a
        digression.
        :param str new_digress_out_slots: Whether the user can digress to top-level nodes
        while filling out slots.
        :param str new_user_label: A label that can be displayed externally to describe
        the purpose of the node to users. This string must be no longer than 512
        characters.
        :param dict headers: A `dict` containing the request headers
        :return: A `DetailedResponse` containing the result, headers and HTTP status code.
        :rtype: DetailedResponse
        """

        if workspace_id is None:
            raise ValueError('workspace_id must be provided')
        if dialog_node is None:
            raise ValueError('dialog_node must be provided')
        if new_output is not None:
            new_output = self._convert_model(new_output, DialogNodeOutput)
        if new_next_step is not None:
            new_next_step = self._convert_model(new_next_step,
                                                DialogNodeNextStep)
        if new_actions is not None:
            new_actions = [
                self._convert_model(x, DialogNodeAction) for x in new_actions
            ]

        headers = {}
        if 'headers' in kwargs:
            headers.update(kwargs.get('headers'))
        sdk_headers = get_sdk_headers('conversation', 'V1',
                                      'update_dialog_node')
        headers.update(sdk_headers)

        params = {'version': self.version}

        data = {
            'dialog_node': new_dialog_node,
            'description': new_description,
            'conditions': new_conditions,
            'parent': new_parent,
            'previous_sibling': new_previous_sibling,
            'output': new_output,
            'context': new_context,
            'metadata': new_metadata,
            'next_step': new_next_step,
            'title': new_title,
            'type': new_node_type,
            'event_name': new_event_name,
            'variable': new_variable,
            'actions': new_actions,
            'digress_in': new_digress_in,
            'digress_out': new_digress_out,
            'digress_out_slots': new_digress_out_slots,
            'user_label': new_user_label
        }

        url = '/v1/workspaces/{0}/dialog_nodes/{1}'.format(
            *self._encode_path_vars(workspace_id, dialog_node))
        response = self.request(
            method='POST',
            url=url,
            headers=headers,
            params=params,
            json=data,
            accept_json=True)
        return response