def settle_deferred_messages(self, settlement, messages, **kwargs):
if (self.entity and self.requires_session) or kwargs.get('<STR_LIT>'):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if settlement.lower() not in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not messages:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>message = {<EOL>'<STR_LIT>': settlement.lower(),<EOL>'<STR_LIT>': types.AMQPArray([m.lock_token for m in messages])}<EOL>with BaseHandler(self.entity_uri, self.auth_config, debug=self.debug, **kwargs) as handler:<EOL><INDENT>return handler._mgmt_request_response(  <EOL>REQUEST_RESPONSE_UPDATE_DISPOSTION_OPERATION,<EOL>message,<EOL>mgmt_handlers.default)<EOL><DEDENT>
Settle messages that have been previously deferred.

        :param settlement: How the messages are to be settled. This must be a string
         of one of the following values: 'completed', 'suspended', 'abandoned'.
        :type settlement: str
        :param messages: A list of deferred messages to be settled.
        :type messages: list[~azure.servicebus.common.message.DeferredMessage]

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START settle_deferred_messages_service_bus]
                :end-before: [END settle_deferred_messages_service_bus]
                :language: python
                :dedent: 8
                :caption: Settle deferred messages.