def set_legal_hold(<EOL>self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config):
legal_hold = models.LegalHold(tags=tags)<EOL>url = self.set_legal_hold.metadata['<STR_LIT:url>']<EOL>path_format_arguments = {<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", resource_group_name, '<STR_LIT:str>', max_length=<NUM_LIT>, min_length=<NUM_LIT:1>, pattern=r'<STR_LIT>'),<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", account_name, '<STR_LIT:str>', max_length=<NUM_LIT>, min_length=<NUM_LIT:3>),<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", container_name, '<STR_LIT:str>', max_length=<NUM_LIT>, min_length=<NUM_LIT:3>),<EOL>'<STR_LIT>': self._serialize.url("<STR_LIT>", self.config.subscription_id, '<STR_LIT:str>', min_length=<NUM_LIT:1>)<EOL>}<EOL>url = self._client.format_url(url, **path_format_arguments)<EOL>query_parameters = {}<EOL>query_parameters['<STR_LIT>'] = self._serialize.query("<STR_LIT>", self.api_version, '<STR_LIT:str>', min_length=<NUM_LIT:1>)<EOL>header_parameters = {}<EOL>header_parameters['<STR_LIT>'] = '<STR_LIT:application/json>'<EOL>header_parameters['<STR_LIT:Content-Type>'] = '<STR_LIT>'<EOL>if self.config.generate_client_request_id:<EOL><INDENT>header_parameters['<STR_LIT>'] = str(uuid.uuid1())<EOL><DEDENT>if custom_headers:<EOL><INDENT>header_parameters.update(custom_headers)<EOL><DEDENT>if self.config.accept_language is not None:<EOL><INDENT>header_parameters['<STR_LIT>'] = self._serialize.header("<STR_LIT>", self.config.accept_language, '<STR_LIT:str>')<EOL><DEDENT>body_content = self._serialize.body(legal_hold, '<STR_LIT>')<EOL>request = self._client.post(url, query_parameters, header_parameters, body_content)<EOL>response = self._client.send(request, stream=False, **operation_config)<EOL>if response.status_code not in [<NUM_LIT:200>]:<EOL><INDENT>exp = CloudError(response)<EOL>exp.request_id = response.headers.get('<STR_LIT>')<EOL>raise exp<EOL><DEDENT>deserialized = None<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>deserialized = self._deserialize('<STR_LIT>', response)<EOL><DEDENT>if raw:<EOL><INDENT>client_raw_response = ClientRawResponse(deserialized, response)<EOL>return client_raw_response<EOL><DEDENT>return deserialized<EOL>
Sets legal hold tags. Setting the same tag results in an idempotent
        operation. SetLegalHold follows an append pattern and does not clear
        out the existing tags that are not specified in the request.

        :param resource_group_name: The name of the resource group within the
         user's subscription. The name is case insensitive.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the
         specified resource group. Storage account names must be between 3 and
         24 characters in length and use numbers and lower-case letters only.
        :type account_name: str
        :param container_name: The name of the blob container within the
         specified storage account. Blob container names must be between 3 and
         63 characters in length and use numbers, lower-case letters and dash
         (-) only. Every dash (-) character must be immediately preceded and
         followed by a letter or number.
        :type container_name: str
        :param tags: Each tag should be 3 to 23 alphanumeric characters and is
         normalized to lower case at SRP.
        :type tags: list[str]
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: LegalHold or ClientRawResponse if raw=true
        :rtype: ~azure.mgmt.storage.v2018_07_01.models.LegalHold or
         ~msrest.pipeline.ClientRawResponse
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`