original_docstring: 
      Uploads list of indicators from Demisto to a reference set in QRadar service.
      possible arguments:
      - ref_name (Required): Name of the reference set to upload indicators to.
      - query: The query for getting indicators from Demisto.
      - limit: Maximum number of indicators to fetch from Demisto.
      - page: The page from which to get the indicators.
      - fields: If used, will filter all fields except for the specified ones.
                Use this parameter to specify which fields you would like to get back in the
                response. Fields that are not explicitly named are excluded.
      Args:
          client (Client): QRadar client to perform the API call.
          args (Dict): Demisto args.
  
      Returns:
          CommandResults.
      
docstring: Uploads list of indicators from Demisto to a reference set in QRadar service.
  possible arguments:
  ref_name (Required): Name of the reference set to upload indicators to.
  query: The query for getting indicators from Demisto.
  limit: Maximum number of indicators to fetch from Demisto.
  page: The page from which to get the indicators.
  fields: If used, will filter all fields except for the specified ones.
  Use this parameter to specify which fields you would like to get back in the
  response. Fields that are not explicitly named are excluded.
docstring_tokens: Uploads list of indicators from Demisto to a reference set in QRadar service . possible arguments : ref_name ( Required ) : Name of the reference set to upload indicators to . query : The query for getting indicators from Demisto . limit : Maximum number of indicators to fetch from Demisto . page : The page from which to get the indicators . fields : If used will filter all fields except for the specified ones . Use this parameter to specify which fields you would like to get back in the response . Fields that are not explicitly named are excluded .
code: def qradar_indicators_upload_command(client: Client, args: Dict) -> CommandResults:
      """
      Uploads list of indicators from Demisto to a reference set in QRadar service.
      possible arguments:
      - ref_name (Required): Name of the reference set to upload indicators to.
      - query: The query for getting indicators from Demisto.
      - limit: Maximum number of indicators to fetch from Demisto.
      - page: The page from which to get the indicators.
      - fields: If used, will filter all fields except for the specified ones.
                Use this parameter to specify which fields you would like to get back in the
                response. Fields that are not explicitly named are excluded.
      Args:
          client (Client): QRadar client to perform the API call.
          args (Dict): Demisto args.
  
      Returns:
          CommandResults.
      """
      ref_name: str = args.get('ref_name', '')
      query = args.get('query')
      limit = arg_to_number(args.get('limit', DEFAULT_LIMIT_VALUE))
      page = arg_to_number(args.get('page', 0))
      fields = args.get('fields')
  
      # Backward compatibility for QRadar V2 command. Create reference set for given 'ref_name' if does not exist.
      element_type = args.get('element_type', '')
      timeout_type = args.get('timeout_type')
      time_to_live = args.get('time_to_live')
      try:
          client.reference_sets_list(ref_name=ref_name)
      except DemistoException as e:
          # Create reference set if does not exist
          if e.message and f'{ref_name} does not exist' in e.message:
              client.reference_set_create(ref_name, element_type, timeout_type, time_to_live)
          else:
              raise e
  
      search_indicators = IndicatorsSearcher(page=page)
      indicators = search_indicators.search_indicators_by_version(query=query, size=limit).get('iocs', [])
      indicators_data = [{'Indicator Value': indicator.get('value'), 'Indicator Type': indicator.get('indicator_type')}
                         for indicator in indicators if 'value' in indicator and 'indicator_type' in indicator]
      indicator_values: List[Any] = [indicator.get('Indicator Value') for indicator in indicators_data]
  
      if not indicators_data:
          return CommandResults(
              readable_output=f'No indicators were found for reference set {ref_name}'
          )
  
      response = client.indicators_upload(ref_name, indicator_values, fields)
      outputs = sanitize_outputs(response)
  
      reference_set_hr = tableToMarkdown(f'Indicators Upload For Reference Set {ref_name}', outputs)
      indicators_uploaded_hr = tableToMarkdown('Indicators Uploaded', indicators_data)
  
      return CommandResults(
          readable_output=f'{reference_set_hr}\n{indicators_uploaded_hr}',
          outputs_prefix='QRadar.Reference',
          outputs_key_field='name',
          outputs=outputs,
          raw_response=response
      )
code_tokens: def qradar_indicators_upload_command ( client : Client , args : Dict ) -> CommandResults : ref_name : str = args . get ( 'ref_name' , '' ) query = args . get ( 'query' ) limit = arg_to_number ( args . get ( 'limit' , DEFAULT_LIMIT_VALUE ) ) page = arg_to_number ( args . get ( 'page' , 0 ) ) fields = args . get ( 'fields' ) element_type = args . get ( 'element_type' , '' ) timeout_type = args . get ( 'timeout_type' ) time_to_live = args . get ( 'time_to_live' ) try : client . reference_sets_list ( ref_name = ref_name ) except DemistoException as e : if e . message and f'{ref_name} does not exist' in e . message : client . reference_set_create ( ref_name , element_type , timeout_type , time_to_live ) else : raise e search_indicators = IndicatorsSearcher ( page = page ) indicators = search_indicators . search_indicators_by_version ( query = query , size = limit ) . get ( 'iocs' , [ ] ) indicators_data = [ { 'Indicator Value' : indicator . get ( 'value' ) , 'Indicator Type' : indicator . get ( 'indicator_type' ) } for indicator in indicators if 'value' in indicator and 'indicator_type' in indicator ] indicator_values : List [ Any ] = [ indicator . get ( 'Indicator Value' ) for indicator in indicators_data ] if not indicators_data : return CommandResults ( readable_output = f'No indicators were found for reference set {ref_name}' ) response = client . indicators_upload ( ref_name , indicator_values , fields ) outputs = sanitize_outputs ( response ) reference_set_hr = tableToMarkdown ( f'Indicators Upload For Reference Set {ref_name}' , outputs ) indicators_uploaded_hr = tableToMarkdown ( 'Indicators Uploaded' , indicators_data ) return CommandResults ( readable_output = f'{reference_set_hr}\n{indicators_uploaded_hr}' , outputs_prefix = 'QRadar.Reference' , outputs_key_field = 'name' , outputs = outputs , raw_response = response )
short_docstring: Uploads list of indicators from Demisto to a reference set in QRadar service.
short_docstring_tokens: Uploads list of indicators from Demisto to a reference set in QRadar service .
comment: """
      Uploads list of indicators from Demisto to a reference set in QRadar service.
      possible arguments:
      - ref_name (Required): Name of the reference set to upload indicators to.
      - query: The query for getting indicators from Demisto.
      - limit: Maximum number of indicators to fetch from Demisto.
      - page: The page from which to get the indicators.
      - fields: If used, will filter all fields except for the specified ones.
                Use this parameter to specify which fields you would like to get back in the
                response. Fields that are not explicitly named are excluded.
      Args:
          client (Client): QRadar client to perform the API call.
          args (Dict): Demisto args.
  
      Returns:
          CommandResults.
      """$SEP$# Backward compatibility for QRadar V2 command. Create reference set for given 'ref_name' if does not exist.$SEP$# Create reference set if does not exist