#!/usr/bin/env python3
# @generated AUTOGENERATED file. Do not Change!

from dataclasses import dataclass, field as _field
from ...config import custom_scalars, datetime
from gql_client.runtime.variables import encode_variables
from gql import gql, Client
from gql.transport.exceptions import TransportQueryError
from functools import partial
from numbers import Number
from typing import Any, AsyncGenerator, Dict, List, Generator, Optional
from time import perf_counter
from dataclasses_json import DataClassJsonMixin, config

from .survey_question import SurveyQuestionFragment, QUERY as SurveyQuestionFragmentQuery

# fmt: off
QUERY: List[str] = SurveyQuestionFragmentQuery + ["""
fragment SurveyFragment on Survey {
  id
  name
  completionTimestamp
  sourceFile {
    id
    fileName
    storeKey
  }
  surveyResponses {
    ...SurveyQuestionFragment
  }
}

"""]

@dataclass(frozen=True)
class SurveyFragment(DataClassJsonMixin):
    @dataclass(frozen=True)
    class File(DataClassJsonMixin):
        id: str
        fileName: str
        storeKey: Optional[str]

    @dataclass(frozen=True)
    class SurveyQuestion(SurveyQuestionFragment):
        pass

    id: str
    name: str
    completionTimestamp: int
    sourceFile: Optional[File]
    surveyResponses: List[SurveyQuestion]
