# Generated by ariadne-codegen
# Source: ./documents

__all__ = [
    "ADD_CONTENTS_TO_COLLECTIONS_GQL",
    "ASK_GRAPHLIT_GQL",
    "BRANCH_CONVERSATION_GQL",
    "CLEAR_CONVERSATION_GQL",
    "CLOSE_CONVERSATION_GQL",
    "COMPLETE_CONVERSATION_GQL",
    "CONTINUE_CONVERSATION_GQL",
    "COUNT_ALERTS_GQL",
    "COUNT_CATEGORIES_GQL",
    "COUNT_COLLECTIONS_GQL",
    "COUNT_CONNECTORS_GQL",
    "COUNT_CONTENTS_GQL",
    "COUNT_CONVERSATIONS_GQL",
    "COUNT_EVENTS_GQL",
    "COUNT_FEEDS_GQL",
    "COUNT_INVESTMENTS_GQL",
    "COUNT_INVESTMENT_FUNDS_GQL",
    "COUNT_LABELS_GQL",
    "COUNT_MEDICAL_CONDITIONS_GQL",
    "COUNT_MEDICAL_CONTRAINDICATIONS_GQL",
    "COUNT_MEDICAL_DEVICES_GQL",
    "COUNT_MEDICAL_DRUGS_GQL",
    "COUNT_MEDICAL_DRUG_CLASSES_GQL",
    "COUNT_MEDICAL_GUIDELINES_GQL",
    "COUNT_MEDICAL_INDICATIONS_GQL",
    "COUNT_MEDICAL_PROCEDURES_GQL",
    "COUNT_MEDICAL_STUDIES_GQL",
    "COUNT_MEDICAL_TESTS_GQL",
    "COUNT_MEDICAL_THERAPIES_GQL",
    "COUNT_ORGANIZATIONS_GQL",
    "COUNT_PERSONS_GQL",
    "COUNT_PLACES_GQL",
    "COUNT_PRODUCTS_GQL",
    "COUNT_REPOS_GQL",
    "COUNT_SOFTWARES_GQL",
    "COUNT_SPECIFICATIONS_GQL",
    "COUNT_USERS_GQL",
    "COUNT_VIEWS_GQL",
    "COUNT_WORKFLOWS_GQL",
    "CREATE_ALERT_GQL",
    "CREATE_CATEGORY_GQL",
    "CREATE_COLLECTION_GQL",
    "CREATE_CONNECTOR_GQL",
    "CREATE_CONVERSATION_GQL",
    "CREATE_EVENT_GQL",
    "CREATE_FEED_GQL",
    "CREATE_INVESTMENT_FUND_GQL",
    "CREATE_INVESTMENT_GQL",
    "CREATE_LABEL_GQL",
    "CREATE_MEDICAL_CONDITION_GQL",
    "CREATE_MEDICAL_CONTRAINDICATION_GQL",
    "CREATE_MEDICAL_DEVICE_GQL",
    "CREATE_MEDICAL_DRUG_CLASS_GQL",
    "CREATE_MEDICAL_DRUG_GQL",
    "CREATE_MEDICAL_GUIDELINE_GQL",
    "CREATE_MEDICAL_INDICATION_GQL",
    "CREATE_MEDICAL_PROCEDURE_GQL",
    "CREATE_MEDICAL_STUDY_GQL",
    "CREATE_MEDICAL_TEST_GQL",
    "CREATE_MEDICAL_THERAPY_GQL",
    "CREATE_OBSERVATION_GQL",
    "CREATE_ORGANIZATION_GQL",
    "CREATE_PERSON_GQL",
    "CREATE_PLACE_GQL",
    "CREATE_PRODUCT_GQL",
    "CREATE_REPO_GQL",
    "CREATE_SOFTWARE_GQL",
    "CREATE_SPECIFICATION_GQL",
    "CREATE_USER_GQL",
    "CREATE_VIEW_GQL",
    "CREATE_WORKFLOW_GQL",
    "DELETE_ALERTS_GQL",
    "DELETE_ALERT_GQL",
    "DELETE_ALL_ALERTS_GQL",
    "DELETE_ALL_CATEGORIES_GQL",
    "DELETE_ALL_COLLECTIONS_GQL",
    "DELETE_ALL_CONTENTS_GQL",
    "DELETE_ALL_CONVERSATIONS_GQL",
    "DELETE_ALL_EVENTS_GQL",
    "DELETE_ALL_FEEDS_GQL",
    "DELETE_ALL_INVESTMENTS_GQL",
    "DELETE_ALL_INVESTMENT_FUNDS_GQL",
    "DELETE_ALL_LABELS_GQL",
    "DELETE_ALL_MEDICAL_CONDITIONS_GQL",
    "DELETE_ALL_MEDICAL_CONTRAINDICATIONS_GQL",
    "DELETE_ALL_MEDICAL_DEVICES_GQL",
    "DELETE_ALL_MEDICAL_DRUGS_GQL",
    "DELETE_ALL_MEDICAL_DRUG_CLASSES_GQL",
    "DELETE_ALL_MEDICAL_GUIDELINES_GQL",
    "DELETE_ALL_MEDICAL_INDICATIONS_GQL",
    "DELETE_ALL_MEDICAL_PROCEDURES_GQL",
    "DELETE_ALL_MEDICAL_STUDIES_GQL",
    "DELETE_ALL_MEDICAL_TESTS_GQL",
    "DELETE_ALL_MEDICAL_THERAPIES_GQL",
    "DELETE_ALL_ORGANIZATIONS_GQL",
    "DELETE_ALL_PERSONS_GQL",
    "DELETE_ALL_PLACES_GQL",
    "DELETE_ALL_PRODUCTS_GQL",
    "DELETE_ALL_REPOS_GQL",
    "DELETE_ALL_SOFTWARES_GQL",
    "DELETE_ALL_SPECIFICATIONS_GQL",
    "DELETE_ALL_VIEWS_GQL",
    "DELETE_ALL_WORKFLOWS_GQL",
    "DELETE_CATEGORIES_GQL",
    "DELETE_CATEGORY_GQL",
    "DELETE_COLLECTIONS_GQL",
    "DELETE_COLLECTION_GQL",
    "DELETE_CONNECTOR_GQL",
    "DELETE_CONTENTS_GQL",
    "DELETE_CONTENT_GQL",
    "DELETE_CONVERSATIONS_GQL",
    "DELETE_CONVERSATION_GQL",
    "DELETE_EVENTS_GQL",
    "DELETE_EVENT_GQL",
    "DELETE_FEEDS_GQL",
    "DELETE_FEED_GQL",
    "DELETE_INVESTMENTS_GQL",
    "DELETE_INVESTMENT_FUNDS_GQL",
    "DELETE_INVESTMENT_FUND_GQL",
    "DELETE_INVESTMENT_GQL",
    "DELETE_LABELS_GQL",
    "DELETE_LABEL_GQL",
    "DELETE_MEDICAL_CONDITIONS_GQL",
    "DELETE_MEDICAL_CONDITION_GQL",
    "DELETE_MEDICAL_CONTRAINDICATIONS_GQL",
    "DELETE_MEDICAL_CONTRAINDICATION_GQL",
    "DELETE_MEDICAL_DEVICES_GQL",
    "DELETE_MEDICAL_DEVICE_GQL",
    "DELETE_MEDICAL_DRUGS_GQL",
    "DELETE_MEDICAL_DRUG_CLASSES_GQL",
    "DELETE_MEDICAL_DRUG_CLASS_GQL",
    "DELETE_MEDICAL_DRUG_GQL",
    "DELETE_MEDICAL_GUIDELINES_GQL",
    "DELETE_MEDICAL_GUIDELINE_GQL",
    "DELETE_MEDICAL_INDICATIONS_GQL",
    "DELETE_MEDICAL_INDICATION_GQL",
    "DELETE_MEDICAL_PROCEDURES_GQL",
    "DELETE_MEDICAL_PROCEDURE_GQL",
    "DELETE_MEDICAL_STUDIES_GQL",
    "DELETE_MEDICAL_STUDY_GQL",
    "DELETE_MEDICAL_TESTS_GQL",
    "DELETE_MEDICAL_TEST_GQL",
    "DELETE_MEDICAL_THERAPIES_GQL",
    "DELETE_MEDICAL_THERAPY_GQL",
    "DELETE_OBSERVATION_GQL",
    "DELETE_ORGANIZATIONS_GQL",
    "DELETE_ORGANIZATION_GQL",
    "DELETE_PERSONS_GQL",
    "DELETE_PERSON_GQL",
    "DELETE_PLACES_GQL",
    "DELETE_PLACE_GQL",
    "DELETE_PRODUCTS_GQL",
    "DELETE_PRODUCT_GQL",
    "DELETE_REPOS_GQL",
    "DELETE_REPO_GQL",
    "DELETE_SOFTWARES_GQL",
    "DELETE_SOFTWARE_GQL",
    "DELETE_SPECIFICATIONS_GQL",
    "DELETE_SPECIFICATION_GQL",
    "DELETE_USER_GQL",
    "DELETE_VIEWS_GQL",
    "DELETE_VIEW_GQL",
    "DELETE_WORKFLOWS_GQL",
    "DELETE_WORKFLOW_GQL",
    "DESCRIBE_ENCODED_IMAGE_GQL",
    "DESCRIBE_IMAGE_GQL",
    "DISABLE_ALERT_GQL",
    "DISABLE_FEED_GQL",
    "DISABLE_USER_GQL",
    "ENABLE_ALERT_GQL",
    "ENABLE_FEED_GQL",
    "ENABLE_USER_GQL",
    "ENRICH_ORGANIZATIONS_GQL",
    "ENRICH_PERSONS_GQL",
    "ENRICH_PLACES_GQL",
    "ENRICH_PRODUCTS_GQL",
    "EXTRACT_CONTENTS_GQL",
    "EXTRACT_OBSERVABLES_GQL",
    "EXTRACT_TEXT_GQL",
    "FEED_EXISTS_GQL",
    "FORMAT_CONVERSATION_GQL",
    "GET_ALERT_GQL",
    "GET_CATEGORY_GQL",
    "GET_COLLECTION_GQL",
    "GET_CONNECTOR_GQL",
    "GET_CONTENT_GQL",
    "GET_CONVERSATION_GQL",
    "GET_EVENT_GQL",
    "GET_FEED_GQL",
    "GET_INVESTMENT_FUND_GQL",
    "GET_INVESTMENT_GQL",
    "GET_LABEL_GQL",
    "GET_MEDICAL_CONDITION_GQL",
    "GET_MEDICAL_CONTRAINDICATION_GQL",
    "GET_MEDICAL_DEVICE_GQL",
    "GET_MEDICAL_DRUG_CLASS_GQL",
    "GET_MEDICAL_DRUG_GQL",
    "GET_MEDICAL_GUIDELINE_GQL",
    "GET_MEDICAL_INDICATION_GQL",
    "GET_MEDICAL_PROCEDURE_GQL",
    "GET_MEDICAL_STUDY_GQL",
    "GET_MEDICAL_TEST_GQL",
    "GET_MEDICAL_THERAPY_GQL",
    "GET_ORGANIZATION_GQL",
    "GET_PERSON_GQL",
    "GET_PLACE_GQL",
    "GET_PRODUCT_GQL",
    "GET_PROJECT_GQL",
    "GET_REPO_GQL",
    "GET_SHARE_POINT_CONSENT_URI_GQL",
    "GET_SOFTWARE_GQL",
    "GET_SPECIFICATION_GQL",
    "GET_USER_BY_IDENTIFIER_GQL",
    "GET_USER_GQL",
    "GET_VIEW_GQL",
    "GET_WORKFLOW_GQL",
    "INGEST_BATCH_GQL",
    "INGEST_ENCODED_FILE_GQL",
    "INGEST_EVENT_GQL",
    "INGEST_MEMORY_GQL",
    "INGEST_TEXT_BATCH_GQL",
    "INGEST_TEXT_GQL",
    "INGEST_URI_GQL",
    "IS_CONTENT_DONE_GQL",
    "IS_FEED_DONE_GQL",
    "LOOKUP_CONTENTS_GQL",
    "LOOKUP_CREDITS_GQL",
    "LOOKUP_ENTITY_GQL",
    "LOOKUP_USAGE_GQL",
    "MAP_WEB_GQL",
    "MATCH_ENTITY_GQL",
    "PROMPT_CONVERSATION_GQL",
    "PROMPT_GQL",
    "PROMPT_SPECIFICATIONS_GQL",
    "PUBLISH_CONTENTS_GQL",
    "PUBLISH_CONVERSATION_GQL",
    "PUBLISH_TEXT_GQL",
    "QUERY_ALERTS_GQL",
    "QUERY_BOX_FOLDERS_GQL",
    "QUERY_CATEGORIES_GQL",
    "QUERY_COLLECTIONS_GQL",
    "QUERY_CONNECTORS_GQL",
    "QUERY_CONTENTS_FACETS_GQL",
    "QUERY_CONTENTS_GQL",
    "QUERY_CONTENTS_GRAPH_GQL",
    "QUERY_CONTENTS_OBSERVATIONS_GQL",
    "QUERY_CONVERSATIONS_GQL",
    "QUERY_CREDITS_GQL",
    "QUERY_DISCORD_CHANNELS_GQL",
    "QUERY_DISCORD_GUILDS_GQL",
    "QUERY_DROPBOX_FOLDERS_GQL",
    "QUERY_EVENTS_CLUSTERS_GQL",
    "QUERY_EVENTS_GQL",
    "QUERY_FEEDS_GQL",
    "QUERY_GIT_HUB_REPOSITORIES_GQL",
    "QUERY_GOOGLE_CALENDARS_GQL",
    "QUERY_GOOGLE_DRIVE_FOLDERS_GQL",
    "QUERY_GRAPH_GQL",
    "QUERY_INVESTMENTS_CLUSTERS_GQL",
    "QUERY_INVESTMENTS_EXPANDED_GQL",
    "QUERY_INVESTMENTS_GQL",
    "QUERY_INVESTMENT_FUNDS_CLUSTERS_GQL",
    "QUERY_INVESTMENT_FUNDS_EXPANDED_GQL",
    "QUERY_INVESTMENT_FUNDS_GQL",
    "QUERY_LABELS_GQL",
    "QUERY_LINEAR_PROJECTS_GQL",
    "QUERY_MEDICAL_CONDITIONS_CLUSTERS_GQL",
    "QUERY_MEDICAL_CONDITIONS_GQL",
    "QUERY_MEDICAL_CONTRAINDICATIONS_CLUSTERS_GQL",
    "QUERY_MEDICAL_CONTRAINDICATIONS_GQL",
    "QUERY_MEDICAL_DEVICES_CLUSTERS_GQL",
    "QUERY_MEDICAL_DEVICES_GQL",
    "QUERY_MEDICAL_DRUGS_CLUSTERS_GQL",
    "QUERY_MEDICAL_DRUGS_GQL",
    "QUERY_MEDICAL_DRUG_CLASSES_CLUSTERS_GQL",
    "QUERY_MEDICAL_DRUG_CLASSES_GQL",
    "QUERY_MEDICAL_GUIDELINES_CLUSTERS_GQL",
    "QUERY_MEDICAL_GUIDELINES_GQL",
    "QUERY_MEDICAL_INDICATIONS_CLUSTERS_GQL",
    "QUERY_MEDICAL_INDICATIONS_GQL",
    "QUERY_MEDICAL_PROCEDURES_CLUSTERS_GQL",
    "QUERY_MEDICAL_PROCEDURES_GQL",
    "QUERY_MEDICAL_STUDIES_CLUSTERS_GQL",
    "QUERY_MEDICAL_STUDIES_GQL",
    "QUERY_MEDICAL_TESTS_CLUSTERS_GQL",
    "QUERY_MEDICAL_TESTS_GQL",
    "QUERY_MEDICAL_THERAPIES_CLUSTERS_GQL",
    "QUERY_MEDICAL_THERAPIES_GQL",
    "QUERY_MICROSOFT_CALENDARS_GQL",
    "QUERY_MICROSOFT_TEAMS_CHANNELS_GQL",
    "QUERY_MICROSOFT_TEAMS_TEAMS_GQL",
    "QUERY_MODELS_GQL",
    "QUERY_NOTION_DATABASES_GQL",
    "QUERY_NOTION_PAGES_GQL",
    "QUERY_OBSERVABLES_GQL",
    "QUERY_ONE_DRIVE_FOLDERS_GQL",
    "QUERY_ORGANIZATIONS_CLUSTERS_GQL",
    "QUERY_ORGANIZATIONS_EXPANDED_GQL",
    "QUERY_ORGANIZATIONS_GQL",
    "QUERY_PERSONS_CLUSTERS_GQL",
    "QUERY_PERSONS_EXPANDED_GQL",
    "QUERY_PERSONS_GQL",
    "QUERY_PLACES_CLUSTERS_GQL",
    "QUERY_PLACES_GQL",
    "QUERY_PRODUCTS_CLUSTERS_GQL",
    "QUERY_PRODUCTS_GQL",
    "QUERY_REPOS_CLUSTERS_GQL",
    "QUERY_REPOS_GQL",
    "QUERY_SHARE_POINT_FOLDERS_GQL",
    "QUERY_SHARE_POINT_LIBRARIES_GQL",
    "QUERY_SLACK_CHANNELS_GQL",
    "QUERY_SOFTWARES_CLUSTERS_GQL",
    "QUERY_SOFTWARES_GQL",
    "QUERY_SPECIFICATIONS_GQL",
    "QUERY_TOKENS_GQL",
    "QUERY_USAGE_GQL",
    "QUERY_USERS_GQL",
    "QUERY_VIEWS_GQL",
    "QUERY_WORKFLOWS_GQL",
    "REMOVE_CONTENTS_FROM_COLLECTION_GQL",
    "RESEARCH_CONTENTS_GQL",
    "RESOLVE_ENTITIES_GQL",
    "RESOLVE_ENTITY_GQL",
    "RETRIEVE_SOURCES_GQL",
    "RETRIEVE_VIEW_GQL",
    "REVISE_CONTENT_GQL",
    "REVISE_ENCODED_IMAGE_GQL",
    "REVISE_IMAGE_GQL",
    "REVISE_TEXT_GQL",
    "SCREENSHOT_PAGE_GQL",
    "SEARCH_WEB_GQL",
    "SEND_NOTIFICATION_GQL",
    "SPECIFICATION_EXISTS_GQL",
    "SUGGEST_CONVERSATION_GQL",
    "SUMMARIZE_CONTENTS_GQL",
    "SUMMARIZE_TEXT_GQL",
    "TRIGGER_FEED_GQL",
    "UPDATE_ALERT_GQL",
    "UPDATE_CATEGORY_GQL",
    "UPDATE_COLLECTION_GQL",
    "UPDATE_CONNECTOR_GQL",
    "UPDATE_CONTENT_GQL",
    "UPDATE_CONVERSATION_GQL",
    "UPDATE_EVENT_GQL",
    "UPDATE_FEED_GQL",
    "UPDATE_INVESTMENT_FUND_GQL",
    "UPDATE_INVESTMENT_GQL",
    "UPDATE_LABEL_GQL",
    "UPDATE_MEDICAL_CONDITION_GQL",
    "UPDATE_MEDICAL_CONTRAINDICATION_GQL",
    "UPDATE_MEDICAL_DEVICE_GQL",
    "UPDATE_MEDICAL_DRUG_CLASS_GQL",
    "UPDATE_MEDICAL_DRUG_GQL",
    "UPDATE_MEDICAL_GUIDELINE_GQL",
    "UPDATE_MEDICAL_INDICATION_GQL",
    "UPDATE_MEDICAL_PROCEDURE_GQL",
    "UPDATE_MEDICAL_STUDY_GQL",
    "UPDATE_MEDICAL_TEST_GQL",
    "UPDATE_MEDICAL_THERAPY_GQL",
    "UPDATE_OBSERVATION_GQL",
    "UPDATE_ORGANIZATION_GQL",
    "UPDATE_PERSON_GQL",
    "UPDATE_PLACE_GQL",
    "UPDATE_PRODUCT_GQL",
    "UPDATE_PROJECT_GQL",
    "UPDATE_REPO_GQL",
    "UPDATE_SOFTWARE_GQL",
    "UPDATE_SPECIFICATION_GQL",
    "UPDATE_USER_GQL",
    "UPDATE_VIEW_GQL",
    "UPDATE_WORKFLOW_GQL",
    "UPSERT_ALERT_GQL",
    "UPSERT_CATEGORY_GQL",
    "UPSERT_LABEL_GQL",
    "UPSERT_SPECIFICATION_GQL",
    "UPSERT_VIEW_GQL",
    "UPSERT_WORKFLOW_GQL",
    "VIEW_EXISTS_GQL",
    "WORKFLOW_EXISTS_GQL",
]

COUNT_ALERTS_GQL = """
query CountAlerts($filter: AlertFilter, $correlationId: String) {
  countAlerts(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_ALERT_GQL = """
