docs: def _merge_entity(entity, if_match, require_encryption=False, key_encryption_key=None):
      '''
      Constructs a merge entity request.
      '''
      _validate_not_none('if_match', if_match)
      _validate_entity(entity)
      _validate_encryption_unsupported(require_encryption, key_encryption_key)
  
      request = HTTPRequest()
      request.method = 'MERGE'
      request.headers = {
          _DEFAULT_CONTENT_TYPE_HEADER[0]: _DEFAULT_CONTENT_TYPE_HEADER[1],
          _DEFAULT_ACCEPT_HEADER[0]: _DEFAULT_ACCEPT_HEADER[1],
          'If-Match': _to_str(if_match)
      }
      request.body = _get_request_body(_convert_entity_to_json(entity))
  
      return request