original_docstring: 
      The results from listing alerts is not always the most recent. It's recommended
          that specific alert IDs are utilized rather than fetching all alerts.
  
      Max number of results: 10
      
docstring: The results from listing alerts is not always the most recent. It's recommended
  that specific alert IDs are utilized rather than fetching all alerts.
  
  Max number of results: 10
docstring_tokens: The results from listing alerts is not always the most recent . It ' s recommended that specific alert IDs are utilized rather than fetching all alerts . Max number of results : 10
code: def fetch_alerts_command(client: Client, args=None):
      """
      The results from listing alerts is not always the most recent. It's recommended
          that specific alert IDs are utilized rather than fetching all alerts.
  
      Max number of results: 10
      """
      if not args.get("ids"):
          args["ids"] = []
  
      query = """
      query alerts {
          alerts(alertIDs: %s) {
              id
              alert_type
              data {
                  username
                  message
                  source_ip
                  destination_ip
                  raw_event
              }
              group_key
              confidence
              severity
              creator
              creator_version
              tenant_id
              message
              description
              timestamp {
                  seconds
              }
              investigations
              source {
                  uuid
                  origin
                  source_event
                  event_snippet
              }
              related_entities
              references {
                  description
                  url
              }
          }
      }
      """ % (str(args["ids"]))
  
      result = client.graphql_run(query)
      readable_output = f'## Results\nFound {len(result["data"]["alerts"])} alerts'
  
      if result["data"]["alerts"]:
          readable_output += "\n\n### Alerts\n"
          for alert in result["data"]["alerts"]:
              readable_output += f"* [{alert['message']}]({XDR_URL}/alerts/{alert['id']})\n"
  
      outputs = result["data"]["alerts"]
  
      results = CommandResults(
          outputs_prefix="TaegisXDR.Result",
          outputs_key_field="id",
          outputs=outputs,
          readable_output=readable_output,
          raw_response=result,
      )
  
      return results
code_tokens: def fetch_alerts_command ( client : Client , args = None ) : if not args . get ( "ids" ) : args [ "ids" ] = [ ] query = """
      query alerts {
          alerts(alertIDs: %s) {
              id
              alert_type
              data {
                  username
                  message
                  source_ip
                  destination_ip
                  raw_event
              }
              group_key
              confidence
              severity
              creator
              creator_version
              tenant_id
              message
              description
              timestamp {
                  seconds
              }
              investigations
              source {
                  uuid
                  origin
                  source_event
                  event_snippet
              }
              related_entities
              references {
                  description
                  url
              }
          }
      }
      """ % ( str ( args [ "ids" ] ) ) result = client . graphql_run ( query ) readable_output = f'## Results\nFound {len(result["data"]["alerts"])} alerts' if result [ "data" ] [ "alerts" ] : readable_output += "\n\n### Alerts\n" for alert in result [ "data" ] [ "alerts" ] : readable_output += f"* [{alert['message']}]({XDR_URL}/alerts/{alert['id']})\n" outputs = result [ "data" ] [ "alerts" ] results = CommandResults ( outputs_prefix = "TaegisXDR.Result" , outputs_key_field = "id" , outputs = outputs , readable_output = readable_output , raw_response = result , ) return results
short_docstring: The results from listing alerts is not always the most recent.
short_docstring_tokens: The results from listing alerts is not always the most recent .
comment: """
      The results from listing alerts is not always the most recent. It's recommended
          that specific alert IDs are utilized rather than fetching all alerts.
  
      Max number of results: 10
      """