mutation CreateAlert($alert: AlertInput!, $correlationId: String) {
  createAlert(alert: $alert, correlationId: $correlationId) {
    id
    name
    state
    type
  }
}
"""

DELETE_ALERT_GQL = """
mutation DeleteAlert($id: ID!) {
  deleteAlert(id: $id) {
    id
    state
  }
}
"""

DELETE_ALERTS_GQL = """
mutation DeleteAlerts($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteAlerts(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

DELETE_ALL_ALERTS_GQL = """
mutation DeleteAllAlerts($filter: AlertFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllAlerts(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DISABLE_ALERT_GQL = """
mutation DisableAlert($id: ID!) {
  disableAlert(id: $id) {
    id
    state
  }
}
"""

ENABLE_ALERT_GQL = """
mutation EnableAlert($id: ID!) {
  enableAlert(id: $id) {
    id
    state
  }
}
"""

GET_ALERT_GQL = """
query GetAlert($id: ID!, $correlationId: String) {
  alert(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    correlationId
    type
    summaryPrompt
    publishPrompt
    view {
      id
    }
    filter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
    integration {
      type
      uri
      slack {
        token
        channel
      }
      email {
        from
        subject
        to
      }
      twitter {
        consumerKey
        consumerSecret
        accessTokenKey
        accessTokenSecret
      }
      mcp {
        token
        type
      }
    }
    publishing {
      type
      elevenLabs {
        model
        voice
      }
      openAIImage {
        model
        count
        seed {
          id
        }
      }
      googleImage {
        model
        count
        seed {
          id
        }
      }
      openAIVideo {
        model
        seconds
        size
        seed {
          id
        }
      }
      parallel {
        processor
      }
    }
    summarySpecification {
      id
    }
    publishSpecification {
      id
    }
    schedulePolicy {
      recurrenceType
      repeatInterval
      cron
      timeZoneId
    }
    lastAlertDate
  }
}
"""

QUERY_ALERTS_GQL = """
query QueryAlerts($filter: AlertFilter, $correlationId: String) {
  alerts(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      correlationId
      type
      summaryPrompt
      publishPrompt
      view {
        id
      }
      filter {
        dateRange {
          from
          to
        }
        inLast
        creationDateRange {
          from
          to
        }
        createdInLast
        types
        fileTypes
        formats
        fileExtensions
        fileSizeRange {
          from
          to
        }
        similarContents {
          id
        }
        contents {
          id
        }
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
        or {
          feeds {
            id
          }
          workflows {
            id
          }
          collections {
            id
          }
          users {
            id
          }
          observations {
            type
            observable {
              id
            }
            states
          }
        }
        and {
          feeds {
            id
          }
          workflows {
            id
          }
          collections {
            id
          }
          users {
            id
          }
          observations {
            type
            observable {
              id
            }
            states
          }
        }
        hasObservations
        hasFeeds
        hasCollections
        hasWorkflows
        collectionMode
        observationMode
      }
      integration {
        type
        uri
        slack {
          token
          channel
        }
        email {
          from
          subject
          to
        }
        twitter {
          consumerKey
          consumerSecret
          accessTokenKey
          accessTokenSecret
        }
        mcp {
          token
          type
        }
      }
      publishing {
        type
        elevenLabs {
          model
          voice
        }
        openAIImage {
          model
          count
          seed {
            id
          }
        }
        googleImage {
          model
          count
          seed {
            id
          }
        }
        openAIVideo {
          model
          seconds
          size
          seed {
            id
          }
        }
        parallel {
          processor
        }
      }
      summarySpecification {
        id
      }
      publishSpecification {
        id
      }
      schedulePolicy {
        recurrenceType
        repeatInterval
        cron
        timeZoneId
      }
      lastAlertDate
    }
  }
}
"""

UPDATE_ALERT_GQL = """
mutation UpdateAlert($alert: AlertUpdateInput!) {
  updateAlert(alert: $alert) {
    id
    name
    state
    type
  }
}
"""

UPSERT_ALERT_GQL = """
mutation UpsertAlert($alert: AlertInput!) {
  upsertAlert(alert: $alert) {
    id
    name
    state
    type
  }
}
"""

COUNT_CATEGORIES_GQL = """
query CountCategories($filter: CategoryFilter, $correlationId: String) {
  countCategories(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_CATEGORY_GQL = """
mutation CreateCategory($category: CategoryInput!) {
  createCategory(category: $category) {
    id
    name
  }
}
"""

DELETE_ALL_CATEGORIES_GQL = """
mutation DeleteAllCategories($filter: CategoryFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllCategories(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_CATEGORIES_GQL = """
mutation DeleteCategories($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteCategories(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

DELETE_CATEGORY_GQL = """
mutation DeleteCategory($id: ID!) {
  deleteCategory(id: $id) {
    id
    state
  }
}
"""

GET_CATEGORY_GQL = """
query GetCategory($id: ID!, $correlationId: String) {
  category(id: $id, correlationId: $correlationId) {
    id
    name
    description
    creationDate
    feeds {
      id
      name
    }
  }
}
"""

QUERY_CATEGORIES_GQL = """
query QueryCategories($filter: CategoryFilter, $correlationId: String) {
  categories(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      description
      creationDate
      relevance
      feeds {
        id
        name
      }
    }
  }
}
"""

UPDATE_CATEGORY_GQL = """
mutation UpdateCategory($category: CategoryUpdateInput!) {
  updateCategory(category: $category) {
    id
    name
  }
}
"""

UPSERT_CATEGORY_GQL = """
mutation UpsertCategory($category: CategoryInput!) {
  upsertCategory(category: $category) {
    id
    name
  }
}
"""

ADD_CONTENTS_TO_COLLECTIONS_GQL = """
mutation AddContentsToCollections($contents: [EntityReferenceInput!]!, $collections: [EntityReferenceInput!]!) {
  addContentsToCollections(contents: $contents, collections: $collections) {
    id
    name
    state
    type
    contents {
      id
      name
    }
  }
}
"""

COUNT_COLLECTIONS_GQL = """
query CountCollections($filter: CollectionFilter, $correlationId: String) {
  countCollections(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_COLLECTION_GQL = """
mutation CreateCollection($collection: CollectionInput!) {
  createCollection(collection: $collection) {
    id
    name
    state
    type
  }
}
"""

DELETE_ALL_COLLECTIONS_GQL = """
mutation DeleteAllCollections($filter: CollectionFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllCollections(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_COLLECTION_GQL = """
mutation DeleteCollection($id: ID!) {
  deleteCollection(id: $id) {
    id
    state
  }
}
"""

DELETE_COLLECTIONS_GQL = """
mutation DeleteCollections($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteCollections(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_COLLECTION_GQL = """
query GetCollection($id: ID!, $correlationId: String) {
  collection(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    type
    contents {
      id
      name
    }
  }
}
"""

QUERY_COLLECTIONS_GQL = """
query QueryCollections($filter: CollectionFilter, $correlationId: String) {
  collections(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      type
    }
  }
}
"""

REMOVE_CONTENTS_FROM_COLLECTION_GQL = """
mutation RemoveContentsFromCollection($contents: [EntityReferenceInput!]!, $collection: EntityReferenceInput!) {
  removeContentsFromCollection(contents: $contents, collection: $collection) {
    id
    name
    state
    type
    contents {
      id
      name
    }
  }
}
"""

UPDATE_COLLECTION_GQL = """
mutation UpdateCollection($collection: CollectionUpdateInput!) {
  updateCollection(collection: $collection) {
    id
    name
    state
    type
  }
}
"""

COUNT_CONNECTORS_GQL = """
query CountConnectors($filter: ConnectorFilter, $correlationId: String) {
  countConnectors(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_CONNECTOR_GQL = """
mutation CreateConnector($connector: ConnectorInput!) {
  createConnector(connector: $connector) {
    id
    name
    state
    type
  }
}
"""

DELETE_CONNECTOR_GQL = """
mutation DeleteConnector($id: ID!) {
  deleteConnector(id: $id) {
    id
    state
  }
}
"""

GET_CONNECTOR_GQL = """
query GetConnector($id: ID!, $correlationId: String) {
  connector(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    type
    authentication {
      type
      microsoft {
        tenantId
        clientId
        clientSecret
      }
      google {
        clientId
        clientSecret
      }
      oauth {
        provider
        clientId
        clientSecret
        refreshToken
        metadata
      }
      arcade {
        authorizationId
        provider
        metadata
      }
    }
    integration {
      type
      uri
      slack {
        token
        channel
      }
      email {
        from
        subject
        to
      }
      twitter {
        consumerKey
        consumerSecret
        accessTokenKey
        accessTokenSecret
      }
      mcp {
        token
        type
      }
    }
  }
}
"""

QUERY_CONNECTORS_GQL = """
query QueryConnectors($filter: ConnectorFilter, $correlationId: String) {
  connectors(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      type
      authentication {
        type
        microsoft {
          tenantId
          clientId
          clientSecret
        }
        google {
          clientId
          clientSecret
        }
        oauth {
          provider
          clientId
          clientSecret
          refreshToken
          metadata
        }
        arcade {
          authorizationId
          provider
          metadata
        }
      }
      integration {
        type
        uri
        slack {
          token
          channel
        }
        email {
          from
          subject
          to
        }
        twitter {
          consumerKey
          consumerSecret
          accessTokenKey
          accessTokenSecret
        }
        mcp {
          token
          type
        }
      }
    }
  }
}
"""

UPDATE_CONNECTOR_GQL = """
mutation UpdateConnector($connector: ConnectorUpdateInput!) {
  updateConnector(connector: $connector) {
    id
    name
    state
    type
  }
}
"""

COUNT_CONTENTS_GQL = """
query CountContents($filter: ContentFilter, $correlationId: String) {
  countContents(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

DELETE_ALL_CONTENTS_GQL = """
mutation DeleteAllContents($filter: ContentFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllContents(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_CONTENT_GQL = """
mutation DeleteContent($id: ID!) {
  deleteContent(id: $id) {
    id
    state
  }
}
"""

DELETE_CONTENTS_GQL = """
mutation DeleteContents($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteContents(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

DESCRIBE_ENCODED_IMAGE_GQL = """
mutation DescribeEncodedImage($prompt: String!, $mimeType: String!, $data: String!, $specification: EntityReferenceInput, $correlationId: String) {
  describeEncodedImage(
    prompt: $prompt
    mimeType: $mimeType
    data: $data
    specification: $specification
    correlationId: $correlationId
  ) {
    role
    author
    message
    citations {
      content {
        id
        name
        state
        originalDate
        identifier
        uri
        type
        fileType
        mimeType
        format
        formatName
        fileExtension
        fileName
        fileSize
        fileMetadata
        relativeFolderPath
        masterUri
        imageUri
        textUri
        audioUri
        transcriptUri
        snapshotsUri
        snapshotCount
        summary
        customSummary
        keywords
        bullets
        headlines
        posts
        chapters
        questions
        quotes
        video {
          width
          height
          duration
          make
          model
          software
          title
          description
          keywords
          author
        }
        audio {
          keywords
          author
          series
          episode
          episodeType
          season
          publisher
          copyright
          genre
          title
          description
          bitrate
          channels
          sampleRate
          bitsPerSample
          duration
        }
        image {
          width
          height
          resolutionX
          resolutionY
          bitsPerComponent
          components
          projectionType
          orientation
          description
          make
          model
          software
          lens
          focalLength
          exposureTime
          fNumber
          iso
          heading
          pitch
        }
        document {
          title
          subject
          summary
          author
          lastModifiedBy
          publisher
          description
          keywords
          pageCount
          worksheetCount
          slideCount
          wordCount
          lineCount
          paragraphCount
          isEncrypted
          hasDigitalSignature
        }
      }
      index
      text
      startTime
      endTime
      pageNumber
      frameNumber
    }
    toolCalls {
      id
      name
      arguments
    }
    tokens
    throughput
    ttft
    completionTime
    timestamp
    modelService
    model
    data
    mimeType
    toolCallId
    toolCallResponse
  }
}
"""

DESCRIBE_IMAGE_GQL = """
mutation DescribeImage($prompt: String!, $uri: URL!, $specification: EntityReferenceInput, $correlationId: String) {
  describeImage(
    prompt: $prompt
    uri: $uri
    specification: $specification
    correlationId: $correlationId
  ) {
    role
    author
    message
    citations {
      content {
        id
        name
        state
        originalDate
        identifier
        uri
        type
        fileType
        mimeType
        format
        formatName
        fileExtension
        fileName
        fileSize
        fileMetadata
        relativeFolderPath
        masterUri
        imageUri
        textUri
        audioUri
        transcriptUri
        snapshotsUri
        snapshotCount
        summary
        customSummary
        keywords
        bullets
        headlines
        posts
        chapters
        questions
        quotes
        video {
          width
          height
          duration
          make
          model
          software
          title
          description
          keywords
          author
        }
        audio {
          keywords
          author
          series
          episode
          episodeType
          season
          publisher
          copyright
          genre
          title
          description
          bitrate
          channels
          sampleRate
          bitsPerSample
          duration
        }
        image {
          width
          height
          resolutionX
          resolutionY
          bitsPerComponent
          components
          projectionType
          orientation
          description
          make
          model
          software
          lens
          focalLength
          exposureTime
          fNumber
          iso
          heading
          pitch
        }
        document {
          title
          subject
          summary
          author
          lastModifiedBy
          publisher
          description
          keywords
          pageCount
          worksheetCount
          slideCount
          wordCount
          lineCount
          paragraphCount
          isEncrypted
          hasDigitalSignature
        }
      }
      index
      text
      startTime
      endTime
      pageNumber
      frameNumber
    }
    toolCalls {
      id
      name
      arguments
    }
    tokens
    throughput
    ttft
    completionTime
    timestamp
    modelService
    model
    data
    mimeType
    toolCallId
    toolCallResponse
  }
}
"""

EXTRACT_CONTENTS_GQL = """
mutation ExtractContents($prompt: String!, $filter: ContentFilter, $specification: EntityReferenceInput, $tools: [ToolDefinitionInput!]!, $correlationId: String) {
  extractContents(
    prompt: $prompt
    filter: $filter
    specification: $specification
    tools: $tools
    correlationId: $correlationId
  ) {
    specification {
      id
    }
    content {
      id
    }
    name
    value
    startTime
    endTime
    pageNumber
    error
  }
}
"""

EXTRACT_OBSERVABLES_GQL = """
mutation ExtractObservables($text: String!, $textType: TextTypes, $specification: EntityReferenceInput, $observableTypes: [ObservableTypes!], $correlationId: String) {
  extractObservables(
    text: $text
    textType: $textType
    specification: $specification
    observableTypes: $observableTypes
    correlationId: $correlationId
  ) {
    labels {
      name
      metadata
    }
    categories {
      name
      metadata
    }
    persons {
      name
      metadata
    }
    organizations {
      name
      metadata
    }
    places {
      name
      metadata
    }
    events {
      name
      metadata
    }
    products {
      name
      metadata
    }
    softwares {
      name
      metadata
    }
    repos {
      name
      metadata
    }
    investments {
      name
      metadata
    }
    investmentFunds {
      name
      metadata
    }
    medicalStudies {
      name
      metadata
    }
    medicalConditions {
      name
      metadata
    }
    medicalGuidelines {
      name
      metadata
    }
    medicalDrugs {
      name
      metadata
    }
    medicalDrugClasses {
      name
      metadata
    }
    medicalIndications {
      name
      metadata
    }
    medicalContraindications {
      name
      metadata
    }
    medicalProcedures {
      name
      metadata
    }
    medicalTherapies {
      name
      metadata
    }
    medicalDevices {
      name
      metadata
    }
    medicalTests {
      name
      metadata
    }
  }
}
"""

EXTRACT_TEXT_GQL = """
mutation ExtractText($prompt: String!, $text: String!, $textType: TextTypes, $specification: EntityReferenceInput, $tools: [ToolDefinitionInput!]!, $correlationId: String) {
  extractText(
    prompt: $prompt
    text: $text
    textType: $textType
    specification: $specification
    tools: $tools
    correlationId: $correlationId
  ) {
    specification {
      id
    }
    content {
      id
    }
    name
    value
    startTime
    endTime
    pageNumber
    error
  }
}
"""

GET_CONTENT_GQL = """
query GetContent($id: ID!, $correlationId: String) {
  content(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    originalDate
    finishedDate
    fileCreationDate
    fileModifiedDate
    workflowDuration
    uri
    description
    identifier
    markdown
    html
    address {
      streetAddress
      city
      region
      country
      postalCode
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
    boundary
    epsgCode
    path
    features
    c4id
    type
    fileType
    mimeType
    format
    formatName
    fileExtension
    fileName
    fileSize
    fileMetadata
    relativeFolderPath
    masterUri
    imageUri
    textUri
    audioUri
    transcriptUri
    snapshotsUri
    snapshotCount
    summary
    customSummary
    keywords
    bullets
    headlines
    posts
    chapters
    questions
    quotes
    video {
      width
      height
      duration
      make
      model
      software
      title
      description
      keywords
      author
    }
    audio {
      keywords
      author
      series
      episode
      episodeType
      season
      publisher
      copyright
      genre
      title
      description
      bitrate
      channels
      sampleRate
      bitsPerSample
      duration
    }
    image {
      width
      height
      resolutionX
      resolutionY
      bitsPerComponent
      components
      projectionType
      orientation
      description
      make
      model
      software
      lens
      focalLength
      exposureTime
      fNumber
      iso
      heading
      pitch
    }
    document {
      title
      subject
      summary
      author
      lastModifiedBy
      publisher
      description
      keywords
      pageCount
      worksheetCount
      slideCount
      wordCount
      lineCount
      paragraphCount
      isEncrypted
      hasDigitalSignature
    }
    email {
      identifier
      threadIdentifier
      subject
      labels
      sensitivity
      priority
      importance
      unsubscribeUrl
      publicationName
      publicationUrl
      attachmentCount
      from {
        name
        email
        givenName
        familyName
      }
      to {
        name
        email
        givenName
        familyName
      }
      cc {
        name
        email
        givenName
        familyName
      }
      bcc {
        name
        email
        givenName
        familyName
      }
    }
    event {
      eventIdentifier
      calendarIdentifier
      subject
      startDateTime
      endDateTime
      isAllDay
      timezone
      status
      visibility
      meetingLink
      organizer {
        name
        email
        isOptional
        isOrganizer
        responseStatus
      }
      attendees {
        name
        email
        isOptional
        isOrganizer
        responseStatus
      }
      categories
      reminders {
        minutesBefore
        method
      }
      recurrence {
        pattern
        interval
        count
        until
        daysOfWeek
        dayOfMonth
        monthOfYear
      }
      recurringEventIdentifier
      isRecurring
    }
    issue {
      identifier
      title
      project
      team
      status
      priority
      type
      labels
    }
    commit {
      sha
      message
      project
      team
      branch
      parentShas
      filesChanged
      additions
      deletions
      pullRequestNumber
      authorDate
      committerDate
      authors {
        name
        email
        givenName
        familyName
      }
      committers {
        name
        email
        givenName
        familyName
      }
      labels
      links
    }
    pullRequest {
      identifier
      title
      description
      project
      team
      status
      type
      baseBranch
      headBranch
      isDraft
      isMergeable
      mergeCommitSha
      mergedAt
      filesChanged
      additions
      deletions
      authors {
        name
        email
        givenName
        familyName
      }
      reviewers {
        name
        email
        givenName
        familyName
      }
      labels
      links
    }
    message {
      identifier
      conversationIdentifier
      channelIdentifier
      channelName
      attachmentCount
      links
      author {
        name
        email
        givenName
        familyName
      }
      mentions {
        name
        email
        givenName
        familyName
      }
    }
    post {
      identifier
      title
      author {
        name
        email
        givenName
        familyName
      }
      upvotes
      downvotes
      commentCount
      links
    }
    package {
      fileCount
      folderCount
      isEncrypted
    }
    language {
      languages
    }
    parent {
      id
      name
    }
    children {
      id
      name
    }
    feed {
      id
      name
    }
    collections {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    observations {
      id
      type
      observable {
        id
        name
      }
      related {
        id
        name
      }
      relatedType
      relation
      occurrences {
        type
        confidence
        startTime
        endTime
        pageIndex
        boundingBox {
          left
          top
          width
          height
        }
      }
      state
    }
    workflow {
      id
      name
    }
    pages {
      index
      text
      relevance
      images {
        id
        mimeType
        data
        left
        right
        top
        bottom
      }
      chunks {
        index
        pageIndex
        rowIndex
        columnIndex
        confidence
        text
        role
        language
        relevance
      }
    }
    segments {
      startTime
      endTime
      text
      relevance
    }
    frames {
      index
      description
      text
      relevance
    }
    error
  }
}
"""

INGEST_BATCH_GQL = """
mutation IngestBatch($uris: [URL!]!, $workflow: EntityReferenceInput, $collections: [EntityReferenceInput!], $observations: [ObservationReferenceInput!], $correlationId: String) {
  ingestBatch(
    uris: $uris
    workflow: $workflow
    collections: $collections
    observations: $observations
    correlationId: $correlationId
  ) {
    id
    name
    state
    type
    fileType
    mimeType
    uri
    identifier
    collections {
      id
      name
    }
    observations {
      id
      type
      observable {
        id
        name
      }
      related {
        id
        name
      }
      relatedType
      relation
      occurrences {
        type
        confidence
        startTime
        endTime
        pageIndex
        boundingBox {
          left
          top
          width
          height
        }
      }
      state
    }
  }
}
"""

INGEST_ENCODED_FILE_GQL = """
mutation IngestEncodedFile($name: String!, $data: String!, $mimeType: String!, $id: ID, $identifier: String, $fileCreationDate: DateTime, $fileModifiedDate: DateTime, $isSynchronous: Boolean, $collections: [EntityReferenceInput!], $observations: [ObservationReferenceInput!], $workflow: EntityReferenceInput, $correlationId: String) {
  ingestEncodedFile(
    name: $name
    data: $data
    mimeType: $mimeType
    id: $id
    identifier: $identifier
    fileCreationDate: $fileCreationDate
    fileModifiedDate: $fileModifiedDate
    isSynchronous: $isSynchronous
    collections: $collections
    observations: $observations
    workflow: $workflow
    correlationId: $correlationId
  ) {
    id
    name
    state
    type
    fileType
    mimeType
    uri
    identifier
    collections {
      id
      name
    }
    observations {
      id
      type
      observable {
        id
        name
      }
      related {
        id
        name
      }
      relatedType
      relation
      occurrences {
        type
        confidence
        startTime
        endTime
        pageIndex
        boundingBox {
          left
          top
          width
          height
        }
      }
      state
    }
  }
}
"""

INGEST_EVENT_GQL = """
mutation IngestEvent($markdown: String!, $name: String, $description: String, $eventDate: DateTime, $id: ID, $identifier: String, $collections: [EntityReferenceInput!], $correlationId: String) {
  ingestEvent(
    name: $name
    description: $description
    eventDate: $eventDate
    markdown: $markdown
    id: $id
    identifier: $identifier
    collections: $collections
    correlationId: $correlationId
  ) {
    id
    name
    state
    type
    fileType
    mimeType
    uri
    identifier
    collections {
      id
      name
    }
    observations {
      id
      type
      observable {
        id
        name
      }
      related {
        id
        name
      }
      relatedType
      relation
      occurrences {
        type
        confidence
        startTime
        endTime
        pageIndex
        boundingBox {
          left
          top
          width
          height
        }
      }
      state
    }
  }
}
"""

INGEST_MEMORY_GQL = """
mutation IngestMemory($text: String!, $name: String, $textType: TextTypes, $id: ID, $identifier: String, $collections: [EntityReferenceInput!], $correlationId: String) {
  ingestMemory(
    name: $name
    text: $text
    textType: $textType
    id: $id
    identifier: $identifier
    collections: $collections
    correlationId: $correlationId
  ) {
    id
    name
    state
    type
    fileType
    mimeType
    uri
    identifier
    collections {
      id
      name
    }
    observations {
      id
      type
      observable {
        id
        name
      }
      related {
        id
        name
      }
      relatedType
      relation
      occurrences {
        type
        confidence
        startTime
        endTime
        pageIndex
        boundingBox {
          left
          top
          width
          height
        }
      }
      state
    }
  }
}
"""

INGEST_TEXT_GQL = """
mutation IngestText($text: String!, $name: String, $textType: TextTypes, $uri: URL, $id: ID, $identifier: String, $isSynchronous: Boolean, $workflow: EntityReferenceInput, $collections: [EntityReferenceInput!], $observations: [ObservationReferenceInput!], $correlationId: String) {
  ingestText(
    name: $name
    text: $text
    textType: $textType
    uri: $uri
    id: $id
    isSynchronous: $isSynchronous
    workflow: $workflow
    identifier: $identifier
    collections: $collections
    observations: $observations
    correlationId: $correlationId
  ) {
    id
    name
    state
    type
    fileType
    mimeType
    uri
    identifier
    collections {
      id
      name
    }
    observations {
      id
      type
      observable {
        id
        name
      }
      related {
        id
        name
      }
      relatedType
      relation
      occurrences {
        type
        confidence
        startTime
        endTime
        pageIndex
        boundingBox {
          left
          top
          width
          height
        }
      }
      state
    }
  }
}
"""

INGEST_TEXT_BATCH_GQL = """
mutation IngestTextBatch($batch: [TextContentInput!]!, $textType: TextTypes, $workflow: EntityReferenceInput, $collections: [EntityReferenceInput!], $observations: [ObservationReferenceInput!], $correlationId: String) {
  ingestTextBatch(
    batch: $batch
    workflow: $workflow
    textType: $textType
    collections: $collections
    observations: $observations
    correlationId: $correlationId
  ) {
    id
    name
    state
    type
    fileType
    mimeType
    uri
    identifier
    collections {
      id
      name
    }
    observations {
      id
      type
      observable {
        id
        name
      }
      related {
        id
        name
      }
      relatedType
      relation
      occurrences {
        type
        confidence
        startTime
        endTime
        pageIndex
        boundingBox {
          left
          top
          width
          height
        }
      }
      state
    }
  }
}
"""

INGEST_URI_GQL = """
mutation IngestUri($name: String, $uri: URL!, $id: ID, $mimeType: String, $identifier: String, $isSynchronous: Boolean, $workflow: EntityReferenceInput, $collections: [EntityReferenceInput!], $observations: [ObservationReferenceInput!], $correlationId: String) {
  ingestUri(
    name: $name
    uri: $uri
    id: $id
    mimeType: $mimeType
    workflow: $workflow
    collections: $collections
    observations: $observations
    identifier: $identifier
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    name
    state
    type
    fileType
    mimeType
    uri
    identifier
    collections {
      id
      name
    }
    observations {
      id
      type
      observable {
        id
        name
      }
      related {
        id
        name
      }
      relatedType
      relation
      occurrences {
        type
        confidence
        startTime
        endTime
        pageIndex
        boundingBox {
          left
          top
          width
          height
        }
      }
      state
    }
  }
}
"""

IS_CONTENT_DONE_GQL = """
query IsContentDone($id: ID!) {
  isContentDone(id: $id) {
    result
  }
}
"""

LOOKUP_CONTENTS_GQL = """
query LookupContents($ids: [ID!]!, $correlationId: String) {
  lookupContents(ids: $ids, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      owner {
        id
      }
      state
      originalDate
      finishedDate
      fileCreationDate
      fileModifiedDate
      workflowDuration
      uri
      description
      identifier
      markdown
      html
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      boundary
      epsgCode
      path
      features
      c4id
      type
      fileType
      mimeType
      format
      formatName
      fileExtension
      fileName
      fileSize
      fileMetadata
      relativeFolderPath
      masterUri
      imageUri
      textUri
      audioUri
      transcriptUri
      snapshotsUri
      snapshotCount
      summary
      customSummary
      keywords
      bullets
      headlines
      posts
      chapters
      questions
      quotes
      video {
        width
        height
        duration
        make
        model
        software
        title
        description
        keywords
        author
      }
      audio {
        keywords
        author
        series
        episode
        episodeType
        season
        publisher
        copyright
        genre
        title
        description
        bitrate
        channels
        sampleRate
        bitsPerSample
        duration
      }
      image {
        width
        height
        resolutionX
        resolutionY
        bitsPerComponent
        components
        projectionType
        orientation
        description
        make
        model
        software
        lens
        focalLength
        exposureTime
        fNumber
        iso
        heading
        pitch
      }
      document {
        title
        subject
        summary
        author
        lastModifiedBy
        publisher
        description
        keywords
        pageCount
        worksheetCount
        slideCount
        wordCount
        lineCount
        paragraphCount
        isEncrypted
        hasDigitalSignature
      }
      email {
        identifier
        threadIdentifier
        subject
        labels
        sensitivity
        priority
        importance
        unsubscribeUrl
        publicationName
        publicationUrl
        attachmentCount
        from {
          name
          email
          givenName
          familyName
        }
        to {
          name
          email
          givenName
          familyName
        }
        cc {
          name
          email
          givenName
          familyName
        }
        bcc {
          name
          email
          givenName
          familyName
        }
      }
      event {
        eventIdentifier
        calendarIdentifier
        subject
        startDateTime
        endDateTime
        isAllDay
        timezone
        status
        visibility
        meetingLink
        organizer {
          name
          email
          isOptional
          isOrganizer
          responseStatus
        }
        attendees {
          name
          email
          isOptional
          isOrganizer
          responseStatus
        }
        categories
        reminders {
          minutesBefore
          method
        }
        recurrence {
          pattern
          interval
          count
          until
          daysOfWeek
          dayOfMonth
          monthOfYear
        }
        recurringEventIdentifier
        isRecurring
      }
      issue {
        identifier
        title
        project
        team
        status
        priority
        type
        labels
      }
      commit {
        sha
        message
        project
        team
        branch
        parentShas
        filesChanged
        additions
        deletions
        pullRequestNumber
        authorDate
        committerDate
        authors {
          name
          email
          givenName
          familyName
        }
        committers {
          name
          email
          givenName
          familyName
        }
        labels
        links
      }
      pullRequest {
        identifier
        title
        description
        project
        team
        status
        type
        baseBranch
        headBranch
        isDraft
        isMergeable
        mergeCommitSha
        mergedAt
        filesChanged
        additions
        deletions
        authors {
          name
          email
          givenName
          familyName
        }
        reviewers {
          name
          email
          givenName
          familyName
        }
        labels
        links
      }
      message {
        identifier
        conversationIdentifier
        channelIdentifier
        channelName
        attachmentCount
        links
        author {
          name
          email
          givenName
          familyName
        }
        mentions {
          name
          email
          givenName
          familyName
        }
      }
      post {
        identifier
        title
        author {
          name
          email
          givenName
          familyName
        }
        upvotes
        downvotes
        commentCount
        links
      }
      package {
        fileCount
        folderCount
        isEncrypted
      }
      language {
        languages
      }
      parent {
        id
        name
      }
      children {
        id
        name
      }
      feed {
        id
        name
      }
      collections {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      observations {
        id
        type
        observable {
          id
          name
        }
        related {
          id
          name
        }
        relatedType
        relation
        occurrences {
          type
          confidence
          startTime
          endTime
          pageIndex
          boundingBox {
            left
            top
            width
            height
          }
        }
        state
      }
      workflow {
        id
        name
      }
      pages {
        index
        text
        relevance
        images {
          id
          mimeType
          data
          left
          right
          top
          bottom
        }
        chunks {
          index
          pageIndex
          rowIndex
          columnIndex
          confidence
          text
          role
          language
          relevance
        }
      }
      segments {
        startTime
        endTime
        text
        relevance
      }
      frames {
        index
        description
        text
        relevance
      }
      error
    }
  }
}
"""

LOOKUP_ENTITY_GQL = """
query LookupEntity($filter: EntityRelationshipsFilter!, $correlationId: String) {
  lookupEntity(filter: $filter, correlationId: $correlationId) {
    entity {
      id
      name
      type
      metadata
    }
    relationships {
      relation
      direction
      entity {
        id
        name
        type
        metadata
      }
    }
    totalCount
  }
}
"""

PUBLISH_CONTENTS_GQL = """
mutation PublishContents($summaryPrompt: String, $publishPrompt: String!, $connector: ContentPublishingConnectorInput!, $filter: ContentFilter, $includeDetails: Boolean, $isSynchronous: Boolean, $correlationId: String, $name: String, $summarySpecification: EntityReferenceInput, $publishSpecification: EntityReferenceInput, $workflow: EntityReferenceInput) {
  publishContents(
    summaryPrompt: $summaryPrompt
    publishPrompt: $publishPrompt
    connector: $connector
    filter: $filter
    includeDetails: $includeDetails
    isSynchronous: $isSynchronous
    correlationId: $correlationId
    name: $name
    summarySpecification: $summarySpecification
    publishSpecification: $publishSpecification
    workflow: $workflow
  ) {
    contents {
      id
      name
      state
      originalDate
      identifier
      markdown
      uri
      type
      fileType
      mimeType
      format
      formatName
      fileExtension
      fileName
      fileSize
      fileMetadata
      relativeFolderPath
      masterUri
      imageUri
      textUri
      audioUri
      transcriptUri
      snapshotsUri
      snapshotCount
      summary
      customSummary
      keywords
      bullets
      headlines
      posts
      chapters
      questions
      quotes
      video {
        width
        height
        duration
        make
        model
        software
        title
        description
        keywords
        author
      }
      audio {
        keywords
        author
        series
        episode
        episodeType
        season
        publisher
        copyright
        genre
        title
        description
        bitrate
        channels
        sampleRate
        bitsPerSample
        duration
      }
      image {
        width
        height
        resolutionX
        resolutionY
        bitsPerComponent
        components
        projectionType
        orientation
        description
        make
        model
        software
        lens
        focalLength
        exposureTime
        fNumber
        iso
        heading
        pitch
      }
      document {
        title
        subject
        summary
        author
        lastModifiedBy
        publisher
        description
        keywords
        pageCount
        worksheetCount
        slideCount
        wordCount
        lineCount
        paragraphCount
        isEncrypted
        hasDigitalSignature
      }
    }
    details {
      contents {
        id
      }
      summaries
      text
      textType
      summarySpecification
      publishSpecification
      summaryTime
      publishTime
    }
  }
}
"""

PUBLISH_TEXT_GQL = """
mutation PublishText($text: String!, $textType: TextTypes, $connector: ContentPublishingConnectorInput!, $isSynchronous: Boolean, $correlationId: String, $name: String, $workflow: EntityReferenceInput) {
  publishText(
    text: $text
    textType: $textType
    connector: $connector
    isSynchronous: $isSynchronous
    correlationId: $correlationId
    name: $name
    workflow: $workflow
  ) {
    contents {
      id
      name
      state
      originalDate
      identifier
      markdown
      uri
      type
      fileType
      mimeType
      format
      formatName
      fileExtension
      fileName
      fileSize
      fileMetadata
      relativeFolderPath
      masterUri
      imageUri
      textUri
      audioUri
      transcriptUri
      snapshotsUri
      snapshotCount
      summary
      customSummary
      keywords
      bullets
      headlines
      posts
      chapters
      questions
      quotes
      video {
        width
        height
        duration
        make
        model
        software
        title
        description
        keywords
        author
      }
      audio {
        keywords
        author
        series
        episode
        episodeType
        season
        publisher
        copyright
        genre
        title
        description
        bitrate
        channels
        sampleRate
        bitsPerSample
        duration
      }
      image {
        width
        height
        resolutionX
        resolutionY
        bitsPerComponent
        components
        projectionType
        orientation
        description
        make
        model
        software
        lens
        focalLength
        exposureTime
        fNumber
        iso
        heading
        pitch
      }
      document {
        title
        subject
        summary
        author
        lastModifiedBy
        publisher
        description
        keywords
        pageCount
        worksheetCount
        slideCount
        wordCount
        lineCount
        paragraphCount
        isEncrypted
        hasDigitalSignature
      }
    }
    details {
      contents {
        id
      }
      summaries
      text
      textType
      summarySpecification
      publishSpecification
      summaryTime
      publishTime
    }
  }
}
"""

QUERY_CONTENTS_GQL = """
query QueryContents($filter: ContentFilter, $correlationId: String) {
  contents(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      originalDate
      finishedDate
      workflowDuration
      uri
      description
      identifier
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      location {
        latitude
        longitude
      }
      features
      type
      fileType
      mimeType
      format
      formatName
      fileExtension
      fileName
      fileSize
      relativeFolderPath
      masterUri
      imageUri
      textUri
      audioUri
      transcriptUri
      snapshotsUri
      snapshotCount
      summary
      customSummary
      quotes
      video {
        width
        height
        duration
        make
        model
        software
        title
        description
        keywords
        author
      }
      audio {
        keywords
        author
        series
        episode
        episodeType
        season
        publisher
        copyright
        genre
        title
        description
        bitrate
        channels
        sampleRate
        bitsPerSample
        duration
      }
      image {
        width
        height
        resolutionX
        resolutionY
        bitsPerComponent
        components
        projectionType
        orientation
        description
        make
        model
        software
        lens
        focalLength
        exposureTime
        fNumber
        iso
        heading
        pitch
      }
      document {
        title
        subject
        summary
        author
        lastModifiedBy
        publisher
        description
        keywords
        pageCount
        worksheetCount
        slideCount
        wordCount
        lineCount
        paragraphCount
        isEncrypted
        hasDigitalSignature
      }
      email {
        identifier
        threadIdentifier
        subject
        labels
        sensitivity
        priority
        importance
        unsubscribeUrl
        publicationName
        publicationUrl
        attachmentCount
        from {
          name
          email
          givenName
          familyName
        }
        to {
          name
          email
          givenName
          familyName
        }
        cc {
          name
          email
          givenName
          familyName
        }
        bcc {
          name
          email
          givenName
          familyName
        }
      }
      event {
        eventIdentifier
        calendarIdentifier
        subject
        startDateTime
        endDateTime
        isAllDay
        timezone
        status
        visibility
        meetingLink
        organizer {
          name
          email
          isOptional
          isOrganizer
          responseStatus
        }
        attendees {
          name
          email
          isOptional
          isOrganizer
          responseStatus
        }
        categories
        reminders {
          minutesBefore
          method
        }
        recurrence {
          pattern
          interval
          count
          until
          daysOfWeek
          dayOfMonth
          monthOfYear
        }
        recurringEventIdentifier
        isRecurring
      }
      issue {
        identifier
        title
        project
        team
        status
        priority
        type
        labels
      }
      commit {
        sha
        message
        project
        team
        branch
        parentShas
        filesChanged
        additions
        deletions
        pullRequestNumber
        authorDate
        committerDate
        authors {
          name
          email
          givenName
          familyName
        }
        committers {
          name
          email
          givenName
          familyName
        }
        labels
        links
      }
      pullRequest {
        identifier
        title
        description
        project
        team
        status
        type
        baseBranch
        headBranch
        isDraft
        isMergeable
        mergeCommitSha
        mergedAt
        filesChanged
        additions
        deletions
        authors {
          name
          email
          givenName
          familyName
        }
        reviewers {
          name
          email
          givenName
          familyName
        }
        labels
        links
      }
      message {
        identifier
        conversationIdentifier
        channelIdentifier
        channelName
        attachmentCount
        links
        author {
          name
          email
          givenName
          familyName
        }
        mentions {
          name
          email
          givenName
          familyName
        }
      }
      post {
        identifier
        title
        author {
          name
          email
          givenName
          familyName
        }
        upvotes
        downvotes
        commentCount
        links
      }
      package {
        fileCount
        folderCount
        isEncrypted
      }
      language {
        languages
      }
      feed {
        id
        name
      }
      workflow {
        id
        name
      }
      pages {
        index
        text
        relevance
        images {
          id
          mimeType
          data
          left
          right
          top
          bottom
        }
        chunks {
          index
          pageIndex
          rowIndex
          columnIndex
          confidence
          text
          role
          language
          relevance
        }
      }
      segments {
        startTime
        endTime
        text
        relevance
      }
      frames {
        index
        description
        text
        relevance
      }
      error
    }
  }
}
"""

QUERY_CONTENTS_FACETS_GQL = """
query QueryContentsFacets($filter: ContentFilter, $facets: [ContentFacetInput!], $correlationId: String) {
  contents(filter: $filter, facets: $facets, correlationId: $correlationId) {
    facets {
      facet
      count
      type
      value
      range {
        from
        to
      }
      observable {
        type
        observable {
          id
          name
        }
      }
    }
  }
}
"""

QUERY_CONTENTS_GRAPH_GQL = """
query QueryContentsGraph($filter: ContentFilter, $graph: ContentGraphInput, $correlationId: String) {
  contents(filter: $filter, graph: $graph, correlationId: $correlationId) {
    graph {
      nodes {
        id
        name
        type
        metadata
      }
      edges {
        from
        to
        relation
      }
    }
  }
}
"""

QUERY_CONTENTS_OBSERVATIONS_GQL = """
query QueryContentsObservations($filter: ContentFilter, $correlationId: String) {
  contents(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      originalDate
      finishedDate
      workflowDuration
      uri
      description
      identifier
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      location {
        latitude
        longitude
      }
      features
      type
      fileType
      mimeType
      format
      formatName
      fileExtension
      fileName
      fileSize
      relativeFolderPath
      masterUri
      imageUri
      textUri
      audioUri
      transcriptUri
      snapshotsUri
      snapshotCount
      summary
      customSummary
      quotes
      video {
        width
        height
        duration
        make
        model
        software
        title
        description
        keywords
        author
      }
      audio {
        keywords
        author
        series
        episode
        episodeType
        season
        publisher
        copyright
        genre
        title
        description
        bitrate
        channels
        sampleRate
        bitsPerSample
        duration
      }
      image {
        width
        height
        resolutionX
        resolutionY
        bitsPerComponent
        components
        projectionType
        orientation
        description
        make
        model
        software
        lens
        focalLength
        exposureTime
        fNumber
        iso
        heading
        pitch
      }
      document {
        title
        subject
        summary
        author
        lastModifiedBy
        publisher
        description
        keywords
        pageCount
        worksheetCount
        slideCount
        wordCount
        lineCount
        paragraphCount
        isEncrypted
        hasDigitalSignature
      }
      email {
        identifier
        threadIdentifier
        subject
        labels
        sensitivity
        priority
        importance
        unsubscribeUrl
        publicationName
        publicationUrl
        attachmentCount
        from {
          name
          email
          givenName
          familyName
        }
        to {
          name
          email
          givenName
          familyName
        }
        cc {
          name
          email
          givenName
          familyName
        }
        bcc {
          name
          email
          givenName
          familyName
        }
      }
      event {
        eventIdentifier
        calendarIdentifier
        subject
        startDateTime
        endDateTime
        isAllDay
        timezone
        status
        visibility
        meetingLink
        organizer {
          name
          email
          isOptional
          isOrganizer
          responseStatus
        }
        attendees {
          name
          email
          isOptional
          isOrganizer
          responseStatus
        }
        categories
        reminders {
          minutesBefore
          method
        }
        recurrence {
          pattern
          interval
          count
          until
          daysOfWeek
          dayOfMonth
          monthOfYear
        }
        recurringEventIdentifier
        isRecurring
      }
      issue {
        identifier
        title
        project
        team
        status
        priority
        type
        labels
      }
      commit {
        sha
        message
        project
        team
        branch
        parentShas
        filesChanged
        additions
        deletions
        pullRequestNumber
        authorDate
        committerDate
        authors {
          name
          email
          givenName
          familyName
        }
        committers {
          name
          email
          givenName
          familyName
        }
        labels
        links
      }
      pullRequest {
        identifier
        title
        description
        project
        team
        status
        type
        baseBranch
        headBranch
        isDraft
        isMergeable
        mergeCommitSha
        mergedAt
        filesChanged
        additions
        deletions
        authors {
          name
          email
          givenName
          familyName
        }
        reviewers {
          name
          email
          givenName
          familyName
        }
        labels
        links
      }
      message {
        identifier
        conversationIdentifier
        channelIdentifier
        channelName
        attachmentCount
        links
        author {
          name
          email
          givenName
          familyName
        }
        mentions {
          name
          email
          givenName
          familyName
        }
      }
      post {
        identifier
        title
        author {
          name
          email
          givenName
          familyName
        }
        upvotes
        downvotes
        commentCount
        links
      }
      package {
        fileCount
        folderCount
        isEncrypted
      }
      language {
        languages
      }
      feed {
        id
        name
      }
      workflow {
        id
        name
      }
      pages {
        index
        text
        relevance
        images {
          id
          mimeType
          data
          left
          right
          top
          bottom
        }
        chunks {
          index
          pageIndex
          rowIndex
          columnIndex
          confidence
          text
          role
          language
          relevance
        }
      }
      segments {
        startTime
        endTime
        text
        relevance
      }
      frames {
        index
        description
        text
        relevance
      }
      error
      markdown
      observations {
        id
        type
        observable {
          id
          name
        }
        related {
          id
          name
        }
        relatedType
        relation
        occurrences {
          type
          confidence
          startTime
          endTime
          pageIndex
          boundingBox {
            left
            top
            width
            height
          }
        }
        state
      }
    }
  }
}
"""

QUERY_GRAPH_GQL = """
query QueryGraph($filter: GraphFilter, $graph: GraphInput, $correlationId: String) {
  graph(filter: $filter, graph: $graph, correlationId: $correlationId) {
    nodes {
      id
      name
      type
      metadata
    }
    edges {
      from
      to
      relation
    }
  }
}
"""

QUERY_OBSERVABLES_GQL = """
query QueryObservables($filter: ContentFilter, $correlationId: String) {
  observables(filter: $filter, correlationId: $correlationId) {
    results {
      type
      observable {
        id
        name
      }
    }
  }
}
"""

RESEARCH_CONTENTS_GQL = """
mutation ResearchContents($connector: ContentPublishingConnectorInput!, $filter: ContentFilter, $name: String, $summarySpecification: EntityReferenceInput, $publishSpecification: EntityReferenceInput, $workflow: EntityReferenceInput, $correlationId: String) {
  researchContents(
    connector: $connector
    filter: $filter
    name: $name
    summarySpecification: $summarySpecification
    publishSpecification: $publishSpecification
    workflow: $workflow
    correlationId: $correlationId
  ) {
    result
  }
}
"""

SCREENSHOT_PAGE_GQL = """
mutation ScreenshotPage($uri: URL!, $maximumHeight: Int, $isSynchronous: Boolean, $workflow: EntityReferenceInput, $collections: [EntityReferenceInput!], $correlationId: String) {
  screenshotPage(
    uri: $uri
    maximumHeight: $maximumHeight
    workflow: $workflow
    collections: $collections
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    name
    state
    type
    fileType
    mimeType
    uri
    identifier
    collections {
      id
      name
    }
    observations {
      id
      type
      observable {
        id
        name
      }
      related {
        id
        name
      }
      relatedType
      relation
      occurrences {
        type
        confidence
        startTime
        endTime
        pageIndex
        boundingBox {
          left
          top
          width
          height
        }
      }
      state
    }
  }
}
"""

SUMMARIZE_CONTENTS_GQL = """
mutation SummarizeContents($summarizations: [SummarizationStrategyInput!]!, $filter: ContentFilter, $correlationId: String) {
  summarizeContents(
    summarizations: $summarizations
    filter: $filter
    correlationId: $correlationId
  ) {
    specification {
      id
    }
    content {
      id
    }
    type
    items {
      text
      tokens
      summarizationTime
    }
    error
  }
}
"""

SUMMARIZE_TEXT_GQL = """
mutation SummarizeText($summarization: SummarizationStrategyInput!, $text: String!, $textType: TextTypes, $correlationId: String) {
  summarizeText(
    summarization: $summarization
    text: $text
    textType: $textType
    correlationId: $correlationId
  ) {
    specification {
      id
    }
    content {
      id
    }
    type
    items {
      text
      tokens
      summarizationTime
    }
    error
  }
}
"""

UPDATE_CONTENT_GQL = """
mutation UpdateContent($content: ContentUpdateInput!) {
  updateContent(content: $content) {
    id
    name
    state
    type
    fileType
    mimeType
    uri
    identifier
    collections {
      id
      name
    }
    observations {
      id
      type
      observable {
        id
        name
      }
      related {
        id
        name
      }
      relatedType
      relation
      occurrences {
        type
        confidence
        startTime
        endTime
        pageIndex
        boundingBox {
          left
          top
          width
          height
        }
      }
      state
    }
  }
}
"""

ASK_GRAPHLIT_GQL = """
mutation AskGraphlit($prompt: String!, $type: SdkTypes, $id: ID, $specification: EntityReferenceInput, $correlationId: String) {
  askGraphlit(
    prompt: $prompt
    type: $type
    id: $id
    specification: $specification
    correlationId: $correlationId
  ) {
    conversation {
      id
    }
    message {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    messageCount
  }
}
"""

BRANCH_CONVERSATION_GQL = """
mutation BranchConversation($id: ID!) {
  branchConversation(id: $id) {
    id
    name
    state
    type
  }
}
"""

CLEAR_CONVERSATION_GQL = """
mutation ClearConversation($id: ID!) {
  clearConversation(id: $id) {
    id
    name
    state
    type
  }
}
"""

CLOSE_CONVERSATION_GQL = """
mutation CloseConversation($id: ID!) {
  closeConversation(id: $id) {
    id
    name
    state
    type
  }
}
"""

COMPLETE_CONVERSATION_GQL = """
mutation CompleteConversation($completion: String!, $id: ID!, $completionTime: TimeSpan, $ttft: TimeSpan, $throughput: Float, $correlationId: String) {
  completeConversation(
    completion: $completion
    id: $id
    completionTime: $completionTime
    ttft: $ttft
    throughput: $throughput
    correlationId: $correlationId
  ) {
    conversation {
      id
    }
    message {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    messageCount
    facets {
      type
      value
      range {
        from
        to
      }
      count
      facet
      observable {
        type
        observable {
          id
          name
        }
      }
    }
    graph {
      nodes {
        id
        name
        type
        metadata
      }
      edges {
        from
        to
        relation
      }
    }
    details {
      modelService
      model
      supportsToolCalling
      sourceCount
      observableCount
      toolCount
      renderedSourceCount
      renderedObservableCount
      renderedToolCount
      rankedSourceCount
      rankedObservableCount
      rankedToolCount
      tokenLimit
      completionTokenLimit
      sources
      formattedSources
      formattedObservables
      formattedInstructions
      formattedTools
      specification
      messages {
        role
        author
        message
        citations {
          content {
            id
            name
            state
            originalDate
            identifier
            uri
            type
            fileType
            mimeType
            format
            formatName
            fileExtension
            fileName
            fileSize
            fileMetadata
            relativeFolderPath
            masterUri
            imageUri
            textUri
            audioUri
            transcriptUri
            snapshotsUri
            snapshotCount
            summary
            customSummary
            keywords
            bullets
            headlines
            posts
            chapters
            questions
            quotes
            video {
              width
              height
              duration
              make
              model
              software
              title
              description
              keywords
              author
            }
            audio {
              keywords
              author
              series
              episode
              episodeType
              season
              publisher
              copyright
              genre
              title
              description
              bitrate
              channels
              sampleRate
              bitsPerSample
              duration
            }
            image {
              width
              height
              resolutionX
              resolutionY
              bitsPerComponent
              components
              projectionType
              orientation
              description
              make
              model
              software
              lens
              focalLength
              exposureTime
              fNumber
              iso
              heading
              pitch
            }
            document {
              title
              subject
              summary
              author
              lastModifiedBy
              publisher
              description
              keywords
              pageCount
              worksheetCount
              slideCount
              wordCount
              lineCount
              paragraphCount
              isEncrypted
              hasDigitalSignature
            }
          }
          index
          text
          startTime
          endTime
          pageNumber
          frameNumber
        }
        toolCalls {
          id
          name
          arguments
        }
        tokens
        throughput
        ttft
        completionTime
        timestamp
        modelService
        model
        data
        mimeType
        toolCallId
        toolCallResponse
      }
    }
  }
}
"""

CONTINUE_CONVERSATION_GQL = """
mutation ContinueConversation($id: ID!, $responses: [ConversationToolResponseInput!]!, $correlationId: String) {
  continueConversation(
    id: $id
    responses: $responses
    correlationId: $correlationId
  ) {
    conversation {
      id
    }
    message {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    messageCount
    facets {
      type
      value
      range {
        from
        to
      }
      count
      facet
      observable {
        type
        observable {
          id
          name
        }
      }
    }
    graph {
      nodes {
        id
        name
        type
        metadata
      }
      edges {
        from
        to
        relation
      }
    }
    details {
      modelService
      model
      supportsToolCalling
      sourceCount
      observableCount
      toolCount
      renderedSourceCount
      renderedObservableCount
      renderedToolCount
      rankedSourceCount
      rankedObservableCount
      rankedToolCount
      tokenLimit
      completionTokenLimit
      sources
      formattedSources
      formattedObservables
      formattedInstructions
      formattedTools
      specification
      messages {
        role
        author
        message
        citations {
          content {
            id
            name
            state
            originalDate
            identifier
            uri
            type
            fileType
            mimeType
            format
            formatName
            fileExtension
            fileName
            fileSize
            fileMetadata
            relativeFolderPath
            masterUri
            imageUri
            textUri
            audioUri
            transcriptUri
            snapshotsUri
            snapshotCount
            summary
            customSummary
            keywords
            bullets
            headlines
            posts
            chapters
            questions
            quotes
            video {
              width
              height
              duration
              make
              model
              software
              title
              description
              keywords
              author
            }
            audio {
              keywords
              author
              series
              episode
              episodeType
              season
              publisher
              copyright
              genre
              title
              description
              bitrate
              channels
              sampleRate
              bitsPerSample
              duration
            }
            image {
              width
              height
              resolutionX
              resolutionY
              bitsPerComponent
              components
              projectionType
              orientation
              description
              make
              model
              software
              lens
              focalLength
              exposureTime
              fNumber
              iso
              heading
              pitch
            }
            document {
              title
              subject
              summary
              author
              lastModifiedBy
              publisher
              description
              keywords
              pageCount
              worksheetCount
              slideCount
              wordCount
              lineCount
              paragraphCount
              isEncrypted
              hasDigitalSignature
            }
          }
          index
          text
          startTime
          endTime
          pageNumber
          frameNumber
        }
        toolCalls {
          id
          name
          arguments
        }
        tokens
        throughput
        ttft
        completionTime
        timestamp
        modelService
        model
        data
        mimeType
        toolCallId
        toolCallResponse
      }
    }
  }
}
"""

COUNT_CONVERSATIONS_GQL = """
query CountConversations($filter: ConversationFilter, $correlationId: String) {
  countConversations(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_CONVERSATION_GQL = """
mutation CreateConversation($conversation: ConversationInput!, $correlationId: String) {
  createConversation(conversation: $conversation, correlationId: $correlationId) {
    id
    name
    state
    type
  }
}
"""

DELETE_ALL_CONVERSATIONS_GQL = """
mutation DeleteAllConversations($filter: ConversationFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllConversations(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_CONVERSATION_GQL = """
mutation DeleteConversation($id: ID!) {
  deleteConversation(id: $id) {
    id
    state
  }
}
"""

DELETE_CONVERSATIONS_GQL = """
mutation DeleteConversations($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteConversations(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

FORMAT_CONVERSATION_GQL = """
mutation FormatConversation($prompt: String!, $id: ID, $specification: EntityReferenceInput, $tools: [ToolDefinitionInput!], $systemPrompt: String, $includeDetails: Boolean, $correlationId: String) {
  formatConversation(
    prompt: $prompt
    id: $id
    specification: $specification
    tools: $tools
    systemPrompt: $systemPrompt
    includeDetails: $includeDetails
    correlationId: $correlationId
  ) {
    conversation {
      id
    }
    message {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    messageCount
    facets {
      type
      value
      range {
        from
        to
      }
      count
      facet
      observable {
        type
        observable {
          id
          name
        }
      }
    }
    graph {
      nodes {
        id
        name
        type
        metadata
      }
      edges {
        from
        to
        relation
      }
    }
    details {
      modelService
      model
      supportsToolCalling
      sourceCount
      observableCount
      toolCount
      renderedSourceCount
      renderedObservableCount
      renderedToolCount
      rankedSourceCount
      rankedObservableCount
      rankedToolCount
      tokenLimit
      completionTokenLimit
      sources
      formattedSources
      formattedObservables
      formattedInstructions
      formattedTools
      specification
      messages {
        role
        author
        message
        citations {
          content {
            id
            name
            state
            originalDate
            identifier
            uri
            type
            fileType
            mimeType
            format
            formatName
            fileExtension
            fileName
            fileSize
            fileMetadata
            relativeFolderPath
            masterUri
            imageUri
            textUri
            audioUri
            transcriptUri
            snapshotsUri
            snapshotCount
            summary
            customSummary
            keywords
            bullets
            headlines
            posts
            chapters
            questions
            quotes
            video {
              width
              height
              duration
              make
              model
              software
              title
              description
              keywords
              author
            }
            audio {
              keywords
              author
              series
              episode
              episodeType
              season
              publisher
              copyright
              genre
              title
              description
              bitrate
              channels
              sampleRate
              bitsPerSample
              duration
            }
            image {
              width
              height
              resolutionX
              resolutionY
              bitsPerComponent
              components
              projectionType
              orientation
              description
              make
              model
              software
              lens
              focalLength
              exposureTime
              fNumber
              iso
              heading
              pitch
            }
            document {
              title
              subject
              summary
              author
              lastModifiedBy
              publisher
              description
              keywords
              pageCount
              worksheetCount
              slideCount
              wordCount
              lineCount
              paragraphCount
              isEncrypted
              hasDigitalSignature
            }
          }
          index
          text
          startTime
          endTime
          pageNumber
          frameNumber
        }
        toolCalls {
          id
          name
          arguments
        }
        tokens
        throughput
        ttft
        completionTime
        timestamp
        modelService
        model
        data
        mimeType
        toolCallId
        toolCallResponse
      }
    }
  }
}
"""

GET_CONVERSATION_GQL = """
query GetConversation($id: ID!, $correlationId: String) {
  conversation(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    correlationId
    type
    messages {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    specification {
      id
      name
    }
    fallbacks {
      id
      name
    }
    filter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
    augmentedFilter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
  }
}
"""

PROMPT_GQL = """
mutation Prompt($prompt: String, $mimeType: String, $data: String, $specification: EntityReferenceInput, $messages: [ConversationMessageInput!], $correlationId: String) {
  prompt(
    prompt: $prompt
    mimeType: $mimeType
    data: $data
    specification: $specification
    messages: $messages
    correlationId: $correlationId
  ) {
    specification {
      id
    }
    messages {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    error
  }
}
"""

PROMPT_CONVERSATION_GQL = """
mutation PromptConversation($prompt: String!, $mimeType: String, $data: String, $id: ID, $specification: EntityReferenceInput, $systemPrompt: String, $tools: [ToolDefinitionInput!], $requireTool: Boolean, $includeDetails: Boolean, $correlationId: String) {
  promptConversation(
    prompt: $prompt
    id: $id
    mimeType: $mimeType
    data: $data
    specification: $specification
    tools: $tools
    systemPrompt: $systemPrompt
    requireTool: $requireTool
    includeDetails: $includeDetails
    correlationId: $correlationId
  ) {
    conversation {
      id
    }
    message {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    messageCount
    facets {
      type
      value
      range {
        from
        to
      }
      count
      facet
      observable {
        type
        observable {
          id
          name
        }
      }
    }
    graph {
      nodes {
        id
        name
        type
        metadata
      }
      edges {
        from
        to
        relation
      }
    }
    details {
      modelService
      model
      supportsToolCalling
      sourceCount
      observableCount
      toolCount
      renderedSourceCount
      renderedObservableCount
      renderedToolCount
      rankedSourceCount
      rankedObservableCount
      rankedToolCount
      tokenLimit
      completionTokenLimit
      sources
      formattedSources
      formattedObservables
      formattedInstructions
      formattedTools
      specification
      messages {
        role
        author
        message
        citations {
          content {
            id
            name
            state
            originalDate
            identifier
            uri
            type
            fileType
            mimeType
            format
            formatName
            fileExtension
            fileName
            fileSize
            fileMetadata
            relativeFolderPath
            masterUri
            imageUri
            textUri
            audioUri
            transcriptUri
            snapshotsUri
            snapshotCount
            summary
            customSummary
            keywords
            bullets
            headlines
            posts
            chapters
            questions
            quotes
            video {
              width
              height
              duration
              make
              model
              software
              title
              description
              keywords
              author
            }
            audio {
              keywords
              author
              series
              episode
              episodeType
              season
              publisher
              copyright
              genre
              title
              description
              bitrate
              channels
              sampleRate
              bitsPerSample
              duration
            }
            image {
              width
              height
              resolutionX
              resolutionY
              bitsPerComponent
              components
              projectionType
              orientation
              description
              make
              model
              software
              lens
              focalLength
              exposureTime
              fNumber
              iso
              heading
              pitch
            }
            document {
              title
              subject
              summary
              author
              lastModifiedBy
              publisher
              description
              keywords
              pageCount
              worksheetCount
              slideCount
              wordCount
              lineCount
              paragraphCount
              isEncrypted
              hasDigitalSignature
            }
          }
          index
          text
          startTime
          endTime
          pageNumber
          frameNumber
        }
        toolCalls {
          id
          name
          arguments
        }
        tokens
        throughput
        ttft
        completionTime
        timestamp
        modelService
        model
        data
        mimeType
        toolCallId
        toolCallResponse
      }
    }
  }
}
"""

PUBLISH_CONVERSATION_GQL = """
mutation PublishConversation($id: ID!, $connector: ContentPublishingConnectorInput!, $name: String, $isSynchronous: Boolean, $workflow: EntityReferenceInput, $correlationId: String) {
  publishConversation(
    id: $id
    connector: $connector
    name: $name
    isSynchronous: $isSynchronous
    workflow: $workflow
    correlationId: $correlationId
  ) {
    contents {
      id
      name
      state
      originalDate
      identifier
      markdown
      uri
      type
      fileType
      mimeType
      format
      formatName
      fileExtension
      fileName
      fileSize
      fileMetadata
      relativeFolderPath
      masterUri
      imageUri
      textUri
      audioUri
      transcriptUri
      snapshotsUri
      snapshotCount
      summary
      customSummary
      keywords
      bullets
      headlines
      posts
      chapters
      questions
      quotes
      video {
        width
        height
        duration
        make
        model
        software
        title
        description
        keywords
        author
      }
      audio {
        keywords
        author
        series
        episode
        episodeType
        season
        publisher
        copyright
        genre
        title
        description
        bitrate
        channels
        sampleRate
        bitsPerSample
        duration
      }
      image {
        width
        height
        resolutionX
        resolutionY
        bitsPerComponent
        components
        projectionType
        orientation
        description
        make
        model
        software
        lens
        focalLength
        exposureTime
        fNumber
        iso
        heading
        pitch
      }
      document {
        title
        subject
        summary
        author
        lastModifiedBy
        publisher
        description
        keywords
        pageCount
        worksheetCount
        slideCount
        wordCount
        lineCount
        paragraphCount
        isEncrypted
        hasDigitalSignature
      }
    }
    details {
      contents {
        id
      }
      summaries
      text
      textType
      summarySpecification
      publishSpecification
      summaryTime
      publishTime
    }
  }
}
"""

QUERY_CONVERSATIONS_GQL = """
query QueryConversations($filter: ConversationFilter, $correlationId: String) {
  conversations(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      correlationId
      type
      messages {
        role
        author
        message
        citations {
          content {
            id
            name
            state
            originalDate
            identifier
            uri
            type
            fileType
            mimeType
            format
            formatName
            fileExtension
            fileName
            fileSize
            fileMetadata
            relativeFolderPath
            masterUri
            imageUri
            textUri
            audioUri
            transcriptUri
            snapshotsUri
            snapshotCount
            summary
            customSummary
            keywords
            bullets
            headlines
            posts
            chapters
            questions
            quotes
            video {
              width
              height
              duration
              make
              model
              software
              title
              description
              keywords
              author
            }
            audio {
              keywords
              author
              series
              episode
              episodeType
              season
              publisher
              copyright
              genre
              title
              description
              bitrate
              channels
              sampleRate
              bitsPerSample
              duration
            }
            image {
              width
              height
              resolutionX
              resolutionY
              bitsPerComponent
              components
              projectionType
              orientation
              description
              make
              model
              software
              lens
              focalLength
              exposureTime
              fNumber
              iso
              heading
              pitch
            }
            document {
              title
              subject
              summary
              author
              lastModifiedBy
              publisher
              description
              keywords
              pageCount
              worksheetCount
              slideCount
              wordCount
              lineCount
              paragraphCount
              isEncrypted
              hasDigitalSignature
            }
          }
          index
          text
          startTime
          endTime
          pageNumber
          frameNumber
        }
        toolCalls {
          id
          name
          arguments
        }
        tokens
        throughput
        ttft
        completionTime
        timestamp
        modelService
        model
        data
        mimeType
        toolCallId
        toolCallResponse
      }
      specification {
        id
        name
      }
      fallbacks {
        id
        name
      }
      filter {
        dateRange {
          from
          to
        }
        inLast
        creationDateRange {
          from
          to
        }
        createdInLast
        types
        fileTypes
        formats
        fileExtensions
        fileSizeRange {
          from
          to
        }
        similarContents {
          id
        }
        contents {
          id
        }
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
        or {
          feeds {
            id
          }
          workflows {
            id
          }
          collections {
            id
          }
          users {
            id
          }
          observations {
            type
            observable {
              id
            }
            states
          }
        }
        and {
          feeds {
            id
          }
          workflows {
            id
          }
          collections {
            id
          }
          users {
            id
          }
          observations {
            type
            observable {
              id
            }
            states
          }
        }
        hasObservations
        hasFeeds
        hasCollections
        hasWorkflows
        collectionMode
        observationMode
      }
      augmentedFilter {
        dateRange {
          from
          to
        }
        inLast
        creationDateRange {
          from
          to
        }
        createdInLast
        types
        fileTypes
        formats
        fileExtensions
        fileSizeRange {
          from
          to
        }
        similarContents {
          id
        }
        contents {
          id
        }
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
        or {
          feeds {
            id
          }
          workflows {
            id
          }
          collections {
            id
          }
          users {
            id
          }
          observations {
            type
            observable {
              id
            }
            states
          }
        }
        and {
          feeds {
            id
          }
          workflows {
            id
          }
          collections {
            id
          }
          users {
            id
          }
          observations {
            type
            observable {
              id
            }
            states
          }
        }
        hasObservations
        hasFeeds
        hasCollections
        hasWorkflows
        collectionMode
        observationMode
      }
    }
  }
}
"""

RETRIEVE_SOURCES_GQL = """
mutation RetrieveSources($prompt: String!, $filter: ContentFilter, $augmentedFilter: ContentFilter, $retrievalStrategy: RetrievalStrategyInput, $rerankingStrategy: RerankingStrategyInput, $correlationId: String) {
  retrieveSources(
    prompt: $prompt
    filter: $filter
    augmentedFilter: $augmentedFilter
    retrievalStrategy: $retrievalStrategy
    rerankingStrategy: $rerankingStrategy
    correlationId: $correlationId
  ) {
    results {
      type
      content {
        id
      }
      text
      metadata
      relevance
      startTime
      endTime
      pageNumber
      frameNumber
    }
  }
}
"""

RETRIEVE_VIEW_GQL = """
mutation RetrieveView($prompt: String!, $id: ID!, $retrievalStrategy: RetrievalStrategyInput, $rerankingStrategy: RerankingStrategyInput, $correlationId: String) {
  retrieveView(
    prompt: $prompt
    id: $id
    retrievalStrategy: $retrievalStrategy
    rerankingStrategy: $rerankingStrategy
    correlationId: $correlationId
  ) {
    results {
      type
      content {
        id
      }
      text
      metadata
      relevance
      startTime
      endTime
      pageNumber
      frameNumber
    }
  }
}
"""

REVISE_CONTENT_GQL = """
mutation ReviseContent($prompt: String!, $content: EntityReferenceInput!, $id: ID, $specification: EntityReferenceInput, $correlationId: String) {
  reviseContent(
    prompt: $prompt
    content: $content
    id: $id
    specification: $specification
    correlationId: $correlationId
  ) {
    conversation {
      id
    }
    message {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    messageCount
  }
}
"""

REVISE_ENCODED_IMAGE_GQL = """
mutation ReviseEncodedImage($prompt: String!, $mimeType: String!, $data: String!, $id: ID, $specification: EntityReferenceInput, $correlationId: String) {
  reviseEncodedImage(
    prompt: $prompt
    mimeType: $mimeType
    data: $data
    id: $id
    specification: $specification
    correlationId: $correlationId
  ) {
    conversation {
      id
    }
    message {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    messageCount
  }
}
"""

REVISE_IMAGE_GQL = """
mutation ReviseImage($prompt: String!, $uri: URL!, $id: ID, $specification: EntityReferenceInput, $correlationId: String) {
  reviseImage(
    prompt: $prompt
    uri: $uri
    id: $id
    specification: $specification
    correlationId: $correlationId
  ) {
    conversation {
      id
    }
    message {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    messageCount
  }
}
"""

REVISE_TEXT_GQL = """
mutation ReviseText($prompt: String!, $text: String!, $id: ID, $specification: EntityReferenceInput, $correlationId: String) {
  reviseText(
    prompt: $prompt
    text: $text
    id: $id
    specification: $specification
    correlationId: $correlationId
  ) {
    conversation {
      id
    }
    message {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    messageCount
  }
}
"""

SUGGEST_CONVERSATION_GQL = """
mutation SuggestConversation($id: ID!, $count: Int, $prompt: String, $correlationId: String) {
  suggestConversation(
    id: $id
    count: $count
    prompt: $prompt
    correlationId: $correlationId
  ) {
    prompts
  }
}
"""

UPDATE_CONVERSATION_GQL = """
mutation UpdateConversation($conversation: ConversationUpdateInput!) {
  updateConversation(conversation: $conversation) {
    id
    name
    state
    type
  }
}
"""

COUNT_EVENTS_GQL = """
query CountEvents($filter: EventFilter, $correlationId: String) {
  countEvents(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_EVENT_GQL = """
mutation CreateEvent($event: EventInput!) {
  createEvent(event: $event) {
    id
    name
  }
}
"""

DELETE_ALL_EVENTS_GQL = """
mutation DeleteAllEvents($filter: EventFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllEvents(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_EVENT_GQL = """
mutation DeleteEvent($id: ID!) {
  deleteEvent(id: $id) {
    id
    state
  }
}
"""

DELETE_EVENTS_GQL = """
mutation DeleteEvents($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteEvents(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_EVENT_GQL = """
query GetEvent($id: ID!, $correlationId: String) {
  event(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
    address {
      streetAddress
      city
      region
      country
      postalCode
    }
    startDate
    endDate
    availabilityStartDate
    availabilityEndDate
    price
    minPrice
    maxPrice
    priceCurrency
    isAccessibleForFree
    typicalAgeRange
    organizer
    performer
    sponsor
    eventStatus
  }
}
"""

QUERY_EVENTS_GQL = """
query QueryEvents($filter: EventFilter, $correlationId: String) {
  events(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      startDate
      endDate
      availabilityStartDate
      availabilityEndDate
      price
      minPrice
      maxPrice
      priceCurrency
      isAccessibleForFree
      typicalAgeRange
      organizer
      performer
      sponsor
      eventStatus
    }
  }
}
"""

QUERY_EVENTS_CLUSTERS_GQL = """
query QueryEventsClusters($filter: EventFilter, $clusters: EntityClustersInput, $correlationId: String) {
  events(filter: $filter, clusters: $clusters, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      startDate
      endDate
      availabilityStartDate
      availabilityEndDate
      price
      minPrice
      maxPrice
      priceCurrency
      isAccessibleForFree
      typicalAgeRange
      organizer
      performer
      sponsor
      eventStatus
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_EVENT_GQL = """
mutation UpdateEvent($event: EventUpdateInput!) {
  updateEvent(event: $event) {
    id
    name
  }
}
"""

COUNT_FEEDS_GQL = """
query CountFeeds($filter: FeedFilter, $correlationId: String) {
  countFeeds(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_FEED_GQL = """
mutation CreateFeed($feed: FeedInput!, $correlationId: String) {
  createFeed(feed: $feed, correlationId: $correlationId) {
    id
    name
    state
    type
    syncMode
  }
}
"""

DELETE_ALL_FEEDS_GQL = """
mutation DeleteAllFeeds($filter: FeedFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllFeeds(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_FEED_GQL = """
mutation DeleteFeed($id: ID!) {
  deleteFeed(id: $id) {
    id
    state
  }
}
"""

DELETE_FEEDS_GQL = """
mutation DeleteFeeds($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteFeeds(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

DISABLE_FEED_GQL = """
mutation DisableFeed($id: ID!) {
  disableFeed(id: $id) {
    id
    state
  }
}
"""

ENABLE_FEED_GQL = """
mutation EnableFeed($id: ID!) {
  enableFeed(id: $id) {
    id
    state
  }
}
"""

FEED_EXISTS_GQL = """
query FeedExists($filter: FeedFilter, $correlationId: String) {
  feedExists(filter: $filter, correlationId: $correlationId) {
    result
  }
}
"""

GET_FEED_GQL = """
query GetFeed($id: ID!, $correlationId: String) {
  feed(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    correlationId
    type
    syncMode
    site {
      siteType
      type
      isRecursive
      allowedPaths
      excludedPaths
      s3 {
        accessKey
        secretAccessKey
        bucketName
        prefix
        region
      }
      azureBlob {
        storageAccessKey
        accountName
        containerName
        prefix
        listType
      }
      azureFile {
        storageAccessKey
        accountName
        shareName
        prefix
      }
      google {
        credentials
        containerName
        prefix
      }
      sharePoint {
        authenticationType
        accountName
        libraryId
        folderId
        tenantId
        clientId
        clientSecret
        refreshToken
        connector {
          id
        }
      }
      oneDrive {
        authenticationType
        folderId
        files
        clientId
        clientSecret
        refreshToken
        connector {
          id
        }
      }
      googleDrive {
        authenticationType
        folderId
        files
        refreshToken
        clientId
        clientSecret
        serviceAccountJson
        connector {
          id
        }
      }
      dropbox {
        authenticationType
        path
        appKey
        appSecret
        refreshToken
      }
      box {
        authenticationType
        folderId
        clientId
        clientSecret
        refreshToken
        redirectUri
      }
      github {
        authenticationType
        uri
        repositoryOwner
        repositoryName
        clientId
        clientSecret
        refreshToken
        personalAccessToken
        connector {
          id
        }
      }
      readLimit
    }
    email {
      type
      includeAttachments
      google {
        type
        filter
        includeSpam
        excludeSentItems
        includeDeletedItems
        inboxOnly
        authenticationType
        refreshToken
        clientId
        clientSecret
        connector {
          id
        }
      }
      microsoft {
        type
        filter
        includeSpam
        excludeSentItems
        includeDeletedItems
        inboxOnly
        authenticationType
        refreshToken
        clientId
        clientSecret
        connector {
          id
        }
      }
      readLimit
    }
    issue {
      type
      includeAttachments
      jira {
        uri
        project
        email
        token
        offset
      }
      linear {
        key
        project
      }
      github {
        authenticationType
        uri
        repositoryOwner
        repositoryName
        refreshToken
        personalAccessToken
        connector {
          id
        }
      }
      intercom {
        accessToken
      }
      zendesk {
        subdomain
        accessToken
      }
      trello {
        key
        token
        identifiers
        type
      }
      attio {
        apiKey
      }
      readLimit
    }
    commit {
      type
      github {
        authenticationType
        uri
        repositoryOwner
        repositoryName
        refreshToken
        personalAccessToken
        connector {
          id
        }
      }
      readLimit
    }
    pullRequest {
      type
      github {
        authenticationType
        uri
        repositoryOwner
        repositoryName
        refreshToken
        personalAccessToken
        connector {
          id
        }
      }
      readLimit
    }
    crm {
      type
      attio {
        authenticationType
        apiKey
      }
      googleContacts {
        authenticationType
        clientId
        clientSecret
        refreshToken
        connector {
          id
        }
      }
      microsoftContacts {
        authenticationType
        clientId
        clientSecret
        refreshToken
        tenantId
        connector {
          id
        }
      }
      readLimit
    }
    calendar {
      type
      includeAttachments
      enableMeetingRecording
      meetingBotName
      google {
        type
        calendarId
        beforeDate
        afterDate
        authenticationType
        refreshToken
        clientId
        clientSecret
        connector {
          id
        }
      }
      microsoft {
        type
        calendarId
        beforeDate
        afterDate
        authenticationType
        refreshToken
        clientId
        clientSecret
        connector {
          id
        }
      }
      readLimit
    }
    rss {
      readLimit
      uri
    }
    web {
      readLimit
      uri
      includeFiles
      allowedPaths
      excludedPaths
    }
    search {
      readLimit
      type
      text
    }
    reddit {
      readLimit
      subredditName
    }
    notion {
      readLimit
      token
      identifiers
      type
    }
    intercom {
      readLimit
      accessToken
    }
    zendesk {
      readLimit
      subdomain
      accessToken
    }
    youtube {
      readLimit
      type
      videoName
      videoIdentifiers
      channelIdentifier
      playlistIdentifier
    }
    twitter {
      readLimit
      token
      type
      userName
      query
      includeAttachments
    }
    slack {
      readLimit
      type
      token
      channel
      includeAttachments
    }
    microsoftTeams {
      readLimit
      type
      authenticationType
      clientId
      clientSecret
      refreshToken
      connector {
        id
      }
      teamId
      channelId
    }
    discord {
      readLimit
      type
      token
      channel
      includeAttachments
    }
    attio {
      readLimit
      apiKey
    }
    research {
      readLimit
      type
      query
      parallel {
        processor
      }
    }
    entity {
      type
      query
      readLimit
      parallel {
        generator
      }
    }
    error
    lastPostDate
    lastReadDate
    readCount
    workflow {
      id
      name
    }
    schedulePolicy {
      recurrenceType
      repeatInterval
    }
  }
}
"""

GET_SHARE_POINT_CONSENT_URI_GQL = """
query GetSharePointConsentUri($tenantId: ID!) {
  sharePointConsentUri(tenantId: $tenantId) {
    uri
  }
}
"""

IS_FEED_DONE_GQL = """
query IsFeedDone($id: ID!) {
  isFeedDone(id: $id) {
    result
  }
}
"""

QUERY_BOX_FOLDERS_GQL = """
query QueryBoxFolders($properties: BoxFoldersInput!, $folderId: ID) {
  boxFolders(properties: $properties, folderId: $folderId) {
    results {
      folderName
      folderId
    }
  }
}
"""

QUERY_DISCORD_CHANNELS_GQL = """
query QueryDiscordChannels($properties: DiscordChannelsInput!) {
  discordChannels(properties: $properties) {
    results {
      channelName
      channelId
    }
  }
}
"""

QUERY_DISCORD_GUILDS_GQL = """
query QueryDiscordGuilds($properties: DiscordGuildsInput!) {
  discordGuilds(properties: $properties) {
    results {
      guildName
      guildId
    }
  }
}
"""

QUERY_DROPBOX_FOLDERS_GQL = """
query QueryDropboxFolders($properties: DropboxFoldersInput!, $folderPath: String) {
  dropboxFolders(properties: $properties, folderPath: $folderPath) {
    results {
      folderName
      folderId
    }
  }
}
"""

QUERY_FEEDS_GQL = """
query QueryFeeds($filter: FeedFilter, $correlationId: String) {
  feeds(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      correlationId
      type
      syncMode
      site {
        siteType
        type
        isRecursive
        allowedPaths
        excludedPaths
        s3 {
          accessKey
          secretAccessKey
          bucketName
          prefix
          region
        }
        azureBlob {
          storageAccessKey
          accountName
          containerName
          prefix
          listType
        }
        azureFile {
          storageAccessKey
          accountName
          shareName
          prefix
        }
        google {
          credentials
          containerName
          prefix
        }
        sharePoint {
          authenticationType
          accountName
          libraryId
          folderId
          tenantId
          clientId
          clientSecret
          refreshToken
          connector {
            id
          }
        }
        oneDrive {
          authenticationType
          folderId
          files
          clientId
          clientSecret
          refreshToken
          connector {
            id
          }
        }
        googleDrive {
          authenticationType
          folderId
          files
          refreshToken
          clientId
          clientSecret
          serviceAccountJson
          connector {
            id
          }
        }
        dropbox {
          authenticationType
          path
          appKey
          appSecret
          refreshToken
        }
        box {
          authenticationType
          folderId
          clientId
          clientSecret
          refreshToken
          redirectUri
        }
        github {
          authenticationType
          uri
          repositoryOwner
          repositoryName
          clientId
          clientSecret
          refreshToken
          personalAccessToken
          connector {
            id
          }
        }
        readLimit
      }
      email {
        type
        includeAttachments
        google {
          type
          filter
          includeSpam
          excludeSentItems
          includeDeletedItems
          inboxOnly
          authenticationType
          refreshToken
          clientId
          clientSecret
          connector {
            id
          }
        }
        microsoft {
          type
          filter
          includeSpam
          excludeSentItems
          includeDeletedItems
          inboxOnly
          authenticationType
          refreshToken
          clientId
          clientSecret
          connector {
            id
          }
        }
        readLimit
      }
      issue {
        type
        includeAttachments
        jira {
          uri
          project
          email
          token
          offset
        }
        linear {
          key
          project
        }
        github {
          authenticationType
          uri
          repositoryOwner
          repositoryName
          refreshToken
          personalAccessToken
          connector {
            id
          }
        }
        intercom {
          accessToken
        }
        zendesk {
          subdomain
          accessToken
        }
        trello {
          key
          token
          identifiers
          type
        }
        attio {
          apiKey
        }
        readLimit
      }
      commit {
        type
        github {
          authenticationType
          uri
          repositoryOwner
          repositoryName
          refreshToken
          personalAccessToken
          connector {
            id
          }
        }
        readLimit
      }
      pullRequest {
        type
        github {
          authenticationType
          uri
          repositoryOwner
          repositoryName
          refreshToken
          personalAccessToken
          connector {
            id
          }
        }
        readLimit
      }
      crm {
        type
        attio {
          authenticationType
          apiKey
        }
        googleContacts {
          authenticationType
          clientId
          clientSecret
          refreshToken
          connector {
            id
          }
        }
        microsoftContacts {
          authenticationType
          clientId
          clientSecret
          refreshToken
          tenantId
          connector {
            id
          }
        }
        readLimit
      }
      calendar {
        type
        includeAttachments
        enableMeetingRecording
        meetingBotName
        google {
          type
          calendarId
          beforeDate
          afterDate
          authenticationType
          refreshToken
          clientId
          clientSecret
          connector {
            id
          }
        }
        microsoft {
          type
          calendarId
          beforeDate
          afterDate
          authenticationType
          refreshToken
          clientId
          clientSecret
          connector {
            id
          }
        }
        readLimit
      }
      rss {
        readLimit
        uri
      }
      web {
        readLimit
        uri
        includeFiles
        allowedPaths
        excludedPaths
      }
      search {
        readLimit
        type
        text
      }
      reddit {
        readLimit
        subredditName
      }
      notion {
        readLimit
        token
        identifiers
        type
      }
      intercom {
        readLimit
        accessToken
      }
      zendesk {
        readLimit
        subdomain
        accessToken
      }
      youtube {
        readLimit
        type
        videoName
        videoIdentifiers
        channelIdentifier
        playlistIdentifier
      }
      twitter {
        readLimit
        token
        type
        userName
        query
        includeAttachments
      }
      slack {
        readLimit
        type
        token
        channel
        includeAttachments
      }
      microsoftTeams {
        readLimit
        type
        authenticationType
        clientId
        clientSecret
        refreshToken
        connector {
          id
        }
        teamId
        channelId
      }
      discord {
        readLimit
        type
        token
        channel
        includeAttachments
      }
      attio {
        readLimit
        apiKey
      }
      research {
        readLimit
        type
        query
        parallel {
          processor
        }
      }
      entity {
        type
        query
        readLimit
        parallel {
          generator
        }
      }
      error
      lastPostDate
      lastReadDate
      readCount
      workflow {
        id
        name
      }
      schedulePolicy {
        recurrenceType
        repeatInterval
      }
    }
  }
}
"""

QUERY_GIT_HUB_REPOSITORIES_GQL = """
query QueryGitHubRepositories($properties: GitHubRepositoriesInput!, $sortBy: GitHubRepositorySortTypes) {
  gitHubRepositories(properties: $properties, sortBy: $sortBy) {
    results {
      repositoryOwner
      repositoryName
      repositoryFullName
      description
      isPrivate
      stargazersCount
      forksCount
      pushedAt
      createdAt
      isOwner
      language
    }
  }
}
"""

QUERY_GOOGLE_CALENDARS_GQL = """
query QueryGoogleCalendars($properties: GoogleCalendarsInput!) {
  googleCalendars(properties: $properties) {
    results {
      calendarName
      calendarId
    }
  }
}
"""

QUERY_GOOGLE_DRIVE_FOLDERS_GQL = """
query QueryGoogleDriveFolders($properties: GoogleDriveFoldersInput!, $folderId: ID) {
  googleDriveFolders(properties: $properties, folderId: $folderId) {
    results {
      folderName
      folderId
    }
  }
}
"""

QUERY_LINEAR_PROJECTS_GQL = """
query QueryLinearProjects($properties: LinearProjectsInput!) {
  linearProjects(properties: $properties) {
    results
  }
}
"""

QUERY_MICROSOFT_CALENDARS_GQL = """
query QueryMicrosoftCalendars($properties: MicrosoftCalendarsInput!) {
  microsoftCalendars(properties: $properties) {
    results {
      calendarName
      calendarId
    }
  }
}
"""

QUERY_MICROSOFT_TEAMS_CHANNELS_GQL = """
query QueryMicrosoftTeamsChannels($properties: MicrosoftTeamsChannelsInput!, $teamId: ID!) {
  microsoftTeamsChannels(properties: $properties, teamId: $teamId) {
    results {
      channelName
      channelId
    }
  }
}
"""

QUERY_MICROSOFT_TEAMS_TEAMS_GQL = """
query QueryMicrosoftTeamsTeams($properties: MicrosoftTeamsTeamsInput!) {
  microsoftTeamsTeams(properties: $properties) {
    results {
      teamName
      teamId
    }
  }
}
"""

QUERY_NOTION_DATABASES_GQL = """
query QueryNotionDatabases($properties: NotionDatabasesInput!) {
  notionDatabases(properties: $properties) {
    results {
      name
      identifier
    }
  }
}
"""

QUERY_NOTION_PAGES_GQL = """
query QueryNotionPages($properties: NotionPagesInput!, $identifier: String!) {
  notionPages(properties: $properties, identifier: $identifier) {
    results {
      name
      identifier
    }
  }
}
"""

QUERY_ONE_DRIVE_FOLDERS_GQL = """
query QueryOneDriveFolders($properties: OneDriveFoldersInput!, $folderId: ID) {
  oneDriveFolders(properties: $properties, folderId: $folderId) {
    results {
      folderName
      folderId
    }
  }
}
"""

QUERY_SHARE_POINT_FOLDERS_GQL = """
query QuerySharePointFolders($properties: SharePointFoldersInput!, $libraryId: ID!, $folderId: ID) {
  sharePointFolders(
    properties: $properties
    libraryId: $libraryId
    folderId: $folderId
  ) {
    accountName
    results {
      folderName
      folderId
    }
  }
}
"""

QUERY_SHARE_POINT_LIBRARIES_GQL = """
query QuerySharePointLibraries($properties: SharePointLibrariesInput!) {
  sharePointLibraries(properties: $properties) {
    accountName
    results {
      libraryName
      libraryId
      siteName
      siteId
    }
  }
}
"""

QUERY_SLACK_CHANNELS_GQL = """
query QuerySlackChannels($properties: SlackChannelsInput!) {
  slackChannels(properties: $properties) {
    results
  }
}
"""

TRIGGER_FEED_GQL = """
mutation TriggerFeed($id: ID!) {
  triggerFeed(id: $id) {
    id
    state
  }
}
"""

UPDATE_FEED_GQL = """
mutation UpdateFeed($feed: FeedUpdateInput!) {
  updateFeed(feed: $feed) {
    id
    name
    state
    type
    syncMode
  }
}
"""

COUNT_INVESTMENTS_GQL = """
query CountInvestments($filter: InvestmentFilter, $correlationId: String) {
  countInvestments(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_INVESTMENT_GQL = """
mutation CreateInvestment($investment: InvestmentInput!) {
  createInvestment(investment: $investment) {
    id
    name
  }
}
"""

DELETE_ALL_INVESTMENTS_GQL = """
mutation DeleteAllInvestments($filter: InvestmentFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllInvestments(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_INVESTMENT_GQL = """
mutation DeleteInvestment($id: ID!) {
  deleteInvestment(id: $id) {
    id
    state
  }
}
"""

DELETE_INVESTMENTS_GQL = """
mutation DeleteInvestments($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteInvestments(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_INVESTMENT_GQL = """
query GetInvestment($id: ID!, $correlationId: String) {
  investment(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
    amount
    amountCurrency
    status
    stage
    investmentDate
    roundSize
    roundSizeCurrency
    postValuation
    postValuationCurrency
    sharesOwned
    vehicle
    entryPricePerShare
    currentPricePerShare
    discountPercent
    proRataRights
    investor {
      id
      name
    }
    organization {
      id
      name
    }
  }
}
"""

QUERY_INVESTMENTS_GQL = """
query QueryInvestments($filter: InvestmentFilter, $correlationId: String) {
  investments(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      amount
      amountCurrency
      status
      stage
      investmentDate
      roundSize
      roundSizeCurrency
      postValuation
      postValuationCurrency
      sharesOwned
      vehicle
      entryPricePerShare
      currentPricePerShare
      discountPercent
      proRataRights
    }
  }
}
"""

QUERY_INVESTMENTS_CLUSTERS_GQL = """
query QueryInvestmentsClusters($filter: InvestmentFilter, $clusters: EntityClustersInput, $correlationId: String) {
  investments(filter: $filter, clusters: $clusters, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      amount
      amountCurrency
      status
      stage
      investmentDate
      roundSize
      roundSizeCurrency
      postValuation
      postValuationCurrency
      sharesOwned
      vehicle
      entryPricePerShare
      currentPricePerShare
      discountPercent
      proRataRights
      investor {
        id
        name
      }
      organization {
        id
        name
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

QUERY_INVESTMENTS_EXPANDED_GQL = """
query QueryInvestmentsExpanded($filter: InvestmentFilter, $correlationId: String) {
  investments(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      amount
      amountCurrency
      status
      stage
      investmentDate
      roundSize
      roundSizeCurrency
      postValuation
      postValuationCurrency
      sharesOwned
      vehicle
      entryPricePerShare
      currentPricePerShare
      discountPercent
      proRataRights
      investor {
        id
        name
      }
      organization {
        id
        name
      }
    }
  }
}
"""

UPDATE_INVESTMENT_GQL = """
mutation UpdateInvestment($investment: InvestmentUpdateInput!) {
  updateInvestment(investment: $investment) {
    id
    name
  }
}
"""

COUNT_INVESTMENT_FUNDS_GQL = """
query CountInvestmentFunds($filter: InvestmentFundFilter, $correlationId: String) {
  countInvestmentFunds(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_INVESTMENT_FUND_GQL = """
mutation CreateInvestmentFund($investmentFund: InvestmentFundInput!) {
  createInvestmentFund(investmentFund: $investmentFund) {
    id
    name
  }
}
"""

DELETE_ALL_INVESTMENT_FUNDS_GQL = """
mutation DeleteAllInvestmentFunds($filter: InvestmentFundFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllInvestmentFunds(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_INVESTMENT_FUND_GQL = """
mutation DeleteInvestmentFund($id: ID!) {
  deleteInvestmentFund(id: $id) {
    id
    state
  }
}
"""

DELETE_INVESTMENT_FUNDS_GQL = """
mutation DeleteInvestmentFunds($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteInvestmentFunds(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_INVESTMENT_FUND_GQL = """
query GetInvestmentFund($id: ID!, $correlationId: String) {
  investmentFund(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
    amount
    amountCurrency
    fundType
    vintage
    targetSize
    targetSizeCurrency
    organizations {
      id
      name
    }
    investments {
      id
      name
    }
    parentFund {
      id
      name
    }
    childFunds {
      id
      name
    }
  }
}
"""

QUERY_INVESTMENT_FUNDS_GQL = """
query QueryInvestmentFunds($filter: InvestmentFundFilter, $correlationId: String) {
  investmentFunds(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      amount
      amountCurrency
      fundType
      vintage
      targetSize
      targetSizeCurrency
    }
  }
}
"""

QUERY_INVESTMENT_FUNDS_CLUSTERS_GQL = """
query QueryInvestmentFundsClusters($filter: InvestmentFundFilter, $clusters: EntityClustersInput, $correlationId: String) {
  investmentFunds(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      amount
      amountCurrency
      fundType
      vintage
      targetSize
      targetSizeCurrency
      organizations {
        id
        name
      }
      investments {
        id
        name
      }
      parentFund {
        id
        name
      }
      childFunds {
        id
        name
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

QUERY_INVESTMENT_FUNDS_EXPANDED_GQL = """
query QueryInvestmentFundsExpanded($filter: InvestmentFundFilter, $correlationId: String) {
  investmentFunds(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      amount
      amountCurrency
      fundType
      vintage
      targetSize
      targetSizeCurrency
      organizations {
        id
        name
      }
      investments {
        id
        name
      }
      parentFund {
        id
        name
      }
      childFunds {
        id
        name
      }
    }
  }
}
"""

UPDATE_INVESTMENT_FUND_GQL = """
mutation UpdateInvestmentFund($investmentFund: InvestmentFundUpdateInput!) {
  updateInvestmentFund(investmentFund: $investmentFund) {
    id
    name
  }
}
"""

COUNT_LABELS_GQL = """
query CountLabels($filter: LabelFilter, $correlationId: String) {
  countLabels(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_LABEL_GQL = """
mutation CreateLabel($label: LabelInput!) {
  createLabel(label: $label) {
    id
    name
  }
}
"""

DELETE_ALL_LABELS_GQL = """
mutation DeleteAllLabels($filter: LabelFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllLabels(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_LABEL_GQL = """
mutation DeleteLabel($id: ID!) {
  deleteLabel(id: $id) {
    id
    state
  }
}
"""

DELETE_LABELS_GQL = """
mutation DeleteLabels($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteLabels(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_LABEL_GQL = """
query GetLabel($id: ID!, $correlationId: String) {
  label(id: $id, correlationId: $correlationId) {
    id
    name
    description
    creationDate
    feeds {
      id
      name
    }
  }
}
"""

QUERY_LABELS_GQL = """
query QueryLabels($filter: LabelFilter, $correlationId: String) {
  labels(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      description
      creationDate
      relevance
      feeds {
        id
        name
      }
    }
  }
}
"""

UPDATE_LABEL_GQL = """
mutation UpdateLabel($label: LabelUpdateInput!) {
  updateLabel(label: $label) {
    id
    name
  }
}
"""

UPSERT_LABEL_GQL = """
mutation UpsertLabel($label: LabelInput!) {
  upsertLabel(label: $label) {
    id
    name
  }
}
"""

COUNT_MEDICAL_CONDITIONS_GQL = """
query CountMedicalConditions($filter: MedicalConditionFilter, $correlationId: String) {
  countMedicalConditions(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_CONDITION_GQL = """
mutation CreateMedicalCondition($medicalCondition: MedicalConditionInput!) {
  createMedicalCondition(medicalCondition: $medicalCondition) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_CONDITIONS_GQL = """
mutation DeleteAllMedicalConditions($filter: MedicalConditionFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalConditions(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_CONDITION_GQL = """
mutation DeleteMedicalCondition($id: ID!) {
  deleteMedicalCondition(id: $id) {
    id
    state
  }
}
"""

DELETE_MEDICAL_CONDITIONS_GQL = """
mutation DeleteMedicalConditions($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalConditions(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_MEDICAL_CONDITION_GQL = """
query GetMedicalCondition($id: ID!, $correlationId: String) {
  medicalCondition(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_MEDICAL_CONDITIONS_GQL = """
query QueryMedicalConditions($filter: MedicalConditionFilter, $correlationId: String) {
  medicalConditions(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_MEDICAL_CONDITIONS_CLUSTERS_GQL = """
query QueryMedicalConditionsClusters($filter: MedicalConditionFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalConditions(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_CONDITION_GQL = """
mutation UpdateMedicalCondition($medicalCondition: MedicalConditionUpdateInput!) {
  updateMedicalCondition(medicalCondition: $medicalCondition) {
    id
    name
  }
}
"""

COUNT_MEDICAL_CONTRAINDICATIONS_GQL = """
query CountMedicalContraindications($filter: MedicalContraindicationFilter, $correlationId: String) {
  countMedicalContraindications(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_CONTRAINDICATION_GQL = """
mutation CreateMedicalContraindication($medicalContraindication: MedicalContraindicationInput!) {
  createMedicalContraindication(medicalContraindication: $medicalContraindication) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_CONTRAINDICATIONS_GQL = """
mutation DeleteAllMedicalContraindications($filter: MedicalContraindicationFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalContraindications(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_CONTRAINDICATION_GQL = """
mutation DeleteMedicalContraindication($id: ID!) {
  deleteMedicalContraindication(id: $id) {
    id
    state
  }
}
"""

DELETE_MEDICAL_CONTRAINDICATIONS_GQL = """
mutation DeleteMedicalContraindications($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalContraindications(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_MEDICAL_CONTRAINDICATION_GQL = """
query GetMedicalContraindication($id: ID!, $correlationId: String) {
  medicalContraindication(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_MEDICAL_CONTRAINDICATIONS_GQL = """
query QueryMedicalContraindications($filter: MedicalContraindicationFilter, $correlationId: String) {
  medicalContraindications(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_MEDICAL_CONTRAINDICATIONS_CLUSTERS_GQL = """
query QueryMedicalContraindicationsClusters($filter: MedicalContraindicationFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalContraindications(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_CONTRAINDICATION_GQL = """
mutation UpdateMedicalContraindication($medicalContraindication: MedicalContraindicationUpdateInput!) {
  updateMedicalContraindication(medicalContraindication: $medicalContraindication) {
    id
    name
  }
}
"""

COUNT_MEDICAL_DEVICES_GQL = """
query CountMedicalDevices($filter: MedicalDeviceFilter, $correlationId: String) {
  countMedicalDevices(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_DEVICE_GQL = """
mutation CreateMedicalDevice($medicalDevice: MedicalDeviceInput!) {
  createMedicalDevice(medicalDevice: $medicalDevice) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_DEVICES_GQL = """
mutation DeleteAllMedicalDevices($filter: MedicalDeviceFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalDevices(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_DEVICE_GQL = """
mutation DeleteMedicalDevice($id: ID!) {
  deleteMedicalDevice(id: $id) {
    id
    state
  }
}
"""

DELETE_MEDICAL_DEVICES_GQL = """
mutation DeleteMedicalDevices($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalDevices(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_MEDICAL_DEVICE_GQL = """
query GetMedicalDevice($id: ID!, $correlationId: String) {
  medicalDevice(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_MEDICAL_DEVICES_GQL = """
query QueryMedicalDevices($filter: MedicalDeviceFilter, $correlationId: String) {
  medicalDevices(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_MEDICAL_DEVICES_CLUSTERS_GQL = """
query QueryMedicalDevicesClusters($filter: MedicalDeviceFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalDevices(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_DEVICE_GQL = """
mutation UpdateMedicalDevice($medicalDevice: MedicalDeviceUpdateInput!) {
  updateMedicalDevice(medicalDevice: $medicalDevice) {
    id
    name
  }
}
"""

COUNT_MEDICAL_DRUGS_GQL = """
query CountMedicalDrugs($filter: MedicalDrugFilter, $correlationId: String) {
  countMedicalDrugs(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_DRUG_GQL = """
mutation CreateMedicalDrug($medicalDrug: MedicalDrugInput!) {
  createMedicalDrug(medicalDrug: $medicalDrug) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_DRUGS_GQL = """
mutation DeleteAllMedicalDrugs($filter: MedicalDrugFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalDrugs(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_DRUG_GQL = """
mutation DeleteMedicalDrug($id: ID!) {
  deleteMedicalDrug(id: $id) {
    id
    state
  }
}
"""

DELETE_MEDICAL_DRUGS_GQL = """
mutation DeleteMedicalDrugs($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalDrugs(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_MEDICAL_DRUG_GQL = """
query GetMedicalDrug($id: ID!, $correlationId: String) {
  medicalDrug(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_MEDICAL_DRUGS_GQL = """
query QueryMedicalDrugs($filter: MedicalDrugFilter, $correlationId: String) {
  medicalDrugs(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_MEDICAL_DRUGS_CLUSTERS_GQL = """
query QueryMedicalDrugsClusters($filter: MedicalDrugFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalDrugs(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_DRUG_GQL = """
mutation UpdateMedicalDrug($medicalDrug: MedicalDrugUpdateInput!) {
  updateMedicalDrug(medicalDrug: $medicalDrug) {
    id
    name
  }
}
"""

COUNT_MEDICAL_DRUG_CLASSES_GQL = """
query CountMedicalDrugClasses($filter: MedicalDrugClassFilter, $correlationId: String) {
  countMedicalDrugClasses(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_DRUG_CLASS_GQL = """
mutation CreateMedicalDrugClass($medicalDrugClass: MedicalDrugClassInput!) {
  createMedicalDrugClass(medicalDrugClass: $medicalDrugClass) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_DRUG_CLASSES_GQL = """
mutation DeleteAllMedicalDrugClasses($filter: MedicalDrugClassFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalDrugClasses(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_DRUG_CLASS_GQL = """
mutation DeleteMedicalDrugClass($id: ID!) {
  deleteMedicalDrugClass(id: $id) {
    id
    state
  }
}
"""

DELETE_MEDICAL_DRUG_CLASSES_GQL = """
mutation DeleteMedicalDrugClasses($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalDrugClasses(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_MEDICAL_DRUG_CLASS_GQL = """
query GetMedicalDrugClass($id: ID!, $correlationId: String) {
  medicalDrugClass(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_MEDICAL_DRUG_CLASSES_GQL = """
query QueryMedicalDrugClasses($filter: MedicalDrugClassFilter, $correlationId: String) {
  medicalDrugClasses(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_MEDICAL_DRUG_CLASSES_CLUSTERS_GQL = """
query QueryMedicalDrugClassesClusters($filter: MedicalDrugClassFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalDrugClasses(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_DRUG_CLASS_GQL = """
mutation UpdateMedicalDrugClass($medicalDrugClass: MedicalDrugClassUpdateInput!) {
  updateMedicalDrugClass(medicalDrugClass: $medicalDrugClass) {
    id
    name
  }
}
"""

COUNT_MEDICAL_GUIDELINES_GQL = """
query CountMedicalGuidelines($filter: MedicalGuidelineFilter, $correlationId: String) {
  countMedicalGuidelines(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_GUIDELINE_GQL = """
mutation CreateMedicalGuideline($medicalGuideline: MedicalGuidelineInput!) {
  createMedicalGuideline(medicalGuideline: $medicalGuideline) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_GUIDELINES_GQL = """
mutation DeleteAllMedicalGuidelines($filter: MedicalGuidelineFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalGuidelines(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_GUIDELINE_GQL = """
mutation DeleteMedicalGuideline($id: ID!) {
  deleteMedicalGuideline(id: $id) {
    id
    state
  }
}
"""

DELETE_MEDICAL_GUIDELINES_GQL = """
mutation DeleteMedicalGuidelines($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalGuidelines(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_MEDICAL_GUIDELINE_GQL = """
query GetMedicalGuideline($id: ID!, $correlationId: String) {
  medicalGuideline(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_MEDICAL_GUIDELINES_GQL = """
query QueryMedicalGuidelines($filter: MedicalGuidelineFilter, $correlationId: String) {
  medicalGuidelines(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_MEDICAL_GUIDELINES_CLUSTERS_GQL = """
query QueryMedicalGuidelinesClusters($filter: MedicalGuidelineFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalGuidelines(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_GUIDELINE_GQL = """
mutation UpdateMedicalGuideline($medicalGuideline: MedicalGuidelineUpdateInput!) {
  updateMedicalGuideline(medicalGuideline: $medicalGuideline) {
    id
    name
  }
}
"""

COUNT_MEDICAL_INDICATIONS_GQL = """
query CountMedicalIndications($filter: MedicalIndicationFilter, $correlationId: String) {
  countMedicalIndications(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_INDICATION_GQL = """
mutation CreateMedicalIndication($medicalIndication: MedicalIndicationInput!) {
  createMedicalIndication(medicalIndication: $medicalIndication) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_INDICATIONS_GQL = """
mutation DeleteAllMedicalIndications($filter: MedicalIndicationFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalIndications(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_INDICATION_GQL = """
mutation DeleteMedicalIndication($id: ID!) {
  deleteMedicalIndication(id: $id) {
    id
    state
  }
}
"""

DELETE_MEDICAL_INDICATIONS_GQL = """
mutation DeleteMedicalIndications($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalIndications(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_MEDICAL_INDICATION_GQL = """
query GetMedicalIndication($id: ID!, $correlationId: String) {
  medicalIndication(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_MEDICAL_INDICATIONS_GQL = """
query QueryMedicalIndications($filter: MedicalIndicationFilter, $correlationId: String) {
  medicalIndications(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_MEDICAL_INDICATIONS_CLUSTERS_GQL = """
query QueryMedicalIndicationsClusters($filter: MedicalIndicationFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalIndications(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_INDICATION_GQL = """
mutation UpdateMedicalIndication($medicalIndication: MedicalIndicationUpdateInput!) {
  updateMedicalIndication(medicalIndication: $medicalIndication) {
    id
    name
  }
}
"""

COUNT_MEDICAL_PROCEDURES_GQL = """
query CountMedicalProcedures($filter: MedicalProcedureFilter, $correlationId: String) {
  countMedicalProcedures(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_PROCEDURE_GQL = """
mutation CreateMedicalProcedure($medicalProcedure: MedicalProcedureInput!) {
  createMedicalProcedure(medicalProcedure: $medicalProcedure) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_PROCEDURES_GQL = """
mutation DeleteAllMedicalProcedures($filter: MedicalProcedureFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalProcedures(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_PROCEDURE_GQL = """
mutation DeleteMedicalProcedure($id: ID!) {
  deleteMedicalProcedure(id: $id) {
    id
    state
  }
}
"""

DELETE_MEDICAL_PROCEDURES_GQL = """
mutation DeleteMedicalProcedures($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalProcedures(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_MEDICAL_PROCEDURE_GQL = """
query GetMedicalProcedure($id: ID!, $correlationId: String) {
  medicalProcedure(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_MEDICAL_PROCEDURES_GQL = """
query QueryMedicalProcedures($filter: MedicalProcedureFilter, $correlationId: String) {
  medicalProcedures(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_MEDICAL_PROCEDURES_CLUSTERS_GQL = """
query QueryMedicalProceduresClusters($filter: MedicalProcedureFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalProcedures(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_PROCEDURE_GQL = """
mutation UpdateMedicalProcedure($medicalProcedure: MedicalProcedureUpdateInput!) {
  updateMedicalProcedure(medicalProcedure: $medicalProcedure) {
    id
    name
  }
}
"""

COUNT_MEDICAL_STUDIES_GQL = """
query CountMedicalStudies($filter: MedicalStudyFilter, $correlationId: String) {
  countMedicalStudies(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_STUDY_GQL = """
mutation CreateMedicalStudy($medicalStudy: MedicalStudyInput!) {
  createMedicalStudy(medicalStudy: $medicalStudy) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_STUDIES_GQL = """
mutation DeleteAllMedicalStudies($filter: MedicalStudyFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalStudies(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_STUDIES_GQL = """
mutation DeleteMedicalStudies($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalStudies(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

DELETE_MEDICAL_STUDY_GQL = """
mutation DeleteMedicalStudy($id: ID!) {
  deleteMedicalStudy(id: $id) {
    id
    state
  }
}
"""

GET_MEDICAL_STUDY_GQL = """
query GetMedicalStudy($id: ID!, $correlationId: String) {
  medicalStudy(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
    address {
      streetAddress
      city
      region
      country
      postalCode
    }
  }
}
"""

QUERY_MEDICAL_STUDIES_GQL = """
query QueryMedicalStudies($filter: MedicalStudyFilter, $correlationId: String) {
  medicalStudies(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
    }
  }
}
"""

QUERY_MEDICAL_STUDIES_CLUSTERS_GQL = """
query QueryMedicalStudiesClusters($filter: MedicalStudyFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalStudies(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_STUDY_GQL = """
mutation UpdateMedicalStudy($medicalStudy: MedicalStudyUpdateInput!) {
  updateMedicalStudy(medicalStudy: $medicalStudy) {
    id
    name
  }
}
"""

COUNT_MEDICAL_TESTS_GQL = """
query CountMedicalTests($filter: MedicalTestFilter, $correlationId: String) {
  countMedicalTests(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_TEST_GQL = """
mutation CreateMedicalTest($medicalTest: MedicalTestInput!) {
  createMedicalTest(medicalTest: $medicalTest) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_TESTS_GQL = """
mutation DeleteAllMedicalTests($filter: MedicalTestFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalTests(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_TEST_GQL = """
mutation DeleteMedicalTest($id: ID!) {
  deleteMedicalTest(id: $id) {
    id
    state
  }
}
"""

DELETE_MEDICAL_TESTS_GQL = """
mutation DeleteMedicalTests($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalTests(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_MEDICAL_TEST_GQL = """
query GetMedicalTest($id: ID!, $correlationId: String) {
  medicalTest(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_MEDICAL_TESTS_GQL = """
query QueryMedicalTests($filter: MedicalTestFilter, $correlationId: String) {
  medicalTests(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_MEDICAL_TESTS_CLUSTERS_GQL = """
query QueryMedicalTestsClusters($filter: MedicalTestFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalTests(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_TEST_GQL = """
mutation UpdateMedicalTest($medicalTest: MedicalTestUpdateInput!) {
  updateMedicalTest(medicalTest: $medicalTest) {
    id
    name
  }
}
"""

COUNT_MEDICAL_THERAPIES_GQL = """
query CountMedicalTherapies($filter: MedicalTherapyFilter, $correlationId: String) {
  countMedicalTherapies(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_MEDICAL_THERAPY_GQL = """
mutation CreateMedicalTherapy($medicalTherapy: MedicalTherapyInput!) {
  createMedicalTherapy(medicalTherapy: $medicalTherapy) {
    id
    name
  }
}
"""

DELETE_ALL_MEDICAL_THERAPIES_GQL = """
mutation DeleteAllMedicalTherapies($filter: MedicalTherapyFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllMedicalTherapies(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_MEDICAL_THERAPIES_GQL = """
mutation DeleteMedicalTherapies($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteMedicalTherapies(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

DELETE_MEDICAL_THERAPY_GQL = """
mutation DeleteMedicalTherapy($id: ID!) {
  deleteMedicalTherapy(id: $id) {
    id
    state
  }
}
"""

GET_MEDICAL_THERAPY_GQL = """
query GetMedicalTherapy($id: ID!, $correlationId: String) {
  medicalTherapy(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_MEDICAL_THERAPIES_GQL = """
query QueryMedicalTherapies($filter: MedicalTherapyFilter, $correlationId: String) {
  medicalTherapies(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_MEDICAL_THERAPIES_CLUSTERS_GQL = """
query QueryMedicalTherapiesClusters($filter: MedicalTherapyFilter, $clusters: EntityClustersInput, $correlationId: String) {
  medicalTherapies(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_MEDICAL_THERAPY_GQL = """
mutation UpdateMedicalTherapy($medicalTherapy: MedicalTherapyUpdateInput!) {
  updateMedicalTherapy(medicalTherapy: $medicalTherapy) {
    id
    name
  }
}
"""

SEND_NOTIFICATION_GQL = """
mutation SendNotification($connector: IntegrationConnectorInput!, $text: String!, $textType: TextTypes) {
  sendNotification(connector: $connector, text: $text, textType: $textType) {
    result
  }
}
"""

CREATE_OBSERVATION_GQL = """
mutation CreateObservation($observation: ObservationInput!) {
  createObservation(observation: $observation) {
    id
    state
  }
}
"""

DELETE_OBSERVATION_GQL = """
mutation DeleteObservation($id: ID!) {
  deleteObservation(id: $id) {
    id
    state
  }
}
"""

MATCH_ENTITY_GQL = """
mutation MatchEntity($observable: ObservableInput!, $candidates: [EntityReferenceInput!]!, $specification: EntityReferenceInput, $correlationId: String) {
  matchEntity(
    observable: $observable
    candidates: $candidates
    specification: $specification
    correlationId: $correlationId
  ) {
    reference {
      type
      observable {
        id
        name
      }
    }
    relevance
    reasoning
  }
}
"""

RESOLVE_ENTITIES_GQL = """
mutation ResolveEntities($type: ObservableTypes!, $entities: [EntityReferenceInput!]!, $threshold: Float, $specification: EntityReferenceInput, $correlationId: String) {
  resolveEntities(
    type: $type
    entities: $entities
    threshold: $threshold
    specification: $specification
    correlationId: $correlationId
  ) {
    type
    primary {
      id
    }
    resolved {
      id
    }
    relevance
    reasoning
    primaryCluster {
      entities {
        id
        name
      }
      similarity
    }
    outlierClusters {
      entities {
        id
        name
      }
      similarity
    }
  }
}
"""

RESOLVE_ENTITY_GQL = """
mutation ResolveEntity($type: ObservableTypes!, $source: EntityReferenceInput!, $target: EntityReferenceInput!, $specification: EntityReferenceInput, $correlationId: String) {
  resolveEntity(
    type: $type
    source: $source
    target: $target
    specification: $specification
    correlationId: $correlationId
  ) {
    reference {
      type
      observable {
        id
        name
      }
    }
    relevance
    reasoning
  }
}
"""

UPDATE_OBSERVATION_GQL = """
mutation UpdateObservation($observation: ObservationUpdateInput!) {
  updateObservation(observation: $observation) {
    id
    state
  }
}
"""

COUNT_ORGANIZATIONS_GQL = """
query CountOrganizations($filter: OrganizationFilter, $correlationId: String) {
  countOrganizations(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_ORGANIZATION_GQL = """
mutation CreateOrganization($organization: OrganizationInput!) {
  createOrganization(organization: $organization) {
    id
    name
  }
}
"""

DELETE_ALL_ORGANIZATIONS_GQL = """
mutation DeleteAllOrganizations($filter: OrganizationFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllOrganizations(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_ORGANIZATION_GQL = """
mutation DeleteOrganization($id: ID!) {
  deleteOrganization(id: $id) {
    id
    state
  }
}
"""

DELETE_ORGANIZATIONS_GQL = """
mutation DeleteOrganizations($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteOrganizations(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

ENRICH_ORGANIZATIONS_GQL = """
mutation EnrichOrganizations($filter: OrganizationFilter, $connector: EntityEnrichmentConnectorInput!, $correlationId: String) {
  enrichOrganizations(
    filter: $filter
    connector: $connector
    correlationId: $correlationId
  ) {
    id
    name
  }
}
"""

GET_ORGANIZATION_GQL = """
query GetOrganization($id: ID!, $correlationId: String) {
  organization(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
    address {
      streetAddress
      city
      region
      country
      postalCode
    }
    foundingDate
    email
    telephone
    legalName
    industries
    revenue
    revenueCurrency
    investment
    investmentCurrency
    founders {
      id
      name
    }
    employees {
      id
      name
    }
    members {
      id
      name
    }
    parentOrganization {
      id
      name
    }
    memberOf {
      id
      name
    }
    subOrganizations {
      id
      name
    }
    locations {
      id
      name
    }
    investmentsReceived {
      id
      name
    }
    investorFunds {
      id
      name
    }
  }
}
"""

QUERY_ORGANIZATIONS_GQL = """
query QueryOrganizations($filter: OrganizationFilter, $correlationId: String) {
  organizations(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      foundingDate
      email
      telephone
      legalName
      industries
      revenue
      revenueCurrency
      investment
      investmentCurrency
    }
  }
}
"""

QUERY_ORGANIZATIONS_CLUSTERS_GQL = """
query QueryOrganizationsClusters($filter: OrganizationFilter, $clusters: EntityClustersInput, $correlationId: String) {
  organizations(
    filter: $filter
    clusters: $clusters
    correlationId: $correlationId
  ) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      foundingDate
      email
      telephone
      legalName
      industries
      revenue
      revenueCurrency
      investment
      investmentCurrency
      founders {
        id
        name
      }
      employees {
        id
        name
      }
      members {
        id
        name
      }
      parentOrganization {
        id
        name
      }
      memberOf {
        id
        name
      }
      subOrganizations {
        id
        name
      }
      locations {
        id
        name
      }
      investmentsReceived {
        id
        name
      }
      investorFunds {
        id
        name
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

QUERY_ORGANIZATIONS_EXPANDED_GQL = """
query QueryOrganizationsExpanded($filter: OrganizationFilter, $correlationId: String) {
  organizations(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      foundingDate
      email
      telephone
      legalName
      industries
      revenue
      revenueCurrency
      investment
      investmentCurrency
      founders {
        id
        name
      }
      employees {
        id
        name
      }
      members {
        id
        name
      }
      parentOrganization {
        id
        name
      }
      memberOf {
        id
        name
      }
      subOrganizations {
        id
        name
      }
      locations {
        id
        name
      }
      investmentsReceived {
        id
        name
      }
      investorFunds {
        id
        name
      }
    }
  }
}
"""

UPDATE_ORGANIZATION_GQL = """
mutation UpdateOrganization($organization: OrganizationUpdateInput!) {
  updateOrganization(organization: $organization) {
    id
    name
  }
}
"""

COUNT_PERSONS_GQL = """
query CountPersons($filter: PersonFilter, $correlationId: String) {
  countPersons(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_PERSON_GQL = """
mutation CreatePerson($person: PersonInput!) {
  createPerson(person: $person) {
    id
    name
  }
}
"""

DELETE_ALL_PERSONS_GQL = """
mutation DeleteAllPersons($filter: PersonFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllPersons(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_PERSON_GQL = """
mutation DeletePerson($id: ID!) {
  deletePerson(id: $id) {
    id
    state
  }
}
"""

DELETE_PERSONS_GQL = """
mutation DeletePersons($ids: [ID!]!, $isSynchronous: Boolean) {
  deletePersons(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

ENRICH_PERSONS_GQL = """
mutation EnrichPersons($filter: PersonFilter, $connector: EntityEnrichmentConnectorInput!, $correlationId: String) {
  enrichPersons(
    filter: $filter
    connector: $connector
    correlationId: $correlationId
  ) {
    id
    name
  }
}
"""

GET_PERSON_GQL = """
query GetPerson($id: ID!, $correlationId: String) {
  person(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
    address {
      streetAddress
      city
      region
      country
      postalCode
    }
    email
    givenName
    familyName
    phoneNumber
    birthDate
    title
    occupation
    education
    worksFor {
      id
      name
    }
    affiliation {
      id
      name
    }
    memberOf {
      id
      name
    }
    alumniOf {
      id
      name
    }
    birthPlace {
      id
      name
    }
    deathPlace {
      id
      name
    }
    homeLocation {
      id
      name
    }
    workLocation {
      id
      name
    }
  }
}
"""

QUERY_PERSONS_GQL = """
query QueryPersons($filter: PersonFilter, $correlationId: String) {
  persons(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      email
      givenName
      familyName
      phoneNumber
      birthDate
      title
      occupation
      education
    }
  }
}
"""

QUERY_PERSONS_CLUSTERS_GQL = """
query QueryPersonsClusters($filter: PersonFilter, $clusters: EntityClustersInput, $correlationId: String) {
  persons(filter: $filter, clusters: $clusters, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      email
      givenName
      familyName
      phoneNumber
      birthDate
      title
      occupation
      education
      worksFor {
        id
        name
      }
      affiliation {
        id
        name
      }
      memberOf {
        id
        name
      }
      alumniOf {
        id
        name
      }
      birthPlace {
        id
        name
      }
      deathPlace {
        id
        name
      }
      homeLocation {
        id
        name
      }
      workLocation {
        id
        name
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

QUERY_PERSONS_EXPANDED_GQL = """
query QueryPersonsExpanded($filter: PersonFilter, $correlationId: String) {
  persons(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      email
      givenName
      familyName
      phoneNumber
      birthDate
      title
      occupation
      education
      worksFor {
        id
        name
      }
      affiliation {
        id
        name
      }
      memberOf {
        id
        name
      }
      alumniOf {
        id
        name
      }
      birthPlace {
        id
        name
      }
      deathPlace {
        id
        name
      }
      homeLocation {
        id
        name
      }
      workLocation {
        id
        name
      }
    }
  }
}
"""

UPDATE_PERSON_GQL = """
mutation UpdatePerson($person: PersonUpdateInput!) {
  updatePerson(person: $person) {
    id
    name
  }
}
"""

COUNT_PLACES_GQL = """
query CountPlaces($filter: PlaceFilter, $correlationId: String) {
  countPlaces(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_PLACE_GQL = """
mutation CreatePlace($place: PlaceInput!) {
  createPlace(place: $place) {
    id
    name
  }
}
"""

DELETE_ALL_PLACES_GQL = """
mutation DeleteAllPlaces($filter: PlaceFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllPlaces(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_PLACE_GQL = """
mutation DeletePlace($id: ID!) {
  deletePlace(id: $id) {
    id
    state
  }
}
"""

DELETE_PLACES_GQL = """
mutation DeletePlaces($ids: [ID!]!, $isSynchronous: Boolean) {
  deletePlaces(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

ENRICH_PLACES_GQL = """
mutation EnrichPlaces($filter: PlaceFilter, $connector: EntityEnrichmentConnectorInput!, $correlationId: String) {
  enrichPlaces(
    filter: $filter
    connector: $connector
    correlationId: $correlationId
  ) {
    id
    name
  }
}
"""

GET_PLACE_GQL = """
query GetPlace($id: ID!, $correlationId: String) {
  place(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
    address {
      streetAddress
      city
      region
      country
      postalCode
    }
    telephone
    openingHours
    priceRange
  }
}
"""

QUERY_PLACES_GQL = """
query QueryPlaces($filter: PlaceFilter, $correlationId: String) {
  places(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      telephone
      openingHours
      priceRange
    }
  }
}
"""

QUERY_PLACES_CLUSTERS_GQL = """
query QueryPlacesClusters($filter: PlaceFilter, $clusters: EntityClustersInput, $correlationId: String) {
  places(filter: $filter, clusters: $clusters, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      telephone
      openingHours
      priceRange
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_PLACE_GQL = """
mutation UpdatePlace($place: PlaceUpdateInput!) {
  updatePlace(place: $place) {
    id
    name
  }
}
"""

COUNT_PRODUCTS_GQL = """
query CountProducts($filter: ProductFilter, $correlationId: String) {
  countProducts(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_PRODUCT_GQL = """
mutation CreateProduct($product: ProductInput!) {
  createProduct(product: $product) {
    id
    name
  }
}
"""

DELETE_ALL_PRODUCTS_GQL = """
mutation DeleteAllProducts($filter: ProductFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllProducts(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_PRODUCT_GQL = """
mutation DeleteProduct($id: ID!) {
  deleteProduct(id: $id) {
    id
    state
  }
}
"""

DELETE_PRODUCTS_GQL = """
mutation DeleteProducts($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteProducts(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

ENRICH_PRODUCTS_GQL = """
mutation EnrichProducts($filter: ProductFilter, $connector: EntityEnrichmentConnectorInput!, $correlationId: String) {
  enrichProducts(
    filter: $filter
    connector: $connector
    correlationId: $correlationId
  ) {
    id
    name
  }
}
"""

GET_PRODUCT_GQL = """
query GetProduct($id: ID!, $correlationId: String) {
  product(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
    address {
      streetAddress
      city
      region
      country
      postalCode
    }
    manufacturer
    model
    brand
    upc
    sku
    gtin
    mpn
    releaseDate
    productionDate
  }
}
"""

QUERY_PRODUCTS_GQL = """
query QueryProducts($filter: ProductFilter, $correlationId: String) {
  products(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      manufacturer
      model
      brand
      upc
      sku
      gtin
      mpn
      releaseDate
      productionDate
    }
  }
}
"""

QUERY_PRODUCTS_CLUSTERS_GQL = """
query QueryProductsClusters($filter: ProductFilter, $clusters: EntityClustersInput, $correlationId: String) {
  products(filter: $filter, clusters: $clusters, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      address {
        streetAddress
        city
        region
        country
        postalCode
      }
      manufacturer
      model
      brand
      upc
      sku
      gtin
      mpn
      releaseDate
      productionDate
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_PRODUCT_GQL = """
mutation UpdateProduct($product: ProductUpdateInput!) {
  updateProduct(product: $product) {
    id
    name
  }
}
"""

GET_PROJECT_GQL = """
query GetProject {
  project {
    id
    name
    creationDate
    modifiedDate
    state
    environmentType
    platform
    region
    credits
    lastCreditsDate
    workflow {
      id
      name
    }
    specification {
      id
      name
    }
    embeddings {
      textSpecification {
        id
      }
      imageSpecification {
        id
      }
    }
    quota {
      storage
      contents
      credits
      feeds
      posts
      conversations
    }
    callbackUri
  }
}
"""

LOOKUP_CREDITS_GQL = """
query LookupCredits($correlationId: String!, $startDate: DateTime, $duration: TimeSpan) {
  lookupCredits(
    correlationId: $correlationId
    startDate: $startDate
    duration: $duration
  ) {
    correlationId
    ownerId
    credits
    storageRatio
    computeRatio
    embeddingRatio
    completionRatio
    generationRatio
    ingestionRatio
    indexingRatio
    preparationRatio
    extractionRatio
    classificationRatio
    enrichmentRatio
    publishingRatio
    searchRatio
    conversationRatio
  }
}
"""

LOOKUP_USAGE_GQL = """
query LookupUsage($correlationId: String!, $startDate: DateTime, $duration: TimeSpan) {
  lookupUsage(
    correlationId: $correlationId
    startDate: $startDate
    duration: $duration
  ) {
    id
    correlationId
    date
    credits
    name
    metric
    workflow
    entityType
    entityId
    projectId
    ownerId
    uri
    duration
    throughput
    contentType
    fileType
    modelService
    modelName
    processorName
    promptTokens
    completionTokens
    tokens
    count
    operation
    operationType
  }
}
"""

QUERY_CREDITS_GQL = """
query QueryCredits($startDate: DateTime!, $duration: TimeSpan!) {
  credits(startDate: $startDate, duration: $duration) {
    correlationId
    ownerId
    credits
    storageRatio
    computeRatio
    embeddingRatio
    completionRatio
    generationRatio
    ingestionRatio
    indexingRatio
    preparationRatio
    extractionRatio
    classificationRatio
    enrichmentRatio
    publishingRatio
    searchRatio
    conversationRatio
  }
}
"""

QUERY_TOKENS_GQL = """
query QueryTokens($startDate: DateTime!, $duration: TimeSpan!) {
  tokens(startDate: $startDate, duration: $duration) {
    correlationId
    ownerId
    embeddingInputTokens
    embeddingModelServices
    completionInputTokens
    completionOutputTokens
    completionModelServices
    preparationInputTokens
    preparationOutputTokens
    preparationModelServices
    extractionInputTokens
    extractionOutputTokens
    extractionModelServices
    generationInputTokens
    generationOutputTokens
    generationModelServices
  }
}
"""

QUERY_USAGE_GQL = """
query QueryUsage($startDate: DateTime!, $duration: TimeSpan!, $names: [String!], $excludedNames: [String!], $offset: Int, $limit: Int) {
  usage(
    startDate: $startDate
    duration: $duration
    names: $names
    excludedNames: $excludedNames
    offset: $offset
    limit: $limit
  ) {
    id
    correlationId
    date
    credits
    name
    metric
    workflow
    entityType
    entityId
    projectId
    ownerId
    uri
    duration
    throughput
    contentType
    fileType
    modelService
    modelName
    processorName
    promptTokens
    completionTokens
    tokens
    count
    operation
    operationType
  }
}
"""

UPDATE_PROJECT_GQL = """
mutation UpdateProject($project: ProjectUpdateInput!) {
  updateProject(project: $project) {
    id
    name
  }
}
"""

COUNT_REPOS_GQL = """
query CountRepos($filter: RepoFilter, $correlationId: String) {
  countRepos(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_REPO_GQL = """
mutation CreateRepo($repo: RepoInput!) {
  createRepo(repo: $repo) {
    id
    name
  }
}
"""

DELETE_ALL_REPOS_GQL = """
mutation DeleteAllRepos($filter: RepoFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllRepos(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_REPO_GQL = """
mutation DeleteRepo($id: ID!) {
  deleteRepo(id: $id) {
    id
    state
  }
}
"""

DELETE_REPOS_GQL = """
mutation DeleteRepos($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteRepos(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_REPO_GQL = """
query GetRepo($id: ID!, $correlationId: String) {
  repo(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
  }
}
"""

QUERY_REPOS_GQL = """
query QueryRepos($filter: RepoFilter, $correlationId: String) {
  repos(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
  }
}
"""

QUERY_REPOS_CLUSTERS_GQL = """
query QueryReposClusters($filter: RepoFilter, $clusters: EntityClustersInput, $correlationId: String) {
  repos(filter: $filter, clusters: $clusters, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_REPO_GQL = """
mutation UpdateRepo($repo: RepoUpdateInput!) {
  updateRepo(repo: $repo) {
    id
    name
  }
}
"""

MAP_WEB_GQL = """
query MapWeb($uri: URL!, $allowedPaths: [String!], $excludedPaths: [String!], $correlationId: String) {
  mapWeb(
    uri: $uri
    allowedPaths: $allowedPaths
    excludedPaths: $excludedPaths
    correlationId: $correlationId
  ) {
    results
  }
}
"""

SEARCH_WEB_GQL = """
query SearchWeb($text: String!, $service: SearchServiceTypes, $limit: Int, $correlationId: String) {
  searchWeb(
    text: $text
    service: $service
    limit: $limit
    correlationId: $correlationId
  ) {
    results {
      uri
      text
      title
      score
    }
  }
}
"""

COUNT_SOFTWARES_GQL = """
query CountSoftwares($filter: SoftwareFilter, $correlationId: String) {
  countSoftwares(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_SOFTWARE_GQL = """
mutation CreateSoftware($software: SoftwareInput!) {
  createSoftware(software: $software) {
    id
    name
  }
}
"""

DELETE_ALL_SOFTWARES_GQL = """
mutation DeleteAllSoftwares($filter: SoftwareFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllSoftwares(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_SOFTWARE_GQL = """
mutation DeleteSoftware($id: ID!) {
  deleteSoftware(id: $id) {
    id
    state
  }
}
"""

DELETE_SOFTWARES_GQL = """
mutation DeleteSoftwares($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteSoftwares(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_SOFTWARE_GQL = """
query GetSoftware($id: ID!, $correlationId: String) {
  software(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    alternateNames
    uri
    description
    identifier
    thing
    feeds {
      id
      name
    }
    links {
      uri
      linkType
      excerpts
    }
    workflow {
      id
      name
    }
    location {
      latitude
      longitude
    }
    h3 {
      h3r0
      h3r1
      h3r2
      h3r3
      h3r4
      h3r5
      h3r6
      h3r7
      h3r8
      h3r9
      h3r10
      h3r11
      h3r12
      h3r13
      h3r14
      h3r15
    }
    releaseDate
    developer
  }
}
"""

QUERY_SOFTWARES_GQL = """
query QuerySoftwares($filter: SoftwareFilter, $correlationId: String) {
  softwares(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      releaseDate
      developer
    }
  }
}
"""

QUERY_SOFTWARES_CLUSTERS_GQL = """
query QuerySoftwaresClusters($filter: SoftwareFilter, $clusters: EntityClustersInput, $correlationId: String) {
  softwares(filter: $filter, clusters: $clusters, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      alternateNames
      uri
      description
      identifier
      thing
      feeds {
        id
        name
      }
      links {
        uri
        linkType
        excerpts
      }
      workflow {
        id
        name
      }
      location {
        latitude
        longitude
      }
      h3 {
        h3r0
        h3r1
        h3r2
        h3r3
        h3r4
        h3r5
        h3r6
        h3r7
        h3r8
        h3r9
        h3r10
        h3r11
        h3r12
        h3r13
        h3r14
        h3r15
      }
      releaseDate
      developer
    }
    clusters {
      clusters {
        entities {
          id
          name
        }
        similarity
      }
    }
  }
}
"""

UPDATE_SOFTWARE_GQL = """
mutation UpdateSoftware($software: SoftwareUpdateInput!) {
  updateSoftware(software: $software) {
    id
    name
  }
}
"""

COUNT_SPECIFICATIONS_GQL = """
query CountSpecifications($filter: SpecificationFilter, $correlationId: String) {
  countSpecifications(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_SPECIFICATION_GQL = """
mutation CreateSpecification($specification: SpecificationInput!) {
  createSpecification(specification: $specification) {
    id
    name
    state
    type
    serviceType
  }
}
"""

DELETE_ALL_SPECIFICATIONS_GQL = """
mutation DeleteAllSpecifications($filter: SpecificationFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllSpecifications(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_SPECIFICATION_GQL = """
mutation DeleteSpecification($id: ID!) {
  deleteSpecification(id: $id) {
    id
    state
  }
}
"""

DELETE_SPECIFICATIONS_GQL = """
mutation DeleteSpecifications($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteSpecifications(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_SPECIFICATION_GQL = """
query GetSpecification($id: ID!, $correlationId: String) {
  specification(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    type
    serviceType
    systemPrompt
    customGuidance
    customInstructions
    searchType
    numberSimilar
    strategy {
      type
      messageLimit
      embedCitations
      flattenCitations
      enableFacets
      messagesWeight
      contentsWeight
    }
    promptStrategy {
      type
    }
    retrievalStrategy {
      type
      contentLimit
      disableFallback
    }
    rerankingStrategy {
      serviceType
      threshold
    }
    graphStrategy {
      type
      generateGraph
      observableLimit
    }
    revisionStrategy {
      type
      customRevision
      count
    }
    azureAI {
      tokenLimit
      completionTokenLimit
      key
      endpoint
      temperature
      probability
      chunkTokenLimit
    }
    openAI {
      tokenLimit
      completionTokenLimit
      model
      key
      endpoint
      modelName
      temperature
      probability
      chunkTokenLimit
      detailLevel
      reasoningEffort
    }
    azureOpenAI {
      tokenLimit
      completionTokenLimit
      model
      key
      endpoint
      deploymentName
      temperature
      probability
      chunkTokenLimit
    }
    cohere {
      tokenLimit
      completionTokenLimit
      model
      key
      modelName
      temperature
      probability
      chunkTokenLimit
    }
    anthropic {
      tokenLimit
      completionTokenLimit
      model
      key
      modelName
      temperature
      probability
      enableThinking
      thinkingTokenLimit
    }
    google {
      tokenLimit
      completionTokenLimit
      model
      key
      modelName
      temperature
      probability
      chunkTokenLimit
      enableThinking
      thinkingTokenLimit
    }
    replicate {
      tokenLimit
      completionTokenLimit
      model
      key
      modelName
      temperature
      probability
    }
    mistral {
      tokenLimit
      completionTokenLimit
      model
      key
      modelName
      endpoint
      temperature
      probability
      chunkTokenLimit
    }
    bedrock {
      tokenLimit
      completionTokenLimit
      model
      accessKey
      secretAccessKey
      endpoint
      region
      modelName
      temperature
      probability
    }
    xai {
      tokenLimit
      completionTokenLimit
      model
      key
      modelName
      endpoint
      temperature
      probability
    }
    groq {
      tokenLimit
      completionTokenLimit
      model
      key
      modelName
      endpoint
      temperature
      probability
    }
    cerebras {
      tokenLimit
      completionTokenLimit
      model
      key
      modelName
      endpoint
      temperature
      probability
    }
    deepseek {
      tokenLimit
      completionTokenLimit
      model
      key
      modelName
      temperature
      probability
    }
    jina {
      model
      key
      modelName
      chunkTokenLimit
    }
    voyage {
      model
      key
      modelName
      chunkTokenLimit
    }
  }
}
"""

PROMPT_SPECIFICATIONS_GQL = """
mutation PromptSpecifications($prompt: String!, $ids: [ID!]!) {
  promptSpecifications(prompt: $prompt, ids: $ids) {
    specification {
      id
    }
    messages {
      role
      author
      message
      citations {
        content {
          id
          name
          state
          originalDate
          identifier
          uri
          type
          fileType
          mimeType
          format
          formatName
          fileExtension
          fileName
          fileSize
          fileMetadata
          relativeFolderPath
          masterUri
          imageUri
          textUri
          audioUri
          transcriptUri
          snapshotsUri
          snapshotCount
          summary
          customSummary
          keywords
          bullets
          headlines
          posts
          chapters
          questions
          quotes
          video {
            width
            height
            duration
            make
            model
            software
            title
            description
            keywords
            author
          }
          audio {
            keywords
            author
            series
            episode
            episodeType
            season
            publisher
            copyright
            genre
            title
            description
            bitrate
            channels
            sampleRate
            bitsPerSample
            duration
          }
          image {
            width
            height
            resolutionX
            resolutionY
            bitsPerComponent
            components
            projectionType
            orientation
            description
            make
            model
            software
            lens
            focalLength
            exposureTime
            fNumber
            iso
            heading
            pitch
          }
          document {
            title
            subject
            summary
            author
            lastModifiedBy
            publisher
            description
            keywords
            pageCount
            worksheetCount
            slideCount
            wordCount
            lineCount
            paragraphCount
            isEncrypted
            hasDigitalSignature
          }
        }
        index
        text
        startTime
        endTime
        pageNumber
        frameNumber
      }
      toolCalls {
        id
        name
        arguments
      }
      tokens
      throughput
      ttft
      completionTime
      timestamp
      modelService
      model
      data
      mimeType
      toolCallId
      toolCallResponse
    }
    error
  }
}
"""

QUERY_MODELS_GQL = """
query QueryModels($filter: ModelFilter) {
  models(filter: $filter) {
    results {
      uri
      name
      type
      serviceType
      model
      modelType
      description
      availableOn
      features {
        keyFeatures
        strengths
        useCases
      }
      metadata {
        reasoning
        multilingual
        multimodal
        knowledgeCutoff
        promptCostPerMillion
        completionCostPerMillion
        embeddingsCostPerMillion
        rerankingCostPerMillion
        contextWindowTokens
        maxOutputTokens
      }
    }
  }
}
"""

QUERY_SPECIFICATIONS_GQL = """
query QuerySpecifications($filter: SpecificationFilter, $correlationId: String) {
  specifications(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      type
      serviceType
      systemPrompt
      customGuidance
      customInstructions
      searchType
      numberSimilar
      strategy {
        type
        messageLimit
        embedCitations
        flattenCitations
        enableFacets
        messagesWeight
        contentsWeight
      }
      promptStrategy {
        type
      }
      retrievalStrategy {
        type
        contentLimit
        disableFallback
      }
      rerankingStrategy {
        serviceType
        threshold
      }
      graphStrategy {
        type
        generateGraph
        observableLimit
      }
      revisionStrategy {
        type
        customRevision
        count
      }
      azureAI {
        tokenLimit
        completionTokenLimit
        key
        endpoint
        temperature
        probability
        chunkTokenLimit
      }
      openAI {
        tokenLimit
        completionTokenLimit
        model
        key
        endpoint
        modelName
        temperature
        probability
        chunkTokenLimit
        detailLevel
        reasoningEffort
      }
      azureOpenAI {
        tokenLimit
        completionTokenLimit
        model
        key
        endpoint
        deploymentName
        temperature
        probability
        chunkTokenLimit
      }
      cohere {
        tokenLimit
        completionTokenLimit
        model
        key
        modelName
        temperature
        probability
        chunkTokenLimit
      }
      anthropic {
        tokenLimit
        completionTokenLimit
        model
        key
        modelName
        temperature
        probability
        enableThinking
        thinkingTokenLimit
      }
      google {
        tokenLimit
        completionTokenLimit
        model
        key
        modelName
        temperature
        probability
        chunkTokenLimit
        enableThinking
        thinkingTokenLimit
      }
      replicate {
        tokenLimit
        completionTokenLimit
        model
        key
        modelName
        temperature
        probability
      }
      mistral {
        tokenLimit
        completionTokenLimit
        model
        key
        modelName
        endpoint
        temperature
        probability
        chunkTokenLimit
      }
      bedrock {
        tokenLimit
        completionTokenLimit
        model
        accessKey
        secretAccessKey
        endpoint
        region
        modelName
        temperature
        probability
      }
      xai {
        tokenLimit
        completionTokenLimit
        model
        key
        modelName
        endpoint
        temperature
        probability
      }
      groq {
        tokenLimit
        completionTokenLimit
        model
        key
        modelName
        endpoint
        temperature
        probability
      }
      cerebras {
        tokenLimit
        completionTokenLimit
        model
        key
        modelName
        endpoint
        temperature
        probability
      }
      deepseek {
        tokenLimit
        completionTokenLimit
        model
        key
        modelName
        temperature
        probability
      }
      jina {
        model
        key
        modelName
        chunkTokenLimit
      }
      voyage {
        model
        key
        modelName
        chunkTokenLimit
      }
    }
  }
}
"""

SPECIFICATION_EXISTS_GQL = """
query SpecificationExists($filter: SpecificationFilter, $correlationId: String) {
  specificationExists(filter: $filter, correlationId: $correlationId) {
    result
  }
}
"""

UPDATE_SPECIFICATION_GQL = """
mutation UpdateSpecification($specification: SpecificationUpdateInput!) {
  updateSpecification(specification: $specification) {
    id
    name
    state
    type
    serviceType
  }
}
"""

UPSERT_SPECIFICATION_GQL = """
mutation UpsertSpecification($specification: SpecificationInput!) {
  upsertSpecification(specification: $specification) {
    id
    name
    state
    type
    serviceType
  }
}
"""

COUNT_USERS_GQL = """
query CountUsers($filter: UserFilter, $correlationId: String) {
  countUsers(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_USER_GQL = """
mutation CreateUser($user: UserInput!) {
  createUser(user: $user) {
    id
    name
    state
    type
    description
    identifier
  }
}
"""

DELETE_USER_GQL = """
mutation DeleteUser($id: ID!) {
  deleteUser(id: $id) {
    id
    state
  }
}
"""

DISABLE_USER_GQL = """
mutation DisableUser($id: ID!) {
  disableUser(id: $id) {
    id
    state
  }
}
"""

ENABLE_USER_GQL = """
mutation EnableUser($id: ID!) {
  enableUser(id: $id) {
    id
    state
  }
}
"""

GET_USER_GQL = """
query GetUser {
  user {
    id
    name
    creationDate
    modifiedDate
    relevance
    owner {
      id
    }
    state
    type
    identifier
    description
    connectors {
      id
      name
      state
      type
      authentication {
        type
        microsoft {
          tenantId
          clientId
          clientSecret
        }
        google {
          clientId
          clientSecret
        }
        oauth {
          provider
          clientId
          clientSecret
          refreshToken
          metadata
        }
        arcade {
          authorizationId
          provider
          metadata
        }
      }
      integration {
        type
        uri
        slack {
          token
          channel
        }
        email {
          from
          subject
          to
        }
        twitter {
          consumerKey
          consumerSecret
          accessTokenKey
          accessTokenSecret
        }
        mcp {
          token
          type
        }
      }
    }
  }
}
"""

GET_USER_BY_IDENTIFIER_GQL = """
query GetUserByIdentifier($identifier: String!) {
  userByIdentifier(identifier: $identifier) {
    id
    name
    creationDate
    modifiedDate
    relevance
    owner {
      id
    }
    state
    type
    identifier
    description
    connectors {
      id
      name
      state
      type
      authentication {
        type
        microsoft {
          tenantId
          clientId
          clientSecret
        }
        google {
          clientId
          clientSecret
        }
        oauth {
          provider
          clientId
          clientSecret
          refreshToken
          metadata
        }
        arcade {
          authorizationId
          provider
          metadata
        }
      }
      integration {
        type
        uri
        slack {
          token
          channel
        }
        email {
          from
          subject
          to
        }
        twitter {
          consumerKey
          consumerSecret
          accessTokenKey
          accessTokenSecret
        }
        mcp {
          token
          type
        }
      }
    }
  }
}
"""

QUERY_USERS_GQL = """
query QueryUsers($filter: UserFilter, $correlationId: String) {
  users(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      type
      identifier
      description
      connectors {
        id
        name
        state
        type
        authentication {
          type
          microsoft {
            tenantId
            clientId
            clientSecret
          }
          google {
            clientId
            clientSecret
          }
          oauth {
            provider
            clientId
            clientSecret
            refreshToken
            metadata
          }
          arcade {
            authorizationId
            provider
            metadata
          }
        }
        integration {
          type
          uri
          slack {
            token
            channel
          }
          email {
            from
            subject
            to
          }
          twitter {
            consumerKey
            consumerSecret
            accessTokenKey
            accessTokenSecret
          }
          mcp {
            token
            type
          }
        }
      }
    }
  }
}
"""

UPDATE_USER_GQL = """
mutation UpdateUser($user: UserUpdateInput!) {
  updateUser(user: $user) {
    id
    name
    state
    type
    description
    identifier
  }
}
"""

COUNT_VIEWS_GQL = """
query CountViews($filter: ViewFilter, $correlationId: String) {
  countViews(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_VIEW_GQL = """
mutation CreateView($view: ViewInput!) {
  createView(view: $view) {
    id
    name
    state
    type
    filter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
    augmentedFilter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
  }
}
"""

DELETE_ALL_VIEWS_GQL = """
mutation DeleteAllViews($filter: ViewFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllViews(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_VIEW_GQL = """
mutation DeleteView($id: ID!) {
  deleteView(id: $id) {
    id
    state
  }
}
"""

DELETE_VIEWS_GQL = """
mutation DeleteViews($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteViews(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_VIEW_GQL = """
query GetView($id: ID!, $correlationId: String) {
  view(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    type
    filter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
    augmentedFilter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
  }
}
"""

QUERY_VIEWS_GQL = """
query QueryViews($filter: ViewFilter, $correlationId: String) {
  views(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      type
      filter {
        dateRange {
          from
          to
        }
        inLast
        creationDateRange {
          from
          to
        }
        createdInLast
        types
        fileTypes
        formats
        fileExtensions
        fileSizeRange {
          from
          to
        }
        similarContents {
          id
        }
        contents {
          id
        }
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
        or {
          feeds {
            id
          }
          workflows {
            id
          }
          collections {
            id
          }
          users {
            id
          }
          observations {
            type
            observable {
              id
            }
            states
          }
        }
        and {
          feeds {
            id
          }
          workflows {
            id
          }
          collections {
            id
          }
          users {
            id
          }
          observations {
            type
            observable {
              id
            }
            states
          }
        }
        hasObservations
        hasFeeds
        hasCollections
        hasWorkflows
        collectionMode
        observationMode
      }
      augmentedFilter {
        dateRange {
          from
          to
        }
        inLast
        creationDateRange {
          from
          to
        }
        createdInLast
        types
        fileTypes
        formats
        fileExtensions
        fileSizeRange {
          from
          to
        }
        similarContents {
          id
        }
        contents {
          id
        }
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
        or {
          feeds {
            id
          }
          workflows {
            id
          }
          collections {
            id
          }
          users {
            id
          }
          observations {
            type
            observable {
              id
            }
            states
          }
        }
        and {
          feeds {
            id
          }
          workflows {
            id
          }
          collections {
            id
          }
          users {
            id
          }
          observations {
            type
            observable {
              id
            }
            states
          }
        }
        hasObservations
        hasFeeds
        hasCollections
        hasWorkflows
        collectionMode
        observationMode
      }
    }
  }
}
"""

UPDATE_VIEW_GQL = """
mutation UpdateView($view: ViewUpdateInput!) {
  updateView(view: $view) {
    id
    name
    state
    type
    filter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
    augmentedFilter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
  }
}
"""

UPSERT_VIEW_GQL = """
mutation UpsertView($view: ViewInput!) {
  upsertView(view: $view) {
    id
    name
    state
    type
    filter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
    augmentedFilter {
      dateRange {
        from
        to
      }
      inLast
      creationDateRange {
        from
        to
      }
      createdInLast
      types
      fileTypes
      formats
      fileExtensions
      fileSizeRange {
        from
        to
      }
      similarContents {
        id
      }
      contents {
        id
      }
      feeds {
        id
      }
      workflows {
        id
      }
      collections {
        id
      }
      users {
        id
      }
      observations {
        type
        observable {
          id
        }
        states
      }
      or {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      and {
        feeds {
          id
        }
        workflows {
          id
        }
        collections {
          id
        }
        users {
          id
        }
        observations {
          type
          observable {
            id
          }
          states
        }
      }
      hasObservations
      hasFeeds
      hasCollections
      hasWorkflows
      collectionMode
      observationMode
    }
  }
}
"""

VIEW_EXISTS_GQL = """
query ViewExists($filter: ViewFilter, $correlationId: String) {
  viewExists(filter: $filter, correlationId: $correlationId) {
    result
  }
}
"""

COUNT_WORKFLOWS_GQL = """
query CountWorkflows($filter: WorkflowFilter, $correlationId: String) {
  countWorkflows(filter: $filter, correlationId: $correlationId) {
    count
  }
}
"""

CREATE_WORKFLOW_GQL = """
mutation CreateWorkflow($workflow: WorkflowInput!) {
  createWorkflow(workflow: $workflow) {
    id
    name
    state
    ingestion {
      if {
        types
        fileTypes
        formats
        fileExtensions
        allowedPaths
        excludedPaths
      }
      collections {
        id
      }
      observations {
        type
        observable {
          id
          name
        }
      }
      enableEmailCollections
      enableFolderCollections
      enableMessageCollections
    }
    indexing {
      jobs {
        connector {
          type
          contentType
          fileType
        }
      }
    }
    preparation {
      enableUnblockedCapture
      disableSmartCapture
      summarizations {
        type
        specification {
          id
        }
        tokens
        items
        prompt
      }
      jobs {
        connector {
          type
          fileTypes
          azureDocument {
            version
            model
            endpoint
            key
          }
          deepgram {
            model
            key
            enableRedaction
            enableSpeakerDiarization
            detectLanguage
            language
          }
          assemblyAI {
            model
            key
            enableRedaction
            enableSpeakerDiarization
            detectLanguage
            language
          }
          page {
            enableScreenshot
          }
          document {
            includeImages
          }
          email {
            includeAttachments
          }
          modelDocument {
            specification {
              id
            }
          }
          reducto {
            ocrMode
            ocrSystem
            extractionMode
            enableEnrichment
            enrichmentMode
            key
          }
          mistral {
            key
          }
        }
      }
    }
    extraction {
      jobs {
        connector {
          type
          contentTypes
          fileTypes
          extractedTypes
          extractedCount
          azureText {
            confidenceThreshold
            enablePII
          }
          azureImage {
            confidenceThreshold
          }
          modelImage {
            specification {
              id
            }
          }
          modelText {
            specification {
              id
            }
            tokenThreshold
            timeBudget
            entityBudget
          }
        }
      }
    }
    classification {
      jobs {
        connector {
          type
          contentType
          fileType
          model {
            specification {
              id
            }
            rules {
              then
              if
            }
          }
          regex {
            rules {
              then
              type
              path
              matches
            }
          }
        }
      }
    }
    enrichment {
      link {
        enableCrawling
        allowedDomains
        excludedDomains
        allowedPaths
        excludedPaths
        allowedLinks
        excludedLinks
        allowedFiles
        excludedFiles
        allowedContentTypes
        excludedContentTypes
        allowContentDomain
        maximumLinks
      }
      jobs {
        connector {
          type
          enrichedTypes
          fhir {
            endpoint
          }
          diffbot {
            key
          }
          parallel {
            processor
            isSynchronous
          }
        }
      }
      entityResolution {
        strategy
        threshold
        specification {
          id
        }
      }
    }
    storage {
      policy {
        type
        allowDuplicates
        embeddingTypes
        enableSnapshots
        snapshotCount
      }
    }
    actions {
      connector {
        type
        uri
        slack {
          token
          channel
        }
        email {
          from
          subject
          to
        }
        twitter {
          consumerKey
          consumerSecret
          accessTokenKey
          accessTokenSecret
        }
        mcp {
          token
          type
        }
      }
    }
  }
}
"""

DELETE_ALL_WORKFLOWS_GQL = """
mutation DeleteAllWorkflows($filter: WorkflowFilter, $isSynchronous: Boolean, $correlationId: String) {
  deleteAllWorkflows(
    filter: $filter
    isSynchronous: $isSynchronous
    correlationId: $correlationId
  ) {
    id
    state
  }
}
"""

DELETE_WORKFLOW_GQL = """
mutation DeleteWorkflow($id: ID!) {
  deleteWorkflow(id: $id) {
    id
    state
  }
}
"""

DELETE_WORKFLOWS_GQL = """
mutation DeleteWorkflows($ids: [ID!]!, $isSynchronous: Boolean) {
  deleteWorkflows(ids: $ids, isSynchronous: $isSynchronous) {
    id
    state
  }
}
"""

GET_WORKFLOW_GQL = """
query GetWorkflow($id: ID!, $correlationId: String) {
  workflow(id: $id, correlationId: $correlationId) {
    id
    name
    creationDate
    modifiedDate
    owner {
      id
    }
    state
    ingestion {
      if {
        types
        fileTypes
        formats
        fileExtensions
        allowedPaths
        excludedPaths
      }
      collections {
        id
      }
      observations {
        type
        observable {
          id
          name
        }
      }
      enableEmailCollections
      enableFolderCollections
      enableMessageCollections
    }
    indexing {
      jobs {
        connector {
          type
          contentType
          fileType
        }
      }
    }
    preparation {
      enableUnblockedCapture
      disableSmartCapture
      summarizations {
        type
        specification {
          id
        }
        tokens
        items
        prompt
      }
      jobs {
        connector {
          type
          fileTypes
          azureDocument {
            version
            model
            endpoint
            key
          }
          deepgram {
            model
            key
            enableRedaction
            enableSpeakerDiarization
            detectLanguage
            language
          }
          assemblyAI {
            model
            key
            enableRedaction
            enableSpeakerDiarization
            detectLanguage
            language
          }
          page {
            enableScreenshot
          }
          document {
            includeImages
          }
          email {
            includeAttachments
          }
          modelDocument {
            specification {
              id
            }
          }
          reducto {
            ocrMode
            ocrSystem
            extractionMode
            enableEnrichment
            enrichmentMode
            key
          }
          mistral {
            key
          }
        }
      }
    }
    extraction {
      jobs {
        connector {
          type
          contentTypes
          fileTypes
          extractedTypes
          extractedCount
          azureText {
            confidenceThreshold
            enablePII
          }
          azureImage {
            confidenceThreshold
          }
          modelImage {
            specification {
              id
            }
          }
          modelText {
            specification {
              id
            }
            tokenThreshold
            timeBudget
            entityBudget
          }
        }
      }
    }
    classification {
      jobs {
        connector {
          type
          contentType
          fileType
          model {
            specification {
              id
            }
            rules {
              then
              if
            }
          }
          regex {
            rules {
              then
              type
              path
              matches
            }
          }
        }
      }
    }
    enrichment {
      link {
        enableCrawling
        allowedDomains
        excludedDomains
        allowedPaths
        excludedPaths
        allowedLinks
        excludedLinks
        allowedFiles
        excludedFiles
        allowedContentTypes
        excludedContentTypes
        allowContentDomain
        maximumLinks
      }
      jobs {
        connector {
          type
          enrichedTypes
          fhir {
            endpoint
          }
          diffbot {
            key
          }
          parallel {
            processor
            isSynchronous
          }
        }
      }
      entityResolution {
        strategy
        threshold
        specification {
          id
        }
      }
    }
    storage {
      policy {
        type
        allowDuplicates
        embeddingTypes
        enableSnapshots
        snapshotCount
      }
    }
    actions {
      connector {
        type
        uri
        slack {
          token
          channel
        }
        email {
          from
          subject
          to
        }
        twitter {
          consumerKey
          consumerSecret
          accessTokenKey
          accessTokenSecret
        }
        mcp {
          token
          type
        }
      }
    }
  }
}
"""

QUERY_WORKFLOWS_GQL = """
query QueryWorkflows($filter: WorkflowFilter, $correlationId: String) {
  workflows(filter: $filter, correlationId: $correlationId) {
    results {
      id
      name
      creationDate
      modifiedDate
      relevance
      owner {
        id
      }
      state
      ingestion {
        if {
          types
          fileTypes
          formats
          fileExtensions
          allowedPaths
          excludedPaths
        }
        collections {
          id
        }
        observations {
          type
          observable {
            id
            name
          }
        }
        enableEmailCollections
        enableFolderCollections
        enableMessageCollections
      }
      indexing {
        jobs {
          connector {
            type
            contentType
            fileType
          }
        }
      }
      preparation {
        enableUnblockedCapture
        disableSmartCapture
        summarizations {
          type
          specification {
            id
          }
          tokens
          items
          prompt
        }
        jobs {
          connector {
            type
            fileTypes
            azureDocument {
              version
              model
              endpoint
              key
            }
            deepgram {
              model
              key
              enableRedaction
              enableSpeakerDiarization
              detectLanguage
              language
            }
            assemblyAI {
              model
              key
              enableRedaction
              enableSpeakerDiarization
              detectLanguage
              language
            }
            page {
              enableScreenshot
            }
            document {
              includeImages
            }
            email {
              includeAttachments
            }
            modelDocument {
              specification {
                id
              }
            }
            reducto {
              ocrMode
              ocrSystem
              extractionMode
              enableEnrichment
              enrichmentMode
              key
            }
            mistral {
              key
            }
          }
        }
      }
      extraction {
        jobs {
          connector {
            type
            contentTypes
            fileTypes
            extractedTypes
            extractedCount
            azureText {
              confidenceThreshold
              enablePII
            }
            azureImage {
              confidenceThreshold
            }
            modelImage {
              specification {
                id
              }
            }
            modelText {
              specification {
                id
              }
              tokenThreshold
              timeBudget
              entityBudget
            }
          }
        }
      }
      classification {
        jobs {
          connector {
            type
            contentType
            fileType
            model {
              specification {
                id
              }
              rules {
                then
                if
              }
            }
            regex {
              rules {
                then
                type
                path
                matches
              }
            }
          }
        }
      }
      enrichment {
        link {
          enableCrawling
          allowedDomains
          excludedDomains
          allowedPaths
          excludedPaths
          allowedLinks
          excludedLinks
          allowedFiles
          excludedFiles
          allowedContentTypes
          excludedContentTypes
          allowContentDomain
          maximumLinks
        }
        jobs {
          connector {
            type
            enrichedTypes
            fhir {
              endpoint
            }
            diffbot {
              key
            }
            parallel {
              processor
              isSynchronous
            }
          }
        }
        entityResolution {
          strategy
          threshold
          specification {
            id
          }
        }
      }
      storage {
        policy {
          type
          allowDuplicates
          embeddingTypes
          enableSnapshots
          snapshotCount
        }
      }
      actions {
        connector {
          type
          uri
          slack {
            token
            channel
          }
          email {
            from
            subject
            to
          }
          twitter {
            consumerKey
            consumerSecret
            accessTokenKey
            accessTokenSecret
          }
          mcp {
            token
            type
          }
        }
      }
    }
  }
}
"""

UPDATE_WORKFLOW_GQL = """
mutation UpdateWorkflow($workflow: WorkflowUpdateInput!) {
  updateWorkflow(workflow: $workflow) {
    id
    name
    state
    ingestion {
      if {
        types
        fileTypes
        formats
        fileExtensions
        allowedPaths
        excludedPaths
      }
      collections {
        id
      }
      observations {
        type
        observable {
          id
          name
        }
      }
      enableEmailCollections
      enableFolderCollections
      enableMessageCollections
    }
    indexing {
      jobs {
        connector {
          type
          contentType
          fileType
        }
      }
    }
    preparation {
      enableUnblockedCapture
      disableSmartCapture
      summarizations {
        type
        specification {
          id
        }
        tokens
        items
        prompt
      }
      jobs {
        connector {
          type
          fileTypes
          azureDocument {
            version
            model
            endpoint
            key
          }
          deepgram {
            model
            key
            enableRedaction
            enableSpeakerDiarization
            detectLanguage
            language
          }
          assemblyAI {
            model
            key
            enableRedaction
            enableSpeakerDiarization
            detectLanguage
            language
          }
          page {
            enableScreenshot
          }
          document {
            includeImages
          }
          email {
            includeAttachments
          }
          modelDocument {
            specification {
              id
            }
          }
          reducto {
            ocrMode
            ocrSystem
            extractionMode
            enableEnrichment
            enrichmentMode
            key
          }
          mistral {
            key
          }
        }
      }
    }
    extraction {
      jobs {
        connector {
          type
          contentTypes
          fileTypes
          extractedTypes
          extractedCount
          azureText {
            confidenceThreshold
            enablePII
          }
          azureImage {
            confidenceThreshold
          }
          modelImage {
            specification {
              id
            }
          }
          modelText {
            specification {
              id
            }
            tokenThreshold
            timeBudget
            entityBudget
          }
        }
      }
    }
    classification {
      jobs {
        connector {
          type
          contentType
          fileType
          model {
            specification {
              id
            }
            rules {
              then
              if
            }
          }
          regex {
            rules {
              then
              type
              path
              matches
            }
          }
        }
      }
    }
    enrichment {
      link {
        enableCrawling
        allowedDomains
        excludedDomains
        allowedPaths
        excludedPaths
        allowedLinks
        excludedLinks
        allowedFiles
        excludedFiles
        allowedContentTypes
        excludedContentTypes
        allowContentDomain
        maximumLinks
      }
      jobs {
        connector {
          type
          enrichedTypes
          fhir {
            endpoint
          }
          diffbot {
            key
          }
          parallel {
            processor
            isSynchronous
          }
        }
      }
      entityResolution {
        strategy
        threshold
        specification {
          id
        }
      }
    }
    storage {
      policy {
        type
        allowDuplicates
        embeddingTypes
        enableSnapshots
        snapshotCount
      }
    }
    actions {
      connector {
        type
        uri
        slack {
          token
          channel
        }
        email {
          from
          subject
          to
        }
        twitter {
          consumerKey
          consumerSecret
          accessTokenKey
          accessTokenSecret
        }
        mcp {
          token
          type
        }
      }
    }
  }
}
"""

UPSERT_WORKFLOW_GQL = """
mutation UpsertWorkflow($workflow: WorkflowInput!) {
  upsertWorkflow(workflow: $workflow) {
    id
    name
    state
    ingestion {
      if {
        types
        fileTypes
        formats
        fileExtensions
        allowedPaths
        excludedPaths
      }
      collections {
        id
      }
      observations {
        type
        observable {
          id
          name
        }
      }
      enableEmailCollections
      enableFolderCollections
      enableMessageCollections
    }
    indexing {
      jobs {
        connector {
          type
          contentType
          fileType
        }
      }
    }
    preparation {
      enableUnblockedCapture
      disableSmartCapture
      summarizations {
        type
        specification {
          id
        }
        tokens
        items
        prompt
      }
      jobs {
        connector {
          type
          fileTypes
          azureDocument {
            version
            model
            endpoint
            key
          }
          deepgram {
            model
            key
            enableRedaction
            enableSpeakerDiarization
            detectLanguage
            language
          }
          assemblyAI {
            model
            key
            enableRedaction
            enableSpeakerDiarization
            detectLanguage
            language
          }
          page {
            enableScreenshot
          }
          document {
            includeImages
          }
          email {
            includeAttachments
          }
          modelDocument {
            specification {
              id
            }
          }
          reducto {
            ocrMode
            ocrSystem
            extractionMode
            enableEnrichment
            enrichmentMode
            key
          }
          mistral {
            key
          }
        }
      }
    }
    extraction {
      jobs {
        connector {
          type
          contentTypes
          fileTypes
          extractedTypes
          extractedCount
          azureText {
            confidenceThreshold
            enablePII
          }
          azureImage {
            confidenceThreshold
          }
          modelImage {
            specification {
              id
            }
          }
          modelText {
            specification {
              id
            }
            tokenThreshold
            timeBudget
            entityBudget
          }
        }
      }
    }
    classification {
      jobs {
        connector {
          type
          contentType
          fileType
          model {
            specification {
              id
            }
            rules {
              then
              if
            }
          }
          regex {
            rules {
              then
              type
              path
              matches
            }
          }
        }
      }
    }
    enrichment {
      link {
        enableCrawling
        allowedDomains
        excludedDomains
        allowedPaths
        excludedPaths
        allowedLinks
        excludedLinks
        allowedFiles
        excludedFiles
        allowedContentTypes
        excludedContentTypes
        allowContentDomain
        maximumLinks
      }
      jobs {
        connector {
          type
          enrichedTypes
          fhir {
            endpoint
          }
          diffbot {
            key
          }
          parallel {
            processor
            isSynchronous
          }
        }
      }
      entityResolution {
        strategy
        threshold
        specification {
          id
        }
      }
    }
    storage {
      policy {
        type
        allowDuplicates
        embeddingTypes
        enableSnapshots
        snapshotCount
      }
    }
    actions {
      connector {
        type
        uri
        slack {
          token
          channel
        }
        email {
          from
          subject
          to
        }
        twitter {
          consumerKey
          consumerSecret
          accessTokenKey
          accessTokenSecret
        }
        mcp {
          token
          type
        }
      }
    }
  }
}
"""

WORKFLOW_EXISTS_GQL = """
query WorkflowExists($filter: WorkflowFilter, $correlationId: String) {
  workflowExists(filter: $filter, correlationId: $correlationId) {
    result
  }
}
"""
