diff --git a/generators/python/src/fern_python/generators/context/pydantic_generator_context.py b/generators/python/src/fern_python/generators/context/pydantic_generator_context.py index dc41bef5ac7..17697bf76f8 100644 --- a/generators/python/src/fern_python/generators/context/pydantic_generator_context.py +++ b/generators/python/src/fern_python/generators/context/pydantic_generator_context.py @@ -69,6 +69,9 @@ def get_class_reference_for_type_id( @abstractmethod def does_circularly_reference_itself(self, type_id: ir_types.TypeId) -> bool: ... + @abstractmethod + def is_in_circular_cluster(self, type_id: ir_types.TypeId) -> bool: ... + @abstractmethod def get_non_union_self_referencing_dependencies_from_types( self, diff --git a/generators/python/src/fern_python/generators/context/pydantic_generator_context_impl.py b/generators/python/src/fern_python/generators/context/pydantic_generator_context_impl.py index e5cf0927dcc..2d7106d1152 100644 --- a/generators/python/src/fern_python/generators/context/pydantic_generator_context_impl.py +++ b/generators/python/src/fern_python/generators/context/pydantic_generator_context_impl.py @@ -8,6 +8,7 @@ from .type_reference_to_type_hint_converter import TypeReferenceToTypeHintConverter from fern_python.codegen import AST, Filepath from fern_python.declaration_referencer import AbstractDeclarationReferencer +from fern_python.generators.pydantic_model.circular_dependency_detector import CircularDependencyDetector from fern_python.generators.pydantic_model.custom_config import UnionNamingVersions from ordered_set import OrderedSet @@ -59,6 +60,11 @@ def __init__( defaultdict(OrderedSet) ) + self._circular_detector = CircularDependencyDetector(ir) + self._types_in_circular_clusters: Set[ir_types.TypeId] = set() + for cluster in self._circular_detector.get_all_circular_clusters(): + self._types_in_circular_clusters.update(cluster) + for id, type in self.ir.types.items(): ordered_reference_types = OrderedSet(list(sorted(type.referenced_types))) for referenced_id in ordered_reference_types: @@ -169,6 +175,9 @@ def get_class_reference_for_type_id( def does_circularly_reference_itself(self, type_id: ir_types.TypeId) -> bool: return self.does_type_reference_other_type(type_id, type_id) + def is_in_circular_cluster(self, type_id: ir_types.TypeId) -> bool: + return type_id in self._types_in_circular_clusters + # This map goes from every non union type to a list of referenced types that circularly reference themselves def get_non_union_self_referencing_dependencies_from_types( self, diff --git a/generators/python/src/fern_python/generators/pydantic_model/circular_dependency_detector.py b/generators/python/src/fern_python/generators/pydantic_model/circular_dependency_detector.py new file mode 100644 index 00000000000..3d246f96c57 --- /dev/null +++ b/generators/python/src/fern_python/generators/pydantic_model/circular_dependency_detector.py @@ -0,0 +1,121 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Dict, List, Set + +if TYPE_CHECKING: + import fern.ir.resources as ir_types + + +class CircularDependencyDetector: + """ + Detects mutually recursive type clusters that should be consolidated into a single file. + + This addresses the issue where deeply mutually recursive types (like AST operators) + cause circular import errors and Pydantic recursion issues when split across files. + """ + + def __init__(self, ir: ir_types.IntermediateRepresentation): + self._ir = ir + self._type_clusters: Dict[ir_types.TypeId, Set[ir_types.TypeId]] = {} + self._computed = False + + def get_type_cluster(self, type_id: ir_types.TypeId) -> Set[ir_types.TypeId]: + """ + Returns the cluster of mutually recursive types that includes the given type_id. + If the type is not part of a circular dependency cluster, returns a set with just the type_id. + """ + if not self._computed: + self._compute_clusters() + return self._type_clusters.get(type_id, {type_id}) + + def is_in_circular_cluster(self, type_id: ir_types.TypeId) -> bool: + """Returns True if the type is part of a mutually recursive cluster with 2+ types.""" + cluster = self.get_type_cluster(type_id) + return len(cluster) > 1 + + def _compute_clusters(self) -> None: + """ + Computes clusters of mutually recursive types using graph analysis. + + Algorithm: + 1. Build a directed graph of type references + 2. Find strongly connected components (SCCs) + 3. SCCs with 2+ nodes are circular dependency clusters + """ + graph: Dict[ir_types.TypeId, Set[ir_types.TypeId]] = {} + for type_id, type_decl in self._ir.types.items(): + graph[type_id] = set(type_decl.referenced_types) + + sccs = self._find_strongly_connected_components(graph) + + for scc in sccs: + if len(scc) > 1: + scc_set = set(scc) + for type_id in scc: + self._type_clusters[type_id] = scc_set + else: + self._type_clusters[scc[0]] = {scc[0]} + + self._computed = True + + def _find_strongly_connected_components( + self, graph: Dict[ir_types.TypeId, Set[ir_types.TypeId]] + ) -> List[List[ir_types.TypeId]]: + """ + Tarjan's algorithm for finding strongly connected components. + Returns a list of SCCs, where each SCC is a list of type_ids. + """ + index_counter = [0] + stack: List[ir_types.TypeId] = [] + lowlinks: Dict[ir_types.TypeId, int] = {} + index: Dict[ir_types.TypeId, int] = {} + on_stack: Dict[ir_types.TypeId, bool] = {} + sccs: List[List[ir_types.TypeId]] = [] + + def strongconnect(node: ir_types.TypeId) -> None: + index[node] = index_counter[0] + lowlinks[node] = index_counter[0] + index_counter[0] += 1 + stack.append(node) + on_stack[node] = True + + successors = graph.get(node, set()) + for successor in successors: + if successor not in index: + strongconnect(successor) + lowlinks[node] = min(lowlinks[node], lowlinks[successor]) + elif on_stack.get(successor, False): + lowlinks[node] = min(lowlinks[node], index[successor]) + + if lowlinks[node] == index[node]: + scc: List[ir_types.TypeId] = [] + while True: + successor = stack.pop() + on_stack[successor] = False + scc.append(successor) + if successor == node: + break + sccs.append(scc) + + for node in graph.keys(): + if node not in index: + strongconnect(node) + + return sccs + + def get_all_circular_clusters(self) -> List[Set[ir_types.TypeId]]: + """Returns all circular dependency clusters (with 2+ types).""" + if not self._computed: + self._compute_clusters() + + seen_clusters: Set[frozenset[ir_types.TypeId]] = set() + circular_clusters: List[Set[ir_types.TypeId]] = [] + + for type_id, cluster in self._type_clusters.items(): + if len(cluster) > 1: + cluster_key = frozenset(cluster) + if cluster_key not in seen_clusters: + seen_clusters.add(cluster_key) + circular_clusters.append(cluster) + + return circular_clusters diff --git a/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py b/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py index 8f2fee80aba..f6713605167 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py +++ b/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py @@ -292,7 +292,13 @@ def finish(self) -> None: ): self._pydantic_model.add_partial_class() self._get_validators_generator().add_validators() - if self._model_contains_forward_refs or self._force_update_forward_refs: + + type_id_for_circular_check = self._type_id_for_forward_ref() + is_in_circular_cluster = type_id_for_circular_check is not None and self._context.is_in_circular_cluster( + type_id_for_circular_check + ) + + if (self._model_contains_forward_refs or self._force_update_forward_refs) and not is_in_circular_cluster: self._pydantic_model.update_forward_refs() # Acknowledge forward refs for extended models as well diff --git a/generators/python/src/fern_python/generators/pydantic_model/pydantic_model_generator.py b/generators/python/src/fern_python/generators/pydantic_model/pydantic_model_generator.py index 0a22cbacd76..884b8f03be1 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/pydantic_model_generator.py +++ b/generators/python/src/fern_python/generators/pydantic_model/pydantic_model_generator.py @@ -1,11 +1,12 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Literal, Tuple +from typing import TYPE_CHECKING, Literal, Set, Tuple if TYPE_CHECKING: from ..context.pydantic_generator_context import PydanticGeneratorContext from ..context.pydantic_generator_context_impl import PydanticGeneratorContextImpl +from .circular_dependency_detector import CircularDependencyDetector from .custom_config import PydanticModelCustomConfig from .type_declaration_handler import ( TypeDeclarationHandler, @@ -13,7 +14,7 @@ ) from .type_declaration_referencer import TypeDeclarationReferencer from fern_python.cli.abstract_generator import AbstractGenerator -from fern_python.codegen import Project +from fern_python.codegen import AST, Filepath, Project from fern_python.generator_exec_wrapper import GeneratorExecWrapper from fern_python.generators.pydantic_model.model_utilities import can_be_fern_model from fern_python.snippet import SnippetRegistry, SnippetWriter @@ -117,17 +118,37 @@ def generate_types( snippet_registry: SnippetRegistry, snippet_writer: SnippetWriter, ) -> None: - for type_to_generate in ir.types.values(): - self._generate_type( - project, - type=type_to_generate, + detector = CircularDependencyDetector(ir) + circular_clusters = detector.get_all_circular_clusters() + + types_in_clusters: Set[ir_types.TypeId] = set() + for cluster in circular_clusters: + types_in_clusters.update(cluster) + + for cluster in circular_clusters: + self._generate_circular_cluster( + project=project, + cluster=cluster, generator_exec_wrapper=generator_exec_wrapper, custom_config=custom_config, context=context, snippet_registry=snippet_registry, snippet_writer=snippet_writer, + ir=ir, ) + for type_to_generate in ir.types.values(): + if type_to_generate.name.type_id not in types_in_clusters: + self._generate_type( + project, + type=type_to_generate, + generator_exec_wrapper=generator_exec_wrapper, + custom_config=custom_config, + context=context, + snippet_registry=snippet_registry, + snippet_writer=snippet_writer, + ) + def _should_generate_typedict(self, context: "PydanticGeneratorContext", type_: ir_types.Type) -> bool: return context.use_typeddict_requests and can_be_fern_model(type_, context.ir.types) @@ -185,6 +206,94 @@ def _generate_type( ) project.write_source_file(source_file=source_file, filepath=filepath) + def _generate_circular_cluster( + self, + project: Project, + cluster: Set[ir_types.TypeId], + generator_exec_wrapper: GeneratorExecWrapper, + custom_config: PydanticModelCustomConfig, + context: "PydanticGeneratorContext", + snippet_registry: SnippetRegistry, + snippet_writer: SnippetWriter, + ir: ir_types.IntermediateRepresentation, + ) -> None: + sorted_cluster = sorted(cluster, key=lambda tid: str(tid)) + canonical_type_id = sorted_cluster[0] + + cluster_names = [ir.types[tid].name.name.snake_case.safe_name for tid in sorted_cluster] + print(f"[CIRCULAR CLUSTER] Generating cluster with {len(cluster_names)} types: {cluster_names}") + + base_filepath = context.get_filepath_for_type_id(type_id=canonical_type_id, as_request=False) + + canonical_decl = ir.types[canonical_type_id] + consolidated_filename = f"{canonical_decl.name.name.snake_case.safe_name}_all" + + consolidated_filepath = Filepath( + directories=base_filepath.directories, + file=Filepath.FilepathPart(module_name=consolidated_filename), + ) + + source_file = context.source_file_factory.create( + project=project, + filepath=consolidated_filepath, + generator_exec_wrapper=generator_exec_wrapper, + ) + + for type_id in sorted_cluster: + type_decl = ir.types[type_id] + + if self._should_generate_typedict(context=context, type_=type_decl.shape): + typeddict_filepath = context.get_filepath_for_type_id(type_id=type_id, as_request=True) + typeddict_source_file = context.source_file_factory.create( + project=project, filepath=typeddict_filepath, generator_exec_wrapper=generator_exec_wrapper + ) + + typeddict_handler = TypeDeclarationHandler( + declaration=type_decl, + context=context, + custom_config=custom_config, + source_file=typeddict_source_file, + snippet_writer=snippet_writer, + generate_typeddict_request=True, + ) + typeddict_handler.run() + + project.write_source_file(source_file=typeddict_source_file, filepath=typeddict_filepath) + + type_declaration_handler = TypeDeclarationHandler( + declaration=type_decl, + context=context, + custom_config=custom_config, + source_file=source_file, + snippet_writer=snippet_writer, + generate_typeddict_request=False, + ) + generated_type = type_declaration_handler.run() + + if generated_type.snippet is not None: + snippet_registry.register_snippet( + type_id=type_decl.name.type_id, + expr=generated_type.snippet, + ) + + project.write_source_file(source_file=source_file, filepath=consolidated_filepath) + + for type_id in sorted_cluster: + type_decl = ir.types[type_id] + + # Create stub file for the regular type (as_request=False) + individual_filepath = context.get_filepath_for_type_id(type_id=type_id, as_request=False) + class_name = context.get_class_name_for_type_id(type_id=type_id, as_request=False) + + stub_content = ( + f"# This file was auto-generated by Fern from our API Definition.\n\n" + f"from .{consolidated_filename} import {class_name} as {class_name}\n\n" + f'__all__ = ["{class_name}"]\n' + ) + + stub_filepath = project.get_relative_source_file_filepath(individual_filepath) + project.add_file(stub_filepath, stub_content) + def get_sorted_modules(self) -> None: return None diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_AndOperator.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_AndOperator.json new file mode 100644 index 00000000000..e74f2279056 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_AndOperator.json @@ -0,0 +1,617 @@ +{ + "type": "object", + "properties": { + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "children" + ], + "additionalProperties": false, + "definitions": { + "ast.GreaterThanOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.GreaterThanOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.OrOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.AndOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_AndOperatorChild.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_AndOperatorChild.json new file mode 100644 index 00000000000..2f3f3ab270a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_AndOperatorChild.json @@ -0,0 +1,702 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "ast.GreaterThanOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.GreaterThanOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.OrOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.AndOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_EqualsOperator.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_EqualsOperator.json new file mode 100644 index 00000000000..9bcbf471ffc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_EqualsOperator.json @@ -0,0 +1,618 @@ +{ + "type": "object", + "properties": { + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "left", + "right" + ], + "additionalProperties": false, + "definitions": { + "ast.GreaterThanOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.GreaterThanOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.OrOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.AndOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_EqualsOperatorLeft.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_EqualsOperatorLeft.json new file mode 100644 index 00000000000..ff1e91ad682 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_EqualsOperatorLeft.json @@ -0,0 +1,702 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "ast.GreaterThanOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.GreaterThanOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.OrOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.AndOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_EqualsOperatorRight.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_EqualsOperatorRight.json new file mode 100644 index 00000000000..ff1e91ad682 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_EqualsOperatorRight.json @@ -0,0 +1,702 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "ast.GreaterThanOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.GreaterThanOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.OrOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.AndOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_GreaterThanOperator.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_GreaterThanOperator.json new file mode 100644 index 00000000000..a959ad0ebf1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_GreaterThanOperator.json @@ -0,0 +1,618 @@ +{ + "type": "object", + "properties": { + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "left", + "right" + ], + "additionalProperties": false, + "definitions": { + "ast.GreaterThanOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.OrOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.AndOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.GreaterThanOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_GreaterThanOperatorLeft.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_GreaterThanOperatorLeft.json new file mode 100644 index 00000000000..73b48823b57 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_GreaterThanOperatorLeft.json @@ -0,0 +1,702 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "ast.GreaterThanOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.GreaterThanOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.OrOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.AndOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_GreaterThanOperatorRight.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_GreaterThanOperatorRight.json new file mode 100644 index 00000000000..73b48823b57 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_GreaterThanOperatorRight.json @@ -0,0 +1,702 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "ast.GreaterThanOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.GreaterThanOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.OrOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.AndOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_OrOperator.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_OrOperator.json new file mode 100644 index 00000000000..29fb8b5b2de --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_OrOperator.json @@ -0,0 +1,617 @@ +{ + "type": "object", + "properties": { + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "children" + ], + "additionalProperties": false, + "definitions": { + "ast.GreaterThanOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.GreaterThanOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.AndOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.OrOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_OrOperatorChild.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_OrOperatorChild.json new file mode 100644 index 00000000000..2f3f3ab270a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_OrOperatorChild.json @@ -0,0 +1,702 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "ast.GreaterThanOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.GreaterThanOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "number_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "number_literal" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorRight": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.EqualsOperatorLeft": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "string_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "string_literal" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.OrOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.AndOperatorChild": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and_operator", + "or_operator", + "eq_operator", + "gt_operator", + "boolean_literal" + ] + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "and_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.AndOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "or_operator" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.OrOperatorChild" + } + } + }, + "required": [ + "type", + "children" + ] + }, + { + "properties": { + "type": { + "const": "eq_operator" + }, + "left": { + "$ref": "#/definitions/ast.EqualsOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.EqualsOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "gt_operator" + }, + "left": { + "$ref": "#/definitions/ast.GreaterThanOperatorLeft" + }, + "right": { + "$ref": "#/definitions/ast.GreaterThanOperatorRight" + } + }, + "required": [ + "type", + "left", + "right" + ] + }, + { + "properties": { + "type": { + "const": "boolean_literal" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/circular-references-advanced.json b/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/circular-references-advanced.json index 763c13a943e..83dac390b32 100644 --- a/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/circular-references-advanced.json +++ b/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/circular-references-advanced.json @@ -1954,6 +1954,1846 @@ } ], "additionalProperties": false + }, + "type_ast:AndOperator": { + "type": "object", + "declaration": { + "name": { + "originalName": "AndOperator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "children", + "camelCase": { + "unsafeName": "children", + "safeName": "children" + }, + "snakeCase": { + "unsafeName": "children", + "safeName": "children" + }, + "screamingSnakeCase": { + "unsafeName": "CHILDREN", + "safeName": "CHILDREN" + }, + "pascalCase": { + "unsafeName": "Children", + "safeName": "Children" + } + }, + "wireValue": "children" + }, + "typeReference": { + "type": "list", + "value": { + "type": "named", + "value": "type_ast:AndOperatorChild" + } + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:AndOperatorChild": { + "type": "discriminatedUnion", + "declaration": { + "name": { + "originalName": "AndOperatorChild", + "camelCase": { + "unsafeName": "andOperatorChild", + "safeName": "andOperatorChild" + }, + "snakeCase": { + "unsafeName": "and_operator_child", + "safeName": "and_operator_child" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR_CHILD", + "safeName": "AND_OPERATOR_CHILD" + }, + "pascalCase": { + "unsafeName": "AndOperatorChild", + "safeName": "AndOperatorChild" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "types": { + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "properties": [] + }, + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "properties": [] + }, + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "properties": [] + }, + "boolean_literal": { + "type": "singleProperty", + "typeReference": { + "type": "primitive", + "value": "BOOLEAN" + }, + "discriminantValue": { + "name": { + "originalName": "boolean_literal", + "camelCase": { + "unsafeName": "booleanLiteral", + "safeName": "booleanLiteral" + }, + "snakeCase": { + "unsafeName": "boolean_literal", + "safeName": "boolean_literal" + }, + "screamingSnakeCase": { + "unsafeName": "BOOLEAN_LITERAL", + "safeName": "BOOLEAN_LITERAL" + }, + "pascalCase": { + "unsafeName": "BooleanLiteral", + "safeName": "BooleanLiteral" + } + }, + "wireValue": "boolean_literal" + }, + "properties": null + } + } + }, + "type_ast:OrOperator": { + "type": "object", + "declaration": { + "name": { + "originalName": "OrOperator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "children", + "camelCase": { + "unsafeName": "children", + "safeName": "children" + }, + "snakeCase": { + "unsafeName": "children", + "safeName": "children" + }, + "screamingSnakeCase": { + "unsafeName": "CHILDREN", + "safeName": "CHILDREN" + }, + "pascalCase": { + "unsafeName": "Children", + "safeName": "Children" + } + }, + "wireValue": "children" + }, + "typeReference": { + "type": "list", + "value": { + "type": "named", + "value": "type_ast:OrOperatorChild" + } + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:OrOperatorChild": { + "type": "discriminatedUnion", + "declaration": { + "name": { + "originalName": "OrOperatorChild", + "camelCase": { + "unsafeName": "orOperatorChild", + "safeName": "orOperatorChild" + }, + "snakeCase": { + "unsafeName": "or_operator_child", + "safeName": "or_operator_child" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR_CHILD", + "safeName": "OR_OPERATOR_CHILD" + }, + "pascalCase": { + "unsafeName": "OrOperatorChild", + "safeName": "OrOperatorChild" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "types": { + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "properties": [] + }, + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "properties": [] + }, + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "properties": [] + }, + "boolean_literal": { + "type": "singleProperty", + "typeReference": { + "type": "primitive", + "value": "BOOLEAN" + }, + "discriminantValue": { + "name": { + "originalName": "boolean_literal", + "camelCase": { + "unsafeName": "booleanLiteral", + "safeName": "booleanLiteral" + }, + "snakeCase": { + "unsafeName": "boolean_literal", + "safeName": "boolean_literal" + }, + "screamingSnakeCase": { + "unsafeName": "BOOLEAN_LITERAL", + "safeName": "BOOLEAN_LITERAL" + }, + "pascalCase": { + "unsafeName": "BooleanLiteral", + "safeName": "BooleanLiteral" + } + }, + "wireValue": "boolean_literal" + }, + "properties": null + } + } + }, + "type_ast:EqualsOperator": { + "type": "object", + "declaration": { + "name": { + "originalName": "EqualsOperator", + "camelCase": { + "unsafeName": "equalsOperator", + "safeName": "equalsOperator" + }, + "snakeCase": { + "unsafeName": "equals_operator", + "safeName": "equals_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR", + "safeName": "EQUALS_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqualsOperator", + "safeName": "EqualsOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "left", + "camelCase": { + "unsafeName": "left", + "safeName": "left" + }, + "snakeCase": { + "unsafeName": "left", + "safeName": "left" + }, + "screamingSnakeCase": { + "unsafeName": "LEFT", + "safeName": "LEFT" + }, + "pascalCase": { + "unsafeName": "Left", + "safeName": "Left" + } + }, + "wireValue": "left" + }, + "typeReference": { + "type": "named", + "value": "type_ast:EqualsOperatorLeft" + }, + "propertyAccess": null, + "variable": null + }, + { + "name": { + "name": { + "originalName": "right", + "camelCase": { + "unsafeName": "right", + "safeName": "right" + }, + "snakeCase": { + "unsafeName": "right", + "safeName": "right" + }, + "screamingSnakeCase": { + "unsafeName": "RIGHT", + "safeName": "RIGHT" + }, + "pascalCase": { + "unsafeName": "Right", + "safeName": "Right" + } + }, + "wireValue": "right" + }, + "typeReference": { + "type": "named", + "value": "type_ast:EqualsOperatorRight" + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:EqualsOperatorLeft": { + "type": "discriminatedUnion", + "declaration": { + "name": { + "originalName": "EqualsOperatorLeft", + "camelCase": { + "unsafeName": "equalsOperatorLeft", + "safeName": "equalsOperatorLeft" + }, + "snakeCase": { + "unsafeName": "equals_operator_left", + "safeName": "equals_operator_left" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR_LEFT", + "safeName": "EQUALS_OPERATOR_LEFT" + }, + "pascalCase": { + "unsafeName": "EqualsOperatorLeft", + "safeName": "EqualsOperatorLeft" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "types": { + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "properties": [] + }, + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "properties": [] + }, + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "properties": [] + }, + "string_literal": { + "type": "singleProperty", + "typeReference": { + "type": "primitive", + "value": "STRING" + }, + "discriminantValue": { + "name": { + "originalName": "string_literal", + "camelCase": { + "unsafeName": "stringLiteral", + "safeName": "stringLiteral" + }, + "snakeCase": { + "unsafeName": "string_literal", + "safeName": "string_literal" + }, + "screamingSnakeCase": { + "unsafeName": "STRING_LITERAL", + "safeName": "STRING_LITERAL" + }, + "pascalCase": { + "unsafeName": "StringLiteral", + "safeName": "StringLiteral" + } + }, + "wireValue": "string_literal" + }, + "properties": null + } + } + }, + "type_ast:EqualsOperatorRight": { + "type": "discriminatedUnion", + "declaration": { + "name": { + "originalName": "EqualsOperatorRight", + "camelCase": { + "unsafeName": "equalsOperatorRight", + "safeName": "equalsOperatorRight" + }, + "snakeCase": { + "unsafeName": "equals_operator_right", + "safeName": "equals_operator_right" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR_RIGHT", + "safeName": "EQUALS_OPERATOR_RIGHT" + }, + "pascalCase": { + "unsafeName": "EqualsOperatorRight", + "safeName": "EqualsOperatorRight" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "types": { + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "properties": [] + }, + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "properties": [] + }, + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "properties": [] + }, + "string_literal": { + "type": "singleProperty", + "typeReference": { + "type": "primitive", + "value": "STRING" + }, + "discriminantValue": { + "name": { + "originalName": "string_literal", + "camelCase": { + "unsafeName": "stringLiteral", + "safeName": "stringLiteral" + }, + "snakeCase": { + "unsafeName": "string_literal", + "safeName": "string_literal" + }, + "screamingSnakeCase": { + "unsafeName": "STRING_LITERAL", + "safeName": "STRING_LITERAL" + }, + "pascalCase": { + "unsafeName": "StringLiteral", + "safeName": "StringLiteral" + } + }, + "wireValue": "string_literal" + }, + "properties": null + } + } + }, + "type_ast:GreaterThanOperator": { + "type": "object", + "declaration": { + "name": { + "originalName": "GreaterThanOperator", + "camelCase": { + "unsafeName": "greaterThanOperator", + "safeName": "greaterThanOperator" + }, + "snakeCase": { + "unsafeName": "greater_than_operator", + "safeName": "greater_than_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR", + "safeName": "GREATER_THAN_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperator", + "safeName": "GreaterThanOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "left", + "camelCase": { + "unsafeName": "left", + "safeName": "left" + }, + "snakeCase": { + "unsafeName": "left", + "safeName": "left" + }, + "screamingSnakeCase": { + "unsafeName": "LEFT", + "safeName": "LEFT" + }, + "pascalCase": { + "unsafeName": "Left", + "safeName": "Left" + } + }, + "wireValue": "left" + }, + "typeReference": { + "type": "named", + "value": "type_ast:GreaterThanOperatorLeft" + }, + "propertyAccess": null, + "variable": null + }, + { + "name": { + "name": { + "originalName": "right", + "camelCase": { + "unsafeName": "right", + "safeName": "right" + }, + "snakeCase": { + "unsafeName": "right", + "safeName": "right" + }, + "screamingSnakeCase": { + "unsafeName": "RIGHT", + "safeName": "RIGHT" + }, + "pascalCase": { + "unsafeName": "Right", + "safeName": "Right" + } + }, + "wireValue": "right" + }, + "typeReference": { + "type": "named", + "value": "type_ast:GreaterThanOperatorRight" + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:GreaterThanOperatorLeft": { + "type": "discriminatedUnion", + "declaration": { + "name": { + "originalName": "GreaterThanOperatorLeft", + "camelCase": { + "unsafeName": "greaterThanOperatorLeft", + "safeName": "greaterThanOperatorLeft" + }, + "snakeCase": { + "unsafeName": "greater_than_operator_left", + "safeName": "greater_than_operator_left" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR_LEFT", + "safeName": "GREATER_THAN_OPERATOR_LEFT" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperatorLeft", + "safeName": "GreaterThanOperatorLeft" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "types": { + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "properties": [] + }, + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "properties": [] + }, + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "properties": [] + }, + "number_literal": { + "type": "singleProperty", + "typeReference": { + "type": "primitive", + "value": "DOUBLE" + }, + "discriminantValue": { + "name": { + "originalName": "number_literal", + "camelCase": { + "unsafeName": "numberLiteral", + "safeName": "numberLiteral" + }, + "snakeCase": { + "unsafeName": "number_literal", + "safeName": "number_literal" + }, + "screamingSnakeCase": { + "unsafeName": "NUMBER_LITERAL", + "safeName": "NUMBER_LITERAL" + }, + "pascalCase": { + "unsafeName": "NumberLiteral", + "safeName": "NumberLiteral" + } + }, + "wireValue": "number_literal" + }, + "properties": null + } + } + }, + "type_ast:GreaterThanOperatorRight": { + "type": "discriminatedUnion", + "declaration": { + "name": { + "originalName": "GreaterThanOperatorRight", + "camelCase": { + "unsafeName": "greaterThanOperatorRight", + "safeName": "greaterThanOperatorRight" + }, + "snakeCase": { + "unsafeName": "greater_than_operator_right", + "safeName": "greater_than_operator_right" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR_RIGHT", + "safeName": "GREATER_THAN_OPERATOR_RIGHT" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperatorRight", + "safeName": "GreaterThanOperatorRight" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "types": { + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "properties": [] + }, + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "properties": [] + }, + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "properties": [] + }, + "number_literal": { + "type": "singleProperty", + "typeReference": { + "type": "primitive", + "value": "DOUBLE" + }, + "discriminantValue": { + "name": { + "originalName": "number_literal", + "camelCase": { + "unsafeName": "numberLiteral", + "safeName": "numberLiteral" + }, + "snakeCase": { + "unsafeName": "number_literal", + "safeName": "number_literal" + }, + "screamingSnakeCase": { + "unsafeName": "NUMBER_LITERAL", + "safeName": "NUMBER_LITERAL" + }, + "pascalCase": { + "unsafeName": "NumberLiteral", + "safeName": "NumberLiteral" + } + }, + "wireValue": "number_literal" + }, + "properties": null + } + } } }, "headers": [], diff --git a/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/circular-references-advanced.json b/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/circular-references-advanced.json index c8a51ed61ea..affde995230 100644 --- a/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/circular-references-advanced.json +++ b/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/circular-references-advanced.json @@ -4127,41 +4127,4401 @@ "v2Examples": null, "availability": null, "docs": "This type allows us to test a circular reference with a union type (see FieldValue)." - } - }, - "errors": {}, - "services": {}, - "constants": { - "errorInstanceIdKey": { + }, + "type_ast:AndOperator": { + "inline": null, "name": { - "originalName": "errorInstanceId", - "camelCase": { - "unsafeName": "errorInstanceID", - "safeName": "errorInstanceID" + "name": { + "originalName": "AndOperator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } }, - "snakeCase": { - "unsafeName": "error_instance_id", - "safeName": "error_instance_id" + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } }, - "screamingSnakeCase": { - "unsafeName": "ERROR_INSTANCE_ID", - "safeName": "ERROR_INSTANCE_ID" + "displayName": null, + "typeId": "type_ast:AndOperator" + }, + "shape": { + "_type": "object", + "extends": [], + "properties": [ + { + "name": { + "name": { + "originalName": "children", + "camelCase": { + "unsafeName": "children", + "safeName": "children" + }, + "snakeCase": { + "unsafeName": "children", + "safeName": "children" + }, + "screamingSnakeCase": { + "unsafeName": "CHILDREN", + "safeName": "CHILDREN" + }, + "pascalCase": { + "unsafeName": "Children", + "safeName": "Children" + } + }, + "wireValue": "children" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "list", + "list": { + "_type": "named", + "name": { + "originalName": "AndOperatorChild", + "camelCase": { + "unsafeName": "andOperatorChild", + "safeName": "andOperatorChild" + }, + "snakeCase": { + "unsafeName": "and_operator_child", + "safeName": "and_operator_child" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR_CHILD", + "safeName": "AND_OPERATOR_CHILD" + }, + "pascalCase": { + "unsafeName": "AndOperatorChild", + "safeName": "AndOperatorChild" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:AndOperatorChild", + "default": null, + "inline": null + } + } + }, + "propertyAccess": null, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + }, + "availability": null, + "docs": null + } + ], + "extra-properties": false, + "extendedProperties": [] + }, + "referencedTypes": [ + "type_ast:AndOperatorChild", + "type_ast:AndOperator", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight", + "type_ast:EqualsOperatorRight" + ], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "v2Examples": null, + "availability": null, + "docs": "Deep circular reference pattern mimicking elevenlabs AST operators" + }, + "type_ast:AndOperatorChild": { + "inline": null, + "name": { + "name": { + "originalName": "AndOperatorChild", + "camelCase": { + "unsafeName": "andOperatorChild", + "safeName": "andOperatorChild" + }, + "snakeCase": { + "unsafeName": "and_operator_child", + "safeName": "and_operator_child" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR_CHILD", + "safeName": "AND_OPERATOR_CHILD" + }, + "pascalCase": { + "unsafeName": "AndOperatorChild", + "safeName": "AndOperatorChild" + } }, - "pascalCase": { - "unsafeName": "ErrorInstanceID", - "safeName": "ErrorInstanceID" - } + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:AndOperatorChild" }, - "wireValue": "errorInstanceId" - } - }, - "environments": null, - "errorDiscriminationStrategy": { - "type": "statusCode" - }, - "basePath": null, - "pathParameters": [], - "variables": [], + "shape": { + "_type": "union", + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "extends": [], + "baseProperties": [], + "types": [ + { + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "AndOperator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:AndOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "OrOperator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:OrOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "EqualsOperator", + "camelCase": { + "unsafeName": "equalsOperator", + "safeName": "equalsOperator" + }, + "snakeCase": { + "unsafeName": "equals_operator", + "safeName": "equals_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR", + "safeName": "EQUALS_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqualsOperator", + "safeName": "EqualsOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "GreaterThanOperator", + "camelCase": { + "unsafeName": "greaterThanOperator", + "safeName": "greaterThanOperator" + }, + "snakeCase": { + "unsafeName": "greater_than_operator", + "safeName": "greater_than_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR", + "safeName": "GREATER_THAN_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperator", + "safeName": "GreaterThanOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "boolean_literal", + "camelCase": { + "unsafeName": "booleanLiteral", + "safeName": "booleanLiteral" + }, + "snakeCase": { + "unsafeName": "boolean_literal", + "safeName": "boolean_literal" + }, + "screamingSnakeCase": { + "unsafeName": "BOOLEAN_LITERAL", + "safeName": "BOOLEAN_LITERAL" + }, + "pascalCase": { + "unsafeName": "BooleanLiteral", + "safeName": "BooleanLiteral" + } + }, + "wireValue": "boolean_literal" + }, + "shape": { + "_type": "singleProperty", + "name": { + "name": { + "originalName": "value", + "camelCase": { + "unsafeName": "value", + "safeName": "value" + }, + "snakeCase": { + "unsafeName": "value", + "safeName": "value" + }, + "screamingSnakeCase": { + "unsafeName": "VALUE", + "safeName": "VALUE" + }, + "pascalCase": { + "unsafeName": "Value", + "safeName": "Value" + } + }, + "wireValue": "value" + }, + "type": { + "_type": "primitive", + "primitive": { + "v1": "BOOLEAN", + "v2": { + "type": "boolean", + "default": null + } + } + } + }, + "displayName": null, + "availability": null, + "docs": null + } + ] + }, + "referencedTypes": [ + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight", + "type_ast:EqualsOperatorRight" + ], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "v2Examples": null, + "availability": null, + "docs": null + }, + "type_ast:OrOperator": { + "inline": null, + "name": { + "name": { + "originalName": "OrOperator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:OrOperator" + }, + "shape": { + "_type": "object", + "extends": [], + "properties": [ + { + "name": { + "name": { + "originalName": "children", + "camelCase": { + "unsafeName": "children", + "safeName": "children" + }, + "snakeCase": { + "unsafeName": "children", + "safeName": "children" + }, + "screamingSnakeCase": { + "unsafeName": "CHILDREN", + "safeName": "CHILDREN" + }, + "pascalCase": { + "unsafeName": "Children", + "safeName": "Children" + } + }, + "wireValue": "children" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "list", + "list": { + "_type": "named", + "name": { + "originalName": "OrOperatorChild", + "camelCase": { + "unsafeName": "orOperatorChild", + "safeName": "orOperatorChild" + }, + "snakeCase": { + "unsafeName": "or_operator_child", + "safeName": "or_operator_child" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR_CHILD", + "safeName": "OR_OPERATOR_CHILD" + }, + "pascalCase": { + "unsafeName": "OrOperatorChild", + "safeName": "OrOperatorChild" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:OrOperatorChild", + "default": null, + "inline": null + } + } + }, + "propertyAccess": null, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + }, + "availability": null, + "docs": null + } + ], + "extra-properties": false, + "extendedProperties": [] + }, + "referencedTypes": [ + "type_ast:OrOperatorChild", + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight", + "type_ast:EqualsOperatorRight" + ], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "v2Examples": null, + "availability": null, + "docs": null + }, + "type_ast:OrOperatorChild": { + "inline": null, + "name": { + "name": { + "originalName": "OrOperatorChild", + "camelCase": { + "unsafeName": "orOperatorChild", + "safeName": "orOperatorChild" + }, + "snakeCase": { + "unsafeName": "or_operator_child", + "safeName": "or_operator_child" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR_CHILD", + "safeName": "OR_OPERATOR_CHILD" + }, + "pascalCase": { + "unsafeName": "OrOperatorChild", + "safeName": "OrOperatorChild" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:OrOperatorChild" + }, + "shape": { + "_type": "union", + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "extends": [], + "baseProperties": [], + "types": [ + { + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "AndOperator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:AndOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "OrOperator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:OrOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "EqualsOperator", + "camelCase": { + "unsafeName": "equalsOperator", + "safeName": "equalsOperator" + }, + "snakeCase": { + "unsafeName": "equals_operator", + "safeName": "equals_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR", + "safeName": "EQUALS_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqualsOperator", + "safeName": "EqualsOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "GreaterThanOperator", + "camelCase": { + "unsafeName": "greaterThanOperator", + "safeName": "greaterThanOperator" + }, + "snakeCase": { + "unsafeName": "greater_than_operator", + "safeName": "greater_than_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR", + "safeName": "GREATER_THAN_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperator", + "safeName": "GreaterThanOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "boolean_literal", + "camelCase": { + "unsafeName": "booleanLiteral", + "safeName": "booleanLiteral" + }, + "snakeCase": { + "unsafeName": "boolean_literal", + "safeName": "boolean_literal" + }, + "screamingSnakeCase": { + "unsafeName": "BOOLEAN_LITERAL", + "safeName": "BOOLEAN_LITERAL" + }, + "pascalCase": { + "unsafeName": "BooleanLiteral", + "safeName": "BooleanLiteral" + } + }, + "wireValue": "boolean_literal" + }, + "shape": { + "_type": "singleProperty", + "name": { + "name": { + "originalName": "value", + "camelCase": { + "unsafeName": "value", + "safeName": "value" + }, + "snakeCase": { + "unsafeName": "value", + "safeName": "value" + }, + "screamingSnakeCase": { + "unsafeName": "VALUE", + "safeName": "VALUE" + }, + "pascalCase": { + "unsafeName": "Value", + "safeName": "Value" + } + }, + "wireValue": "value" + }, + "type": { + "_type": "primitive", + "primitive": { + "v1": "BOOLEAN", + "v2": { + "type": "boolean", + "default": null + } + } + } + }, + "displayName": null, + "availability": null, + "docs": null + } + ] + }, + "referencedTypes": [ + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight", + "type_ast:EqualsOperatorRight" + ], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "v2Examples": null, + "availability": null, + "docs": null + }, + "type_ast:EqualsOperator": { + "inline": null, + "name": { + "name": { + "originalName": "EqualsOperator", + "camelCase": { + "unsafeName": "equalsOperator", + "safeName": "equalsOperator" + }, + "snakeCase": { + "unsafeName": "equals_operator", + "safeName": "equals_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR", + "safeName": "EQUALS_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqualsOperator", + "safeName": "EqualsOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperator" + }, + "shape": { + "_type": "object", + "extends": [], + "properties": [ + { + "name": { + "name": { + "originalName": "left", + "camelCase": { + "unsafeName": "left", + "safeName": "left" + }, + "snakeCase": { + "unsafeName": "left", + "safeName": "left" + }, + "screamingSnakeCase": { + "unsafeName": "LEFT", + "safeName": "LEFT" + }, + "pascalCase": { + "unsafeName": "Left", + "safeName": "Left" + } + }, + "wireValue": "left" + }, + "valueType": { + "_type": "named", + "name": { + "originalName": "EqualsOperatorLeft", + "camelCase": { + "unsafeName": "equalsOperatorLeft", + "safeName": "equalsOperatorLeft" + }, + "snakeCase": { + "unsafeName": "equals_operator_left", + "safeName": "equals_operator_left" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR_LEFT", + "safeName": "EQUALS_OPERATOR_LEFT" + }, + "pascalCase": { + "unsafeName": "EqualsOperatorLeft", + "safeName": "EqualsOperatorLeft" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperatorLeft", + "default": null, + "inline": null + }, + "propertyAccess": null, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + }, + "availability": null, + "docs": null + }, + { + "name": { + "name": { + "originalName": "right", + "camelCase": { + "unsafeName": "right", + "safeName": "right" + }, + "snakeCase": { + "unsafeName": "right", + "safeName": "right" + }, + "screamingSnakeCase": { + "unsafeName": "RIGHT", + "safeName": "RIGHT" + }, + "pascalCase": { + "unsafeName": "Right", + "safeName": "Right" + } + }, + "wireValue": "right" + }, + "valueType": { + "_type": "named", + "name": { + "originalName": "EqualsOperatorRight", + "camelCase": { + "unsafeName": "equalsOperatorRight", + "safeName": "equalsOperatorRight" + }, + "snakeCase": { + "unsafeName": "equals_operator_right", + "safeName": "equals_operator_right" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR_RIGHT", + "safeName": "EQUALS_OPERATOR_RIGHT" + }, + "pascalCase": { + "unsafeName": "EqualsOperatorRight", + "safeName": "EqualsOperatorRight" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperatorRight", + "default": null, + "inline": null + }, + "propertyAccess": null, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + }, + "availability": null, + "docs": null + } + ], + "extra-properties": false, + "extendedProperties": [] + }, + "referencedTypes": [ + "type_ast:EqualsOperatorLeft", + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorRight", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight" + ], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "v2Examples": null, + "availability": null, + "docs": null + }, + "type_ast:EqualsOperatorLeft": { + "inline": null, + "name": { + "name": { + "originalName": "EqualsOperatorLeft", + "camelCase": { + "unsafeName": "equalsOperatorLeft", + "safeName": "equalsOperatorLeft" + }, + "snakeCase": { + "unsafeName": "equals_operator_left", + "safeName": "equals_operator_left" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR_LEFT", + "safeName": "EQUALS_OPERATOR_LEFT" + }, + "pascalCase": { + "unsafeName": "EqualsOperatorLeft", + "safeName": "EqualsOperatorLeft" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperatorLeft" + }, + "shape": { + "_type": "union", + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "extends": [], + "baseProperties": [], + "types": [ + { + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "AndOperator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:AndOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "OrOperator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:OrOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "EqualsOperator", + "camelCase": { + "unsafeName": "equalsOperator", + "safeName": "equalsOperator" + }, + "snakeCase": { + "unsafeName": "equals_operator", + "safeName": "equals_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR", + "safeName": "EQUALS_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqualsOperator", + "safeName": "EqualsOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "GreaterThanOperator", + "camelCase": { + "unsafeName": "greaterThanOperator", + "safeName": "greaterThanOperator" + }, + "snakeCase": { + "unsafeName": "greater_than_operator", + "safeName": "greater_than_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR", + "safeName": "GREATER_THAN_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperator", + "safeName": "GreaterThanOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "string_literal", + "camelCase": { + "unsafeName": "stringLiteral", + "safeName": "stringLiteral" + }, + "snakeCase": { + "unsafeName": "string_literal", + "safeName": "string_literal" + }, + "screamingSnakeCase": { + "unsafeName": "STRING_LITERAL", + "safeName": "STRING_LITERAL" + }, + "pascalCase": { + "unsafeName": "StringLiteral", + "safeName": "StringLiteral" + } + }, + "wireValue": "string_literal" + }, + "shape": { + "_type": "singleProperty", + "name": { + "name": { + "originalName": "value", + "camelCase": { + "unsafeName": "value", + "safeName": "value" + }, + "snakeCase": { + "unsafeName": "value", + "safeName": "value" + }, + "screamingSnakeCase": { + "unsafeName": "VALUE", + "safeName": "VALUE" + }, + "pascalCase": { + "unsafeName": "Value", + "safeName": "Value" + } + }, + "wireValue": "value" + }, + "type": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + }, + "displayName": null, + "availability": null, + "docs": null + } + ] + }, + "referencedTypes": [ + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight", + "type_ast:EqualsOperatorRight" + ], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "v2Examples": null, + "availability": null, + "docs": null + }, + "type_ast:EqualsOperatorRight": { + "inline": null, + "name": { + "name": { + "originalName": "EqualsOperatorRight", + "camelCase": { + "unsafeName": "equalsOperatorRight", + "safeName": "equalsOperatorRight" + }, + "snakeCase": { + "unsafeName": "equals_operator_right", + "safeName": "equals_operator_right" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR_RIGHT", + "safeName": "EQUALS_OPERATOR_RIGHT" + }, + "pascalCase": { + "unsafeName": "EqualsOperatorRight", + "safeName": "EqualsOperatorRight" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperatorRight" + }, + "shape": { + "_type": "union", + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "extends": [], + "baseProperties": [], + "types": [ + { + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "AndOperator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:AndOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "OrOperator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:OrOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "EqualsOperator", + "camelCase": { + "unsafeName": "equalsOperator", + "safeName": "equalsOperator" + }, + "snakeCase": { + "unsafeName": "equals_operator", + "safeName": "equals_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR", + "safeName": "EQUALS_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqualsOperator", + "safeName": "EqualsOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "GreaterThanOperator", + "camelCase": { + "unsafeName": "greaterThanOperator", + "safeName": "greaterThanOperator" + }, + "snakeCase": { + "unsafeName": "greater_than_operator", + "safeName": "greater_than_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR", + "safeName": "GREATER_THAN_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperator", + "safeName": "GreaterThanOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "string_literal", + "camelCase": { + "unsafeName": "stringLiteral", + "safeName": "stringLiteral" + }, + "snakeCase": { + "unsafeName": "string_literal", + "safeName": "string_literal" + }, + "screamingSnakeCase": { + "unsafeName": "STRING_LITERAL", + "safeName": "STRING_LITERAL" + }, + "pascalCase": { + "unsafeName": "StringLiteral", + "safeName": "StringLiteral" + } + }, + "wireValue": "string_literal" + }, + "shape": { + "_type": "singleProperty", + "name": { + "name": { + "originalName": "value", + "camelCase": { + "unsafeName": "value", + "safeName": "value" + }, + "snakeCase": { + "unsafeName": "value", + "safeName": "value" + }, + "screamingSnakeCase": { + "unsafeName": "VALUE", + "safeName": "VALUE" + }, + "pascalCase": { + "unsafeName": "Value", + "safeName": "Value" + } + }, + "wireValue": "value" + }, + "type": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + }, + "displayName": null, + "availability": null, + "docs": null + } + ] + }, + "referencedTypes": [ + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight", + "type_ast:EqualsOperatorRight" + ], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "v2Examples": null, + "availability": null, + "docs": null + }, + "type_ast:GreaterThanOperator": { + "inline": null, + "name": { + "name": { + "originalName": "GreaterThanOperator", + "camelCase": { + "unsafeName": "greaterThanOperator", + "safeName": "greaterThanOperator" + }, + "snakeCase": { + "unsafeName": "greater_than_operator", + "safeName": "greater_than_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR", + "safeName": "GREATER_THAN_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperator", + "safeName": "GreaterThanOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperator" + }, + "shape": { + "_type": "object", + "extends": [], + "properties": [ + { + "name": { + "name": { + "originalName": "left", + "camelCase": { + "unsafeName": "left", + "safeName": "left" + }, + "snakeCase": { + "unsafeName": "left", + "safeName": "left" + }, + "screamingSnakeCase": { + "unsafeName": "LEFT", + "safeName": "LEFT" + }, + "pascalCase": { + "unsafeName": "Left", + "safeName": "Left" + } + }, + "wireValue": "left" + }, + "valueType": { + "_type": "named", + "name": { + "originalName": "GreaterThanOperatorLeft", + "camelCase": { + "unsafeName": "greaterThanOperatorLeft", + "safeName": "greaterThanOperatorLeft" + }, + "snakeCase": { + "unsafeName": "greater_than_operator_left", + "safeName": "greater_than_operator_left" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR_LEFT", + "safeName": "GREATER_THAN_OPERATOR_LEFT" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperatorLeft", + "safeName": "GreaterThanOperatorLeft" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperatorLeft", + "default": null, + "inline": null + }, + "propertyAccess": null, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + }, + "availability": null, + "docs": null + }, + { + "name": { + "name": { + "originalName": "right", + "camelCase": { + "unsafeName": "right", + "safeName": "right" + }, + "snakeCase": { + "unsafeName": "right", + "safeName": "right" + }, + "screamingSnakeCase": { + "unsafeName": "RIGHT", + "safeName": "RIGHT" + }, + "pascalCase": { + "unsafeName": "Right", + "safeName": "Right" + } + }, + "wireValue": "right" + }, + "valueType": { + "_type": "named", + "name": { + "originalName": "GreaterThanOperatorRight", + "camelCase": { + "unsafeName": "greaterThanOperatorRight", + "safeName": "greaterThanOperatorRight" + }, + "snakeCase": { + "unsafeName": "greater_than_operator_right", + "safeName": "greater_than_operator_right" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR_RIGHT", + "safeName": "GREATER_THAN_OPERATOR_RIGHT" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperatorRight", + "safeName": "GreaterThanOperatorRight" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperatorRight", + "default": null, + "inline": null + }, + "propertyAccess": null, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + }, + "availability": null, + "docs": null + } + ], + "extra-properties": false, + "extendedProperties": [] + }, + "referencedTypes": [ + "type_ast:GreaterThanOperatorLeft", + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorRight", + "type_ast:EqualsOperatorRight" + ], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "v2Examples": null, + "availability": null, + "docs": null + }, + "type_ast:GreaterThanOperatorLeft": { + "inline": null, + "name": { + "name": { + "originalName": "GreaterThanOperatorLeft", + "camelCase": { + "unsafeName": "greaterThanOperatorLeft", + "safeName": "greaterThanOperatorLeft" + }, + "snakeCase": { + "unsafeName": "greater_than_operator_left", + "safeName": "greater_than_operator_left" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR_LEFT", + "safeName": "GREATER_THAN_OPERATOR_LEFT" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperatorLeft", + "safeName": "GreaterThanOperatorLeft" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperatorLeft" + }, + "shape": { + "_type": "union", + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "extends": [], + "baseProperties": [], + "types": [ + { + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "AndOperator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:AndOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "OrOperator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:OrOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "EqualsOperator", + "camelCase": { + "unsafeName": "equalsOperator", + "safeName": "equalsOperator" + }, + "snakeCase": { + "unsafeName": "equals_operator", + "safeName": "equals_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR", + "safeName": "EQUALS_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqualsOperator", + "safeName": "EqualsOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "GreaterThanOperator", + "camelCase": { + "unsafeName": "greaterThanOperator", + "safeName": "greaterThanOperator" + }, + "snakeCase": { + "unsafeName": "greater_than_operator", + "safeName": "greater_than_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR", + "safeName": "GREATER_THAN_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperator", + "safeName": "GreaterThanOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "number_literal", + "camelCase": { + "unsafeName": "numberLiteral", + "safeName": "numberLiteral" + }, + "snakeCase": { + "unsafeName": "number_literal", + "safeName": "number_literal" + }, + "screamingSnakeCase": { + "unsafeName": "NUMBER_LITERAL", + "safeName": "NUMBER_LITERAL" + }, + "pascalCase": { + "unsafeName": "NumberLiteral", + "safeName": "NumberLiteral" + } + }, + "wireValue": "number_literal" + }, + "shape": { + "_type": "singleProperty", + "name": { + "name": { + "originalName": "value", + "camelCase": { + "unsafeName": "value", + "safeName": "value" + }, + "snakeCase": { + "unsafeName": "value", + "safeName": "value" + }, + "screamingSnakeCase": { + "unsafeName": "VALUE", + "safeName": "VALUE" + }, + "pascalCase": { + "unsafeName": "Value", + "safeName": "Value" + } + }, + "wireValue": "value" + }, + "type": { + "_type": "primitive", + "primitive": { + "v1": "DOUBLE", + "v2": { + "type": "double", + "default": null, + "validation": null + } + } + } + }, + "displayName": null, + "availability": null, + "docs": null + } + ] + }, + "referencedTypes": [ + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight", + "type_ast:EqualsOperatorRight" + ], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "v2Examples": null, + "availability": null, + "docs": null + }, + "type_ast:GreaterThanOperatorRight": { + "inline": null, + "name": { + "name": { + "originalName": "GreaterThanOperatorRight", + "camelCase": { + "unsafeName": "greaterThanOperatorRight", + "safeName": "greaterThanOperatorRight" + }, + "snakeCase": { + "unsafeName": "greater_than_operator_right", + "safeName": "greater_than_operator_right" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR_RIGHT", + "safeName": "GREATER_THAN_OPERATOR_RIGHT" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperatorRight", + "safeName": "GreaterThanOperatorRight" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperatorRight" + }, + "shape": { + "_type": "union", + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "extends": [], + "baseProperties": [], + "types": [ + { + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "AndOperator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:AndOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "OrOperator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:OrOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "EqualsOperator", + "camelCase": { + "unsafeName": "equalsOperator", + "safeName": "equalsOperator" + }, + "snakeCase": { + "unsafeName": "equals_operator", + "safeName": "equals_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQUALS_OPERATOR", + "safeName": "EQUALS_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqualsOperator", + "safeName": "EqualsOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:EqualsOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "shape": { + "_type": "samePropertiesAsObject", + "name": { + "originalName": "GreaterThanOperator", + "camelCase": { + "unsafeName": "greaterThanOperator", + "safeName": "greaterThanOperator" + }, + "snakeCase": { + "unsafeName": "greater_than_operator", + "safeName": "greater_than_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GREATER_THAN_OPERATOR", + "safeName": "GREATER_THAN_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GreaterThanOperator", + "safeName": "GreaterThanOperator" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + }, + "displayName": null, + "typeId": "type_ast:GreaterThanOperator" + }, + "displayName": null, + "availability": null, + "docs": null + }, + { + "discriminantValue": { + "name": { + "originalName": "number_literal", + "camelCase": { + "unsafeName": "numberLiteral", + "safeName": "numberLiteral" + }, + "snakeCase": { + "unsafeName": "number_literal", + "safeName": "number_literal" + }, + "screamingSnakeCase": { + "unsafeName": "NUMBER_LITERAL", + "safeName": "NUMBER_LITERAL" + }, + "pascalCase": { + "unsafeName": "NumberLiteral", + "safeName": "NumberLiteral" + } + }, + "wireValue": "number_literal" + }, + "shape": { + "_type": "singleProperty", + "name": { + "name": { + "originalName": "value", + "camelCase": { + "unsafeName": "value", + "safeName": "value" + }, + "snakeCase": { + "unsafeName": "value", + "safeName": "value" + }, + "screamingSnakeCase": { + "unsafeName": "VALUE", + "safeName": "VALUE" + }, + "pascalCase": { + "unsafeName": "Value", + "safeName": "Value" + } + }, + "wireValue": "value" + }, + "type": { + "_type": "primitive", + "primitive": { + "v1": "DOUBLE", + "v2": { + "type": "double", + "default": null, + "validation": null + } + } + } + }, + "displayName": null, + "availability": null, + "docs": null + } + ] + }, + "referencedTypes": [ + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight", + "type_ast:EqualsOperatorRight" + ], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "v2Examples": null, + "availability": null, + "docs": null + } + }, + "errors": {}, + "services": {}, + "constants": { + "errorInstanceIdKey": { + "name": { + "originalName": "errorInstanceId", + "camelCase": { + "unsafeName": "errorInstanceID", + "safeName": "errorInstanceID" + }, + "snakeCase": { + "unsafeName": "error_instance_id", + "safeName": "error_instance_id" + }, + "screamingSnakeCase": { + "unsafeName": "ERROR_INSTANCE_ID", + "safeName": "ERROR_INSTANCE_ID" + }, + "pascalCase": { + "unsafeName": "ErrorInstanceID", + "safeName": "ErrorInstanceID" + } + }, + "wireValue": "errorInstanceId" + } + }, + "environments": null, + "errorDiscriminationStrategy": { + "type": "statusCode" + }, + "basePath": null, + "pathParameters": [], + "variables": [], "serviceTypeReferenceInfo": { "typesReferencedOnlyByService": {}, "sharedTypes": [ @@ -4184,7 +8544,17 @@ "type_ast:ObjectValue", "type_ast:FieldName", "type_ast:FieldValue", - "type_ast:ObjectFieldValue" + "type_ast:ObjectFieldValue", + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:EqualsOperatorRight", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight" ] }, "webhookGroups": {}, @@ -4199,59 +8569,1230 @@ "type": "object", "declaration": { "name": { - "originalName": "ImportingA", + "originalName": "ImportingA", + "camelCase": { + "unsafeName": "importingA", + "safeName": "importingA" + }, + "snakeCase": { + "unsafeName": "importing_a", + "safeName": "importing_a" + }, + "screamingSnakeCase": { + "unsafeName": "IMPORTING_A", + "safeName": "IMPORTING_A" + }, + "pascalCase": { + "unsafeName": "ImportingA", + "safeName": "ImportingA" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "a", + "camelCase": { + "unsafeName": "a", + "safeName": "a" + }, + "snakeCase": { + "unsafeName": "a", + "safeName": "a" + }, + "screamingSnakeCase": { + "unsafeName": "A", + "safeName": "A" + }, + "pascalCase": { + "unsafeName": "A", + "safeName": "A" + } + }, + "wireValue": "a" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "named", + "value": "type_a:A" + } + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_:RootType": { + "type": "object", + "declaration": { + "name": { + "originalName": "RootType", + "camelCase": { + "unsafeName": "rootType", + "safeName": "rootType" + }, + "snakeCase": { + "unsafeName": "root_type", + "safeName": "root_type" + }, + "screamingSnakeCase": { + "unsafeName": "ROOT_TYPE", + "safeName": "ROOT_TYPE" + }, + "pascalCase": { + "unsafeName": "RootType", + "safeName": "RootType" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "s", + "camelCase": { + "unsafeName": "s", + "safeName": "s" + }, + "snakeCase": { + "unsafeName": "s", + "safeName": "s" + }, + "screamingSnakeCase": { + "unsafeName": "S", + "safeName": "S" + }, + "pascalCase": { + "unsafeName": "S", + "safeName": "S" + } + }, + "wireValue": "s" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_a:A": { + "type": "object", + "declaration": { + "name": { + "originalName": "A", + "camelCase": { + "unsafeName": "a", + "safeName": "a" + }, + "snakeCase": { + "unsafeName": "a", + "safeName": "a" + }, + "screamingSnakeCase": { + "unsafeName": "A", + "safeName": "A" + }, + "pascalCase": { + "unsafeName": "A", + "safeName": "A" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "a", + "camelCase": { + "unsafeName": "a", + "safeName": "a" + }, + "snakeCase": { + "unsafeName": "a", + "safeName": "a" + }, + "screamingSnakeCase": { + "unsafeName": "A", + "safeName": "A" + }, + "pascalCase": { + "unsafeName": "A", + "safeName": "A" + } + } + ], + "packagePath": [], + "file": { + "originalName": "a", + "camelCase": { + "unsafeName": "a", + "safeName": "a" + }, + "snakeCase": { + "unsafeName": "a", + "safeName": "a" + }, + "screamingSnakeCase": { + "unsafeName": "A", + "safeName": "A" + }, + "pascalCase": { + "unsafeName": "A", + "safeName": "A" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "s", + "camelCase": { + "unsafeName": "s", + "safeName": "s" + }, + "snakeCase": { + "unsafeName": "s", + "safeName": "s" + }, + "screamingSnakeCase": { + "unsafeName": "S", + "safeName": "S" + }, + "pascalCase": { + "unsafeName": "S", + "safeName": "S" + } + }, + "wireValue": "s" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:Animal": { + "type": "undiscriminatedUnion", + "declaration": { + "name": { + "originalName": "Animal", + "camelCase": { + "unsafeName": "animal", + "safeName": "animal" + }, + "snakeCase": { + "unsafeName": "animal", + "safeName": "animal" + }, + "screamingSnakeCase": { + "unsafeName": "ANIMAL", + "safeName": "ANIMAL" + }, + "pascalCase": { + "unsafeName": "Animal", + "safeName": "Animal" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "types": [ + { + "type": "named", + "value": "type_ast:Cat" + }, + { + "type": "named", + "value": "type_ast:Dog" + } + ] + }, + "type_ast:Fruit": { + "type": "undiscriminatedUnion", + "declaration": { + "name": { + "originalName": "Fruit", + "camelCase": { + "unsafeName": "fruit", + "safeName": "fruit" + }, + "snakeCase": { + "unsafeName": "fruit", + "safeName": "fruit" + }, + "screamingSnakeCase": { + "unsafeName": "FRUIT", + "safeName": "FRUIT" + }, + "pascalCase": { + "unsafeName": "Fruit", + "safeName": "Fruit" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "types": [ + { + "type": "named", + "value": "type_ast:Acai" + }, + { + "type": "named", + "value": "type_ast:Fig" + } + ] + }, + "type_ast:Node": { + "type": "undiscriminatedUnion", + "declaration": { + "name": { + "originalName": "Node", + "camelCase": { + "unsafeName": "node", + "safeName": "node" + }, + "snakeCase": { + "unsafeName": "node", + "safeName": "node" + }, + "screamingSnakeCase": { + "unsafeName": "NODE", + "safeName": "NODE" + }, + "pascalCase": { + "unsafeName": "Node", + "safeName": "Node" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "types": [ + { + "type": "named", + "value": "type_ast:BranchNode" + }, + { + "type": "named", + "value": "type_ast:LeafNode" + } + ] + }, + "type_ast:Cat": { + "type": "object", + "declaration": { + "name": { + "originalName": "Cat", + "camelCase": { + "unsafeName": "cat", + "safeName": "cat" + }, + "snakeCase": { + "unsafeName": "cat", + "safeName": "cat" + }, + "screamingSnakeCase": { + "unsafeName": "CAT", + "safeName": "CAT" + }, + "pascalCase": { + "unsafeName": "Cat", + "safeName": "Cat" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "fruit", + "camelCase": { + "unsafeName": "fruit", + "safeName": "fruit" + }, + "snakeCase": { + "unsafeName": "fruit", + "safeName": "fruit" + }, + "screamingSnakeCase": { + "unsafeName": "FRUIT", + "safeName": "FRUIT" + }, + "pascalCase": { + "unsafeName": "Fruit", + "safeName": "Fruit" + } + }, + "wireValue": "fruit" + }, + "typeReference": { + "type": "named", + "value": "type_ast:Fruit" + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:Dog": { + "type": "object", + "declaration": { + "name": { + "originalName": "Dog", + "camelCase": { + "unsafeName": "dog", + "safeName": "dog" + }, + "snakeCase": { + "unsafeName": "dog", + "safeName": "dog" + }, + "screamingSnakeCase": { + "unsafeName": "DOG", + "safeName": "DOG" + }, + "pascalCase": { + "unsafeName": "Dog", + "safeName": "Dog" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "fruit", + "camelCase": { + "unsafeName": "fruit", + "safeName": "fruit" + }, + "snakeCase": { + "unsafeName": "fruit", + "safeName": "fruit" + }, + "screamingSnakeCase": { + "unsafeName": "FRUIT", + "safeName": "FRUIT" + }, + "pascalCase": { + "unsafeName": "Fruit", + "safeName": "Fruit" + } + }, + "wireValue": "fruit" + }, + "typeReference": { + "type": "named", + "value": "type_ast:Fruit" + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:Acai": { + "type": "object", + "declaration": { + "name": { + "originalName": "Acai", + "camelCase": { + "unsafeName": "acai", + "safeName": "acai" + }, + "snakeCase": { + "unsafeName": "acai", + "safeName": "acai" + }, + "screamingSnakeCase": { + "unsafeName": "ACAI", + "safeName": "ACAI" + }, + "pascalCase": { + "unsafeName": "Acai", + "safeName": "Acai" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "animal", + "camelCase": { + "unsafeName": "animal", + "safeName": "animal" + }, + "snakeCase": { + "unsafeName": "animal", + "safeName": "animal" + }, + "screamingSnakeCase": { + "unsafeName": "ANIMAL", + "safeName": "ANIMAL" + }, + "pascalCase": { + "unsafeName": "Animal", + "safeName": "Animal" + } + }, + "wireValue": "animal" + }, + "typeReference": { + "type": "named", + "value": "type_ast:Animal" + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:Fig": { + "type": "object", + "declaration": { + "name": { + "originalName": "Fig", + "camelCase": { + "unsafeName": "fig", + "safeName": "fig" + }, + "snakeCase": { + "unsafeName": "fig", + "safeName": "fig" + }, + "screamingSnakeCase": { + "unsafeName": "FIG", + "safeName": "FIG" + }, + "pascalCase": { + "unsafeName": "Fig", + "safeName": "Fig" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "animal", + "camelCase": { + "unsafeName": "animal", + "safeName": "animal" + }, + "snakeCase": { + "unsafeName": "animal", + "safeName": "animal" + }, + "screamingSnakeCase": { + "unsafeName": "ANIMAL", + "safeName": "ANIMAL" + }, + "pascalCase": { + "unsafeName": "Animal", + "safeName": "Animal" + } + }, + "wireValue": "animal" + }, + "typeReference": { + "type": "named", + "value": "type_ast:Animal" + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:Berry": { + "type": "object", + "declaration": { + "name": { + "originalName": "Berry", + "camelCase": { + "unsafeName": "berry", + "safeName": "berry" + }, + "snakeCase": { + "unsafeName": "berry", + "safeName": "berry" + }, + "screamingSnakeCase": { + "unsafeName": "BERRY", + "safeName": "BERRY" + }, + "pascalCase": { + "unsafeName": "Berry", + "safeName": "Berry" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "animal", + "camelCase": { + "unsafeName": "animal", + "safeName": "animal" + }, + "snakeCase": { + "unsafeName": "animal", + "safeName": "animal" + }, + "screamingSnakeCase": { + "unsafeName": "ANIMAL", + "safeName": "ANIMAL" + }, + "pascalCase": { + "unsafeName": "Animal", + "safeName": "Animal" + } + }, + "wireValue": "animal" + }, + "typeReference": { + "type": "named", + "value": "type_ast:Animal" + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:BranchNode": { + "type": "object", + "declaration": { + "name": { + "originalName": "BranchNode", + "camelCase": { + "unsafeName": "branchNode", + "safeName": "branchNode" + }, + "snakeCase": { + "unsafeName": "branch_node", + "safeName": "branch_node" + }, + "screamingSnakeCase": { + "unsafeName": "BRANCH_NODE", + "safeName": "BRANCH_NODE" + }, + "pascalCase": { + "unsafeName": "BranchNode", + "safeName": "BranchNode" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "children", + "camelCase": { + "unsafeName": "children", + "safeName": "children" + }, + "snakeCase": { + "unsafeName": "children", + "safeName": "children" + }, + "screamingSnakeCase": { + "unsafeName": "CHILDREN", + "safeName": "CHILDREN" + }, + "pascalCase": { + "unsafeName": "Children", + "safeName": "Children" + } + }, + "wireValue": "children" + }, + "typeReference": { + "type": "list", + "value": { + "type": "named", + "value": "type_ast:Node" + } + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false + }, + "type_ast:LeafNode": { + "type": "object", + "declaration": { + "name": { + "originalName": "LeafNode", + "camelCase": { + "unsafeName": "leafNode", + "safeName": "leafNode" + }, + "snakeCase": { + "unsafeName": "leaf_node", + "safeName": "leaf_node" + }, + "screamingSnakeCase": { + "unsafeName": "LEAF_NODE", + "safeName": "LEAF_NODE" + }, + "pascalCase": { + "unsafeName": "LeafNode", + "safeName": "LeafNode" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + } + }, + "properties": [], + "additionalProperties": false + }, + "type_ast:NodesWrapper": { + "type": "object", + "declaration": { + "name": { + "originalName": "NodesWrapper", "camelCase": { - "unsafeName": "importingA", - "safeName": "importingA" + "unsafeName": "nodesWrapper", + "safeName": "nodesWrapper" }, "snakeCase": { - "unsafeName": "importing_a", - "safeName": "importing_a" + "unsafeName": "nodes_wrapper", + "safeName": "nodes_wrapper" }, "screamingSnakeCase": { - "unsafeName": "IMPORTING_A", - "safeName": "IMPORTING_A" + "unsafeName": "NODES_WRAPPER", + "safeName": "NODES_WRAPPER" }, "pascalCase": { - "unsafeName": "ImportingA", - "safeName": "ImportingA" + "unsafeName": "NodesWrapper", + "safeName": "NodesWrapper" } }, "fernFilepath": { - "allParts": [], + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], "packagePath": [], - "file": null + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } } }, "properties": [ { "name": { "name": { - "originalName": "a", + "originalName": "nodes", "camelCase": { - "unsafeName": "a", - "safeName": "a" + "unsafeName": "nodes", + "safeName": "nodes" }, "snakeCase": { - "unsafeName": "a", - "safeName": "a" + "unsafeName": "nodes", + "safeName": "nodes" }, "screamingSnakeCase": { - "unsafeName": "A", - "safeName": "A" + "unsafeName": "NODES", + "safeName": "NODES" }, "pascalCase": { - "unsafeName": "A", - "safeName": "A" + "unsafeName": "Nodes", + "safeName": "Nodes" } }, - "wireValue": "a" + "wireValue": "nodes" }, "typeReference": { - "type": "optional", + "type": "list", "value": { - "type": "named", - "value": "type_a:A" + "type": "list", + "value": { + "type": "named", + "value": "type_ast:Node" + } } }, "propertyAccess": null, @@ -4260,188 +9801,365 @@ ], "additionalProperties": false }, - "type_:RootType": { - "type": "object", + "type_ast:ContainerValue": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "RootType", + "originalName": "ContainerValue", "camelCase": { - "unsafeName": "rootType", - "safeName": "rootType" + "unsafeName": "containerValue", + "safeName": "containerValue" }, "snakeCase": { - "unsafeName": "root_type", - "safeName": "root_type" + "unsafeName": "container_value", + "safeName": "container_value" }, "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE", - "safeName": "ROOT_TYPE" + "unsafeName": "CONTAINER_VALUE", + "safeName": "CONTAINER_VALUE" }, "pascalCase": { - "unsafeName": "RootType", - "safeName": "RootType" + "unsafeName": "ContainerValue", + "safeName": "ContainerValue" } }, "fernFilepath": { - "allParts": [], + "allParts": [ + { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } + ], "packagePath": [], - "file": null + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } } }, - "properties": [ - { - "name": { + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "types": { + "list": { + "type": "singleProperty", + "typeReference": { + "type": "list", + "value": { + "type": "named", + "value": "type_ast:FieldValue" + } + }, + "discriminantValue": { "name": { - "originalName": "s", + "originalName": "list", "camelCase": { - "unsafeName": "s", - "safeName": "s" + "unsafeName": "list", + "safeName": "list" + }, + "snakeCase": { + "unsafeName": "list", + "safeName": "list" + }, + "screamingSnakeCase": { + "unsafeName": "LIST", + "safeName": "LIST" + }, + "pascalCase": { + "unsafeName": "List", + "safeName": "List" + } + }, + "wireValue": "list" + }, + "properties": null + }, + "optional": { + "type": "singleProperty", + "typeReference": { + "type": "optional", + "value": { + "type": "named", + "value": "type_ast:FieldValue" + } + }, + "discriminantValue": { + "name": { + "originalName": "optional", + "camelCase": { + "unsafeName": "optional", + "safeName": "optional" }, "snakeCase": { - "unsafeName": "s", - "safeName": "s" + "unsafeName": "optional", + "safeName": "optional" }, "screamingSnakeCase": { - "unsafeName": "S", - "safeName": "S" + "unsafeName": "OPTIONAL", + "safeName": "OPTIONAL" }, "pascalCase": { - "unsafeName": "S", - "safeName": "S" + "unsafeName": "Optional", + "safeName": "Optional" } }, - "wireValue": "s" - }, - "typeReference": { - "type": "primitive", - "value": "STRING" + "wireValue": "optional" }, - "propertyAccess": null, - "variable": null + "properties": null } - ], - "additionalProperties": false + } }, - "type_a:A": { - "type": "object", + "type_ast:PrimitiveValue": { + "type": "enum", "declaration": { "name": { - "originalName": "A", + "originalName": "PrimitiveValue", "camelCase": { - "unsafeName": "a", - "safeName": "a" + "unsafeName": "primitiveValue", + "safeName": "primitiveValue" }, "snakeCase": { - "unsafeName": "a", - "safeName": "a" + "unsafeName": "primitive_value", + "safeName": "primitive_value" }, "screamingSnakeCase": { - "unsafeName": "A", - "safeName": "A" + "unsafeName": "PRIMITIVE_VALUE", + "safeName": "PRIMITIVE_VALUE" }, "pascalCase": { - "unsafeName": "A", - "safeName": "A" + "unsafeName": "PrimitiveValue", + "safeName": "PrimitiveValue" } }, "fernFilepath": { "allParts": [ { - "originalName": "a", + "originalName": "ast", "camelCase": { - "unsafeName": "a", - "safeName": "a" + "unsafeName": "ast", + "safeName": "ast" }, "snakeCase": { - "unsafeName": "a", - "safeName": "a" + "unsafeName": "ast", + "safeName": "ast" }, "screamingSnakeCase": { - "unsafeName": "A", - "safeName": "A" + "unsafeName": "AST", + "safeName": "AST" }, "pascalCase": { - "unsafeName": "A", - "safeName": "A" + "unsafeName": "Ast", + "safeName": "Ast" } } ], "packagePath": [], "file": { - "originalName": "a", + "originalName": "ast", "camelCase": { - "unsafeName": "a", - "safeName": "a" + "unsafeName": "ast", + "safeName": "ast" }, "snakeCase": { - "unsafeName": "a", - "safeName": "a" + "unsafeName": "ast", + "safeName": "ast" }, "screamingSnakeCase": { - "unsafeName": "A", - "safeName": "A" + "unsafeName": "AST", + "safeName": "AST" }, "pascalCase": { - "unsafeName": "A", - "safeName": "A" + "unsafeName": "Ast", + "safeName": "Ast" } } } }, - "properties": [ + "values": [ { "name": { - "name": { - "originalName": "s", + "originalName": "STRING", + "camelCase": { + "unsafeName": "string", + "safeName": "string" + }, + "snakeCase": { + "unsafeName": "string", + "safeName": "string" + }, + "screamingSnakeCase": { + "unsafeName": "STRING", + "safeName": "STRING" + }, + "pascalCase": { + "unsafeName": "String", + "safeName": "String" + } + }, + "wireValue": "STRING" + }, + { + "name": { + "originalName": "NUMBER", + "camelCase": { + "unsafeName": "number", + "safeName": "number" + }, + "snakeCase": { + "unsafeName": "number", + "safeName": "number" + }, + "screamingSnakeCase": { + "unsafeName": "NUMBER", + "safeName": "NUMBER" + }, + "pascalCase": { + "unsafeName": "Number", + "safeName": "Number" + } + }, + "wireValue": "NUMBER" + } + ] + }, + "type_ast:ObjectValue": { + "type": "object", + "declaration": { + "name": { + "originalName": "ObjectValue", + "camelCase": { + "unsafeName": "objectValue", + "safeName": "objectValue" + }, + "snakeCase": { + "unsafeName": "object_value", + "safeName": "object_value" + }, + "screamingSnakeCase": { + "unsafeName": "OBJECT_VALUE", + "safeName": "OBJECT_VALUE" + }, + "pascalCase": { + "unsafeName": "ObjectValue", + "safeName": "ObjectValue" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "ast", "camelCase": { - "unsafeName": "s", - "safeName": "s" + "unsafeName": "ast", + "safeName": "ast" }, "snakeCase": { - "unsafeName": "s", - "safeName": "s" + "unsafeName": "ast", + "safeName": "ast" }, "screamingSnakeCase": { - "unsafeName": "S", - "safeName": "S" + "unsafeName": "AST", + "safeName": "AST" }, "pascalCase": { - "unsafeName": "S", - "safeName": "S" + "unsafeName": "Ast", + "safeName": "Ast" } + } + ], + "packagePath": [], + "file": { + "originalName": "ast", + "camelCase": { + "unsafeName": "ast", + "safeName": "ast" }, - "wireValue": "s" - }, - "typeReference": { - "type": "primitive", - "value": "STRING" - }, - "propertyAccess": null, - "variable": null + "snakeCase": { + "unsafeName": "ast", + "safeName": "ast" + }, + "screamingSnakeCase": { + "unsafeName": "AST", + "safeName": "AST" + }, + "pascalCase": { + "unsafeName": "Ast", + "safeName": "Ast" + } + } } - ], + }, + "properties": [], "additionalProperties": false }, - "type_ast:Animal": { - "type": "undiscriminatedUnion", + "type_ast:FieldName": { + "type": "alias", "declaration": { "name": { - "originalName": "Animal", + "originalName": "FieldName", "camelCase": { - "unsafeName": "animal", - "safeName": "animal" + "unsafeName": "fieldName", + "safeName": "fieldName" }, "snakeCase": { - "unsafeName": "animal", - "safeName": "animal" + "unsafeName": "field_name", + "safeName": "field_name" }, "screamingSnakeCase": { - "unsafeName": "ANIMAL", - "safeName": "ANIMAL" + "unsafeName": "FIELD_NAME", + "safeName": "FIELD_NAME" }, "pascalCase": { - "unsafeName": "Animal", - "safeName": "Animal" + "unsafeName": "FieldName", + "safeName": "FieldName" } }, "fernFilepath": { @@ -4488,37 +10206,31 @@ } } }, - "types": [ - { - "type": "named", - "value": "type_ast:Cat" - }, - { - "type": "named", - "value": "type_ast:Dog" - } - ] + "typeReference": { + "type": "primitive", + "value": "STRING" + } }, - "type_ast:Fruit": { - "type": "undiscriminatedUnion", + "type_ast:FieldValue": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "Fruit", + "originalName": "FieldValue", "camelCase": { - "unsafeName": "fruit", - "safeName": "fruit" + "unsafeName": "fieldValue", + "safeName": "fieldValue" }, "snakeCase": { - "unsafeName": "fruit", - "safeName": "fruit" + "unsafeName": "field_value", + "safeName": "field_value" }, "screamingSnakeCase": { - "unsafeName": "FRUIT", - "safeName": "FRUIT" + "unsafeName": "FIELD_VALUE", + "safeName": "FIELD_VALUE" }, "pascalCase": { - "unsafeName": "Fruit", - "safeName": "Fruit" + "unsafeName": "FieldValue", + "safeName": "FieldValue" } }, "fernFilepath": { @@ -4565,37 +10277,138 @@ } } }, - "types": [ - { - "type": "named", - "value": "type_ast:Acai" + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } }, - { - "type": "named", - "value": "type_ast:Fig" + "wireValue": "type" + }, + "types": { + "primitive_value": { + "type": "singleProperty", + "typeReference": { + "type": "named", + "value": "type_ast:PrimitiveValue" + }, + "discriminantValue": { + "name": { + "originalName": "primitive_value", + "camelCase": { + "unsafeName": "primitiveValue", + "safeName": "primitiveValue" + }, + "snakeCase": { + "unsafeName": "primitive_value", + "safeName": "primitive_value" + }, + "screamingSnakeCase": { + "unsafeName": "PRIMITIVE_VALUE", + "safeName": "PRIMITIVE_VALUE" + }, + "pascalCase": { + "unsafeName": "PrimitiveValue", + "safeName": "PrimitiveValue" + } + }, + "wireValue": "primitive_value" + }, + "properties": null + }, + "object_value": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:ObjectValue", + "discriminantValue": { + "name": { + "originalName": "object_value", + "camelCase": { + "unsafeName": "objectValue", + "safeName": "objectValue" + }, + "snakeCase": { + "unsafeName": "object_value", + "safeName": "object_value" + }, + "screamingSnakeCase": { + "unsafeName": "OBJECT_VALUE", + "safeName": "OBJECT_VALUE" + }, + "pascalCase": { + "unsafeName": "ObjectValue", + "safeName": "ObjectValue" + } + }, + "wireValue": "object_value" + }, + "properties": [] + }, + "container_value": { + "type": "singleProperty", + "typeReference": { + "type": "named", + "value": "type_ast:ContainerValue" + }, + "discriminantValue": { + "name": { + "originalName": "container_value", + "camelCase": { + "unsafeName": "containerValue", + "safeName": "containerValue" + }, + "snakeCase": { + "unsafeName": "container_value", + "safeName": "container_value" + }, + "screamingSnakeCase": { + "unsafeName": "CONTAINER_VALUE", + "safeName": "CONTAINER_VALUE" + }, + "pascalCase": { + "unsafeName": "ContainerValue", + "safeName": "ContainerValue" + } + }, + "wireValue": "container_value" + }, + "properties": null } - ] + } }, - "type_ast:Node": { - "type": "undiscriminatedUnion", + "type_ast:ObjectFieldValue": { + "type": "object", "declaration": { "name": { - "originalName": "Node", + "originalName": "ObjectFieldValue", "camelCase": { - "unsafeName": "node", - "safeName": "node" + "unsafeName": "objectFieldValue", + "safeName": "objectFieldValue" }, "snakeCase": { - "unsafeName": "node", - "safeName": "node" + "unsafeName": "object_field_value", + "safeName": "object_field_value" }, "screamingSnakeCase": { - "unsafeName": "NODE", - "safeName": "NODE" + "unsafeName": "OBJECT_FIELD_VALUE", + "safeName": "OBJECT_FIELD_VALUE" }, "pascalCase": { - "unsafeName": "Node", - "safeName": "Node" + "unsafeName": "ObjectFieldValue", + "safeName": "ObjectFieldValue" } }, "fernFilepath": { @@ -4642,37 +10455,90 @@ } } }, - "types": [ + "properties": [ { - "type": "named", - "value": "type_ast:BranchNode" + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "typeReference": { + "type": "named", + "value": "type_ast:FieldName" + }, + "propertyAccess": null, + "variable": null }, { - "type": "named", - "value": "type_ast:LeafNode" + "name": { + "name": { + "originalName": "value", + "camelCase": { + "unsafeName": "value", + "safeName": "value" + }, + "snakeCase": { + "unsafeName": "value", + "safeName": "value" + }, + "screamingSnakeCase": { + "unsafeName": "VALUE", + "safeName": "VALUE" + }, + "pascalCase": { + "unsafeName": "Value", + "safeName": "Value" + } + }, + "wireValue": "value" + }, + "typeReference": { + "type": "named", + "value": "type_ast:FieldValue" + }, + "propertyAccess": null, + "variable": null } - ] + ], + "additionalProperties": false }, - "type_ast:Cat": { + "type_ast:AndOperator": { "type": "object", "declaration": { "name": { - "originalName": "Cat", + "originalName": "AndOperator", "camelCase": { - "unsafeName": "cat", - "safeName": "cat" + "unsafeName": "andOperator", + "safeName": "andOperator" }, "snakeCase": { - "unsafeName": "cat", - "safeName": "cat" + "unsafeName": "and_operator", + "safeName": "and_operator" }, "screamingSnakeCase": { - "unsafeName": "CAT", - "safeName": "CAT" + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" }, "pascalCase": { - "unsafeName": "Cat", - "safeName": "Cat" + "unsafeName": "AndOperator", + "safeName": "AndOperator" } }, "fernFilepath": { @@ -4723,29 +10589,32 @@ { "name": { "name": { - "originalName": "fruit", + "originalName": "children", "camelCase": { - "unsafeName": "fruit", - "safeName": "fruit" + "unsafeName": "children", + "safeName": "children" }, "snakeCase": { - "unsafeName": "fruit", - "safeName": "fruit" + "unsafeName": "children", + "safeName": "children" }, "screamingSnakeCase": { - "unsafeName": "FRUIT", - "safeName": "FRUIT" + "unsafeName": "CHILDREN", + "safeName": "CHILDREN" }, "pascalCase": { - "unsafeName": "Fruit", - "safeName": "Fruit" + "unsafeName": "Children", + "safeName": "Children" } }, - "wireValue": "fruit" + "wireValue": "children" }, "typeReference": { - "type": "named", - "value": "type_ast:Fruit" + "type": "list", + "value": { + "type": "named", + "value": "type_ast:AndOperatorChild" + } }, "propertyAccess": null, "variable": null @@ -4753,26 +10622,26 @@ ], "additionalProperties": false }, - "type_ast:Dog": { - "type": "object", + "type_ast:AndOperatorChild": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "Dog", + "originalName": "AndOperatorChild", "camelCase": { - "unsafeName": "dog", - "safeName": "dog" + "unsafeName": "andOperatorChild", + "safeName": "andOperatorChild" }, "snakeCase": { - "unsafeName": "dog", - "safeName": "dog" + "unsafeName": "and_operator_child", + "safeName": "and_operator_child" }, "screamingSnakeCase": { - "unsafeName": "DOG", - "safeName": "DOG" + "unsafeName": "AND_OPERATOR_CHILD", + "safeName": "AND_OPERATOR_CHILD" }, "pascalCase": { - "unsafeName": "Dog", - "safeName": "Dog" + "unsafeName": "AndOperatorChild", + "safeName": "AndOperatorChild" } }, "fernFilepath": { @@ -4819,60 +10688,189 @@ } } }, - "properties": [ - { - "name": { + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "types": { + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { "name": { - "originalName": "fruit", + "originalName": "and_operator", "camelCase": { - "unsafeName": "fruit", - "safeName": "fruit" + "unsafeName": "andOperator", + "safeName": "andOperator" }, "snakeCase": { - "unsafeName": "fruit", - "safeName": "fruit" + "unsafeName": "and_operator", + "safeName": "and_operator" }, "screamingSnakeCase": { - "unsafeName": "FRUIT", - "safeName": "FRUIT" + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" }, "pascalCase": { - "unsafeName": "Fruit", - "safeName": "Fruit" + "unsafeName": "AndOperator", + "safeName": "AndOperator" } }, - "wireValue": "fruit" + "wireValue": "and_operator" + }, + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" + }, + "properties": [] + }, + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "properties": [] + }, + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" }, + "properties": [] + }, + "boolean_literal": { + "type": "singleProperty", "typeReference": { - "type": "named", - "value": "type_ast:Fruit" + "type": "primitive", + "value": "BOOLEAN" }, - "propertyAccess": null, - "variable": null + "discriminantValue": { + "name": { + "originalName": "boolean_literal", + "camelCase": { + "unsafeName": "booleanLiteral", + "safeName": "booleanLiteral" + }, + "snakeCase": { + "unsafeName": "boolean_literal", + "safeName": "boolean_literal" + }, + "screamingSnakeCase": { + "unsafeName": "BOOLEAN_LITERAL", + "safeName": "BOOLEAN_LITERAL" + }, + "pascalCase": { + "unsafeName": "BooleanLiteral", + "safeName": "BooleanLiteral" + } + }, + "wireValue": "boolean_literal" + }, + "properties": null } - ], - "additionalProperties": false + } }, - "type_ast:Acai": { + "type_ast:OrOperator": { "type": "object", "declaration": { "name": { - "originalName": "Acai", + "originalName": "OrOperator", "camelCase": { - "unsafeName": "acai", - "safeName": "acai" + "unsafeName": "orOperator", + "safeName": "orOperator" }, "snakeCase": { - "unsafeName": "acai", - "safeName": "acai" + "unsafeName": "or_operator", + "safeName": "or_operator" }, "screamingSnakeCase": { - "unsafeName": "ACAI", - "safeName": "ACAI" + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" }, "pascalCase": { - "unsafeName": "Acai", - "safeName": "Acai" + "unsafeName": "OrOperator", + "safeName": "OrOperator" } }, "fernFilepath": { @@ -4923,29 +10921,32 @@ { "name": { "name": { - "originalName": "animal", + "originalName": "children", "camelCase": { - "unsafeName": "animal", - "safeName": "animal" + "unsafeName": "children", + "safeName": "children" }, "snakeCase": { - "unsafeName": "animal", - "safeName": "animal" + "unsafeName": "children", + "safeName": "children" }, "screamingSnakeCase": { - "unsafeName": "ANIMAL", - "safeName": "ANIMAL" + "unsafeName": "CHILDREN", + "safeName": "CHILDREN" }, "pascalCase": { - "unsafeName": "Animal", - "safeName": "Animal" + "unsafeName": "Children", + "safeName": "Children" } }, - "wireValue": "animal" + "wireValue": "children" }, "typeReference": { - "type": "named", - "value": "type_ast:Animal" + "type": "list", + "value": { + "type": "named", + "value": "type_ast:OrOperatorChild" + } }, "propertyAccess": null, "variable": null @@ -4953,26 +10954,26 @@ ], "additionalProperties": false }, - "type_ast:Fig": { - "type": "object", + "type_ast:OrOperatorChild": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "Fig", + "originalName": "OrOperatorChild", "camelCase": { - "unsafeName": "fig", - "safeName": "fig" + "unsafeName": "orOperatorChild", + "safeName": "orOperatorChild" }, "snakeCase": { - "unsafeName": "fig", - "safeName": "fig" + "unsafeName": "or_operator_child", + "safeName": "or_operator_child" }, "screamingSnakeCase": { - "unsafeName": "FIG", - "safeName": "FIG" + "unsafeName": "OR_OPERATOR_CHILD", + "safeName": "OR_OPERATOR_CHILD" }, "pascalCase": { - "unsafeName": "Fig", - "safeName": "Fig" + "unsafeName": "OrOperatorChild", + "safeName": "OrOperatorChild" } }, "fernFilepath": { @@ -5019,160 +11020,189 @@ } } }, - "properties": [ - { - "name": { + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "types": { + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { "name": { - "originalName": "animal", + "originalName": "and_operator", "camelCase": { - "unsafeName": "animal", - "safeName": "animal" + "unsafeName": "andOperator", + "safeName": "andOperator" }, "snakeCase": { - "unsafeName": "animal", - "safeName": "animal" + "unsafeName": "and_operator", + "safeName": "and_operator" }, "screamingSnakeCase": { - "unsafeName": "ANIMAL", - "safeName": "ANIMAL" + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" }, "pascalCase": { - "unsafeName": "Animal", - "safeName": "Animal" + "unsafeName": "AndOperator", + "safeName": "AndOperator" } }, - "wireValue": "animal" - }, - "typeReference": { - "type": "named", - "value": "type_ast:Animal" - }, - "propertyAccess": null, - "variable": null - } - ], - "additionalProperties": false - }, - "type_ast:Berry": { - "type": "object", - "declaration": { - "name": { - "originalName": "Berry", - "camelCase": { - "unsafeName": "berry", - "safeName": "berry" - }, - "snakeCase": { - "unsafeName": "berry", - "safeName": "berry" + "wireValue": "and_operator" }, - "screamingSnakeCase": { - "unsafeName": "BERRY", - "safeName": "BERRY" + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" }, - "pascalCase": { - "unsafeName": "Berry", - "safeName": "Berry" - } + "properties": [] }, - "fernFilepath": { - "allParts": [ - { - "originalName": "ast", + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } + }, + "wireValue": "eq_operator" + }, + "properties": [] + }, + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", "camelCase": { - "unsafeName": "ast", - "safeName": "ast" + "unsafeName": "gtOperator", + "safeName": "gtOperator" }, "snakeCase": { - "unsafeName": "ast", - "safeName": "ast" + "unsafeName": "gt_operator", + "safeName": "gt_operator" }, "screamingSnakeCase": { - "unsafeName": "AST", - "safeName": "AST" + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" }, "pascalCase": { - "unsafeName": "Ast", - "safeName": "Ast" + "unsafeName": "GtOperator", + "safeName": "GtOperator" } - } - ], - "packagePath": [], - "file": { - "originalName": "ast", - "camelCase": { - "unsafeName": "ast", - "safeName": "ast" - }, - "snakeCase": { - "unsafeName": "ast", - "safeName": "ast" - }, - "screamingSnakeCase": { - "unsafeName": "AST", - "safeName": "AST" }, - "pascalCase": { - "unsafeName": "Ast", - "safeName": "Ast" - } - } - } - }, - "properties": [ - { - "name": { + "wireValue": "gt_operator" + }, + "properties": [] + }, + "boolean_literal": { + "type": "singleProperty", + "typeReference": { + "type": "primitive", + "value": "BOOLEAN" + }, + "discriminantValue": { "name": { - "originalName": "animal", + "originalName": "boolean_literal", "camelCase": { - "unsafeName": "animal", - "safeName": "animal" + "unsafeName": "booleanLiteral", + "safeName": "booleanLiteral" }, "snakeCase": { - "unsafeName": "animal", - "safeName": "animal" + "unsafeName": "boolean_literal", + "safeName": "boolean_literal" }, "screamingSnakeCase": { - "unsafeName": "ANIMAL", - "safeName": "ANIMAL" + "unsafeName": "BOOLEAN_LITERAL", + "safeName": "BOOLEAN_LITERAL" }, "pascalCase": { - "unsafeName": "Animal", - "safeName": "Animal" + "unsafeName": "BooleanLiteral", + "safeName": "BooleanLiteral" } }, - "wireValue": "animal" - }, - "typeReference": { - "type": "named", - "value": "type_ast:Animal" + "wireValue": "boolean_literal" }, - "propertyAccess": null, - "variable": null + "properties": null } - ], - "additionalProperties": false + } }, - "type_ast:BranchNode": { + "type_ast:EqualsOperator": { "type": "object", "declaration": { "name": { - "originalName": "BranchNode", + "originalName": "EqualsOperator", "camelCase": { - "unsafeName": "branchNode", - "safeName": "branchNode" + "unsafeName": "equalsOperator", + "safeName": "equalsOperator" }, "snakeCase": { - "unsafeName": "branch_node", - "safeName": "branch_node" + "unsafeName": "equals_operator", + "safeName": "equals_operator" }, "screamingSnakeCase": { - "unsafeName": "BRANCH_NODE", - "safeName": "BRANCH_NODE" + "unsafeName": "EQUALS_OPERATOR", + "safeName": "EQUALS_OPERATOR" }, "pascalCase": { - "unsafeName": "BranchNode", - "safeName": "BranchNode" + "unsafeName": "EqualsOperator", + "safeName": "EqualsOperator" } }, "fernFilepath": { @@ -5223,32 +11253,59 @@ { "name": { "name": { - "originalName": "children", + "originalName": "left", "camelCase": { - "unsafeName": "children", - "safeName": "children" + "unsafeName": "left", + "safeName": "left" }, "snakeCase": { - "unsafeName": "children", - "safeName": "children" + "unsafeName": "left", + "safeName": "left" }, "screamingSnakeCase": { - "unsafeName": "CHILDREN", - "safeName": "CHILDREN" + "unsafeName": "LEFT", + "safeName": "LEFT" }, "pascalCase": { - "unsafeName": "Children", - "safeName": "Children" + "unsafeName": "Left", + "safeName": "Left" } }, - "wireValue": "children" + "wireValue": "left" }, "typeReference": { - "type": "list", - "value": { - "type": "named", - "value": "type_ast:Node" - } + "type": "named", + "value": "type_ast:EqualsOperatorLeft" + }, + "propertyAccess": null, + "variable": null + }, + { + "name": { + "name": { + "originalName": "right", + "camelCase": { + "unsafeName": "right", + "safeName": "right" + }, + "snakeCase": { + "unsafeName": "right", + "safeName": "right" + }, + "screamingSnakeCase": { + "unsafeName": "RIGHT", + "safeName": "RIGHT" + }, + "pascalCase": { + "unsafeName": "Right", + "safeName": "Right" + } + }, + "wireValue": "right" + }, + "typeReference": { + "type": "named", + "value": "type_ast:EqualsOperatorRight" }, "propertyAccess": null, "variable": null @@ -5256,26 +11313,26 @@ ], "additionalProperties": false }, - "type_ast:LeafNode": { - "type": "object", + "type_ast:EqualsOperatorLeft": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "LeafNode", + "originalName": "EqualsOperatorLeft", "camelCase": { - "unsafeName": "leafNode", - "safeName": "leafNode" + "unsafeName": "equalsOperatorLeft", + "safeName": "equalsOperatorLeft" }, "snakeCase": { - "unsafeName": "leaf_node", - "safeName": "leaf_node" + "unsafeName": "equals_operator_left", + "safeName": "equals_operator_left" }, "screamingSnakeCase": { - "unsafeName": "LEAF_NODE", - "safeName": "LEAF_NODE" + "unsafeName": "EQUALS_OPERATOR_LEFT", + "safeName": "EQUALS_OPERATOR_LEFT" }, "pascalCase": { - "unsafeName": "LeafNode", - "safeName": "LeafNode" + "unsafeName": "EqualsOperatorLeft", + "safeName": "EqualsOperatorLeft" } }, "fernFilepath": { @@ -5322,135 +11379,189 @@ } } }, - "properties": [], - "additionalProperties": false - }, - "type_ast:NodesWrapper": { - "type": "object", - "declaration": { + "discriminant": { "name": { - "originalName": "NodesWrapper", + "originalName": "type", "camelCase": { - "unsafeName": "nodesWrapper", - "safeName": "nodesWrapper" + "unsafeName": "type", + "safeName": "type" }, "snakeCase": { - "unsafeName": "nodes_wrapper", - "safeName": "nodes_wrapper" + "unsafeName": "type", + "safeName": "type" }, "screamingSnakeCase": { - "unsafeName": "NODES_WRAPPER", - "safeName": "NODES_WRAPPER" + "unsafeName": "TYPE", + "safeName": "TYPE" }, "pascalCase": { - "unsafeName": "NodesWrapper", - "safeName": "NodesWrapper" + "unsafeName": "Type", + "safeName": "Type" } }, - "fernFilepath": { - "allParts": [ - { - "originalName": "ast", + "wireValue": "type" + }, + "types": { + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { + "name": { + "originalName": "and_operator", "camelCase": { - "unsafeName": "ast", - "safeName": "ast" + "unsafeName": "andOperator", + "safeName": "andOperator" }, "snakeCase": { - "unsafeName": "ast", - "safeName": "ast" + "unsafeName": "and_operator", + "safeName": "and_operator" }, "screamingSnakeCase": { - "unsafeName": "AST", - "safeName": "AST" + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" }, "pascalCase": { - "unsafeName": "Ast", - "safeName": "Ast" + "unsafeName": "AndOperator", + "safeName": "AndOperator" } - } - ], - "packagePath": [], - "file": { - "originalName": "ast", - "camelCase": { - "unsafeName": "ast", - "safeName": "ast" }, - "snakeCase": { - "unsafeName": "ast", - "safeName": "ast" + "wireValue": "and_operator" + }, + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } }, - "screamingSnakeCase": { - "unsafeName": "AST", - "safeName": "AST" + "wireValue": "or_operator" + }, + "properties": [] + }, + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { + "name": { + "originalName": "eq_operator", + "camelCase": { + "unsafeName": "eqOperator", + "safeName": "eqOperator" + }, + "snakeCase": { + "unsafeName": "eq_operator", + "safeName": "eq_operator" + }, + "screamingSnakeCase": { + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" + }, + "pascalCase": { + "unsafeName": "EqOperator", + "safeName": "EqOperator" + } }, - "pascalCase": { - "unsafeName": "Ast", - "safeName": "Ast" - } - } - } - }, - "properties": [ - { - "name": { + "wireValue": "eq_operator" + }, + "properties": [] + }, + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { "name": { - "originalName": "nodes", + "originalName": "gt_operator", "camelCase": { - "unsafeName": "nodes", - "safeName": "nodes" + "unsafeName": "gtOperator", + "safeName": "gtOperator" }, "snakeCase": { - "unsafeName": "nodes", - "safeName": "nodes" + "unsafeName": "gt_operator", + "safeName": "gt_operator" }, "screamingSnakeCase": { - "unsafeName": "NODES", - "safeName": "NODES" + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" }, "pascalCase": { - "unsafeName": "Nodes", - "safeName": "Nodes" + "unsafeName": "GtOperator", + "safeName": "GtOperator" } }, - "wireValue": "nodes" + "wireValue": "gt_operator" }, + "properties": [] + }, + "string_literal": { + "type": "singleProperty", "typeReference": { - "type": "list", - "value": { - "type": "list", - "value": { - "type": "named", - "value": "type_ast:Node" + "type": "primitive", + "value": "STRING" + }, + "discriminantValue": { + "name": { + "originalName": "string_literal", + "camelCase": { + "unsafeName": "stringLiteral", + "safeName": "stringLiteral" + }, + "snakeCase": { + "unsafeName": "string_literal", + "safeName": "string_literal" + }, + "screamingSnakeCase": { + "unsafeName": "STRING_LITERAL", + "safeName": "STRING_LITERAL" + }, + "pascalCase": { + "unsafeName": "StringLiteral", + "safeName": "StringLiteral" } - } + }, + "wireValue": "string_literal" }, - "propertyAccess": null, - "variable": null + "properties": null } - ], - "additionalProperties": false + } }, - "type_ast:ContainerValue": { + "type_ast:EqualsOperatorRight": { "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "ContainerValue", + "originalName": "EqualsOperatorRight", "camelCase": { - "unsafeName": "containerValue", - "safeName": "containerValue" + "unsafeName": "equalsOperatorRight", + "safeName": "equalsOperatorRight" }, "snakeCase": { - "unsafeName": "container_value", - "safeName": "container_value" + "unsafeName": "equals_operator_right", + "safeName": "equals_operator_right" }, "screamingSnakeCase": { - "unsafeName": "CONTAINER_VALUE", - "safeName": "CONTAINER_VALUE" + "unsafeName": "EQUALS_OPERATOR_RIGHT", + "safeName": "EQUALS_OPERATOR_RIGHT" }, "pascalCase": { - "unsafeName": "ContainerValue", - "safeName": "ContainerValue" + "unsafeName": "EqualsOperatorRight", + "safeName": "EqualsOperatorRight" } }, "fernFilepath": { @@ -5520,276 +11631,166 @@ "wireValue": "type" }, "types": { - "list": { - "type": "singleProperty", - "typeReference": { - "type": "list", - "value": { - "type": "named", - "value": "type_ast:FieldValue" - } - }, + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", "discriminantValue": { "name": { - "originalName": "list", + "originalName": "and_operator", "camelCase": { - "unsafeName": "list", - "safeName": "list" + "unsafeName": "andOperator", + "safeName": "andOperator" }, "snakeCase": { - "unsafeName": "list", - "safeName": "list" + "unsafeName": "and_operator", + "safeName": "and_operator" }, "screamingSnakeCase": { - "unsafeName": "LIST", - "safeName": "LIST" + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" }, "pascalCase": { - "unsafeName": "List", - "safeName": "List" + "unsafeName": "AndOperator", + "safeName": "AndOperator" } }, - "wireValue": "list" + "wireValue": "and_operator" }, - "properties": null + "properties": [] }, - "optional": { - "type": "singleProperty", - "typeReference": { - "type": "optional", - "value": { - "type": "named", - "value": "type_ast:FieldValue" - } - }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", "discriminantValue": { "name": { - "originalName": "optional", + "originalName": "or_operator", "camelCase": { - "unsafeName": "optional", - "safeName": "optional" + "unsafeName": "orOperator", + "safeName": "orOperator" }, "snakeCase": { - "unsafeName": "optional", - "safeName": "optional" + "unsafeName": "or_operator", + "safeName": "or_operator" }, "screamingSnakeCase": { - "unsafeName": "OPTIONAL", - "safeName": "OPTIONAL" + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" }, "pascalCase": { - "unsafeName": "Optional", - "safeName": "Optional" + "unsafeName": "OrOperator", + "safeName": "OrOperator" } }, - "wireValue": "optional" - }, - "properties": null - } - } - }, - "type_ast:PrimitiveValue": { - "type": "enum", - "declaration": { - "name": { - "originalName": "PrimitiveValue", - "camelCase": { - "unsafeName": "primitiveValue", - "safeName": "primitiveValue" - }, - "snakeCase": { - "unsafeName": "primitive_value", - "safeName": "primitive_value" - }, - "screamingSnakeCase": { - "unsafeName": "PRIMITIVE_VALUE", - "safeName": "PRIMITIVE_VALUE" + "wireValue": "or_operator" }, - "pascalCase": { - "unsafeName": "PrimitiveValue", - "safeName": "PrimitiveValue" - } + "properties": [] }, - "fernFilepath": { - "allParts": [ - { - "originalName": "ast", + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { + "name": { + "originalName": "eq_operator", "camelCase": { - "unsafeName": "ast", - "safeName": "ast" + "unsafeName": "eqOperator", + "safeName": "eqOperator" }, "snakeCase": { - "unsafeName": "ast", - "safeName": "ast" + "unsafeName": "eq_operator", + "safeName": "eq_operator" }, "screamingSnakeCase": { - "unsafeName": "AST", - "safeName": "AST" + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" }, "pascalCase": { - "unsafeName": "Ast", - "safeName": "Ast" + "unsafeName": "EqOperator", + "safeName": "EqOperator" } - } - ], - "packagePath": [], - "file": { - "originalName": "ast", - "camelCase": { - "unsafeName": "ast", - "safeName": "ast" - }, - "snakeCase": { - "unsafeName": "ast", - "safeName": "ast" - }, - "screamingSnakeCase": { - "unsafeName": "AST", - "safeName": "AST" - }, - "pascalCase": { - "unsafeName": "Ast", - "safeName": "Ast" - } - } - } - }, - "values": [ - { - "name": { - "originalName": "STRING", - "camelCase": { - "unsafeName": "string", - "safeName": "string" - }, - "snakeCase": { - "unsafeName": "string", - "safeName": "string" }, - "screamingSnakeCase": { - "unsafeName": "STRING", - "safeName": "STRING" - }, - "pascalCase": { - "unsafeName": "String", - "safeName": "String" - } + "wireValue": "eq_operator" }, - "wireValue": "STRING" + "properties": [] }, - { - "name": { - "originalName": "NUMBER", - "camelCase": { - "unsafeName": "number", - "safeName": "number" - }, - "snakeCase": { - "unsafeName": "number", - "safeName": "number" - }, - "screamingSnakeCase": { - "unsafeName": "NUMBER", - "safeName": "NUMBER" + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } }, - "pascalCase": { - "unsafeName": "Number", - "safeName": "Number" - } - }, - "wireValue": "NUMBER" - } - ] - }, - "type_ast:ObjectValue": { - "type": "object", - "declaration": { - "name": { - "originalName": "ObjectValue", - "camelCase": { - "unsafeName": "objectValue", - "safeName": "objectValue" - }, - "snakeCase": { - "unsafeName": "object_value", - "safeName": "object_value" + "wireValue": "gt_operator" }, - "screamingSnakeCase": { - "unsafeName": "OBJECT_VALUE", - "safeName": "OBJECT_VALUE" - }, - "pascalCase": { - "unsafeName": "ObjectValue", - "safeName": "ObjectValue" - } + "properties": [] }, - "fernFilepath": { - "allParts": [ - { - "originalName": "ast", + "string_literal": { + "type": "singleProperty", + "typeReference": { + "type": "primitive", + "value": "STRING" + }, + "discriminantValue": { + "name": { + "originalName": "string_literal", "camelCase": { - "unsafeName": "ast", - "safeName": "ast" + "unsafeName": "stringLiteral", + "safeName": "stringLiteral" }, "snakeCase": { - "unsafeName": "ast", - "safeName": "ast" + "unsafeName": "string_literal", + "safeName": "string_literal" }, "screamingSnakeCase": { - "unsafeName": "AST", - "safeName": "AST" + "unsafeName": "STRING_LITERAL", + "safeName": "STRING_LITERAL" }, "pascalCase": { - "unsafeName": "Ast", - "safeName": "Ast" + "unsafeName": "StringLiteral", + "safeName": "StringLiteral" } - } - ], - "packagePath": [], - "file": { - "originalName": "ast", - "camelCase": { - "unsafeName": "ast", - "safeName": "ast" - }, - "snakeCase": { - "unsafeName": "ast", - "safeName": "ast" }, - "screamingSnakeCase": { - "unsafeName": "AST", - "safeName": "AST" - }, - "pascalCase": { - "unsafeName": "Ast", - "safeName": "Ast" - } - } + "wireValue": "string_literal" + }, + "properties": null } - }, - "properties": [], - "additionalProperties": false + } }, - "type_ast:FieldName": { - "type": "alias", + "type_ast:GreaterThanOperator": { + "type": "object", "declaration": { "name": { - "originalName": "FieldName", + "originalName": "GreaterThanOperator", "camelCase": { - "unsafeName": "fieldName", - "safeName": "fieldName" + "unsafeName": "greaterThanOperator", + "safeName": "greaterThanOperator" }, - "snakeCase": { - "unsafeName": "field_name", - "safeName": "field_name" + "snakeCase": { + "unsafeName": "greater_than_operator", + "safeName": "greater_than_operator" }, "screamingSnakeCase": { - "unsafeName": "FIELD_NAME", - "safeName": "FIELD_NAME" + "unsafeName": "GREATER_THAN_OPERATOR", + "safeName": "GREATER_THAN_OPERATOR" }, "pascalCase": { - "unsafeName": "FieldName", - "safeName": "FieldName" + "unsafeName": "GreaterThanOperator", + "safeName": "GreaterThanOperator" } }, "fernFilepath": { @@ -5836,31 +11837,90 @@ } } }, - "typeReference": { - "type": "primitive", - "value": "STRING" - } + "properties": [ + { + "name": { + "name": { + "originalName": "left", + "camelCase": { + "unsafeName": "left", + "safeName": "left" + }, + "snakeCase": { + "unsafeName": "left", + "safeName": "left" + }, + "screamingSnakeCase": { + "unsafeName": "LEFT", + "safeName": "LEFT" + }, + "pascalCase": { + "unsafeName": "Left", + "safeName": "Left" + } + }, + "wireValue": "left" + }, + "typeReference": { + "type": "named", + "value": "type_ast:GreaterThanOperatorLeft" + }, + "propertyAccess": null, + "variable": null + }, + { + "name": { + "name": { + "originalName": "right", + "camelCase": { + "unsafeName": "right", + "safeName": "right" + }, + "snakeCase": { + "unsafeName": "right", + "safeName": "right" + }, + "screamingSnakeCase": { + "unsafeName": "RIGHT", + "safeName": "RIGHT" + }, + "pascalCase": { + "unsafeName": "Right", + "safeName": "Right" + } + }, + "wireValue": "right" + }, + "typeReference": { + "type": "named", + "value": "type_ast:GreaterThanOperatorRight" + }, + "propertyAccess": null, + "variable": null + } + ], + "additionalProperties": false }, - "type_ast:FieldValue": { + "type_ast:GreaterThanOperatorLeft": { "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "FieldValue", + "originalName": "GreaterThanOperatorLeft", "camelCase": { - "unsafeName": "fieldValue", - "safeName": "fieldValue" + "unsafeName": "greaterThanOperatorLeft", + "safeName": "greaterThanOperatorLeft" }, "snakeCase": { - "unsafeName": "field_value", - "safeName": "field_value" + "unsafeName": "greater_than_operator_left", + "safeName": "greater_than_operator_left" }, "screamingSnakeCase": { - "unsafeName": "FIELD_VALUE", - "safeName": "FIELD_VALUE" + "unsafeName": "GREATER_THAN_OPERATOR_LEFT", + "safeName": "GREATER_THAN_OPERATOR_LEFT" }, "pascalCase": { - "unsafeName": "FieldValue", - "safeName": "FieldValue" + "unsafeName": "GreaterThanOperatorLeft", + "safeName": "GreaterThanOperatorLeft" } }, "fernFilepath": { @@ -5930,115 +11990,166 @@ "wireValue": "type" }, "types": { - "primitive_value": { - "type": "singleProperty", - "typeReference": { - "type": "named", - "value": "type_ast:PrimitiveValue" + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { + "name": { + "originalName": "and_operator", + "camelCase": { + "unsafeName": "andOperator", + "safeName": "andOperator" + }, + "snakeCase": { + "unsafeName": "and_operator", + "safeName": "and_operator" + }, + "screamingSnakeCase": { + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" + }, + "pascalCase": { + "unsafeName": "AndOperator", + "safeName": "AndOperator" + } + }, + "wireValue": "and_operator" }, + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", "discriminantValue": { "name": { - "originalName": "primitive_value", + "originalName": "or_operator", "camelCase": { - "unsafeName": "primitiveValue", - "safeName": "primitiveValue" + "unsafeName": "orOperator", + "safeName": "orOperator" }, "snakeCase": { - "unsafeName": "primitive_value", - "safeName": "primitive_value" + "unsafeName": "or_operator", + "safeName": "or_operator" }, "screamingSnakeCase": { - "unsafeName": "PRIMITIVE_VALUE", - "safeName": "PRIMITIVE_VALUE" + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" }, "pascalCase": { - "unsafeName": "PrimitiveValue", - "safeName": "PrimitiveValue" + "unsafeName": "OrOperator", + "safeName": "OrOperator" } }, - "wireValue": "primitive_value" + "wireValue": "or_operator" }, - "properties": null + "properties": [] }, - "object_value": { + "eq_operator": { "type": "samePropertiesAsObject", - "typeId": "type_ast:ObjectValue", + "typeId": "type_ast:EqualsOperator", "discriminantValue": { "name": { - "originalName": "object_value", + "originalName": "eq_operator", "camelCase": { - "unsafeName": "objectValue", - "safeName": "objectValue" + "unsafeName": "eqOperator", + "safeName": "eqOperator" }, "snakeCase": { - "unsafeName": "object_value", - "safeName": "object_value" + "unsafeName": "eq_operator", + "safeName": "eq_operator" }, "screamingSnakeCase": { - "unsafeName": "OBJECT_VALUE", - "safeName": "OBJECT_VALUE" + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" }, "pascalCase": { - "unsafeName": "ObjectValue", - "safeName": "ObjectValue" + "unsafeName": "EqOperator", + "safeName": "EqOperator" } }, - "wireValue": "object_value" + "wireValue": "eq_operator" }, "properties": [] }, - "container_value": { + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" + }, + "properties": [] + }, + "number_literal": { "type": "singleProperty", "typeReference": { - "type": "named", - "value": "type_ast:ContainerValue" + "type": "primitive", + "value": "DOUBLE" }, "discriminantValue": { "name": { - "originalName": "container_value", + "originalName": "number_literal", "camelCase": { - "unsafeName": "containerValue", - "safeName": "containerValue" + "unsafeName": "numberLiteral", + "safeName": "numberLiteral" }, "snakeCase": { - "unsafeName": "container_value", - "safeName": "container_value" + "unsafeName": "number_literal", + "safeName": "number_literal" }, "screamingSnakeCase": { - "unsafeName": "CONTAINER_VALUE", - "safeName": "CONTAINER_VALUE" + "unsafeName": "NUMBER_LITERAL", + "safeName": "NUMBER_LITERAL" }, "pascalCase": { - "unsafeName": "ContainerValue", - "safeName": "ContainerValue" + "unsafeName": "NumberLiteral", + "safeName": "NumberLiteral" } }, - "wireValue": "container_value" + "wireValue": "number_literal" }, "properties": null } } }, - "type_ast:ObjectFieldValue": { - "type": "object", + "type_ast:GreaterThanOperatorRight": { + "type": "discriminatedUnion", "declaration": { "name": { - "originalName": "ObjectFieldValue", + "originalName": "GreaterThanOperatorRight", "camelCase": { - "unsafeName": "objectFieldValue", - "safeName": "objectFieldValue" + "unsafeName": "greaterThanOperatorRight", + "safeName": "greaterThanOperatorRight" }, "snakeCase": { - "unsafeName": "object_field_value", - "safeName": "object_field_value" + "unsafeName": "greater_than_operator_right", + "safeName": "greater_than_operator_right" }, "screamingSnakeCase": { - "unsafeName": "OBJECT_FIELD_VALUE", - "safeName": "OBJECT_FIELD_VALUE" + "unsafeName": "GREATER_THAN_OPERATOR_RIGHT", + "safeName": "GREATER_THAN_OPERATOR_RIGHT" }, "pascalCase": { - "unsafeName": "ObjectFieldValue", - "safeName": "ObjectFieldValue" + "unsafeName": "GreaterThanOperatorRight", + "safeName": "GreaterThanOperatorRight" } }, "fernFilepath": { @@ -6085,69 +12196,168 @@ } } }, - "properties": [ - { - "name": { + "discriminant": { + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + }, + "wireValue": "type" + }, + "types": { + "and_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:AndOperator", + "discriminantValue": { "name": { - "originalName": "name", + "originalName": "and_operator", "camelCase": { - "unsafeName": "name", - "safeName": "name" + "unsafeName": "andOperator", + "safeName": "andOperator" }, "snakeCase": { - "unsafeName": "name", - "safeName": "name" + "unsafeName": "and_operator", + "safeName": "and_operator" }, "screamingSnakeCase": { - "unsafeName": "NAME", - "safeName": "NAME" + "unsafeName": "AND_OPERATOR", + "safeName": "AND_OPERATOR" }, "pascalCase": { - "unsafeName": "Name", - "safeName": "Name" + "unsafeName": "AndOperator", + "safeName": "AndOperator" } }, - "wireValue": "name" + "wireValue": "and_operator" }, - "typeReference": { - "type": "named", - "value": "type_ast:FieldName" + "properties": [] + }, + "or_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:OrOperator", + "discriminantValue": { + "name": { + "originalName": "or_operator", + "camelCase": { + "unsafeName": "orOperator", + "safeName": "orOperator" + }, + "snakeCase": { + "unsafeName": "or_operator", + "safeName": "or_operator" + }, + "screamingSnakeCase": { + "unsafeName": "OR_OPERATOR", + "safeName": "OR_OPERATOR" + }, + "pascalCase": { + "unsafeName": "OrOperator", + "safeName": "OrOperator" + } + }, + "wireValue": "or_operator" }, - "propertyAccess": null, - "variable": null + "properties": [] }, - { - "name": { + "eq_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:EqualsOperator", + "discriminantValue": { "name": { - "originalName": "value", + "originalName": "eq_operator", "camelCase": { - "unsafeName": "value", - "safeName": "value" + "unsafeName": "eqOperator", + "safeName": "eqOperator" }, "snakeCase": { - "unsafeName": "value", - "safeName": "value" + "unsafeName": "eq_operator", + "safeName": "eq_operator" }, "screamingSnakeCase": { - "unsafeName": "VALUE", - "safeName": "VALUE" + "unsafeName": "EQ_OPERATOR", + "safeName": "EQ_OPERATOR" }, "pascalCase": { - "unsafeName": "Value", - "safeName": "Value" + "unsafeName": "EqOperator", + "safeName": "EqOperator" } }, - "wireValue": "value" + "wireValue": "eq_operator" + }, + "properties": [] + }, + "gt_operator": { + "type": "samePropertiesAsObject", + "typeId": "type_ast:GreaterThanOperator", + "discriminantValue": { + "name": { + "originalName": "gt_operator", + "camelCase": { + "unsafeName": "gtOperator", + "safeName": "gtOperator" + }, + "snakeCase": { + "unsafeName": "gt_operator", + "safeName": "gt_operator" + }, + "screamingSnakeCase": { + "unsafeName": "GT_OPERATOR", + "safeName": "GT_OPERATOR" + }, + "pascalCase": { + "unsafeName": "GtOperator", + "safeName": "GtOperator" + } + }, + "wireValue": "gt_operator" }, + "properties": [] + }, + "number_literal": { + "type": "singleProperty", "typeReference": { - "type": "named", - "value": "type_ast:FieldValue" + "type": "primitive", + "value": "DOUBLE" }, - "propertyAccess": null, - "variable": null + "discriminantValue": { + "name": { + "originalName": "number_literal", + "camelCase": { + "unsafeName": "numberLiteral", + "safeName": "numberLiteral" + }, + "snakeCase": { + "unsafeName": "number_literal", + "safeName": "number_literal" + }, + "screamingSnakeCase": { + "unsafeName": "NUMBER_LITERAL", + "safeName": "NUMBER_LITERAL" + }, + "pascalCase": { + "unsafeName": "NumberLiteral", + "safeName": "NumberLiteral" + } + }, + "wireValue": "number_literal" + }, + "properties": null } - ], - "additionalProperties": false + } } }, "headers": [], @@ -6317,7 +12527,17 @@ "type_ast:ObjectValue", "type_ast:FieldName", "type_ast:FieldValue", - "type_ast:ObjectFieldValue" + "type_ast:ObjectFieldValue", + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:EqualsOperatorRight", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight" ], "errors": [], "subpackages": [], diff --git a/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/fdr/circular-references-advanced.json b/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/fdr/circular-references-advanced.json index a4353394289..35d9c36a054 100644 --- a/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/fdr/circular-references-advanced.json +++ b/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/fdr/circular-references-advanced.json @@ -392,6 +392,463 @@ } ] } + }, + "type_ast:AndOperator": { + "description": "Deep circular reference pattern mimicking elevenlabs AST operators", + "name": "AndOperator", + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "children", + "valueType": { + "type": "list", + "itemType": { + "type": "id", + "value": "type_ast:AndOperatorChild" + } + } + } + ] + } + }, + "type_ast:AndOperatorChild": { + "name": "AndOperatorChild", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "and_operator", + "additionalProperties": { + "extends": [ + "type_ast:AndOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "or_operator", + "additionalProperties": { + "extends": [ + "type_ast:OrOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "eq_operator", + "additionalProperties": { + "extends": [ + "type_ast:EqualsOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "gt_operator", + "additionalProperties": { + "extends": [ + "type_ast:GreaterThanOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "boolean_literal", + "additionalProperties": { + "extends": [], + "properties": [ + { + "key": "value", + "valueType": { + "type": "primitive", + "value": { + "type": "boolean" + } + } + } + ] + } + } + ] + } + }, + "type_ast:OrOperator": { + "name": "OrOperator", + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "children", + "valueType": { + "type": "list", + "itemType": { + "type": "id", + "value": "type_ast:OrOperatorChild" + } + } + } + ] + } + }, + "type_ast:OrOperatorChild": { + "name": "OrOperatorChild", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "and_operator", + "additionalProperties": { + "extends": [ + "type_ast:AndOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "or_operator", + "additionalProperties": { + "extends": [ + "type_ast:OrOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "eq_operator", + "additionalProperties": { + "extends": [ + "type_ast:EqualsOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "gt_operator", + "additionalProperties": { + "extends": [ + "type_ast:GreaterThanOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "boolean_literal", + "additionalProperties": { + "extends": [], + "properties": [ + { + "key": "value", + "valueType": { + "type": "primitive", + "value": { + "type": "boolean" + } + } + } + ] + } + } + ] + } + }, + "type_ast:EqualsOperator": { + "name": "EqualsOperator", + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "left", + "valueType": { + "type": "id", + "value": "type_ast:EqualsOperatorLeft" + } + }, + { + "key": "right", + "valueType": { + "type": "id", + "value": "type_ast:EqualsOperatorRight" + } + } + ] + } + }, + "type_ast:EqualsOperatorLeft": { + "name": "EqualsOperatorLeft", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "and_operator", + "additionalProperties": { + "extends": [ + "type_ast:AndOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "or_operator", + "additionalProperties": { + "extends": [ + "type_ast:OrOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "eq_operator", + "additionalProperties": { + "extends": [ + "type_ast:EqualsOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "gt_operator", + "additionalProperties": { + "extends": [ + "type_ast:GreaterThanOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "string_literal", + "additionalProperties": { + "extends": [], + "properties": [ + { + "key": "value", + "valueType": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + ] + } + } + ] + } + }, + "type_ast:EqualsOperatorRight": { + "name": "EqualsOperatorRight", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "and_operator", + "additionalProperties": { + "extends": [ + "type_ast:AndOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "or_operator", + "additionalProperties": { + "extends": [ + "type_ast:OrOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "eq_operator", + "additionalProperties": { + "extends": [ + "type_ast:EqualsOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "gt_operator", + "additionalProperties": { + "extends": [ + "type_ast:GreaterThanOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "string_literal", + "additionalProperties": { + "extends": [], + "properties": [ + { + "key": "value", + "valueType": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + ] + } + } + ] + } + }, + "type_ast:GreaterThanOperator": { + "name": "GreaterThanOperator", + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "left", + "valueType": { + "type": "id", + "value": "type_ast:GreaterThanOperatorLeft" + } + }, + { + "key": "right", + "valueType": { + "type": "id", + "value": "type_ast:GreaterThanOperatorRight" + } + } + ] + } + }, + "type_ast:GreaterThanOperatorLeft": { + "name": "GreaterThanOperatorLeft", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "and_operator", + "additionalProperties": { + "extends": [ + "type_ast:AndOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "or_operator", + "additionalProperties": { + "extends": [ + "type_ast:OrOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "eq_operator", + "additionalProperties": { + "extends": [ + "type_ast:EqualsOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "gt_operator", + "additionalProperties": { + "extends": [ + "type_ast:GreaterThanOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "number_literal", + "additionalProperties": { + "extends": [], + "properties": [ + { + "key": "value", + "valueType": { + "type": "primitive", + "value": { + "type": "double" + } + } + } + ] + } + } + ] + } + }, + "type_ast:GreaterThanOperatorRight": { + "name": "GreaterThanOperatorRight", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "and_operator", + "additionalProperties": { + "extends": [ + "type_ast:AndOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "or_operator", + "additionalProperties": { + "extends": [ + "type_ast:OrOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "eq_operator", + "additionalProperties": { + "extends": [ + "type_ast:EqualsOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "gt_operator", + "additionalProperties": { + "extends": [ + "type_ast:GreaterThanOperator" + ], + "properties": [] + } + }, + { + "discriminantValue": "number_literal", + "additionalProperties": { + "extends": [], + "properties": [ + { + "key": "value", + "valueType": { + "type": "primitive", + "value": { + "type": "double" + } + } + } + ] + } + } + ] + } } }, "subpackages": { @@ -429,7 +886,17 @@ "type_ast:ObjectValue", "type_ast:FieldName", "type_ast:FieldValue", - "type_ast:ObjectFieldValue" + "type_ast:ObjectFieldValue", + "type_ast:AndOperator", + "type_ast:AndOperatorChild", + "type_ast:OrOperator", + "type_ast:OrOperatorChild", + "type_ast:EqualsOperator", + "type_ast:EqualsOperatorLeft", + "type_ast:EqualsOperatorRight", + "type_ast:GreaterThanOperator", + "type_ast:GreaterThanOperatorLeft", + "type_ast:GreaterThanOperatorRight" ], "subpackages": [] } diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/__init__.py b/seed/fastapi/circular-references-advanced/no-custom-config/__init__.py index 81847151de8..a5882c8de63 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/__init__.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/__init__.py @@ -5,21 +5,31 @@ from .resources import ( A, Acai, + AndOperator, + AndOperatorChild, Animal, Berry, BranchNode, Cat, ContainerValue, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorRight, FieldName, FieldValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorRight, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, PrimitiveValue, a, ast, @@ -29,22 +39,32 @@ __all__ = [ "A", "Acai", + "AndOperator", + "AndOperatorChild", "Animal", "Berry", "BranchNode", "Cat", "ContainerValue", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorRight", "FieldName", "FieldValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorRight", "ImportingA", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", "PrimitiveValue", "RootType", "a", diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/__init__.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/__init__.py index b343397ca6c..84a925facf5 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/__init__.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/__init__.py @@ -6,42 +6,62 @@ from .a import A from .ast import ( Acai, + AndOperator, + AndOperatorChild, Animal, Berry, BranchNode, Cat, ContainerValue, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorRight, FieldName, FieldValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorRight, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, PrimitiveValue, ) __all__ = [ "A", "Acai", + "AndOperator", + "AndOperatorChild", "Animal", "Berry", "BranchNode", "Cat", "ContainerValue", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorRight", "FieldName", "FieldValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorRight", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", "PrimitiveValue", "a", "ast", diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/__init__.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/__init__.py index c965801b4b4..f07b911e237 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/__init__.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/__init__.py @@ -4,40 +4,60 @@ from .types import ( Acai, + AndOperator, + AndOperatorChild, Animal, Berry, BranchNode, Cat, ContainerValue, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorRight, FieldName, FieldValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorRight, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, PrimitiveValue, ) __all__ = [ "Acai", + "AndOperator", + "AndOperatorChild", "Animal", "Berry", "BranchNode", "Cat", "ContainerValue", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorRight", "FieldName", "FieldValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorRight", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", "PrimitiveValue", ] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/__init__.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/__init__.py index 85b975b5f16..3c03ac39a7e 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/__init__.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/__init__.py @@ -2,19 +2,23 @@ # isort: skip_file -from .acai import Acai -from .animal import Animal -from .berry import Berry -from .branch_node import BranchNode -from .cat import Cat -from .container_value import ContainerValue -from .dog import Dog +from .acai_all import Acai, Animal, Berry, Cat, Dog, Fig, Fruit +from .and_operator_all import ( + AndOperator, + AndOperatorChild, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorRight, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorRight, + OrOperator, + OrOperatorChild, +) +from .branch_node_all import BranchNode, Node +from .container_value_all import ContainerValue, FieldValue from .field_name import FieldName -from .field_value import FieldValue -from .fig import Fig -from .fruit import Fruit from .leaf_node import LeafNode -from .node import Node from .nodes_wrapper import NodesWrapper from .object_field_value import ObjectFieldValue from .object_value import ObjectValue @@ -22,20 +26,30 @@ __all__ = [ "Acai", + "AndOperator", + "AndOperatorChild", "Animal", "Berry", "BranchNode", "Cat", "ContainerValue", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorRight", "FieldName", "FieldValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorRight", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", "PrimitiveValue", ] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/acai.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/acai.py index 1fbdba58253..06dc06d5aa6 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/acai.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/acai.py @@ -1,16 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import typing +from .acai_all import Acai as Acai -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2 -from .berry import Berry - - -class Acai(Berry): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid +__all__ = ["Acai"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/acai_all.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/acai_all.py new file mode 100644 index 00000000000..a81691a16e0 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/acai_all.py @@ -0,0 +1,79 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .berry import Berry as resources_ast_types_berry_Berry + +if typing.TYPE_CHECKING: + from .acai import Acai as resources_ast_types_acai_Acai + from .cat import Cat as resources_ast_types_cat_Cat + from .dog import Dog as resources_ast_types_dog_Dog + from .fig import Fig as resources_ast_types_fig_Fig + + +class Acai(resources_ast_types_berry_Berry): + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +Animal = typing.Union["resources_ast_types_cat_Cat", "resources_ast_types_dog_Dog"] + + +class Berry(UniversalBaseModel): + animal: "resources_ast_types_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class Cat(UniversalBaseModel): + fruit: "resources_ast_types_fruit_Fruit" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class Dog(UniversalBaseModel): + fruit: "resources_ast_types_fruit_Fruit" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .fruit import Fruit as resources_ast_types_fruit_Fruit # noqa: E402, F401, I001 + + +class Fig(UniversalBaseModel): + animal: "resources_ast_types_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .animal import Animal as resources_ast_types_animal_Animal # noqa: E402, F401, I001 + +Fruit = typing.Union["resources_ast_types_acai_Acai", "resources_ast_types_fig_Fig"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/and_operator.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/and_operator.py new file mode 100644 index 00000000000..f3c921a6c39 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/and_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperator as AndOperator + +__all__ = ["AndOperator"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/and_operator_all.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/and_operator_all.py new file mode 100644 index 00000000000..c39967e05ac --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/and_operator_all.py @@ -0,0 +1,1082 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs + +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") + + +class AndOperator(UniversalBaseModel): + """ + Deep circular reference pattern mimicking elevenlabs AST operators + """ + + children: typing.List["resources_ast_types_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_and_operator_child_AndOperatorChild: + if IS_PYDANTIC_V2: + return AndOperatorChild( + root=_AndOperatorChild.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return AndOperatorChild( + __root__=_AndOperatorChild.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_and_operator_child_AndOperatorChild: + if IS_PYDANTIC_V2: + return AndOperatorChild( + root=_AndOperatorChild.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return AndOperatorChild( + __root__=_AndOperatorChild.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_and_operator_child_AndOperatorChild: + if IS_PYDANTIC_V2: + return AndOperatorChild( + root=_AndOperatorChild.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return AndOperatorChild( + __root__=_AndOperatorChild.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_and_operator_child_AndOperatorChild: + if IS_PYDANTIC_V2: + return AndOperatorChild( + root=_AndOperatorChild.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return AndOperatorChild( + __root__=_AndOperatorChild.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def boolean_literal(self, value: bool) -> resources_ast_types_and_operator_child_AndOperatorChild: + if IS_PYDANTIC_V2: + return AndOperatorChild(root=_AndOperatorChild.BooleanLiteral(type="boolean_literal", value=value)) # type: ignore + else: + return AndOperatorChild(__root__=_AndOperatorChild.BooleanLiteral(type="boolean_literal", value=value)) # type: ignore + + +class AndOperatorChild(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _AndOperatorChild.AndOperator, + _AndOperatorChild.OrOperator, + _AndOperatorChild.EqOperator, + _AndOperatorChild.GtOperator, + _AndOperatorChild.BooleanLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _AndOperatorChild.AndOperator, + _AndOperatorChild.OrOperator, + _AndOperatorChild.EqOperator, + _AndOperatorChild.GtOperator, + _AndOperatorChild.BooleanLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _AndOperatorChild.AndOperator, + _AndOperatorChild.OrOperator, + _AndOperatorChild.EqOperator, + _AndOperatorChild.GtOperator, + _AndOperatorChild.BooleanLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _AndOperatorChild.AndOperator, + _AndOperatorChild.OrOperator, + _AndOperatorChild.EqOperator, + _AndOperatorChild.GtOperator, + _AndOperatorChild.BooleanLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + boolean_literal: typing.Callable[[bool], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "boolean_literal": + return boolean_literal(unioned_value.value) + + +class _AndOperatorChild: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class BooleanLiteral(UniversalBaseModel): + type: typing.Literal["boolean_literal"] = "boolean_literal" + value: bool + + +class EqualsOperator(UniversalBaseModel): + left: "resources_ast_types_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_types_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_equals_operator_left_EqualsOperatorLeft: + if IS_PYDANTIC_V2: + return EqualsOperatorLeft( + root=_EqualsOperatorLeft.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return EqualsOperatorLeft( + __root__=_EqualsOperatorLeft.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_equals_operator_left_EqualsOperatorLeft: + if IS_PYDANTIC_V2: + return EqualsOperatorLeft( + root=_EqualsOperatorLeft.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return EqualsOperatorLeft( + __root__=_EqualsOperatorLeft.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_equals_operator_left_EqualsOperatorLeft: + if IS_PYDANTIC_V2: + return EqualsOperatorLeft( + root=_EqualsOperatorLeft.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return EqualsOperatorLeft( + __root__=_EqualsOperatorLeft.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_equals_operator_left_EqualsOperatorLeft: + if IS_PYDANTIC_V2: + return EqualsOperatorLeft( + root=_EqualsOperatorLeft.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return EqualsOperatorLeft( + __root__=_EqualsOperatorLeft.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def string_literal(self, value: str) -> resources_ast_types_equals_operator_left_EqualsOperatorLeft: + if IS_PYDANTIC_V2: + return EqualsOperatorLeft(root=_EqualsOperatorLeft.StringLiteral(type="string_literal", value=value)) # type: ignore + else: + return EqualsOperatorLeft(__root__=_EqualsOperatorLeft.StringLiteral(type="string_literal", value=value)) # type: ignore + + +class EqualsOperatorLeft(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _EqualsOperatorLeft.AndOperator, + _EqualsOperatorLeft.OrOperator, + _EqualsOperatorLeft.EqOperator, + _EqualsOperatorLeft.GtOperator, + _EqualsOperatorLeft.StringLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _EqualsOperatorLeft.AndOperator, + _EqualsOperatorLeft.OrOperator, + _EqualsOperatorLeft.EqOperator, + _EqualsOperatorLeft.GtOperator, + _EqualsOperatorLeft.StringLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _EqualsOperatorLeft.AndOperator, + _EqualsOperatorLeft.OrOperator, + _EqualsOperatorLeft.EqOperator, + _EqualsOperatorLeft.GtOperator, + _EqualsOperatorLeft.StringLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _EqualsOperatorLeft.AndOperator, + _EqualsOperatorLeft.OrOperator, + _EqualsOperatorLeft.EqOperator, + _EqualsOperatorLeft.GtOperator, + _EqualsOperatorLeft.StringLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + string_literal: typing.Callable[[str], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "string_literal": + return string_literal(unioned_value.value) + + +class _EqualsOperatorLeft: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class StringLiteral(UniversalBaseModel): + type: typing.Literal["string_literal"] = "string_literal" + value: str + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_equals_operator_right_EqualsOperatorRight: + if IS_PYDANTIC_V2: + return EqualsOperatorRight( + root=_EqualsOperatorRight.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return EqualsOperatorRight( + __root__=_EqualsOperatorRight.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_equals_operator_right_EqualsOperatorRight: + if IS_PYDANTIC_V2: + return EqualsOperatorRight( + root=_EqualsOperatorRight.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return EqualsOperatorRight( + __root__=_EqualsOperatorRight.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_equals_operator_right_EqualsOperatorRight: + if IS_PYDANTIC_V2: + return EqualsOperatorRight( + root=_EqualsOperatorRight.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return EqualsOperatorRight( + __root__=_EqualsOperatorRight.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_equals_operator_right_EqualsOperatorRight: + if IS_PYDANTIC_V2: + return EqualsOperatorRight( + root=_EqualsOperatorRight.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return EqualsOperatorRight( + __root__=_EqualsOperatorRight.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def string_literal(self, value: str) -> resources_ast_types_equals_operator_right_EqualsOperatorRight: + if IS_PYDANTIC_V2: + return EqualsOperatorRight(root=_EqualsOperatorRight.StringLiteral(type="string_literal", value=value)) # type: ignore + else: + return EqualsOperatorRight(__root__=_EqualsOperatorRight.StringLiteral(type="string_literal", value=value)) # type: ignore + + +class EqualsOperatorRight(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _EqualsOperatorRight.AndOperator, + _EqualsOperatorRight.OrOperator, + _EqualsOperatorRight.EqOperator, + _EqualsOperatorRight.GtOperator, + _EqualsOperatorRight.StringLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _EqualsOperatorRight.AndOperator, + _EqualsOperatorRight.OrOperator, + _EqualsOperatorRight.EqOperator, + _EqualsOperatorRight.GtOperator, + _EqualsOperatorRight.StringLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _EqualsOperatorRight.AndOperator, + _EqualsOperatorRight.OrOperator, + _EqualsOperatorRight.EqOperator, + _EqualsOperatorRight.GtOperator, + _EqualsOperatorRight.StringLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _EqualsOperatorRight.AndOperator, + _EqualsOperatorRight.OrOperator, + _EqualsOperatorRight.EqOperator, + _EqualsOperatorRight.GtOperator, + _EqualsOperatorRight.StringLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + string_literal: typing.Callable[[str], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "string_literal": + return string_literal(unioned_value.value) + + +class _EqualsOperatorRight: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class StringLiteral(UniversalBaseModel): + type: typing.Literal["string_literal"] = "string_literal" + value: str + + +class GreaterThanOperator(UniversalBaseModel): + left: "resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft: + if IS_PYDANTIC_V2: + return GreaterThanOperatorLeft( + root=_GreaterThanOperatorLeft.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return GreaterThanOperatorLeft( + __root__=_GreaterThanOperatorLeft.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft: + if IS_PYDANTIC_V2: + return GreaterThanOperatorLeft( + root=_GreaterThanOperatorLeft.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return GreaterThanOperatorLeft( + __root__=_GreaterThanOperatorLeft.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft: + if IS_PYDANTIC_V2: + return GreaterThanOperatorLeft( + root=_GreaterThanOperatorLeft.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return GreaterThanOperatorLeft( + __root__=_GreaterThanOperatorLeft.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft: + if IS_PYDANTIC_V2: + return GreaterThanOperatorLeft( + root=_GreaterThanOperatorLeft.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return GreaterThanOperatorLeft( + __root__=_GreaterThanOperatorLeft.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def number_literal(self, value: float) -> resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft: + if IS_PYDANTIC_V2: + return GreaterThanOperatorLeft( + root=_GreaterThanOperatorLeft.NumberLiteral(type="number_literal", value=value) + ) # type: ignore + else: + return GreaterThanOperatorLeft( + __root__=_GreaterThanOperatorLeft.NumberLiteral(type="number_literal", value=value) + ) # type: ignore + + +class GreaterThanOperatorLeft(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _GreaterThanOperatorLeft.AndOperator, + _GreaterThanOperatorLeft.OrOperator, + _GreaterThanOperatorLeft.EqOperator, + _GreaterThanOperatorLeft.GtOperator, + _GreaterThanOperatorLeft.NumberLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _GreaterThanOperatorLeft.AndOperator, + _GreaterThanOperatorLeft.OrOperator, + _GreaterThanOperatorLeft.EqOperator, + _GreaterThanOperatorLeft.GtOperator, + _GreaterThanOperatorLeft.NumberLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _GreaterThanOperatorLeft.AndOperator, + _GreaterThanOperatorLeft.OrOperator, + _GreaterThanOperatorLeft.EqOperator, + _GreaterThanOperatorLeft.GtOperator, + _GreaterThanOperatorLeft.NumberLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _GreaterThanOperatorLeft.AndOperator, + _GreaterThanOperatorLeft.OrOperator, + _GreaterThanOperatorLeft.EqOperator, + _GreaterThanOperatorLeft.GtOperator, + _GreaterThanOperatorLeft.NumberLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + number_literal: typing.Callable[[float], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "number_literal": + return number_literal(unioned_value.value) + + +class _GreaterThanOperatorLeft: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class NumberLiteral(UniversalBaseModel): + type: typing.Literal["number_literal"] = "number_literal" + value: float + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight: + if IS_PYDANTIC_V2: + return GreaterThanOperatorRight( + root=_GreaterThanOperatorRight.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return GreaterThanOperatorRight( + __root__=_GreaterThanOperatorRight.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight: + if IS_PYDANTIC_V2: + return GreaterThanOperatorRight( + root=_GreaterThanOperatorRight.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return GreaterThanOperatorRight( + __root__=_GreaterThanOperatorRight.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight: + if IS_PYDANTIC_V2: + return GreaterThanOperatorRight( + root=_GreaterThanOperatorRight.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return GreaterThanOperatorRight( + __root__=_GreaterThanOperatorRight.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight: + if IS_PYDANTIC_V2: + return GreaterThanOperatorRight( + root=_GreaterThanOperatorRight.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return GreaterThanOperatorRight( + __root__=_GreaterThanOperatorRight.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def number_literal(self, value: float) -> resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight: + if IS_PYDANTIC_V2: + return GreaterThanOperatorRight( + root=_GreaterThanOperatorRight.NumberLiteral(type="number_literal", value=value) + ) # type: ignore + else: + return GreaterThanOperatorRight( + __root__=_GreaterThanOperatorRight.NumberLiteral(type="number_literal", value=value) + ) # type: ignore + + +class GreaterThanOperatorRight(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _GreaterThanOperatorRight.AndOperator, + _GreaterThanOperatorRight.OrOperator, + _GreaterThanOperatorRight.EqOperator, + _GreaterThanOperatorRight.GtOperator, + _GreaterThanOperatorRight.NumberLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _GreaterThanOperatorRight.AndOperator, + _GreaterThanOperatorRight.OrOperator, + _GreaterThanOperatorRight.EqOperator, + _GreaterThanOperatorRight.GtOperator, + _GreaterThanOperatorRight.NumberLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _GreaterThanOperatorRight.AndOperator, + _GreaterThanOperatorRight.OrOperator, + _GreaterThanOperatorRight.EqOperator, + _GreaterThanOperatorRight.GtOperator, + _GreaterThanOperatorRight.NumberLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _GreaterThanOperatorRight.AndOperator, + _GreaterThanOperatorRight.OrOperator, + _GreaterThanOperatorRight.EqOperator, + _GreaterThanOperatorRight.GtOperator, + _GreaterThanOperatorRight.NumberLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + number_literal: typing.Callable[[float], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "number_literal": + return number_literal(unioned_value.value) + + +class _GreaterThanOperatorRight: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class NumberLiteral(UniversalBaseModel): + type: typing.Literal["number_literal"] = "number_literal" + value: float + + +class OrOperator(UniversalBaseModel): + children: typing.List["resources_ast_types_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_or_operator_child_OrOperatorChild: + if IS_PYDANTIC_V2: + return OrOperatorChild( + root=_OrOperatorChild.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return OrOperatorChild( + __root__=_OrOperatorChild.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_or_operator_child_OrOperatorChild: + if IS_PYDANTIC_V2: + return OrOperatorChild( + root=_OrOperatorChild.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return OrOperatorChild( + __root__=_OrOperatorChild.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_or_operator_child_OrOperatorChild: + if IS_PYDANTIC_V2: + return OrOperatorChild( + root=_OrOperatorChild.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return OrOperatorChild( + __root__=_OrOperatorChild.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_or_operator_child_OrOperatorChild: + if IS_PYDANTIC_V2: + return OrOperatorChild( + root=_OrOperatorChild.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return OrOperatorChild( + __root__=_OrOperatorChild.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def boolean_literal(self, value: bool) -> resources_ast_types_or_operator_child_OrOperatorChild: + if IS_PYDANTIC_V2: + return OrOperatorChild(root=_OrOperatorChild.BooleanLiteral(type="boolean_literal", value=value)) # type: ignore + else: + return OrOperatorChild(__root__=_OrOperatorChild.BooleanLiteral(type="boolean_literal", value=value)) # type: ignore + + +class OrOperatorChild(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _OrOperatorChild.AndOperator, + _OrOperatorChild.OrOperator, + _OrOperatorChild.EqOperator, + _OrOperatorChild.GtOperator, + _OrOperatorChild.BooleanLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _OrOperatorChild.AndOperator, + _OrOperatorChild.OrOperator, + _OrOperatorChild.EqOperator, + _OrOperatorChild.GtOperator, + _OrOperatorChild.BooleanLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _OrOperatorChild.AndOperator, + _OrOperatorChild.OrOperator, + _OrOperatorChild.EqOperator, + _OrOperatorChild.GtOperator, + _OrOperatorChild.BooleanLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _OrOperatorChild.AndOperator, + _OrOperatorChild.OrOperator, + _OrOperatorChild.EqOperator, + _OrOperatorChild.GtOperator, + _OrOperatorChild.BooleanLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + boolean_literal: typing.Callable[[bool], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "boolean_literal": + return boolean_literal(unioned_value.value) + + +from .and_operator_child import AndOperatorChild as resources_ast_types_and_operator_child_AndOperatorChild # noqa: E402, F401, I001 +from .and_operator import AndOperator as resources_ast_types_and_operator_AndOperator # noqa: E402, F401, I001 +from .or_operator import OrOperator as resources_ast_types_or_operator_OrOperator # noqa: E402, F401, I001 +from .equals_operator import EqualsOperator as resources_ast_types_equals_operator_EqualsOperator # noqa: E402, F401, I001 +from .greater_than_operator import GreaterThanOperator as resources_ast_types_greater_than_operator_GreaterThanOperator # noqa: E402, F401, I001 +from .equals_operator_left import EqualsOperatorLeft as resources_ast_types_equals_operator_left_EqualsOperatorLeft # noqa: E402, F401, I001 +from .equals_operator_right import EqualsOperatorRight as resources_ast_types_equals_operator_right_EqualsOperatorRight # noqa: E402, F401, I001 +from .greater_than_operator_left import ( + GreaterThanOperatorLeft as resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft, +) # noqa: E402, F401, I001 +from .greater_than_operator_right import ( + GreaterThanOperatorRight as resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight, +) # noqa: E402, F401, I001 +from .or_operator_child import OrOperatorChild as resources_ast_types_or_operator_child_OrOperatorChild # noqa: E402, F401, I001 + + +class _OrOperatorChild: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class BooleanLiteral(UniversalBaseModel): + type: typing.Literal["boolean_literal"] = "boolean_literal" + value: bool + + +update_forward_refs(_AndOperatorChild.AndOperator) +update_forward_refs(_AndOperatorChild.OrOperator) +update_forward_refs(_AndOperatorChild.EqOperator) +update_forward_refs(_AndOperatorChild.GtOperator) +update_forward_refs(_EqualsOperatorLeft.AndOperator) +update_forward_refs(_EqualsOperatorLeft.OrOperator) +update_forward_refs(_EqualsOperatorLeft.EqOperator) +update_forward_refs(_EqualsOperatorLeft.GtOperator) +update_forward_refs(_EqualsOperatorRight.AndOperator) +update_forward_refs(_EqualsOperatorRight.OrOperator) +update_forward_refs(_EqualsOperatorRight.EqOperator) +update_forward_refs(_EqualsOperatorRight.GtOperator) +update_forward_refs(_GreaterThanOperatorLeft.AndOperator) +update_forward_refs(_GreaterThanOperatorLeft.OrOperator) +update_forward_refs(_GreaterThanOperatorLeft.EqOperator) +update_forward_refs(_GreaterThanOperatorLeft.GtOperator) +update_forward_refs(_GreaterThanOperatorRight.AndOperator) +update_forward_refs(_GreaterThanOperatorRight.OrOperator) +update_forward_refs(_GreaterThanOperatorRight.EqOperator) +update_forward_refs(_GreaterThanOperatorRight.GtOperator) +update_forward_refs(_OrOperatorChild.AndOperator) +update_forward_refs(_OrOperatorChild.OrOperator) +update_forward_refs(_OrOperatorChild.EqOperator) +update_forward_refs(_OrOperatorChild.GtOperator) diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/and_operator_child.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/and_operator_child.py new file mode 100644 index 00000000000..0c043b87dbb --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/and_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperatorChild as AndOperatorChild + +__all__ = ["AndOperatorChild"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/animal.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/animal.py index ce527295dff..bc07c7d3b20 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/animal.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/animal.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Animal as Animal -import typing - -if typing.TYPE_CHECKING: - from .cat import Cat - from .dog import Dog -Animal = typing.Union["Cat", "Dog"] +__all__ = ["Animal"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/berry.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/berry.py index 3af1cd110e0..1131a180b1a 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/berry.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/berry.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Berry as Berry -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Berry(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Berry) +__all__ = ["Berry"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/branch_node.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/branch_node.py index a1dd998526f..e53f75d7362 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/branch_node.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/branch_node.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .branch_node_all import BranchNode as BranchNode -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class BranchNode(UniversalBaseModel): - children: typing.List["Node"] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .node import Node # noqa: E402, F401, I001 - -update_forward_refs(BranchNode) +__all__ = ["BranchNode"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/branch_node_all.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/branch_node_all.py new file mode 100644 index 00000000000..43752a1382e --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/branch_node_all.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .leaf_node import LeafNode + +if typing.TYPE_CHECKING: + from .branch_node import BranchNode as resources_ast_types_branch_node_BranchNode + + +class BranchNode(UniversalBaseModel): + children: typing.List["resources_ast_types_node_Node"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .node import Node as resources_ast_types_node_Node # noqa: E402, F401, I001 + +Node = typing.Union["resources_ast_types_branch_node_BranchNode", LeafNode] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/cat.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/cat.py index 0a24cf7a011..3d1211c6497 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/cat.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/cat.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Cat as Cat -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Cat(UniversalBaseModel): - fruit: "Fruit" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .fruit import Fruit # noqa: E402, F401, I001 - -update_forward_refs(Cat) +__all__ = ["Cat"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/container_value.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/container_value.py index 9fdcc8225e4..d3b9fbcdba7 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/container_value.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/container_value.py @@ -1,79 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def list_(self, value: typing.List[FieldValue]) -> ContainerValue: - if IS_PYDANTIC_V2: - return ContainerValue(root=_ContainerValue.List(type="list", value=value)) # type: ignore - else: - return ContainerValue(__root__=_ContainerValue.List(type="list", value=value)) # type: ignore - - def optional(self, value: typing.Optional[FieldValue]) -> ContainerValue: - if IS_PYDANTIC_V2: - return ContainerValue(root=_ContainerValue.Optional(type="optional", value=value)) # type: ignore - else: - return ContainerValue(__root__=_ContainerValue.Optional(type="optional", value=value)) # type: ignore - - -class ContainerValue(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") - ] - - def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") - ] - - def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - list_: typing.Callable[[typing.List["FieldValue"]], T_Result], - optional: typing.Callable[[typing.Optional["FieldValue"]], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "list": - return list_(unioned_value.value) - if unioned_value.type == "optional": - return optional(unioned_value.value) - - -from .field_value import FieldValue # noqa: E402, F401, I001 - - -class _ContainerValue: - class List(UniversalBaseModel): - type: typing.Literal["list"] = "list" - value: typing.List[FieldValue] - - class Optional(UniversalBaseModel): - type: typing.Literal["optional"] = "optional" - value: typing.Optional[FieldValue] = None - - -update_forward_refs(_ContainerValue.List) -update_forward_refs(_ContainerValue.Optional) -update_forward_refs(ContainerValue) +__all__ = ["ContainerValue"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/container_value_all.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/container_value_all.py new file mode 100644 index 00000000000..f0da27c1248 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/container_value_all.py @@ -0,0 +1,173 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs +from .object_value import ObjectValue as resources_ast_types_object_value_ObjectValue +from .primitive_value import PrimitiveValue as resources_ast_types_primitive_value_PrimitiveValue + +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") + + +class _Factory: + def list_( + self, value: typing.List[resources_ast_types_field_value_FieldValue] + ) -> resources_ast_types_container_value_ContainerValue: + if IS_PYDANTIC_V2: + return ContainerValue(root=_ContainerValue.List(type="list", value=value)) # type: ignore + else: + return ContainerValue(__root__=_ContainerValue.List(type="list", value=value)) # type: ignore + + def optional( + self, value: typing.Optional[resources_ast_types_field_value_FieldValue] + ) -> resources_ast_types_container_value_ContainerValue: + if IS_PYDANTIC_V2: + return ContainerValue(root=_ContainerValue.Optional(type="optional", value=value)) # type: ignore + else: + return ContainerValue(__root__=_ContainerValue.Optional(type="optional", value=value)) # type: ignore + + +class ContainerValue(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") + ] + + def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") + ] + + def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + list_: typing.Callable[[typing.List["resources_ast_types_field_value_FieldValue"]], T_Result], + optional: typing.Callable[[typing.Optional["resources_ast_types_field_value_FieldValue"]], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "list": + return list_(unioned_value.value) + if unioned_value.type == "optional": + return optional(unioned_value.value) + + +class _ContainerValue: + class List(UniversalBaseModel): + type: typing.Literal["list"] = "list" + value: typing.List[resources_ast_types_field_value_FieldValue] + + class Optional(UniversalBaseModel): + type: typing.Literal["optional"] = "optional" + value: typing.Optional[resources_ast_types_field_value_FieldValue] = None + + +class _Factory: + def primitive_value( + self, value: resources_ast_types_primitive_value_PrimitiveValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore + else: + return FieldValue(__root__=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore + + def object_value( + self, value: resources_ast_types_object_value_ObjectValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore + else: + return FieldValue(__root__=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore + + def container_value( + self, value: resources_ast_types_container_value_ContainerValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore + else: + return FieldValue(__root__=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore + + +class FieldValue(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + primitive_value: typing.Callable[[resources_ast_types_primitive_value_PrimitiveValue], T_Result], + object_value: typing.Callable[[resources_ast_types_object_value_ObjectValue], T_Result], + container_value: typing.Callable[["resources_ast_types_container_value_ContainerValue"], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "primitive_value": + return primitive_value(unioned_value.value) + if unioned_value.type == "object_value": + return object_value( + resources_ast_types_object_value_ObjectValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "container_value": + return container_value(unioned_value.value) + + +from .field_value import FieldValue as resources_ast_types_field_value_FieldValue # noqa: E402, F401, I001 +from .container_value import ContainerValue as resources_ast_types_container_value_ContainerValue # noqa: E402, F401, I001 + + +class _FieldValue: + class PrimitiveValue(UniversalBaseModel): + type: typing.Literal["primitive_value"] = "primitive_value" + value: resources_ast_types_primitive_value_PrimitiveValue + + class ObjectValue(resources_ast_types_object_value_ObjectValue): + type: typing.Literal["object_value"] = "object_value" + + class ContainerValue(UniversalBaseModel): + type: typing.Literal["container_value"] = "container_value" + value: resources_ast_types_container_value_ContainerValue + + +update_forward_refs(_ContainerValue.List) +update_forward_refs(_ContainerValue.Optional) +update_forward_refs(_FieldValue.ContainerValue) diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/dog.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/dog.py index 2070c58319b..bc696fce765 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/dog.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/dog.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Dog as Dog -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Dog(UniversalBaseModel): - fruit: "Fruit" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .fruit import Fruit # noqa: E402, F401, I001 - -update_forward_refs(Dog) +__all__ = ["Dog"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/equals_operator.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/equals_operator.py new file mode 100644 index 00000000000..3a95724f67a --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/equals_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperator as EqualsOperator + +__all__ = ["EqualsOperator"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/equals_operator_left.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/equals_operator_left.py new file mode 100644 index 00000000000..53901b8504e --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/equals_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorLeft as EqualsOperatorLeft + +__all__ = ["EqualsOperatorLeft"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/equals_operator_right.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/equals_operator_right.py new file mode 100644 index 00000000000..4348ffe8d3f --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/equals_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorRight as EqualsOperatorRight + +__all__ = ["EqualsOperatorRight"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/field_value.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/field_value.py index 16330a1bf96..88d4a5e9c2d 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/field_value.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/field_value.py @@ -1,100 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs -from .object_value import ObjectValue as resources_ast_types_object_value_ObjectValue -from .primitive_value import PrimitiveValue as resources_ast_types_primitive_value_PrimitiveValue - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def primitive_value(self, value: resources_ast_types_primitive_value_PrimitiveValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore - else: - return FieldValue(__root__=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore - - def object_value(self, value: resources_ast_types_object_value_ObjectValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore - else: - return FieldValue(__root__=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore - - def container_value(self, value: resources_ast_types_container_value_ContainerValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore - else: - return FieldValue(__root__=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore - - -class FieldValue(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - primitive_value: typing.Callable[[resources_ast_types_primitive_value_PrimitiveValue], T_Result], - object_value: typing.Callable[[resources_ast_types_object_value_ObjectValue], T_Result], - container_value: typing.Callable[["resources_ast_types_container_value_ContainerValue"], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "primitive_value": - return primitive_value(unioned_value.value) - if unioned_value.type == "object_value": - return object_value( - resources_ast_types_object_value_ObjectValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "container_value": - return container_value(unioned_value.value) - - -from .container_value import ContainerValue as resources_ast_types_container_value_ContainerValue # noqa: E402, F401, I001 - - -class _FieldValue: - class PrimitiveValue(UniversalBaseModel): - type: typing.Literal["primitive_value"] = "primitive_value" - value: resources_ast_types_primitive_value_PrimitiveValue - - class ObjectValue(resources_ast_types_object_value_ObjectValue): - type: typing.Literal["object_value"] = "object_value" - - class ContainerValue(UniversalBaseModel): - type: typing.Literal["container_value"] = "container_value" - value: resources_ast_types_container_value_ContainerValue - - -update_forward_refs(_FieldValue.ContainerValue) -update_forward_refs(FieldValue) +__all__ = ["FieldValue"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/fig.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/fig.py index de365089535..cf5006340ba 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/fig.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/fig.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Fig as Fig -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Fig(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Fig) +__all__ = ["Fig"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/fruit.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/fruit.py index 0a4a5e8b439..6f9ff11e1b4 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/fruit.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/fruit.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Fruit as Fruit -import typing - -if typing.TYPE_CHECKING: - from .acai import Acai - from .fig import Fig -Fruit = typing.Union["Acai", "Fig"] +__all__ = ["Fruit"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/greater_than_operator.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/greater_than_operator.py new file mode 100644 index 00000000000..56a53f19013 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/greater_than_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperator as GreaterThanOperator + +__all__ = ["GreaterThanOperator"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/greater_than_operator_left.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/greater_than_operator_left.py new file mode 100644 index 00000000000..0958d95ca84 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/greater_than_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorLeft as GreaterThanOperatorLeft + +__all__ = ["GreaterThanOperatorLeft"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/greater_than_operator_right.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/greater_than_operator_right.py new file mode 100644 index 00000000000..20234cb9d0e --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/greater_than_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorRight as GreaterThanOperatorRight + +__all__ = ["GreaterThanOperatorRight"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/node.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/node.py index 50575ba6722..f8d6f92d33c 100644 --- a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/node.py +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/node.py @@ -1,11 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .branch_node_all import Node as Node -import typing - -from .leaf_node import LeafNode - -if typing.TYPE_CHECKING: - from .branch_node import BranchNode -Node = typing.Union["BranchNode", LeafNode] +__all__ = ["Node"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/or_operator.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/or_operator.py new file mode 100644 index 00000000000..04bc907e4c8 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/or_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperator as OrOperator + +__all__ = ["OrOperator"] diff --git a/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/or_operator_child.py b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/or_operator_child.py new file mode 100644 index 00000000000..49d1ffed627 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-custom-config/resources/ast/types/or_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperatorChild as OrOperatorChild + +__all__ = ["OrOperatorChild"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/__init__.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/__init__.py index 81847151de8..a5882c8de63 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/__init__.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/__init__.py @@ -5,21 +5,31 @@ from .resources import ( A, Acai, + AndOperator, + AndOperatorChild, Animal, Berry, BranchNode, Cat, ContainerValue, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorRight, FieldName, FieldValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorRight, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, PrimitiveValue, a, ast, @@ -29,22 +39,32 @@ __all__ = [ "A", "Acai", + "AndOperator", + "AndOperatorChild", "Animal", "Berry", "BranchNode", "Cat", "ContainerValue", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorRight", "FieldName", "FieldValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorRight", "ImportingA", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", "PrimitiveValue", "RootType", "a", diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/__init__.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/__init__.py index b343397ca6c..84a925facf5 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/__init__.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/__init__.py @@ -6,42 +6,62 @@ from .a import A from .ast import ( Acai, + AndOperator, + AndOperatorChild, Animal, Berry, BranchNode, Cat, ContainerValue, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorRight, FieldName, FieldValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorRight, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, PrimitiveValue, ) __all__ = [ "A", "Acai", + "AndOperator", + "AndOperatorChild", "Animal", "Berry", "BranchNode", "Cat", "ContainerValue", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorRight", "FieldName", "FieldValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorRight", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", "PrimitiveValue", "a", "ast", diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/__init__.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/__init__.py index c965801b4b4..f07b911e237 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/__init__.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/__init__.py @@ -4,40 +4,60 @@ from .types import ( Acai, + AndOperator, + AndOperatorChild, Animal, Berry, BranchNode, Cat, ContainerValue, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorRight, FieldName, FieldValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorRight, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, PrimitiveValue, ) __all__ = [ "Acai", + "AndOperator", + "AndOperatorChild", "Animal", "Berry", "BranchNode", "Cat", "ContainerValue", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorRight", "FieldName", "FieldValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorRight", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", "PrimitiveValue", ] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/__init__.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/__init__.py index 85b975b5f16..3c03ac39a7e 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/__init__.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/__init__.py @@ -2,19 +2,23 @@ # isort: skip_file -from .acai import Acai -from .animal import Animal -from .berry import Berry -from .branch_node import BranchNode -from .cat import Cat -from .container_value import ContainerValue -from .dog import Dog +from .acai_all import Acai, Animal, Berry, Cat, Dog, Fig, Fruit +from .and_operator_all import ( + AndOperator, + AndOperatorChild, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorRight, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorRight, + OrOperator, + OrOperatorChild, +) +from .branch_node_all import BranchNode, Node +from .container_value_all import ContainerValue, FieldValue from .field_name import FieldName -from .field_value import FieldValue -from .fig import Fig -from .fruit import Fruit from .leaf_node import LeafNode -from .node import Node from .nodes_wrapper import NodesWrapper from .object_field_value import ObjectFieldValue from .object_value import ObjectValue @@ -22,20 +26,30 @@ __all__ = [ "Acai", + "AndOperator", + "AndOperatorChild", "Animal", "Berry", "BranchNode", "Cat", "ContainerValue", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorRight", "FieldName", "FieldValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorRight", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", "PrimitiveValue", ] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/acai.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/acai.py index e5394d6a820..06dc06d5aa6 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/acai.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/acai.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Acai as Acai -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Acai(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Acai) +__all__ = ["Acai"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/acai_all.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/acai_all.py new file mode 100644 index 00000000000..f93f59fbb7e --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/acai_all.py @@ -0,0 +1,80 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .acai import Acai as resources_ast_types_acai_Acai + from .cat import Cat as resources_ast_types_cat_Cat + from .dog import Dog as resources_ast_types_dog_Dog + from .fig import Fig as resources_ast_types_fig_Fig + + +class Acai(UniversalBaseModel): + animal: "resources_ast_types_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +Animal = typing.Union["resources_ast_types_cat_Cat", "resources_ast_types_dog_Dog"] + + +class Berry(UniversalBaseModel): + animal: "resources_ast_types_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class Cat(UniversalBaseModel): + fruit: "resources_ast_types_fruit_Fruit" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class Dog(UniversalBaseModel): + fruit: "resources_ast_types_fruit_Fruit" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .fruit import Fruit as resources_ast_types_fruit_Fruit # noqa: E402, F401, I001 + + +class Fig(UniversalBaseModel): + animal: "resources_ast_types_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .animal import Animal as resources_ast_types_animal_Animal # noqa: E402, F401, I001 + +Fruit = typing.Union["resources_ast_types_acai_Acai", "resources_ast_types_fig_Fig"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/and_operator.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/and_operator.py new file mode 100644 index 00000000000..f3c921a6c39 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/and_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperator as AndOperator + +__all__ = ["AndOperator"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/and_operator_all.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/and_operator_all.py new file mode 100644 index 00000000000..c39967e05ac --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/and_operator_all.py @@ -0,0 +1,1082 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs + +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") + + +class AndOperator(UniversalBaseModel): + """ + Deep circular reference pattern mimicking elevenlabs AST operators + """ + + children: typing.List["resources_ast_types_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_and_operator_child_AndOperatorChild: + if IS_PYDANTIC_V2: + return AndOperatorChild( + root=_AndOperatorChild.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return AndOperatorChild( + __root__=_AndOperatorChild.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_and_operator_child_AndOperatorChild: + if IS_PYDANTIC_V2: + return AndOperatorChild( + root=_AndOperatorChild.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return AndOperatorChild( + __root__=_AndOperatorChild.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_and_operator_child_AndOperatorChild: + if IS_PYDANTIC_V2: + return AndOperatorChild( + root=_AndOperatorChild.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return AndOperatorChild( + __root__=_AndOperatorChild.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_and_operator_child_AndOperatorChild: + if IS_PYDANTIC_V2: + return AndOperatorChild( + root=_AndOperatorChild.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return AndOperatorChild( + __root__=_AndOperatorChild.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def boolean_literal(self, value: bool) -> resources_ast_types_and_operator_child_AndOperatorChild: + if IS_PYDANTIC_V2: + return AndOperatorChild(root=_AndOperatorChild.BooleanLiteral(type="boolean_literal", value=value)) # type: ignore + else: + return AndOperatorChild(__root__=_AndOperatorChild.BooleanLiteral(type="boolean_literal", value=value)) # type: ignore + + +class AndOperatorChild(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _AndOperatorChild.AndOperator, + _AndOperatorChild.OrOperator, + _AndOperatorChild.EqOperator, + _AndOperatorChild.GtOperator, + _AndOperatorChild.BooleanLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _AndOperatorChild.AndOperator, + _AndOperatorChild.OrOperator, + _AndOperatorChild.EqOperator, + _AndOperatorChild.GtOperator, + _AndOperatorChild.BooleanLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _AndOperatorChild.AndOperator, + _AndOperatorChild.OrOperator, + _AndOperatorChild.EqOperator, + _AndOperatorChild.GtOperator, + _AndOperatorChild.BooleanLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _AndOperatorChild.AndOperator, + _AndOperatorChild.OrOperator, + _AndOperatorChild.EqOperator, + _AndOperatorChild.GtOperator, + _AndOperatorChild.BooleanLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + boolean_literal: typing.Callable[[bool], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "boolean_literal": + return boolean_literal(unioned_value.value) + + +class _AndOperatorChild: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class BooleanLiteral(UniversalBaseModel): + type: typing.Literal["boolean_literal"] = "boolean_literal" + value: bool + + +class EqualsOperator(UniversalBaseModel): + left: "resources_ast_types_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_types_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_equals_operator_left_EqualsOperatorLeft: + if IS_PYDANTIC_V2: + return EqualsOperatorLeft( + root=_EqualsOperatorLeft.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return EqualsOperatorLeft( + __root__=_EqualsOperatorLeft.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_equals_operator_left_EqualsOperatorLeft: + if IS_PYDANTIC_V2: + return EqualsOperatorLeft( + root=_EqualsOperatorLeft.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return EqualsOperatorLeft( + __root__=_EqualsOperatorLeft.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_equals_operator_left_EqualsOperatorLeft: + if IS_PYDANTIC_V2: + return EqualsOperatorLeft( + root=_EqualsOperatorLeft.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return EqualsOperatorLeft( + __root__=_EqualsOperatorLeft.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_equals_operator_left_EqualsOperatorLeft: + if IS_PYDANTIC_V2: + return EqualsOperatorLeft( + root=_EqualsOperatorLeft.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return EqualsOperatorLeft( + __root__=_EqualsOperatorLeft.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def string_literal(self, value: str) -> resources_ast_types_equals_operator_left_EqualsOperatorLeft: + if IS_PYDANTIC_V2: + return EqualsOperatorLeft(root=_EqualsOperatorLeft.StringLiteral(type="string_literal", value=value)) # type: ignore + else: + return EqualsOperatorLeft(__root__=_EqualsOperatorLeft.StringLiteral(type="string_literal", value=value)) # type: ignore + + +class EqualsOperatorLeft(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _EqualsOperatorLeft.AndOperator, + _EqualsOperatorLeft.OrOperator, + _EqualsOperatorLeft.EqOperator, + _EqualsOperatorLeft.GtOperator, + _EqualsOperatorLeft.StringLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _EqualsOperatorLeft.AndOperator, + _EqualsOperatorLeft.OrOperator, + _EqualsOperatorLeft.EqOperator, + _EqualsOperatorLeft.GtOperator, + _EqualsOperatorLeft.StringLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _EqualsOperatorLeft.AndOperator, + _EqualsOperatorLeft.OrOperator, + _EqualsOperatorLeft.EqOperator, + _EqualsOperatorLeft.GtOperator, + _EqualsOperatorLeft.StringLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _EqualsOperatorLeft.AndOperator, + _EqualsOperatorLeft.OrOperator, + _EqualsOperatorLeft.EqOperator, + _EqualsOperatorLeft.GtOperator, + _EqualsOperatorLeft.StringLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + string_literal: typing.Callable[[str], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "string_literal": + return string_literal(unioned_value.value) + + +class _EqualsOperatorLeft: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class StringLiteral(UniversalBaseModel): + type: typing.Literal["string_literal"] = "string_literal" + value: str + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_equals_operator_right_EqualsOperatorRight: + if IS_PYDANTIC_V2: + return EqualsOperatorRight( + root=_EqualsOperatorRight.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return EqualsOperatorRight( + __root__=_EqualsOperatorRight.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_equals_operator_right_EqualsOperatorRight: + if IS_PYDANTIC_V2: + return EqualsOperatorRight( + root=_EqualsOperatorRight.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return EqualsOperatorRight( + __root__=_EqualsOperatorRight.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_equals_operator_right_EqualsOperatorRight: + if IS_PYDANTIC_V2: + return EqualsOperatorRight( + root=_EqualsOperatorRight.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return EqualsOperatorRight( + __root__=_EqualsOperatorRight.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_equals_operator_right_EqualsOperatorRight: + if IS_PYDANTIC_V2: + return EqualsOperatorRight( + root=_EqualsOperatorRight.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return EqualsOperatorRight( + __root__=_EqualsOperatorRight.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def string_literal(self, value: str) -> resources_ast_types_equals_operator_right_EqualsOperatorRight: + if IS_PYDANTIC_V2: + return EqualsOperatorRight(root=_EqualsOperatorRight.StringLiteral(type="string_literal", value=value)) # type: ignore + else: + return EqualsOperatorRight(__root__=_EqualsOperatorRight.StringLiteral(type="string_literal", value=value)) # type: ignore + + +class EqualsOperatorRight(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _EqualsOperatorRight.AndOperator, + _EqualsOperatorRight.OrOperator, + _EqualsOperatorRight.EqOperator, + _EqualsOperatorRight.GtOperator, + _EqualsOperatorRight.StringLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _EqualsOperatorRight.AndOperator, + _EqualsOperatorRight.OrOperator, + _EqualsOperatorRight.EqOperator, + _EqualsOperatorRight.GtOperator, + _EqualsOperatorRight.StringLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _EqualsOperatorRight.AndOperator, + _EqualsOperatorRight.OrOperator, + _EqualsOperatorRight.EqOperator, + _EqualsOperatorRight.GtOperator, + _EqualsOperatorRight.StringLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _EqualsOperatorRight.AndOperator, + _EqualsOperatorRight.OrOperator, + _EqualsOperatorRight.EqOperator, + _EqualsOperatorRight.GtOperator, + _EqualsOperatorRight.StringLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + string_literal: typing.Callable[[str], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "string_literal": + return string_literal(unioned_value.value) + + +class _EqualsOperatorRight: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class StringLiteral(UniversalBaseModel): + type: typing.Literal["string_literal"] = "string_literal" + value: str + + +class GreaterThanOperator(UniversalBaseModel): + left: "resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft: + if IS_PYDANTIC_V2: + return GreaterThanOperatorLeft( + root=_GreaterThanOperatorLeft.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return GreaterThanOperatorLeft( + __root__=_GreaterThanOperatorLeft.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft: + if IS_PYDANTIC_V2: + return GreaterThanOperatorLeft( + root=_GreaterThanOperatorLeft.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return GreaterThanOperatorLeft( + __root__=_GreaterThanOperatorLeft.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft: + if IS_PYDANTIC_V2: + return GreaterThanOperatorLeft( + root=_GreaterThanOperatorLeft.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return GreaterThanOperatorLeft( + __root__=_GreaterThanOperatorLeft.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft: + if IS_PYDANTIC_V2: + return GreaterThanOperatorLeft( + root=_GreaterThanOperatorLeft.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return GreaterThanOperatorLeft( + __root__=_GreaterThanOperatorLeft.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def number_literal(self, value: float) -> resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft: + if IS_PYDANTIC_V2: + return GreaterThanOperatorLeft( + root=_GreaterThanOperatorLeft.NumberLiteral(type="number_literal", value=value) + ) # type: ignore + else: + return GreaterThanOperatorLeft( + __root__=_GreaterThanOperatorLeft.NumberLiteral(type="number_literal", value=value) + ) # type: ignore + + +class GreaterThanOperatorLeft(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _GreaterThanOperatorLeft.AndOperator, + _GreaterThanOperatorLeft.OrOperator, + _GreaterThanOperatorLeft.EqOperator, + _GreaterThanOperatorLeft.GtOperator, + _GreaterThanOperatorLeft.NumberLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _GreaterThanOperatorLeft.AndOperator, + _GreaterThanOperatorLeft.OrOperator, + _GreaterThanOperatorLeft.EqOperator, + _GreaterThanOperatorLeft.GtOperator, + _GreaterThanOperatorLeft.NumberLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _GreaterThanOperatorLeft.AndOperator, + _GreaterThanOperatorLeft.OrOperator, + _GreaterThanOperatorLeft.EqOperator, + _GreaterThanOperatorLeft.GtOperator, + _GreaterThanOperatorLeft.NumberLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _GreaterThanOperatorLeft.AndOperator, + _GreaterThanOperatorLeft.OrOperator, + _GreaterThanOperatorLeft.EqOperator, + _GreaterThanOperatorLeft.GtOperator, + _GreaterThanOperatorLeft.NumberLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + number_literal: typing.Callable[[float], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "number_literal": + return number_literal(unioned_value.value) + + +class _GreaterThanOperatorLeft: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class NumberLiteral(UniversalBaseModel): + type: typing.Literal["number_literal"] = "number_literal" + value: float + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight: + if IS_PYDANTIC_V2: + return GreaterThanOperatorRight( + root=_GreaterThanOperatorRight.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return GreaterThanOperatorRight( + __root__=_GreaterThanOperatorRight.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight: + if IS_PYDANTIC_V2: + return GreaterThanOperatorRight( + root=_GreaterThanOperatorRight.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return GreaterThanOperatorRight( + __root__=_GreaterThanOperatorRight.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight: + if IS_PYDANTIC_V2: + return GreaterThanOperatorRight( + root=_GreaterThanOperatorRight.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return GreaterThanOperatorRight( + __root__=_GreaterThanOperatorRight.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight: + if IS_PYDANTIC_V2: + return GreaterThanOperatorRight( + root=_GreaterThanOperatorRight.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return GreaterThanOperatorRight( + __root__=_GreaterThanOperatorRight.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def number_literal(self, value: float) -> resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight: + if IS_PYDANTIC_V2: + return GreaterThanOperatorRight( + root=_GreaterThanOperatorRight.NumberLiteral(type="number_literal", value=value) + ) # type: ignore + else: + return GreaterThanOperatorRight( + __root__=_GreaterThanOperatorRight.NumberLiteral(type="number_literal", value=value) + ) # type: ignore + + +class GreaterThanOperatorRight(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _GreaterThanOperatorRight.AndOperator, + _GreaterThanOperatorRight.OrOperator, + _GreaterThanOperatorRight.EqOperator, + _GreaterThanOperatorRight.GtOperator, + _GreaterThanOperatorRight.NumberLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _GreaterThanOperatorRight.AndOperator, + _GreaterThanOperatorRight.OrOperator, + _GreaterThanOperatorRight.EqOperator, + _GreaterThanOperatorRight.GtOperator, + _GreaterThanOperatorRight.NumberLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _GreaterThanOperatorRight.AndOperator, + _GreaterThanOperatorRight.OrOperator, + _GreaterThanOperatorRight.EqOperator, + _GreaterThanOperatorRight.GtOperator, + _GreaterThanOperatorRight.NumberLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _GreaterThanOperatorRight.AndOperator, + _GreaterThanOperatorRight.OrOperator, + _GreaterThanOperatorRight.EqOperator, + _GreaterThanOperatorRight.GtOperator, + _GreaterThanOperatorRight.NumberLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + number_literal: typing.Callable[[float], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "number_literal": + return number_literal(unioned_value.value) + + +class _GreaterThanOperatorRight: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class NumberLiteral(UniversalBaseModel): + type: typing.Literal["number_literal"] = "number_literal" + value: float + + +class OrOperator(UniversalBaseModel): + children: typing.List["resources_ast_types_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def and_operator( + self, value: resources_ast_types_and_operator_AndOperator + ) -> resources_ast_types_or_operator_child_OrOperatorChild: + if IS_PYDANTIC_V2: + return OrOperatorChild( + root=_OrOperatorChild.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + else: + return OrOperatorChild( + __root__=_OrOperatorChild.AndOperator(**value.dict(exclude_unset=True), type="and_operator") + ) # type: ignore + + def or_operator( + self, value: resources_ast_types_or_operator_OrOperator + ) -> resources_ast_types_or_operator_child_OrOperatorChild: + if IS_PYDANTIC_V2: + return OrOperatorChild( + root=_OrOperatorChild.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + else: + return OrOperatorChild( + __root__=_OrOperatorChild.OrOperator(**value.dict(exclude_unset=True), type="or_operator") + ) # type: ignore + + def eq_operator( + self, value: resources_ast_types_equals_operator_EqualsOperator + ) -> resources_ast_types_or_operator_child_OrOperatorChild: + if IS_PYDANTIC_V2: + return OrOperatorChild( + root=_OrOperatorChild.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + else: + return OrOperatorChild( + __root__=_OrOperatorChild.EqOperator(**value.dict(exclude_unset=True), type="eq_operator") + ) # type: ignore + + def gt_operator( + self, value: resources_ast_types_greater_than_operator_GreaterThanOperator + ) -> resources_ast_types_or_operator_child_OrOperatorChild: + if IS_PYDANTIC_V2: + return OrOperatorChild( + root=_OrOperatorChild.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + else: + return OrOperatorChild( + __root__=_OrOperatorChild.GtOperator(**value.dict(exclude_unset=True), type="gt_operator") + ) # type: ignore + + def boolean_literal(self, value: bool) -> resources_ast_types_or_operator_child_OrOperatorChild: + if IS_PYDANTIC_V2: + return OrOperatorChild(root=_OrOperatorChild.BooleanLiteral(type="boolean_literal", value=value)) # type: ignore + else: + return OrOperatorChild(__root__=_OrOperatorChild.BooleanLiteral(type="boolean_literal", value=value)) # type: ignore + + +class OrOperatorChild(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _OrOperatorChild.AndOperator, + _OrOperatorChild.OrOperator, + _OrOperatorChild.EqOperator, + _OrOperatorChild.GtOperator, + _OrOperatorChild.BooleanLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _OrOperatorChild.AndOperator, + _OrOperatorChild.OrOperator, + _OrOperatorChild.EqOperator, + _OrOperatorChild.GtOperator, + _OrOperatorChild.BooleanLiteral, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _OrOperatorChild.AndOperator, + _OrOperatorChild.OrOperator, + _OrOperatorChild.EqOperator, + _OrOperatorChild.GtOperator, + _OrOperatorChild.BooleanLiteral, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _OrOperatorChild.AndOperator, + _OrOperatorChild.OrOperator, + _OrOperatorChild.EqOperator, + _OrOperatorChild.GtOperator, + _OrOperatorChild.BooleanLiteral, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + and_operator: typing.Callable[["resources_ast_types_and_operator_AndOperator"], T_Result], + or_operator: typing.Callable[["resources_ast_types_or_operator_OrOperator"], T_Result], + eq_operator: typing.Callable[["resources_ast_types_equals_operator_EqualsOperator"], T_Result], + gt_operator: typing.Callable[["resources_ast_types_greater_than_operator_GreaterThanOperator"], T_Result], + boolean_literal: typing.Callable[[bool], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "and_operator": + return and_operator( + resources_ast_types_and_operator_AndOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "or_operator": + return or_operator( + resources_ast_types_or_operator_OrOperator(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "eq_operator": + return eq_operator( + resources_ast_types_equals_operator_EqualsOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "gt_operator": + return gt_operator( + resources_ast_types_greater_than_operator_GreaterThanOperator( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "boolean_literal": + return boolean_literal(unioned_value.value) + + +from .and_operator_child import AndOperatorChild as resources_ast_types_and_operator_child_AndOperatorChild # noqa: E402, F401, I001 +from .and_operator import AndOperator as resources_ast_types_and_operator_AndOperator # noqa: E402, F401, I001 +from .or_operator import OrOperator as resources_ast_types_or_operator_OrOperator # noqa: E402, F401, I001 +from .equals_operator import EqualsOperator as resources_ast_types_equals_operator_EqualsOperator # noqa: E402, F401, I001 +from .greater_than_operator import GreaterThanOperator as resources_ast_types_greater_than_operator_GreaterThanOperator # noqa: E402, F401, I001 +from .equals_operator_left import EqualsOperatorLeft as resources_ast_types_equals_operator_left_EqualsOperatorLeft # noqa: E402, F401, I001 +from .equals_operator_right import EqualsOperatorRight as resources_ast_types_equals_operator_right_EqualsOperatorRight # noqa: E402, F401, I001 +from .greater_than_operator_left import ( + GreaterThanOperatorLeft as resources_ast_types_greater_than_operator_left_GreaterThanOperatorLeft, +) # noqa: E402, F401, I001 +from .greater_than_operator_right import ( + GreaterThanOperatorRight as resources_ast_types_greater_than_operator_right_GreaterThanOperatorRight, +) # noqa: E402, F401, I001 +from .or_operator_child import OrOperatorChild as resources_ast_types_or_operator_child_OrOperatorChild # noqa: E402, F401, I001 + + +class _OrOperatorChild: + class AndOperator(resources_ast_types_and_operator_AndOperator): + type: typing.Literal["and_operator"] = "and_operator" + + class OrOperator(resources_ast_types_or_operator_OrOperator): + type: typing.Literal["or_operator"] = "or_operator" + + class EqOperator(resources_ast_types_equals_operator_EqualsOperator): + type: typing.Literal["eq_operator"] = "eq_operator" + + class GtOperator(resources_ast_types_greater_than_operator_GreaterThanOperator): + type: typing.Literal["gt_operator"] = "gt_operator" + + class BooleanLiteral(UniversalBaseModel): + type: typing.Literal["boolean_literal"] = "boolean_literal" + value: bool + + +update_forward_refs(_AndOperatorChild.AndOperator) +update_forward_refs(_AndOperatorChild.OrOperator) +update_forward_refs(_AndOperatorChild.EqOperator) +update_forward_refs(_AndOperatorChild.GtOperator) +update_forward_refs(_EqualsOperatorLeft.AndOperator) +update_forward_refs(_EqualsOperatorLeft.OrOperator) +update_forward_refs(_EqualsOperatorLeft.EqOperator) +update_forward_refs(_EqualsOperatorLeft.GtOperator) +update_forward_refs(_EqualsOperatorRight.AndOperator) +update_forward_refs(_EqualsOperatorRight.OrOperator) +update_forward_refs(_EqualsOperatorRight.EqOperator) +update_forward_refs(_EqualsOperatorRight.GtOperator) +update_forward_refs(_GreaterThanOperatorLeft.AndOperator) +update_forward_refs(_GreaterThanOperatorLeft.OrOperator) +update_forward_refs(_GreaterThanOperatorLeft.EqOperator) +update_forward_refs(_GreaterThanOperatorLeft.GtOperator) +update_forward_refs(_GreaterThanOperatorRight.AndOperator) +update_forward_refs(_GreaterThanOperatorRight.OrOperator) +update_forward_refs(_GreaterThanOperatorRight.EqOperator) +update_forward_refs(_GreaterThanOperatorRight.GtOperator) +update_forward_refs(_OrOperatorChild.AndOperator) +update_forward_refs(_OrOperatorChild.OrOperator) +update_forward_refs(_OrOperatorChild.EqOperator) +update_forward_refs(_OrOperatorChild.GtOperator) diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/and_operator_child.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/and_operator_child.py new file mode 100644 index 00000000000..0c043b87dbb --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/and_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperatorChild as AndOperatorChild + +__all__ = ["AndOperatorChild"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/animal.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/animal.py index ce527295dff..bc07c7d3b20 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/animal.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/animal.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Animal as Animal -import typing - -if typing.TYPE_CHECKING: - from .cat import Cat - from .dog import Dog -Animal = typing.Union["Cat", "Dog"] +__all__ = ["Animal"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/berry.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/berry.py index 3af1cd110e0..1131a180b1a 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/berry.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/berry.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Berry as Berry -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Berry(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Berry) +__all__ = ["Berry"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/branch_node.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/branch_node.py index a1dd998526f..e53f75d7362 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/branch_node.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/branch_node.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .branch_node_all import BranchNode as BranchNode -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class BranchNode(UniversalBaseModel): - children: typing.List["Node"] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .node import Node # noqa: E402, F401, I001 - -update_forward_refs(BranchNode) +__all__ = ["BranchNode"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/branch_node_all.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/branch_node_all.py new file mode 100644 index 00000000000..43752a1382e --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/branch_node_all.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .leaf_node import LeafNode + +if typing.TYPE_CHECKING: + from .branch_node import BranchNode as resources_ast_types_branch_node_BranchNode + + +class BranchNode(UniversalBaseModel): + children: typing.List["resources_ast_types_node_Node"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .node import Node as resources_ast_types_node_Node # noqa: E402, F401, I001 + +Node = typing.Union["resources_ast_types_branch_node_BranchNode", LeafNode] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/cat.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/cat.py index 0a24cf7a011..3d1211c6497 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/cat.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/cat.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Cat as Cat -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Cat(UniversalBaseModel): - fruit: "Fruit" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .fruit import Fruit # noqa: E402, F401, I001 - -update_forward_refs(Cat) +__all__ = ["Cat"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/container_value.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/container_value.py index 9fdcc8225e4..d3b9fbcdba7 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/container_value.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/container_value.py @@ -1,79 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def list_(self, value: typing.List[FieldValue]) -> ContainerValue: - if IS_PYDANTIC_V2: - return ContainerValue(root=_ContainerValue.List(type="list", value=value)) # type: ignore - else: - return ContainerValue(__root__=_ContainerValue.List(type="list", value=value)) # type: ignore - - def optional(self, value: typing.Optional[FieldValue]) -> ContainerValue: - if IS_PYDANTIC_V2: - return ContainerValue(root=_ContainerValue.Optional(type="optional", value=value)) # type: ignore - else: - return ContainerValue(__root__=_ContainerValue.Optional(type="optional", value=value)) # type: ignore - - -class ContainerValue(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") - ] - - def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") - ] - - def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - list_: typing.Callable[[typing.List["FieldValue"]], T_Result], - optional: typing.Callable[[typing.Optional["FieldValue"]], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "list": - return list_(unioned_value.value) - if unioned_value.type == "optional": - return optional(unioned_value.value) - - -from .field_value import FieldValue # noqa: E402, F401, I001 - - -class _ContainerValue: - class List(UniversalBaseModel): - type: typing.Literal["list"] = "list" - value: typing.List[FieldValue] - - class Optional(UniversalBaseModel): - type: typing.Literal["optional"] = "optional" - value: typing.Optional[FieldValue] = None - - -update_forward_refs(_ContainerValue.List) -update_forward_refs(_ContainerValue.Optional) -update_forward_refs(ContainerValue) +__all__ = ["ContainerValue"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/container_value_all.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/container_value_all.py new file mode 100644 index 00000000000..f0da27c1248 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/container_value_all.py @@ -0,0 +1,173 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs +from .object_value import ObjectValue as resources_ast_types_object_value_ObjectValue +from .primitive_value import PrimitiveValue as resources_ast_types_primitive_value_PrimitiveValue + +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") + + +class _Factory: + def list_( + self, value: typing.List[resources_ast_types_field_value_FieldValue] + ) -> resources_ast_types_container_value_ContainerValue: + if IS_PYDANTIC_V2: + return ContainerValue(root=_ContainerValue.List(type="list", value=value)) # type: ignore + else: + return ContainerValue(__root__=_ContainerValue.List(type="list", value=value)) # type: ignore + + def optional( + self, value: typing.Optional[resources_ast_types_field_value_FieldValue] + ) -> resources_ast_types_container_value_ContainerValue: + if IS_PYDANTIC_V2: + return ContainerValue(root=_ContainerValue.Optional(type="optional", value=value)) # type: ignore + else: + return ContainerValue(__root__=_ContainerValue.Optional(type="optional", value=value)) # type: ignore + + +class ContainerValue(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") + ] + + def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") + ] + + def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + list_: typing.Callable[[typing.List["resources_ast_types_field_value_FieldValue"]], T_Result], + optional: typing.Callable[[typing.Optional["resources_ast_types_field_value_FieldValue"]], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "list": + return list_(unioned_value.value) + if unioned_value.type == "optional": + return optional(unioned_value.value) + + +class _ContainerValue: + class List(UniversalBaseModel): + type: typing.Literal["list"] = "list" + value: typing.List[resources_ast_types_field_value_FieldValue] + + class Optional(UniversalBaseModel): + type: typing.Literal["optional"] = "optional" + value: typing.Optional[resources_ast_types_field_value_FieldValue] = None + + +class _Factory: + def primitive_value( + self, value: resources_ast_types_primitive_value_PrimitiveValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore + else: + return FieldValue(__root__=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore + + def object_value( + self, value: resources_ast_types_object_value_ObjectValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore + else: + return FieldValue(__root__=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore + + def container_value( + self, value: resources_ast_types_container_value_ContainerValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore + else: + return FieldValue(__root__=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore + + +class FieldValue(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + primitive_value: typing.Callable[[resources_ast_types_primitive_value_PrimitiveValue], T_Result], + object_value: typing.Callable[[resources_ast_types_object_value_ObjectValue], T_Result], + container_value: typing.Callable[["resources_ast_types_container_value_ContainerValue"], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "primitive_value": + return primitive_value(unioned_value.value) + if unioned_value.type == "object_value": + return object_value( + resources_ast_types_object_value_ObjectValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "container_value": + return container_value(unioned_value.value) + + +from .field_value import FieldValue as resources_ast_types_field_value_FieldValue # noqa: E402, F401, I001 +from .container_value import ContainerValue as resources_ast_types_container_value_ContainerValue # noqa: E402, F401, I001 + + +class _FieldValue: + class PrimitiveValue(UniversalBaseModel): + type: typing.Literal["primitive_value"] = "primitive_value" + value: resources_ast_types_primitive_value_PrimitiveValue + + class ObjectValue(resources_ast_types_object_value_ObjectValue): + type: typing.Literal["object_value"] = "object_value" + + class ContainerValue(UniversalBaseModel): + type: typing.Literal["container_value"] = "container_value" + value: resources_ast_types_container_value_ContainerValue + + +update_forward_refs(_ContainerValue.List) +update_forward_refs(_ContainerValue.Optional) +update_forward_refs(_FieldValue.ContainerValue) diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/dog.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/dog.py index 2070c58319b..bc696fce765 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/dog.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/dog.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Dog as Dog -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Dog(UniversalBaseModel): - fruit: "Fruit" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .fruit import Fruit # noqa: E402, F401, I001 - -update_forward_refs(Dog) +__all__ = ["Dog"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/equals_operator.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/equals_operator.py new file mode 100644 index 00000000000..3a95724f67a --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/equals_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperator as EqualsOperator + +__all__ = ["EqualsOperator"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/equals_operator_left.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/equals_operator_left.py new file mode 100644 index 00000000000..53901b8504e --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/equals_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorLeft as EqualsOperatorLeft + +__all__ = ["EqualsOperatorLeft"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/equals_operator_right.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/equals_operator_right.py new file mode 100644 index 00000000000..4348ffe8d3f --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/equals_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorRight as EqualsOperatorRight + +__all__ = ["EqualsOperatorRight"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/field_value.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/field_value.py index 16330a1bf96..88d4a5e9c2d 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/field_value.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/field_value.py @@ -1,100 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs -from .object_value import ObjectValue as resources_ast_types_object_value_ObjectValue -from .primitive_value import PrimitiveValue as resources_ast_types_primitive_value_PrimitiveValue - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def primitive_value(self, value: resources_ast_types_primitive_value_PrimitiveValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore - else: - return FieldValue(__root__=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore - - def object_value(self, value: resources_ast_types_object_value_ObjectValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore - else: - return FieldValue(__root__=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore - - def container_value(self, value: resources_ast_types_container_value_ContainerValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore - else: - return FieldValue(__root__=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore - - -class FieldValue(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - primitive_value: typing.Callable[[resources_ast_types_primitive_value_PrimitiveValue], T_Result], - object_value: typing.Callable[[resources_ast_types_object_value_ObjectValue], T_Result], - container_value: typing.Callable[["resources_ast_types_container_value_ContainerValue"], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "primitive_value": - return primitive_value(unioned_value.value) - if unioned_value.type == "object_value": - return object_value( - resources_ast_types_object_value_ObjectValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "container_value": - return container_value(unioned_value.value) - - -from .container_value import ContainerValue as resources_ast_types_container_value_ContainerValue # noqa: E402, F401, I001 - - -class _FieldValue: - class PrimitiveValue(UniversalBaseModel): - type: typing.Literal["primitive_value"] = "primitive_value" - value: resources_ast_types_primitive_value_PrimitiveValue - - class ObjectValue(resources_ast_types_object_value_ObjectValue): - type: typing.Literal["object_value"] = "object_value" - - class ContainerValue(UniversalBaseModel): - type: typing.Literal["container_value"] = "container_value" - value: resources_ast_types_container_value_ContainerValue - - -update_forward_refs(_FieldValue.ContainerValue) -update_forward_refs(FieldValue) +__all__ = ["FieldValue"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/fig.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/fig.py index de365089535..cf5006340ba 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/fig.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/fig.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Fig as Fig -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Fig(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Fig) +__all__ = ["Fig"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/fruit.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/fruit.py index 0a4a5e8b439..6f9ff11e1b4 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/fruit.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/fruit.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Fruit as Fruit -import typing - -if typing.TYPE_CHECKING: - from .acai import Acai - from .fig import Fig -Fruit = typing.Union["Acai", "Fig"] +__all__ = ["Fruit"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/greater_than_operator.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/greater_than_operator.py new file mode 100644 index 00000000000..56a53f19013 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/greater_than_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperator as GreaterThanOperator + +__all__ = ["GreaterThanOperator"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/greater_than_operator_left.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/greater_than_operator_left.py new file mode 100644 index 00000000000..0958d95ca84 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/greater_than_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorLeft as GreaterThanOperatorLeft + +__all__ = ["GreaterThanOperatorLeft"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/greater_than_operator_right.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/greater_than_operator_right.py new file mode 100644 index 00000000000..20234cb9d0e --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/greater_than_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorRight as GreaterThanOperatorRight + +__all__ = ["GreaterThanOperatorRight"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/node.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/node.py index 50575ba6722..f8d6f92d33c 100644 --- a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/node.py +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/node.py @@ -1,11 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .branch_node_all import Node as Node -import typing - -from .leaf_node import LeafNode - -if typing.TYPE_CHECKING: - from .branch_node import BranchNode -Node = typing.Union["BranchNode", LeafNode] +__all__ = ["Node"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/or_operator.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/or_operator.py new file mode 100644 index 00000000000..04bc907e4c8 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/or_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperator as OrOperator + +__all__ = ["OrOperator"] diff --git a/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/or_operator_child.py b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/or_operator_child.py new file mode 100644 index 00000000000..49d1ffed627 --- /dev/null +++ b/seed/fastapi/circular-references-advanced/no-inheritance-for-extended-models/resources/ast/types/or_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperatorChild as OrOperatorChild + +__all__ = ["OrOperatorChild"] diff --git a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/__init__.py b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/__init__.py index 5e3444d4c91..7fc95ca053c 100644 --- a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/__init__.py +++ b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/__init__.py @@ -2,13 +2,10 @@ # isort: skip_file -from .container_value import ContainerValue -from .field_value import FieldValue +from .container_value_all import ContainerValue, FieldValue from .json_like import JsonLike from .object_value import ObjectValue from .primitive_value import PrimitiveValue -from .t import T -from .tor_u import TorU -from .u import U +from .t_all import T, TorU, U __all__ = ["ContainerValue", "FieldValue", "JsonLike", "ObjectValue", "PrimitiveValue", "T", "TorU", "U"] diff --git a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/container_value.py b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/container_value.py index 9fdcc8225e4..d3b9fbcdba7 100644 --- a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/container_value.py +++ b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/container_value.py @@ -1,79 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def list_(self, value: typing.List[FieldValue]) -> ContainerValue: - if IS_PYDANTIC_V2: - return ContainerValue(root=_ContainerValue.List(type="list", value=value)) # type: ignore - else: - return ContainerValue(__root__=_ContainerValue.List(type="list", value=value)) # type: ignore - - def optional(self, value: typing.Optional[FieldValue]) -> ContainerValue: - if IS_PYDANTIC_V2: - return ContainerValue(root=_ContainerValue.Optional(type="optional", value=value)) # type: ignore - else: - return ContainerValue(__root__=_ContainerValue.Optional(type="optional", value=value)) # type: ignore - - -class ContainerValue(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") - ] - - def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") - ] - - def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - list_: typing.Callable[[typing.List["FieldValue"]], T_Result], - optional: typing.Callable[[typing.Optional["FieldValue"]], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "list": - return list_(unioned_value.value) - if unioned_value.type == "optional": - return optional(unioned_value.value) - - -from .field_value import FieldValue # noqa: E402, F401, I001 - - -class _ContainerValue: - class List(UniversalBaseModel): - type: typing.Literal["list"] = "list" - value: typing.List[FieldValue] - - class Optional(UniversalBaseModel): - type: typing.Literal["optional"] = "optional" - value: typing.Optional[FieldValue] = None - - -update_forward_refs(_ContainerValue.List) -update_forward_refs(_ContainerValue.Optional) -update_forward_refs(ContainerValue) +__all__ = ["ContainerValue"] diff --git a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/container_value_all.py b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/container_value_all.py new file mode 100644 index 00000000000..f0da27c1248 --- /dev/null +++ b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/container_value_all.py @@ -0,0 +1,173 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs +from .object_value import ObjectValue as resources_ast_types_object_value_ObjectValue +from .primitive_value import PrimitiveValue as resources_ast_types_primitive_value_PrimitiveValue + +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") + + +class _Factory: + def list_( + self, value: typing.List[resources_ast_types_field_value_FieldValue] + ) -> resources_ast_types_container_value_ContainerValue: + if IS_PYDANTIC_V2: + return ContainerValue(root=_ContainerValue.List(type="list", value=value)) # type: ignore + else: + return ContainerValue(__root__=_ContainerValue.List(type="list", value=value)) # type: ignore + + def optional( + self, value: typing.Optional[resources_ast_types_field_value_FieldValue] + ) -> resources_ast_types_container_value_ContainerValue: + if IS_PYDANTIC_V2: + return ContainerValue(root=_ContainerValue.Optional(type="optional", value=value)) # type: ignore + else: + return ContainerValue(__root__=_ContainerValue.Optional(type="optional", value=value)) # type: ignore + + +class ContainerValue(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") + ] + + def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") + ] + + def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + list_: typing.Callable[[typing.List["resources_ast_types_field_value_FieldValue"]], T_Result], + optional: typing.Callable[[typing.Optional["resources_ast_types_field_value_FieldValue"]], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "list": + return list_(unioned_value.value) + if unioned_value.type == "optional": + return optional(unioned_value.value) + + +class _ContainerValue: + class List(UniversalBaseModel): + type: typing.Literal["list"] = "list" + value: typing.List[resources_ast_types_field_value_FieldValue] + + class Optional(UniversalBaseModel): + type: typing.Literal["optional"] = "optional" + value: typing.Optional[resources_ast_types_field_value_FieldValue] = None + + +class _Factory: + def primitive_value( + self, value: resources_ast_types_primitive_value_PrimitiveValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore + else: + return FieldValue(__root__=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore + + def object_value( + self, value: resources_ast_types_object_value_ObjectValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore + else: + return FieldValue(__root__=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore + + def container_value( + self, value: resources_ast_types_container_value_ContainerValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore + else: + return FieldValue(__root__=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore + + +class FieldValue(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + primitive_value: typing.Callable[[resources_ast_types_primitive_value_PrimitiveValue], T_Result], + object_value: typing.Callable[[resources_ast_types_object_value_ObjectValue], T_Result], + container_value: typing.Callable[["resources_ast_types_container_value_ContainerValue"], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "primitive_value": + return primitive_value(unioned_value.value) + if unioned_value.type == "object_value": + return object_value( + resources_ast_types_object_value_ObjectValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "container_value": + return container_value(unioned_value.value) + + +from .field_value import FieldValue as resources_ast_types_field_value_FieldValue # noqa: E402, F401, I001 +from .container_value import ContainerValue as resources_ast_types_container_value_ContainerValue # noqa: E402, F401, I001 + + +class _FieldValue: + class PrimitiveValue(UniversalBaseModel): + type: typing.Literal["primitive_value"] = "primitive_value" + value: resources_ast_types_primitive_value_PrimitiveValue + + class ObjectValue(resources_ast_types_object_value_ObjectValue): + type: typing.Literal["object_value"] = "object_value" + + class ContainerValue(UniversalBaseModel): + type: typing.Literal["container_value"] = "container_value" + value: resources_ast_types_container_value_ContainerValue + + +update_forward_refs(_ContainerValue.List) +update_forward_refs(_ContainerValue.Optional) +update_forward_refs(_FieldValue.ContainerValue) diff --git a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/field_value.py b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/field_value.py index 16330a1bf96..88d4a5e9c2d 100644 --- a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/field_value.py +++ b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/field_value.py @@ -1,100 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs -from .object_value import ObjectValue as resources_ast_types_object_value_ObjectValue -from .primitive_value import PrimitiveValue as resources_ast_types_primitive_value_PrimitiveValue - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def primitive_value(self, value: resources_ast_types_primitive_value_PrimitiveValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore - else: - return FieldValue(__root__=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore - - def object_value(self, value: resources_ast_types_object_value_ObjectValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore - else: - return FieldValue(__root__=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore - - def container_value(self, value: resources_ast_types_container_value_ContainerValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore - else: - return FieldValue(__root__=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore - - -class FieldValue(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - primitive_value: typing.Callable[[resources_ast_types_primitive_value_PrimitiveValue], T_Result], - object_value: typing.Callable[[resources_ast_types_object_value_ObjectValue], T_Result], - container_value: typing.Callable[["resources_ast_types_container_value_ContainerValue"], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "primitive_value": - return primitive_value(unioned_value.value) - if unioned_value.type == "object_value": - return object_value( - resources_ast_types_object_value_ObjectValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "container_value": - return container_value(unioned_value.value) - - -from .container_value import ContainerValue as resources_ast_types_container_value_ContainerValue # noqa: E402, F401, I001 - - -class _FieldValue: - class PrimitiveValue(UniversalBaseModel): - type: typing.Literal["primitive_value"] = "primitive_value" - value: resources_ast_types_primitive_value_PrimitiveValue - - class ObjectValue(resources_ast_types_object_value_ObjectValue): - type: typing.Literal["object_value"] = "object_value" - - class ContainerValue(UniversalBaseModel): - type: typing.Literal["container_value"] = "container_value" - value: resources_ast_types_container_value_ContainerValue - - -update_forward_refs(_FieldValue.ContainerValue) -update_forward_refs(FieldValue) +__all__ = ["FieldValue"] diff --git a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/t.py b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/t.py index 064b54fccb4..7890c29fb10 100644 --- a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/t.py +++ b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/t.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import T as T -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class T(UniversalBaseModel): - child: "TorU" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .tor_u import TorU # noqa: E402, F401, I001 - -update_forward_refs(T) +__all__ = ["T"] diff --git a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/t_all.py b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/t_all.py new file mode 100644 index 00000000000..d3a84794dfc --- /dev/null +++ b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/t_all.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .t import T as resources_ast_types_t_T + from .u import U as resources_ast_types_u_U + + +class T(UniversalBaseModel): + child: "resources_ast_types_tor_u_TorU" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .tor_u import TorU as resources_ast_types_tor_u_TorU # noqa: E402, F401, I001 + +TorU = typing.Union["resources_ast_types_t_T", "resources_ast_types_u_U"] + + +class U(UniversalBaseModel): + child: "resources_ast_types_t_T" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .t import T as resources_ast_types_t_T # noqa: E402, F401, I001 diff --git a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/tor_u.py b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/tor_u.py index 5409b5f1551..fd9fb53be9a 100644 --- a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/tor_u.py +++ b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/tor_u.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import TorU as TorU -import typing - -if typing.TYPE_CHECKING: - from .t import T - from .u import U -TorU = typing.Union["T", "U"] +__all__ = ["TorU"] diff --git a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/u.py b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/u.py index 7cf8d4cd288..85016723b61 100644 --- a/seed/fastapi/circular-references/no-custom-config/resources/ast/types/u.py +++ b/seed/fastapi/circular-references/no-custom-config/resources/ast/types/u.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import U as U -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class U(UniversalBaseModel): - child: "T" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .t import T # noqa: E402, F401, I001 - -update_forward_refs(U) +__all__ = ["U"] diff --git a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/__init__.py b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/__init__.py index 5e3444d4c91..7fc95ca053c 100644 --- a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/__init__.py +++ b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/__init__.py @@ -2,13 +2,10 @@ # isort: skip_file -from .container_value import ContainerValue -from .field_value import FieldValue +from .container_value_all import ContainerValue, FieldValue from .json_like import JsonLike from .object_value import ObjectValue from .primitive_value import PrimitiveValue -from .t import T -from .tor_u import TorU -from .u import U +from .t_all import T, TorU, U __all__ = ["ContainerValue", "FieldValue", "JsonLike", "ObjectValue", "PrimitiveValue", "T", "TorU", "U"] diff --git a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/container_value.py b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/container_value.py index 9fdcc8225e4..d3b9fbcdba7 100644 --- a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/container_value.py +++ b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/container_value.py @@ -1,79 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def list_(self, value: typing.List[FieldValue]) -> ContainerValue: - if IS_PYDANTIC_V2: - return ContainerValue(root=_ContainerValue.List(type="list", value=value)) # type: ignore - else: - return ContainerValue(__root__=_ContainerValue.List(type="list", value=value)) # type: ignore - - def optional(self, value: typing.Optional[FieldValue]) -> ContainerValue: - if IS_PYDANTIC_V2: - return ContainerValue(root=_ContainerValue.Optional(type="optional", value=value)) # type: ignore - else: - return ContainerValue(__root__=_ContainerValue.Optional(type="optional", value=value)) # type: ignore - - -class ContainerValue(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") - ] - - def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") - ] - - def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - list_: typing.Callable[[typing.List["FieldValue"]], T_Result], - optional: typing.Callable[[typing.Optional["FieldValue"]], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "list": - return list_(unioned_value.value) - if unioned_value.type == "optional": - return optional(unioned_value.value) - - -from .field_value import FieldValue # noqa: E402, F401, I001 - - -class _ContainerValue: - class List(UniversalBaseModel): - type: typing.Literal["list"] = "list" - value: typing.List[FieldValue] - - class Optional(UniversalBaseModel): - type: typing.Literal["optional"] = "optional" - value: typing.Optional[FieldValue] = None - - -update_forward_refs(_ContainerValue.List) -update_forward_refs(_ContainerValue.Optional) -update_forward_refs(ContainerValue) +__all__ = ["ContainerValue"] diff --git a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/container_value_all.py b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/container_value_all.py new file mode 100644 index 00000000000..f0da27c1248 --- /dev/null +++ b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/container_value_all.py @@ -0,0 +1,173 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs +from .object_value import ObjectValue as resources_ast_types_object_value_ObjectValue +from .primitive_value import PrimitiveValue as resources_ast_types_primitive_value_PrimitiveValue + +T_Result = typing.TypeVar("T_Result") +T_Result = typing.TypeVar("T_Result") + + +class _Factory: + def list_( + self, value: typing.List[resources_ast_types_field_value_FieldValue] + ) -> resources_ast_types_container_value_ContainerValue: + if IS_PYDANTIC_V2: + return ContainerValue(root=_ContainerValue.List(type="list", value=value)) # type: ignore + else: + return ContainerValue(__root__=_ContainerValue.List(type="list", value=value)) # type: ignore + + def optional( + self, value: typing.Optional[resources_ast_types_field_value_FieldValue] + ) -> resources_ast_types_container_value_ContainerValue: + if IS_PYDANTIC_V2: + return ContainerValue(root=_ContainerValue.Optional(type="optional", value=value)) # type: ignore + else: + return ContainerValue(__root__=_ContainerValue.Optional(type="optional", value=value)) # type: ignore + + +class ContainerValue(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") + ] + + def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[_ContainerValue.List, _ContainerValue.Optional], pydantic.Field(discriminator="type") + ] + + def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Optional]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + list_: typing.Callable[[typing.List["resources_ast_types_field_value_FieldValue"]], T_Result], + optional: typing.Callable[[typing.Optional["resources_ast_types_field_value_FieldValue"]], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "list": + return list_(unioned_value.value) + if unioned_value.type == "optional": + return optional(unioned_value.value) + + +class _ContainerValue: + class List(UniversalBaseModel): + type: typing.Literal["list"] = "list" + value: typing.List[resources_ast_types_field_value_FieldValue] + + class Optional(UniversalBaseModel): + type: typing.Literal["optional"] = "optional" + value: typing.Optional[resources_ast_types_field_value_FieldValue] = None + + +class _Factory: + def primitive_value( + self, value: resources_ast_types_primitive_value_PrimitiveValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore + else: + return FieldValue(__root__=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore + + def object_value( + self, value: resources_ast_types_object_value_ObjectValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore + else: + return FieldValue(__root__=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore + + def container_value( + self, value: resources_ast_types_container_value_ContainerValue + ) -> resources_ast_types_field_value_FieldValue: + if IS_PYDANTIC_V2: + return FieldValue(root=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore + else: + return FieldValue(__root__=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore + + +class FieldValue(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + primitive_value: typing.Callable[[resources_ast_types_primitive_value_PrimitiveValue], T_Result], + object_value: typing.Callable[[resources_ast_types_object_value_ObjectValue], T_Result], + container_value: typing.Callable[["resources_ast_types_container_value_ContainerValue"], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "primitive_value": + return primitive_value(unioned_value.value) + if unioned_value.type == "object_value": + return object_value( + resources_ast_types_object_value_ObjectValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "container_value": + return container_value(unioned_value.value) + + +from .field_value import FieldValue as resources_ast_types_field_value_FieldValue # noqa: E402, F401, I001 +from .container_value import ContainerValue as resources_ast_types_container_value_ContainerValue # noqa: E402, F401, I001 + + +class _FieldValue: + class PrimitiveValue(UniversalBaseModel): + type: typing.Literal["primitive_value"] = "primitive_value" + value: resources_ast_types_primitive_value_PrimitiveValue + + class ObjectValue(resources_ast_types_object_value_ObjectValue): + type: typing.Literal["object_value"] = "object_value" + + class ContainerValue(UniversalBaseModel): + type: typing.Literal["container_value"] = "container_value" + value: resources_ast_types_container_value_ContainerValue + + +update_forward_refs(_ContainerValue.List) +update_forward_refs(_ContainerValue.Optional) +update_forward_refs(_FieldValue.ContainerValue) diff --git a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/field_value.py b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/field_value.py index 16330a1bf96..88d4a5e9c2d 100644 --- a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/field_value.py +++ b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/field_value.py @@ -1,100 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs -from .object_value import ObjectValue as resources_ast_types_object_value_ObjectValue -from .primitive_value import PrimitiveValue as resources_ast_types_primitive_value_PrimitiveValue - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def primitive_value(self, value: resources_ast_types_primitive_value_PrimitiveValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore - else: - return FieldValue(__root__=_FieldValue.PrimitiveValue(type="primitive_value", value=value)) # type: ignore - - def object_value(self, value: resources_ast_types_object_value_ObjectValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore - else: - return FieldValue(__root__=_FieldValue.ObjectValue(**value.dict(exclude_unset=True), type="object_value")) # type: ignore - - def container_value(self, value: resources_ast_types_container_value_ContainerValue) -> FieldValue: - if IS_PYDANTIC_V2: - return FieldValue(root=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore - else: - return FieldValue(__root__=_FieldValue.ContainerValue(type="container_value", value=value)) # type: ignore - - -class FieldValue(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[_FieldValue.PrimitiveValue, _FieldValue.ObjectValue, _FieldValue.ContainerValue]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - primitive_value: typing.Callable[[resources_ast_types_primitive_value_PrimitiveValue], T_Result], - object_value: typing.Callable[[resources_ast_types_object_value_ObjectValue], T_Result], - container_value: typing.Callable[["resources_ast_types_container_value_ContainerValue"], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "primitive_value": - return primitive_value(unioned_value.value) - if unioned_value.type == "object_value": - return object_value( - resources_ast_types_object_value_ObjectValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "container_value": - return container_value(unioned_value.value) - - -from .container_value import ContainerValue as resources_ast_types_container_value_ContainerValue # noqa: E402, F401, I001 - - -class _FieldValue: - class PrimitiveValue(UniversalBaseModel): - type: typing.Literal["primitive_value"] = "primitive_value" - value: resources_ast_types_primitive_value_PrimitiveValue - - class ObjectValue(resources_ast_types_object_value_ObjectValue): - type: typing.Literal["object_value"] = "object_value" - - class ContainerValue(UniversalBaseModel): - type: typing.Literal["container_value"] = "container_value" - value: resources_ast_types_container_value_ContainerValue - - -update_forward_refs(_FieldValue.ContainerValue) -update_forward_refs(FieldValue) +__all__ = ["FieldValue"] diff --git a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/t.py b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/t.py index 064b54fccb4..7890c29fb10 100644 --- a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/t.py +++ b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/t.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import T as T -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class T(UniversalBaseModel): - child: "TorU" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .tor_u import TorU # noqa: E402, F401, I001 - -update_forward_refs(T) +__all__ = ["T"] diff --git a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/t_all.py b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/t_all.py new file mode 100644 index 00000000000..d3a84794dfc --- /dev/null +++ b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/t_all.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .t import T as resources_ast_types_t_T + from .u import U as resources_ast_types_u_U + + +class T(UniversalBaseModel): + child: "resources_ast_types_tor_u_TorU" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .tor_u import TorU as resources_ast_types_tor_u_TorU # noqa: E402, F401, I001 + +TorU = typing.Union["resources_ast_types_t_T", "resources_ast_types_u_U"] + + +class U(UniversalBaseModel): + child: "resources_ast_types_t_T" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .t import T as resources_ast_types_t_T # noqa: E402, F401, I001 diff --git a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/tor_u.py b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/tor_u.py index 5409b5f1551..fd9fb53be9a 100644 --- a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/tor_u.py +++ b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/tor_u.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import TorU as TorU -import typing - -if typing.TYPE_CHECKING: - from .t import T - from .u import U -TorU = typing.Union["T", "U"] +__all__ = ["TorU"] diff --git a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/u.py b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/u.py index 7cf8d4cd288..85016723b61 100644 --- a/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/u.py +++ b/seed/fastapi/circular-references/no-inheritance-for-extended-models/resources/ast/types/u.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import U as U -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class U(UniversalBaseModel): - child: "T" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .t import T # noqa: E402, F401, I001 - -update_forward_refs(U) +__all__ = ["U"] diff --git a/seed/fastapi/examples/resources/types/types/__init__.py b/seed/fastapi/examples/resources/types/types/__init__.py index e783854d5c6..9f434abe101 100644 --- a/seed/fastapi/examples/resources/types/types/__init__.py +++ b/seed/fastapi/examples/resources/types/types/__init__.py @@ -19,14 +19,13 @@ from .moment import Moment from .movie import Movie from .movie_id import MovieId -from .node import Node +from .node_all import Node, Tree from .refresh_token_request import RefreshTokenRequest from .request import Request from .response import Response from .response_type import ResponseType from .stunt_double import StuntDouble from .test import Test -from .tree import Tree __all__ = [ "Actor", diff --git a/seed/fastapi/examples/resources/types/types/node.py b/seed/fastapi/examples/resources/types/types/node.py index 0ffecfbaf8c..2e2b0d00578 100644 --- a/seed/fastapi/examples/resources/types/types/node.py +++ b/seed/fastapi/examples/resources/types/types/node.py @@ -1,56 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .node_all import Node as Node -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Node(UniversalBaseModel): - """ - Examples - -------- - from seed.examples.resources.types import Node, Tree - - Node( - name="root", - nodes=[ - Node( - name="left", - ), - Node( - name="right", - ), - ], - trees=[ - Tree( - nodes=[ - Node( - name="left", - ), - Node( - name="right", - ), - ], - ) - ], - ) - """ - - name: str - nodes: typing.Optional[typing.List["Node"]] = None - trees: typing.Optional[typing.List["Tree"]] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .tree import Tree # noqa: E402, F401, I001 - -update_forward_refs(Node) +__all__ = ["Node"] diff --git a/seed/fastapi/examples/resources/types/types/node_all.py b/seed/fastapi/examples/resources/types/types/node_all.py new file mode 100644 index 00000000000..981e6f97b38 --- /dev/null +++ b/seed/fastapi/examples/resources/types/types/node_all.py @@ -0,0 +1,85 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class Node(UniversalBaseModel): + """ + Examples + -------- + from seed.examples.resources.types import Node, Tree + + Node( + name="root", + nodes=[ + Node( + name="left", + ), + Node( + name="right", + ), + ], + trees=[ + Tree( + nodes=[ + Node( + name="left", + ), + Node( + name="right", + ), + ], + ) + ], + ) + """ + + name: str + nodes: typing.Optional[typing.List["resources_types_types_node_Node"]] = None + trees: typing.Optional[typing.List["resources_types_types_tree_Tree"]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .tree import Tree as resources_types_types_tree_Tree # noqa: E402, F401, I001 + + +class Tree(UniversalBaseModel): + """ + Examples + -------- + from seed.examples.resources.types import Node, Tree + + Tree( + nodes=[ + Node( + name="left", + ), + Node( + name="right", + ), + ], + ) + """ + + nodes: typing.Optional[typing.List["resources_types_types_node_Node"]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .node import Node as resources_types_types_node_Node # noqa: E402, F401, I001 diff --git a/seed/fastapi/examples/resources/types/types/tree.py b/seed/fastapi/examples/resources/types/types/tree.py index cef45e765c2..70bb4517fd9 100644 --- a/seed/fastapi/examples/resources/types/types/tree.py +++ b/seed/fastapi/examples/resources/types/types/tree.py @@ -1,41 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .node_all import Tree as Tree -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Tree(UniversalBaseModel): - """ - Examples - -------- - from seed.examples.resources.types import Node, Tree - - Tree( - nodes=[ - Node( - name="left", - ), - Node( - name="right", - ), - ], - ) - """ - - nodes: typing.Optional[typing.List["Node"]] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .node import Node # noqa: E402, F401, I001 - -update_forward_refs(Tree) +__all__ = ["Tree"] diff --git a/seed/fastapi/pagination/no-custom-config/resources/complex/types/__init__.py b/seed/fastapi/pagination/no-custom-config/resources/complex/types/__init__.py index 01132dec47a..29899b90550 100644 --- a/seed/fastapi/pagination/no-custom-config/resources/complex/types/__init__.py +++ b/seed/fastapi/pagination/no-custom-config/resources/complex/types/__init__.py @@ -4,9 +4,8 @@ from .conversation import Conversation from .cursor_pages import CursorPages -from .multiple_filter_search_request import MultipleFilterSearchRequest +from .multiple_filter_search_request_all import MultipleFilterSearchRequest, MultipleFilterSearchRequestValue from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator -from .multiple_filter_search_request_value import MultipleFilterSearchRequestValue from .paginated_conversation_response import PaginatedConversationResponse from .search_request import SearchRequest from .search_request_query import SearchRequestQuery diff --git a/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request.py b/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request.py index 1f224263e7e..9b434b22531 100644 --- a/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request.py +++ b/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request.py @@ -1,26 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .multiple_filter_search_request_all import MultipleFilterSearchRequest as MultipleFilterSearchRequest -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator - - -class MultipleFilterSearchRequest(UniversalBaseModel): - operator: typing.Optional[MultipleFilterSearchRequestOperator] = None - value: typing.Optional["MultipleFilterSearchRequestValue"] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .multiple_filter_search_request_value import MultipleFilterSearchRequestValue # noqa: E402, F401, I001 - -update_forward_refs(MultipleFilterSearchRequest) +__all__ = ["MultipleFilterSearchRequest"] diff --git a/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request_all.py b/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request_all.py new file mode 100644 index 00000000000..e841932826e --- /dev/null +++ b/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request_all.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator +from .single_filter_search_request import SingleFilterSearchRequest + +if typing.TYPE_CHECKING: + from .multiple_filter_search_request import ( + MultipleFilterSearchRequest as resources_complex_types_multiple_filter_search_request_MultipleFilterSearchRequest, + ) + + +class MultipleFilterSearchRequest(UniversalBaseModel): + operator: typing.Optional[MultipleFilterSearchRequestOperator] = None + value: typing.Optional[ + "resources_complex_types_multiple_filter_search_request_value_MultipleFilterSearchRequestValue" + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .multiple_filter_search_request_value import ( + MultipleFilterSearchRequestValue as resources_complex_types_multiple_filter_search_request_value_MultipleFilterSearchRequestValue, +) # noqa: E402, F401, I001 + +MultipleFilterSearchRequestValue = typing.Union[ + typing.List["resources_complex_types_multiple_filter_search_request_MultipleFilterSearchRequest"], + typing.List[SingleFilterSearchRequest], +] diff --git a/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request_value.py b/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request_value.py index 16a7c594785..88ccc5a0991 100644 --- a/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request_value.py +++ b/seed/fastapi/pagination/no-custom-config/resources/complex/types/multiple_filter_search_request_value.py @@ -1,13 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .multiple_filter_search_request_all import MultipleFilterSearchRequestValue as MultipleFilterSearchRequestValue -import typing - -from .single_filter_search_request import SingleFilterSearchRequest - -if typing.TYPE_CHECKING: - from .multiple_filter_search_request import MultipleFilterSearchRequest -MultipleFilterSearchRequestValue = typing.Union[ - typing.List["MultipleFilterSearchRequest"], typing.List[SingleFilterSearchRequest] -] +__all__ = ["MultipleFilterSearchRequestValue"] diff --git a/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/__init__.py b/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/__init__.py index 01132dec47a..29899b90550 100644 --- a/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/__init__.py +++ b/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/__init__.py @@ -4,9 +4,8 @@ from .conversation import Conversation from .cursor_pages import CursorPages -from .multiple_filter_search_request import MultipleFilterSearchRequest +from .multiple_filter_search_request_all import MultipleFilterSearchRequest, MultipleFilterSearchRequestValue from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator -from .multiple_filter_search_request_value import MultipleFilterSearchRequestValue from .paginated_conversation_response import PaginatedConversationResponse from .search_request import SearchRequest from .search_request_query import SearchRequestQuery diff --git a/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request.py b/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request.py index 1f224263e7e..9b434b22531 100644 --- a/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request.py +++ b/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request.py @@ -1,26 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .multiple_filter_search_request_all import MultipleFilterSearchRequest as MultipleFilterSearchRequest -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator - - -class MultipleFilterSearchRequest(UniversalBaseModel): - operator: typing.Optional[MultipleFilterSearchRequestOperator] = None - value: typing.Optional["MultipleFilterSearchRequestValue"] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .multiple_filter_search_request_value import MultipleFilterSearchRequestValue # noqa: E402, F401, I001 - -update_forward_refs(MultipleFilterSearchRequest) +__all__ = ["MultipleFilterSearchRequest"] diff --git a/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request_all.py b/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request_all.py new file mode 100644 index 00000000000..e841932826e --- /dev/null +++ b/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request_all.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator +from .single_filter_search_request import SingleFilterSearchRequest + +if typing.TYPE_CHECKING: + from .multiple_filter_search_request import ( + MultipleFilterSearchRequest as resources_complex_types_multiple_filter_search_request_MultipleFilterSearchRequest, + ) + + +class MultipleFilterSearchRequest(UniversalBaseModel): + operator: typing.Optional[MultipleFilterSearchRequestOperator] = None + value: typing.Optional[ + "resources_complex_types_multiple_filter_search_request_value_MultipleFilterSearchRequestValue" + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .multiple_filter_search_request_value import ( + MultipleFilterSearchRequestValue as resources_complex_types_multiple_filter_search_request_value_MultipleFilterSearchRequestValue, +) # noqa: E402, F401, I001 + +MultipleFilterSearchRequestValue = typing.Union[ + typing.List["resources_complex_types_multiple_filter_search_request_MultipleFilterSearchRequest"], + typing.List[SingleFilterSearchRequest], +] diff --git a/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request_value.py b/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request_value.py index 16a7c594785..88ccc5a0991 100644 --- a/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request_value.py +++ b/seed/fastapi/pagination/no-inheritance-for-extended-models/resources/complex/types/multiple_filter_search_request_value.py @@ -1,13 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .multiple_filter_search_request_all import MultipleFilterSearchRequestValue as MultipleFilterSearchRequestValue -import typing - -from .single_filter_search_request import SingleFilterSearchRequest - -if typing.TYPE_CHECKING: - from .multiple_filter_search_request import MultipleFilterSearchRequest -MultipleFilterSearchRequestValue = typing.Union[ - typing.List["MultipleFilterSearchRequest"], typing.List[SingleFilterSearchRequest] -] +__all__ = ["MultipleFilterSearchRequestValue"] diff --git a/seed/fastapi/simple-fhir/no-custom-config/types/__init__.py b/seed/fastapi/simple-fhir/no-custom-config/types/__init__.py index b958e07559c..ba6a1ca8220 100644 --- a/seed/fastapi/simple-fhir/no-custom-config/types/__init__.py +++ b/seed/fastapi/simple-fhir/no-custom-config/types/__init__.py @@ -2,12 +2,6 @@ # isort: skip_file -from .account import Account -from .base_resource import BaseResource -from .memo import Memo -from .patient import Patient -from .practitioner import Practitioner -from .resource_list import ResourceList -from .script import Script +from .account_all import Account, BaseResource, Memo, Patient, Practitioner, ResourceList, Script __all__ = ["Account", "BaseResource", "Memo", "Patient", "Practitioner", "ResourceList", "Script"] diff --git a/seed/fastapi/simple-fhir/no-custom-config/types/account.py b/seed/fastapi/simple-fhir/no-custom-config/types/account.py index a59d4e4efa8..c8df55e2e86 100644 --- a/seed/fastapi/simple-fhir/no-custom-config/types/account.py +++ b/seed/fastapi/simple-fhir/no-custom-config/types/account.py @@ -1,29 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Account as Account -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from .base_resource import BaseResource - - -class Account(BaseResource): - resource_type: typing.Literal["Account"] = "Account" - name: str - patient: typing.Optional["Patient"] = None - practitioner: typing.Optional["Practitioner"] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .patient import Patient # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 - -update_forward_refs(Account) +__all__ = ["Account"] diff --git a/seed/fastapi/simple-fhir/no-custom-config/types/account_all.py b/seed/fastapi/simple-fhir/no-custom-config/types/account_all.py new file mode 100644 index 00000000000..230723f2fd1 --- /dev/null +++ b/seed/fastapi/simple-fhir/no-custom-config/types/account_all.py @@ -0,0 +1,110 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .base_resource import BaseResource as types_base_resource_BaseResource + +if typing.TYPE_CHECKING: + from .account import Account as types_account_Account + from .patient import Patient as types_patient_Patient + from .practitioner import Practitioner as types_practitioner_Practitioner + from .script import Script as types_script_Script + + +class Account(types_base_resource_BaseResource): + resource_type: typing.Literal["Account"] = "Account" + name: str + patient: typing.Optional["types_patient_Patient"] = None + practitioner: typing.Optional["types_practitioner_Practitioner"] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .patient import Patient as types_patient_Patient # noqa: E402, F401, I001 +from .practitioner import Practitioner as types_practitioner_Practitioner # noqa: E402, F401, I001 + + +class BaseResource(UniversalBaseModel): + id: str + related_resources: typing.List["types_resource_list_ResourceList"] + memo: "types_memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .resource_list import ResourceList as types_resource_list_ResourceList # noqa: E402, F401, I001 +from .memo import Memo as types_memo_Memo # noqa: E402, F401, I001 + + +class Memo(UniversalBaseModel): + description: str + account: typing.Optional["types_account_Account"] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .account import Account as types_account_Account # noqa: E402, F401, I001 + + +class Patient(types_base_resource_BaseResource): + resource_type: typing.Literal["Patient"] = "Patient" + name: str + scripts: typing.List["types_script_Script"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .script import Script as types_script_Script # noqa: E402, F401, I001 + + +class Practitioner(types_base_resource_BaseResource): + resource_type: typing.Literal["Practitioner"] = "Practitioner" + name: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +ResourceList = typing.Union[ + "types_account_Account", "types_patient_Patient", "types_practitioner_Practitioner", "types_script_Script" +] + + +class Script(types_base_resource_BaseResource): + resource_type: typing.Literal["Script"] = "Script" + name: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid diff --git a/seed/fastapi/simple-fhir/no-custom-config/types/base_resource.py b/seed/fastapi/simple-fhir/no-custom-config/types/base_resource.py index 88888b0f3b0..5da3c7b44de 100644 --- a/seed/fastapi/simple-fhir/no-custom-config/types/base_resource.py +++ b/seed/fastapi/simple-fhir/no-custom-config/types/base_resource.py @@ -1,27 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import BaseResource as BaseResource -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class BaseResource(UniversalBaseModel): - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .resource_list import ResourceList # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 - -update_forward_refs(BaseResource) +__all__ = ["BaseResource"] diff --git a/seed/fastapi/simple-fhir/no-custom-config/types/memo.py b/seed/fastapi/simple-fhir/no-custom-config/types/memo.py index 6eb4180e9a3..98072e88536 100644 --- a/seed/fastapi/simple-fhir/no-custom-config/types/memo.py +++ b/seed/fastapi/simple-fhir/no-custom-config/types/memo.py @@ -1,25 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Memo as Memo -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Memo(UniversalBaseModel): - description: str - account: typing.Optional["Account"] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .account import Account # noqa: E402, F401, I001 - -update_forward_refs(Memo) +__all__ = ["Memo"] diff --git a/seed/fastapi/simple-fhir/no-custom-config/types/patient.py b/seed/fastapi/simple-fhir/no-custom-config/types/patient.py index fe90aa208c7..4585fa44111 100644 --- a/seed/fastapi/simple-fhir/no-custom-config/types/patient.py +++ b/seed/fastapi/simple-fhir/no-custom-config/types/patient.py @@ -1,27 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Patient as Patient -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs -from .base_resource import BaseResource - - -class Patient(BaseResource): - resource_type: typing.Literal["Patient"] = "Patient" - name: str - scripts: typing.List["Script"] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .script import Script # noqa: E402, F401, I001 - -update_forward_refs(Patient) +__all__ = ["Patient"] diff --git a/seed/fastapi/simple-fhir/no-custom-config/types/practitioner.py b/seed/fastapi/simple-fhir/no-custom-config/types/practitioner.py index 1322ead10c3..7c6f6187af5 100644 --- a/seed/fastapi/simple-fhir/no-custom-config/types/practitioner.py +++ b/seed/fastapi/simple-fhir/no-custom-config/types/practitioner.py @@ -1,19 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import typing +from .account_all import Practitioner as Practitioner -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from .base_resource import BaseResource - - -class Practitioner(BaseResource): - resource_type: typing.Literal["Practitioner"] = "Practitioner" - name: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid +__all__ = ["Practitioner"] diff --git a/seed/fastapi/simple-fhir/no-custom-config/types/resource_list.py b/seed/fastapi/simple-fhir/no-custom-config/types/resource_list.py index fb879a7c9d7..d247c3c8672 100644 --- a/seed/fastapi/simple-fhir/no-custom-config/types/resource_list.py +++ b/seed/fastapi/simple-fhir/no-custom-config/types/resource_list.py @@ -1,12 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import ResourceList as ResourceList -import typing - -if typing.TYPE_CHECKING: - from .account import Account - from .patient import Patient - from .practitioner import Practitioner - from .script import Script -ResourceList = typing.Union["Account", "Patient", "Practitioner", "Script"] +__all__ = ["ResourceList"] diff --git a/seed/fastapi/simple-fhir/no-custom-config/types/script.py b/seed/fastapi/simple-fhir/no-custom-config/types/script.py index 4a50568abb3..682ca1a5f1a 100644 --- a/seed/fastapi/simple-fhir/no-custom-config/types/script.py +++ b/seed/fastapi/simple-fhir/no-custom-config/types/script.py @@ -1,19 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import typing +from .account_all import Script as Script -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from .base_resource import BaseResource - - -class Script(BaseResource): - resource_type: typing.Literal["Script"] = "Script" - name: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid +__all__ = ["Script"] diff --git a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/__init__.py b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/__init__.py index b958e07559c..ba6a1ca8220 100644 --- a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/__init__.py +++ b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/__init__.py @@ -2,12 +2,6 @@ # isort: skip_file -from .account import Account -from .base_resource import BaseResource -from .memo import Memo -from .patient import Patient -from .practitioner import Practitioner -from .resource_list import ResourceList -from .script import Script +from .account_all import Account, BaseResource, Memo, Patient, Practitioner, ResourceList, Script __all__ = ["Account", "BaseResource", "Memo", "Patient", "Practitioner", "ResourceList", "Script"] diff --git a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/account.py b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/account.py index fe6532432ce..c8df55e2e86 100644 --- a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/account.py +++ b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/account.py @@ -1,33 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Account as Account -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Account(UniversalBaseModel): - resource_type: typing.Literal["Account"] = "Account" - name: str - patient: typing.Optional["Patient"] = None - practitioner: typing.Optional["Practitioner"] = None - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .patient import Patient # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 -from .resource_list import ResourceList # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 - -update_forward_refs(Account) +__all__ = ["Account"] diff --git a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/account_all.py b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/account_all.py new file mode 100644 index 00000000000..caf0a852dd5 --- /dev/null +++ b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/account_all.py @@ -0,0 +1,121 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .account import Account as types_account_Account + from .patient import Patient as types_patient_Patient + from .practitioner import Practitioner as types_practitioner_Practitioner + from .script import Script as types_script_Script + + +class Account(UniversalBaseModel): + resource_type: typing.Literal["Account"] = "Account" + name: str + patient: typing.Optional["types_patient_Patient"] = None + practitioner: typing.Optional["types_practitioner_Practitioner"] = None + id: str + related_resources: typing.List["types_resource_list_ResourceList"] + memo: "types_memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .patient import Patient as types_patient_Patient # noqa: E402, F401, I001 +from .practitioner import Practitioner as types_practitioner_Practitioner # noqa: E402, F401, I001 + + +class BaseResource(UniversalBaseModel): + id: str + related_resources: typing.List["types_resource_list_ResourceList"] + memo: "types_memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class Memo(UniversalBaseModel): + description: str + account: typing.Optional["types_account_Account"] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .account import Account as types_account_Account # noqa: E402, F401, I001 + + +class Patient(UniversalBaseModel): + resource_type: typing.Literal["Patient"] = "Patient" + name: str + scripts: typing.List["types_script_Script"] + id: str + related_resources: typing.List["types_resource_list_ResourceList"] + memo: "types_memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .script import Script as types_script_Script # noqa: E402, F401, I001 + + +class Practitioner(UniversalBaseModel): + resource_type: typing.Literal["Practitioner"] = "Practitioner" + name: str + id: str + related_resources: typing.List["types_resource_list_ResourceList"] + memo: "types_memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +ResourceList = typing.Union[ + "types_account_Account", "types_patient_Patient", "types_practitioner_Practitioner", "types_script_Script" +] + + +class Script(UniversalBaseModel): + resource_type: typing.Literal["Script"] = "Script" + name: str + id: str + related_resources: typing.List["types_resource_list_ResourceList"] + memo: "types_memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +from .resource_list import ResourceList as types_resource_list_ResourceList # noqa: E402, F401, I001 +from .memo import Memo as types_memo_Memo # noqa: E402, F401, I001 diff --git a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/base_resource.py b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/base_resource.py index 88888b0f3b0..5da3c7b44de 100644 --- a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/base_resource.py +++ b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/base_resource.py @@ -1,27 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import BaseResource as BaseResource -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class BaseResource(UniversalBaseModel): - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .resource_list import ResourceList # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 - -update_forward_refs(BaseResource) +__all__ = ["BaseResource"] diff --git a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/memo.py b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/memo.py index 6eb4180e9a3..98072e88536 100644 --- a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/memo.py +++ b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/memo.py @@ -1,25 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Memo as Memo -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Memo(UniversalBaseModel): - description: str - account: typing.Optional["Account"] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .account import Account # noqa: E402, F401, I001 - -update_forward_refs(Memo) +__all__ = ["Memo"] diff --git a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/patient.py b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/patient.py index 1428888f390..4585fa44111 100644 --- a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/patient.py +++ b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/patient.py @@ -1,31 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Patient as Patient -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Patient(UniversalBaseModel): - resource_type: typing.Literal["Patient"] = "Patient" - name: str - scripts: typing.List["Script"] - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .script import Script # noqa: E402, F401, I001 -from .resource_list import ResourceList # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 - -update_forward_refs(Patient) +__all__ = ["Patient"] diff --git a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/practitioner.py b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/practitioner.py index ebd24b07677..7c6f6187af5 100644 --- a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/practitioner.py +++ b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/practitioner.py @@ -1,29 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Practitioner as Practitioner -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Practitioner(UniversalBaseModel): - resource_type: typing.Literal["Practitioner"] = "Practitioner" - name: str - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .resource_list import ResourceList # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 - -update_forward_refs(Practitioner) +__all__ = ["Practitioner"] diff --git a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/resource_list.py b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/resource_list.py index fb879a7c9d7..d247c3c8672 100644 --- a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/resource_list.py +++ b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/resource_list.py @@ -1,12 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import ResourceList as ResourceList -import typing - -if typing.TYPE_CHECKING: - from .account import Account - from .patient import Patient - from .practitioner import Practitioner - from .script import Script -ResourceList = typing.Union["Account", "Patient", "Practitioner", "Script"] +__all__ = ["ResourceList"] diff --git a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/script.py b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/script.py index ed4f960977d..682ca1a5f1a 100644 --- a/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/script.py +++ b/seed/fastapi/simple-fhir/no-inheritance-for-extended-models/types/script.py @@ -1,29 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Script as Script -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Script(UniversalBaseModel): - resource_type: typing.Literal["Script"] = "Script" - name: str - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .resource_list import ResourceList # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 - -update_forward_refs(Script) +__all__ = ["Script"] diff --git a/seed/fastapi/trace/resources/commons/types/__init__.py b/seed/fastapi/trace/resources/commons/types/__init__.py index 0a258b015c9..738c5bce3a1 100644 --- a/seed/fastapi/trace/resources/commons/types/__init__.py +++ b/seed/fastapi/trace/resources/commons/types/__init__.py @@ -5,19 +5,15 @@ from .binary_tree_node_and_tree_value import BinaryTreeNodeAndTreeValue from .binary_tree_node_value import BinaryTreeNodeValue from .binary_tree_value import BinaryTreeValue -from .debug_key_value_pairs import DebugKeyValuePairs -from .debug_map_value import DebugMapValue -from .debug_variable_value import DebugVariableValue +from .debug_key_value_pairs_all import DebugKeyValuePairs, DebugMapValue, DebugVariableValue from .doubly_linked_list_node_and_list_value import DoublyLinkedListNodeAndListValue from .doubly_linked_list_node_value import DoublyLinkedListNodeValue from .doubly_linked_list_value import DoublyLinkedListValue from .file_info import FileInfo from .generic_value import GenericValue -from .key_value_pair import KeyValuePair +from .key_value_pair_all import KeyValuePair, MapValue, VariableValue from .language import Language -from .list_type import ListType -from .map_type import MapType -from .map_value import MapValue +from .list_type_all import ListType, MapType, VariableType from .node_id import NodeId from .problem_id import ProblemId from .singly_linked_list_node_and_list_value import SinglyLinkedListNodeAndListValue @@ -26,8 +22,6 @@ from .test_case import TestCase from .test_case_with_expected_result import TestCaseWithExpectedResult from .user_id import UserId -from .variable_type import VariableType -from .variable_value import VariableValue __all__ = [ "BinaryTreeNodeAndTreeValue", diff --git a/seed/fastapi/trace/resources/commons/types/debug_key_value_pairs.py b/seed/fastapi/trace/resources/commons/types/debug_key_value_pairs.py index 8806331b6c6..02c2427d2c0 100644 --- a/seed/fastapi/trace/resources/commons/types/debug_key_value_pairs.py +++ b/seed/fastapi/trace/resources/commons/types/debug_key_value_pairs.py @@ -1,25 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .debug_key_value_pairs_all import DebugKeyValuePairs as DebugKeyValuePairs -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class DebugKeyValuePairs(UniversalBaseModel): - key: "DebugVariableValue" - value: "DebugVariableValue" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .debug_variable_value import DebugVariableValue # noqa: E402, F401, I001 - -update_forward_refs(DebugKeyValuePairs) +__all__ = ["DebugKeyValuePairs"] diff --git a/seed/fastapi/trace/resources/commons/types/debug_key_value_pairs_all.py b/seed/fastapi/trace/resources/commons/types/debug_key_value_pairs_all.py new file mode 100644 index 00000000000..526691faa92 --- /dev/null +++ b/seed/fastapi/trace/resources/commons/types/debug_key_value_pairs_all.py @@ -0,0 +1,369 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs +from .binary_tree_node_and_tree_value import BinaryTreeNodeAndTreeValue +from .doubly_linked_list_node_and_list_value import DoublyLinkedListNodeAndListValue +from .generic_value import GenericValue as resources_commons_types_generic_value_GenericValue +from .singly_linked_list_node_and_list_value import SinglyLinkedListNodeAndListValue + +T_Result = typing.TypeVar("T_Result") + + +class DebugKeyValuePairs(UniversalBaseModel): + key: "resources_commons_types_debug_variable_value_DebugVariableValue" + value: "resources_commons_types_debug_variable_value_DebugVariableValue" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class DebugMapValue(UniversalBaseModel): + key_value_pairs: typing.List["resources_commons_types_debug_key_value_pairs_DebugKeyValuePairs"] = pydantic.Field( + alias="keyValuePairs" + ) + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def integer_value(self, value: int) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue(root=_DebugVariableValue.IntegerValue(type="integerValue", value=value)) # type: ignore + else: + return DebugVariableValue(__root__=_DebugVariableValue.IntegerValue(type="integerValue", value=value)) # type: ignore + + def boolean_value(self, value: bool) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue(root=_DebugVariableValue.BooleanValue(type="booleanValue", value=value)) # type: ignore + else: + return DebugVariableValue(__root__=_DebugVariableValue.BooleanValue(type="booleanValue", value=value)) # type: ignore + + def double_value(self, value: float) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue(root=_DebugVariableValue.DoubleValue(type="doubleValue", value=value)) # type: ignore + else: + return DebugVariableValue(__root__=_DebugVariableValue.DoubleValue(type="doubleValue", value=value)) # type: ignore + + def string_value(self, value: str) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue(root=_DebugVariableValue.StringValue(type="stringValue", value=value)) # type: ignore + else: + return DebugVariableValue(__root__=_DebugVariableValue.StringValue(type="stringValue", value=value)) # type: ignore + + def char_value(self, value: str) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue(root=_DebugVariableValue.CharValue(type="charValue", value=value)) # type: ignore + else: + return DebugVariableValue(__root__=_DebugVariableValue.CharValue(type="charValue", value=value)) # type: ignore + + def map_value( + self, value: resources_commons_types_debug_map_value_DebugMapValue + ) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue( + root=_DebugVariableValue.MapValue(**value.dict(exclude_unset=True), type="mapValue") + ) # type: ignore + else: + return DebugVariableValue( + __root__=_DebugVariableValue.MapValue(**value.dict(exclude_unset=True), type="mapValue") + ) # type: ignore + + def list_value( + self, value: typing.List[resources_commons_types_debug_variable_value_DebugVariableValue] + ) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue(root=_DebugVariableValue.ListValue(type="listValue", value=value)) # type: ignore + else: + return DebugVariableValue(__root__=_DebugVariableValue.ListValue(type="listValue", value=value)) # type: ignore + + def binary_tree_node_value( + self, value: BinaryTreeNodeAndTreeValue + ) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue( + root=_DebugVariableValue.BinaryTreeNodeValue( + **value.dict(exclude_unset=True), type="binaryTreeNodeValue" + ) + ) # type: ignore + else: + return DebugVariableValue( + __root__=_DebugVariableValue.BinaryTreeNodeValue( + **value.dict(exclude_unset=True), type="binaryTreeNodeValue" + ) + ) # type: ignore + + def singly_linked_list_node_value( + self, value: SinglyLinkedListNodeAndListValue + ) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue( + root=_DebugVariableValue.SinglyLinkedListNodeValue( + **value.dict(exclude_unset=True), type="singlyLinkedListNodeValue" + ) + ) # type: ignore + else: + return DebugVariableValue( + __root__=_DebugVariableValue.SinglyLinkedListNodeValue( + **value.dict(exclude_unset=True), type="singlyLinkedListNodeValue" + ) + ) # type: ignore + + def doubly_linked_list_node_value( + self, value: DoublyLinkedListNodeAndListValue + ) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue( + root=_DebugVariableValue.DoublyLinkedListNodeValue( + **value.dict(exclude_unset=True), type="doublyLinkedListNodeValue" + ) + ) # type: ignore + else: + return DebugVariableValue( + __root__=_DebugVariableValue.DoublyLinkedListNodeValue( + **value.dict(exclude_unset=True), type="doublyLinkedListNodeValue" + ) + ) # type: ignore + + def undefined_value(self) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue(root=_DebugVariableValue.UndefinedValue(type="undefinedValue")) # type: ignore + else: + return DebugVariableValue(__root__=_DebugVariableValue.UndefinedValue(type="undefinedValue")) # type: ignore + + def null_value(self) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue(root=_DebugVariableValue.NullValue(type="nullValue")) # type: ignore + else: + return DebugVariableValue(__root__=_DebugVariableValue.NullValue(type="nullValue")) # type: ignore + + def generic_value( + self, value: resources_commons_types_generic_value_GenericValue + ) -> resources_commons_types_debug_variable_value_DebugVariableValue: + if IS_PYDANTIC_V2: + return DebugVariableValue( + root=_DebugVariableValue.GenericValue(**value.dict(exclude_unset=True), type="genericValue") + ) # type: ignore + else: + return DebugVariableValue( + __root__=_DebugVariableValue.GenericValue(**value.dict(exclude_unset=True), type="genericValue") + ) # type: ignore + + +class DebugVariableValue(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _DebugVariableValue.IntegerValue, + _DebugVariableValue.BooleanValue, + _DebugVariableValue.DoubleValue, + _DebugVariableValue.StringValue, + _DebugVariableValue.CharValue, + _DebugVariableValue.MapValue, + _DebugVariableValue.ListValue, + _DebugVariableValue.BinaryTreeNodeValue, + _DebugVariableValue.SinglyLinkedListNodeValue, + _DebugVariableValue.DoublyLinkedListNodeValue, + _DebugVariableValue.UndefinedValue, + _DebugVariableValue.NullValue, + _DebugVariableValue.GenericValue, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _DebugVariableValue.IntegerValue, + _DebugVariableValue.BooleanValue, + _DebugVariableValue.DoubleValue, + _DebugVariableValue.StringValue, + _DebugVariableValue.CharValue, + _DebugVariableValue.MapValue, + _DebugVariableValue.ListValue, + _DebugVariableValue.BinaryTreeNodeValue, + _DebugVariableValue.SinglyLinkedListNodeValue, + _DebugVariableValue.DoublyLinkedListNodeValue, + _DebugVariableValue.UndefinedValue, + _DebugVariableValue.NullValue, + _DebugVariableValue.GenericValue, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _DebugVariableValue.IntegerValue, + _DebugVariableValue.BooleanValue, + _DebugVariableValue.DoubleValue, + _DebugVariableValue.StringValue, + _DebugVariableValue.CharValue, + _DebugVariableValue.MapValue, + _DebugVariableValue.ListValue, + _DebugVariableValue.BinaryTreeNodeValue, + _DebugVariableValue.SinglyLinkedListNodeValue, + _DebugVariableValue.DoublyLinkedListNodeValue, + _DebugVariableValue.UndefinedValue, + _DebugVariableValue.NullValue, + _DebugVariableValue.GenericValue, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _DebugVariableValue.IntegerValue, + _DebugVariableValue.BooleanValue, + _DebugVariableValue.DoubleValue, + _DebugVariableValue.StringValue, + _DebugVariableValue.CharValue, + _DebugVariableValue.MapValue, + _DebugVariableValue.ListValue, + _DebugVariableValue.BinaryTreeNodeValue, + _DebugVariableValue.SinglyLinkedListNodeValue, + _DebugVariableValue.DoublyLinkedListNodeValue, + _DebugVariableValue.UndefinedValue, + _DebugVariableValue.NullValue, + _DebugVariableValue.GenericValue, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + integer_value: typing.Callable[[int], T_Result], + boolean_value: typing.Callable[[bool], T_Result], + double_value: typing.Callable[[float], T_Result], + string_value: typing.Callable[[str], T_Result], + char_value: typing.Callable[[str], T_Result], + map_value: typing.Callable[["resources_commons_types_debug_map_value_DebugMapValue"], T_Result], + list_value: typing.Callable[ + [typing.List["resources_commons_types_debug_variable_value_DebugVariableValue"]], T_Result + ], + binary_tree_node_value: typing.Callable[[BinaryTreeNodeAndTreeValue], T_Result], + singly_linked_list_node_value: typing.Callable[[SinglyLinkedListNodeAndListValue], T_Result], + doubly_linked_list_node_value: typing.Callable[[DoublyLinkedListNodeAndListValue], T_Result], + undefined_value: typing.Callable[[], T_Result], + null_value: typing.Callable[[], T_Result], + generic_value: typing.Callable[[resources_commons_types_generic_value_GenericValue], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "integerValue": + return integer_value(unioned_value.value) + if unioned_value.type == "booleanValue": + return boolean_value(unioned_value.value) + if unioned_value.type == "doubleValue": + return double_value(unioned_value.value) + if unioned_value.type == "stringValue": + return string_value(unioned_value.value) + if unioned_value.type == "charValue": + return char_value(unioned_value.value) + if unioned_value.type == "mapValue": + return map_value( + resources_commons_types_debug_map_value_DebugMapValue( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "listValue": + return list_value(unioned_value.value) + if unioned_value.type == "binaryTreeNodeValue": + return binary_tree_node_value( + BinaryTreeNodeAndTreeValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "singlyLinkedListNodeValue": + return singly_linked_list_node_value( + SinglyLinkedListNodeAndListValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "doublyLinkedListNodeValue": + return doubly_linked_list_node_value( + DoublyLinkedListNodeAndListValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "undefinedValue": + return undefined_value() + if unioned_value.type == "nullValue": + return null_value() + if unioned_value.type == "genericValue": + return generic_value( + resources_commons_types_generic_value_GenericValue( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + + +from .debug_variable_value import DebugVariableValue as resources_commons_types_debug_variable_value_DebugVariableValue # noqa: E402, F401, I001 +from .debug_key_value_pairs import ( + DebugKeyValuePairs as resources_commons_types_debug_key_value_pairs_DebugKeyValuePairs, +) # noqa: E402, F401, I001 +from .debug_map_value import DebugMapValue as resources_commons_types_debug_map_value_DebugMapValue # noqa: E402, F401, I001 + + +class _DebugVariableValue: + class IntegerValue(UniversalBaseModel): + type: typing.Literal["integerValue"] = "integerValue" + value: int + + class BooleanValue(UniversalBaseModel): + type: typing.Literal["booleanValue"] = "booleanValue" + value: bool + + class DoubleValue(UniversalBaseModel): + type: typing.Literal["doubleValue"] = "doubleValue" + value: float + + class StringValue(UniversalBaseModel): + type: typing.Literal["stringValue"] = "stringValue" + value: str + + class CharValue(UniversalBaseModel): + type: typing.Literal["charValue"] = "charValue" + value: str + + class MapValue(resources_commons_types_debug_map_value_DebugMapValue): + type: typing.Literal["mapValue"] = "mapValue" + + class ListValue(UniversalBaseModel): + type: typing.Literal["listValue"] = "listValue" + value: typing.List[resources_commons_types_debug_variable_value_DebugVariableValue] + + class BinaryTreeNodeValue(BinaryTreeNodeAndTreeValue): + type: typing.Literal["binaryTreeNodeValue"] = "binaryTreeNodeValue" + + class SinglyLinkedListNodeValue(SinglyLinkedListNodeAndListValue): + type: typing.Literal["singlyLinkedListNodeValue"] = "singlyLinkedListNodeValue" + + class DoublyLinkedListNodeValue(DoublyLinkedListNodeAndListValue): + type: typing.Literal["doublyLinkedListNodeValue"] = "doublyLinkedListNodeValue" + + class UndefinedValue(UniversalBaseModel): + type: typing.Literal["undefinedValue"] = "undefinedValue" + + class NullValue(UniversalBaseModel): + type: typing.Literal["nullValue"] = "nullValue" + + class GenericValue(resources_commons_types_generic_value_GenericValue): + type: typing.Literal["genericValue"] = "genericValue" + + +update_forward_refs(_DebugVariableValue.MapValue) +update_forward_refs(_DebugVariableValue.ListValue) diff --git a/seed/fastapi/trace/resources/commons/types/debug_map_value.py b/seed/fastapi/trace/resources/commons/types/debug_map_value.py index 99eb539b3f2..9b4997f82d4 100644 --- a/seed/fastapi/trace/resources/commons/types/debug_map_value.py +++ b/seed/fastapi/trace/resources/commons/types/debug_map_value.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .debug_key_value_pairs_all import DebugMapValue as DebugMapValue -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class DebugMapValue(UniversalBaseModel): - key_value_pairs: typing.List["DebugKeyValuePairs"] = pydantic.Field(alias="keyValuePairs") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .debug_key_value_pairs import DebugKeyValuePairs # noqa: E402, F401, I001 - -update_forward_refs(DebugMapValue) +__all__ = ["DebugMapValue"] diff --git a/seed/fastapi/trace/resources/commons/types/debug_variable_value.py b/seed/fastapi/trace/resources/commons/types/debug_variable_value.py index bab606cba1c..0a3286a6c0a 100644 --- a/seed/fastapi/trace/resources/commons/types/debug_variable_value.py +++ b/seed/fastapi/trace/resources/commons/types/debug_variable_value.py @@ -1,324 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .debug_key_value_pairs_all import DebugVariableValue as DebugVariableValue -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs -from .binary_tree_node_and_tree_value import BinaryTreeNodeAndTreeValue -from .doubly_linked_list_node_and_list_value import DoublyLinkedListNodeAndListValue -from .generic_value import GenericValue as resources_commons_types_generic_value_GenericValue -from .singly_linked_list_node_and_list_value import SinglyLinkedListNodeAndListValue - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def integer_value(self, value: int) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue(root=_DebugVariableValue.IntegerValue(type="integerValue", value=value)) # type: ignore - else: - return DebugVariableValue(__root__=_DebugVariableValue.IntegerValue(type="integerValue", value=value)) # type: ignore - - def boolean_value(self, value: bool) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue(root=_DebugVariableValue.BooleanValue(type="booleanValue", value=value)) # type: ignore - else: - return DebugVariableValue(__root__=_DebugVariableValue.BooleanValue(type="booleanValue", value=value)) # type: ignore - - def double_value(self, value: float) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue(root=_DebugVariableValue.DoubleValue(type="doubleValue", value=value)) # type: ignore - else: - return DebugVariableValue(__root__=_DebugVariableValue.DoubleValue(type="doubleValue", value=value)) # type: ignore - - def string_value(self, value: str) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue(root=_DebugVariableValue.StringValue(type="stringValue", value=value)) # type: ignore - else: - return DebugVariableValue(__root__=_DebugVariableValue.StringValue(type="stringValue", value=value)) # type: ignore - - def char_value(self, value: str) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue(root=_DebugVariableValue.CharValue(type="charValue", value=value)) # type: ignore - else: - return DebugVariableValue(__root__=_DebugVariableValue.CharValue(type="charValue", value=value)) # type: ignore - - def map_value(self, value: DebugMapValue) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue( - root=_DebugVariableValue.MapValue(**value.dict(exclude_unset=True), type="mapValue") - ) # type: ignore - else: - return DebugVariableValue( - __root__=_DebugVariableValue.MapValue(**value.dict(exclude_unset=True), type="mapValue") - ) # type: ignore - - def list_value(self, value: typing.List[DebugVariableValue]) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue(root=_DebugVariableValue.ListValue(type="listValue", value=value)) # type: ignore - else: - return DebugVariableValue(__root__=_DebugVariableValue.ListValue(type="listValue", value=value)) # type: ignore - - def binary_tree_node_value(self, value: BinaryTreeNodeAndTreeValue) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue( - root=_DebugVariableValue.BinaryTreeNodeValue( - **value.dict(exclude_unset=True), type="binaryTreeNodeValue" - ) - ) # type: ignore - else: - return DebugVariableValue( - __root__=_DebugVariableValue.BinaryTreeNodeValue( - **value.dict(exclude_unset=True), type="binaryTreeNodeValue" - ) - ) # type: ignore - - def singly_linked_list_node_value(self, value: SinglyLinkedListNodeAndListValue) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue( - root=_DebugVariableValue.SinglyLinkedListNodeValue( - **value.dict(exclude_unset=True), type="singlyLinkedListNodeValue" - ) - ) # type: ignore - else: - return DebugVariableValue( - __root__=_DebugVariableValue.SinglyLinkedListNodeValue( - **value.dict(exclude_unset=True), type="singlyLinkedListNodeValue" - ) - ) # type: ignore - - def doubly_linked_list_node_value(self, value: DoublyLinkedListNodeAndListValue) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue( - root=_DebugVariableValue.DoublyLinkedListNodeValue( - **value.dict(exclude_unset=True), type="doublyLinkedListNodeValue" - ) - ) # type: ignore - else: - return DebugVariableValue( - __root__=_DebugVariableValue.DoublyLinkedListNodeValue( - **value.dict(exclude_unset=True), type="doublyLinkedListNodeValue" - ) - ) # type: ignore - - def undefined_value(self) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue(root=_DebugVariableValue.UndefinedValue(type="undefinedValue")) # type: ignore - else: - return DebugVariableValue(__root__=_DebugVariableValue.UndefinedValue(type="undefinedValue")) # type: ignore - - def null_value(self) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue(root=_DebugVariableValue.NullValue(type="nullValue")) # type: ignore - else: - return DebugVariableValue(__root__=_DebugVariableValue.NullValue(type="nullValue")) # type: ignore - - def generic_value(self, value: resources_commons_types_generic_value_GenericValue) -> DebugVariableValue: - if IS_PYDANTIC_V2: - return DebugVariableValue( - root=_DebugVariableValue.GenericValue(**value.dict(exclude_unset=True), type="genericValue") - ) # type: ignore - else: - return DebugVariableValue( - __root__=_DebugVariableValue.GenericValue(**value.dict(exclude_unset=True), type="genericValue") - ) # type: ignore - - -class DebugVariableValue(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[ - _DebugVariableValue.IntegerValue, - _DebugVariableValue.BooleanValue, - _DebugVariableValue.DoubleValue, - _DebugVariableValue.StringValue, - _DebugVariableValue.CharValue, - _DebugVariableValue.MapValue, - _DebugVariableValue.ListValue, - _DebugVariableValue.BinaryTreeNodeValue, - _DebugVariableValue.SinglyLinkedListNodeValue, - _DebugVariableValue.DoublyLinkedListNodeValue, - _DebugVariableValue.UndefinedValue, - _DebugVariableValue.NullValue, - _DebugVariableValue.GenericValue, - ], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[ - _DebugVariableValue.IntegerValue, - _DebugVariableValue.BooleanValue, - _DebugVariableValue.DoubleValue, - _DebugVariableValue.StringValue, - _DebugVariableValue.CharValue, - _DebugVariableValue.MapValue, - _DebugVariableValue.ListValue, - _DebugVariableValue.BinaryTreeNodeValue, - _DebugVariableValue.SinglyLinkedListNodeValue, - _DebugVariableValue.DoublyLinkedListNodeValue, - _DebugVariableValue.UndefinedValue, - _DebugVariableValue.NullValue, - _DebugVariableValue.GenericValue, - ]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[ - _DebugVariableValue.IntegerValue, - _DebugVariableValue.BooleanValue, - _DebugVariableValue.DoubleValue, - _DebugVariableValue.StringValue, - _DebugVariableValue.CharValue, - _DebugVariableValue.MapValue, - _DebugVariableValue.ListValue, - _DebugVariableValue.BinaryTreeNodeValue, - _DebugVariableValue.SinglyLinkedListNodeValue, - _DebugVariableValue.DoublyLinkedListNodeValue, - _DebugVariableValue.UndefinedValue, - _DebugVariableValue.NullValue, - _DebugVariableValue.GenericValue, - ], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[ - _DebugVariableValue.IntegerValue, - _DebugVariableValue.BooleanValue, - _DebugVariableValue.DoubleValue, - _DebugVariableValue.StringValue, - _DebugVariableValue.CharValue, - _DebugVariableValue.MapValue, - _DebugVariableValue.ListValue, - _DebugVariableValue.BinaryTreeNodeValue, - _DebugVariableValue.SinglyLinkedListNodeValue, - _DebugVariableValue.DoublyLinkedListNodeValue, - _DebugVariableValue.UndefinedValue, - _DebugVariableValue.NullValue, - _DebugVariableValue.GenericValue, - ]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - integer_value: typing.Callable[[int], T_Result], - boolean_value: typing.Callable[[bool], T_Result], - double_value: typing.Callable[[float], T_Result], - string_value: typing.Callable[[str], T_Result], - char_value: typing.Callable[[str], T_Result], - map_value: typing.Callable[["DebugMapValue"], T_Result], - list_value: typing.Callable[[typing.List["DebugVariableValue"]], T_Result], - binary_tree_node_value: typing.Callable[[BinaryTreeNodeAndTreeValue], T_Result], - singly_linked_list_node_value: typing.Callable[[SinglyLinkedListNodeAndListValue], T_Result], - doubly_linked_list_node_value: typing.Callable[[DoublyLinkedListNodeAndListValue], T_Result], - undefined_value: typing.Callable[[], T_Result], - null_value: typing.Callable[[], T_Result], - generic_value: typing.Callable[[resources_commons_types_generic_value_GenericValue], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "integerValue": - return integer_value(unioned_value.value) - if unioned_value.type == "booleanValue": - return boolean_value(unioned_value.value) - if unioned_value.type == "doubleValue": - return double_value(unioned_value.value) - if unioned_value.type == "stringValue": - return string_value(unioned_value.value) - if unioned_value.type == "charValue": - return char_value(unioned_value.value) - if unioned_value.type == "mapValue": - return map_value(DebugMapValue(**unioned_value.dict(exclude_unset=True, exclude={"type"}))) - if unioned_value.type == "listValue": - return list_value(unioned_value.value) - if unioned_value.type == "binaryTreeNodeValue": - return binary_tree_node_value( - BinaryTreeNodeAndTreeValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "singlyLinkedListNodeValue": - return singly_linked_list_node_value( - SinglyLinkedListNodeAndListValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "doublyLinkedListNodeValue": - return doubly_linked_list_node_value( - DoublyLinkedListNodeAndListValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "undefinedValue": - return undefined_value() - if unioned_value.type == "nullValue": - return null_value() - if unioned_value.type == "genericValue": - return generic_value( - resources_commons_types_generic_value_GenericValue( - **unioned_value.dict(exclude_unset=True, exclude={"type"}) - ) - ) - - -from .debug_map_value import DebugMapValue # noqa: E402, F401, I001 -from .debug_key_value_pairs import DebugKeyValuePairs # noqa: E402, F401, I001 - - -class _DebugVariableValue: - class IntegerValue(UniversalBaseModel): - type: typing.Literal["integerValue"] = "integerValue" - value: int - - class BooleanValue(UniversalBaseModel): - type: typing.Literal["booleanValue"] = "booleanValue" - value: bool - - class DoubleValue(UniversalBaseModel): - type: typing.Literal["doubleValue"] = "doubleValue" - value: float - - class StringValue(UniversalBaseModel): - type: typing.Literal["stringValue"] = "stringValue" - value: str - - class CharValue(UniversalBaseModel): - type: typing.Literal["charValue"] = "charValue" - value: str - - class MapValue(DebugMapValue): - type: typing.Literal["mapValue"] = "mapValue" - - class ListValue(UniversalBaseModel): - type: typing.Literal["listValue"] = "listValue" - value: typing.List[DebugVariableValue] - - class BinaryTreeNodeValue(BinaryTreeNodeAndTreeValue): - type: typing.Literal["binaryTreeNodeValue"] = "binaryTreeNodeValue" - - class SinglyLinkedListNodeValue(SinglyLinkedListNodeAndListValue): - type: typing.Literal["singlyLinkedListNodeValue"] = "singlyLinkedListNodeValue" - - class DoublyLinkedListNodeValue(DoublyLinkedListNodeAndListValue): - type: typing.Literal["doublyLinkedListNodeValue"] = "doublyLinkedListNodeValue" - - class UndefinedValue(UniversalBaseModel): - type: typing.Literal["undefinedValue"] = "undefinedValue" - - class NullValue(UniversalBaseModel): - type: typing.Literal["nullValue"] = "nullValue" - - class GenericValue(resources_commons_types_generic_value_GenericValue): - type: typing.Literal["genericValue"] = "genericValue" - - -update_forward_refs(_DebugVariableValue.MapValue) -update_forward_refs(_DebugVariableValue.ListValue) -update_forward_refs(DebugVariableValue) +__all__ = ["DebugVariableValue"] diff --git a/seed/fastapi/trace/resources/commons/types/key_value_pair.py b/seed/fastapi/trace/resources/commons/types/key_value_pair.py index 048911dd1cb..846326b8355 100644 --- a/seed/fastapi/trace/resources/commons/types/key_value_pair.py +++ b/seed/fastapi/trace/resources/commons/types/key_value_pair.py @@ -1,25 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .key_value_pair_all import KeyValuePair as KeyValuePair -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class KeyValuePair(UniversalBaseModel): - key: "VariableValue" - value: "VariableValue" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .variable_value import VariableValue # noqa: E402, F401, I001 - -update_forward_refs(KeyValuePair) +__all__ = ["KeyValuePair"] diff --git a/seed/fastapi/trace/resources/commons/types/key_value_pair_all.py b/seed/fastapi/trace/resources/commons/types/key_value_pair_all.py new file mode 100644 index 00000000000..591f155d0e8 --- /dev/null +++ b/seed/fastapi/trace/resources/commons/types/key_value_pair_all.py @@ -0,0 +1,326 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs +from .binary_tree_value import BinaryTreeValue as resources_commons_types_binary_tree_value_BinaryTreeValue +from .doubly_linked_list_value import ( + DoublyLinkedListValue as resources_commons_types_doubly_linked_list_value_DoublyLinkedListValue, +) +from .singly_linked_list_value import ( + SinglyLinkedListValue as resources_commons_types_singly_linked_list_value_SinglyLinkedListValue, +) + +T_Result = typing.TypeVar("T_Result") + + +class KeyValuePair(UniversalBaseModel): + key: "resources_commons_types_variable_value_VariableValue" + value: "resources_commons_types_variable_value_VariableValue" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class MapValue(UniversalBaseModel): + key_value_pairs: typing.List["resources_commons_types_key_value_pair_KeyValuePair"] = pydantic.Field( + alias="keyValuePairs" + ) + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def integer_value(self, value: int) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue(root=_VariableValue.IntegerValue(type="integerValue", value=value)) # type: ignore + else: + return VariableValue(__root__=_VariableValue.IntegerValue(type="integerValue", value=value)) # type: ignore + + def boolean_value(self, value: bool) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue(root=_VariableValue.BooleanValue(type="booleanValue", value=value)) # type: ignore + else: + return VariableValue(__root__=_VariableValue.BooleanValue(type="booleanValue", value=value)) # type: ignore + + def double_value(self, value: float) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue(root=_VariableValue.DoubleValue(type="doubleValue", value=value)) # type: ignore + else: + return VariableValue(__root__=_VariableValue.DoubleValue(type="doubleValue", value=value)) # type: ignore + + def string_value(self, value: str) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue(root=_VariableValue.StringValue(type="stringValue", value=value)) # type: ignore + else: + return VariableValue(__root__=_VariableValue.StringValue(type="stringValue", value=value)) # type: ignore + + def char_value(self, value: str) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue(root=_VariableValue.CharValue(type="charValue", value=value)) # type: ignore + else: + return VariableValue(__root__=_VariableValue.CharValue(type="charValue", value=value)) # type: ignore + + def map_value( + self, value: resources_commons_types_map_value_MapValue + ) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue(root=_VariableValue.MapValue(**value.dict(exclude_unset=True), type="mapValue")) # type: ignore + else: + return VariableValue(__root__=_VariableValue.MapValue(**value.dict(exclude_unset=True), type="mapValue")) # type: ignore + + def list_value( + self, value: typing.List[resources_commons_types_variable_value_VariableValue] + ) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue(root=_VariableValue.ListValue(type="listValue", value=value)) # type: ignore + else: + return VariableValue(__root__=_VariableValue.ListValue(type="listValue", value=value)) # type: ignore + + def binary_tree_value( + self, value: resources_commons_types_binary_tree_value_BinaryTreeValue + ) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue( + root=_VariableValue.BinaryTreeValue(**value.dict(exclude_unset=True), type="binaryTreeValue") + ) # type: ignore + else: + return VariableValue( + __root__=_VariableValue.BinaryTreeValue(**value.dict(exclude_unset=True), type="binaryTreeValue") + ) # type: ignore + + def singly_linked_list_value( + self, value: resources_commons_types_singly_linked_list_value_SinglyLinkedListValue + ) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue( + root=_VariableValue.SinglyLinkedListValue( + **value.dict(exclude_unset=True), type="singlyLinkedListValue" + ) + ) # type: ignore + else: + return VariableValue( + __root__=_VariableValue.SinglyLinkedListValue( + **value.dict(exclude_unset=True), type="singlyLinkedListValue" + ) + ) # type: ignore + + def doubly_linked_list_value( + self, value: resources_commons_types_doubly_linked_list_value_DoublyLinkedListValue + ) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue( + root=_VariableValue.DoublyLinkedListValue( + **value.dict(exclude_unset=True), type="doublyLinkedListValue" + ) + ) # type: ignore + else: + return VariableValue( + __root__=_VariableValue.DoublyLinkedListValue( + **value.dict(exclude_unset=True), type="doublyLinkedListValue" + ) + ) # type: ignore + + def null_value(self) -> resources_commons_types_variable_value_VariableValue: + if IS_PYDANTIC_V2: + return VariableValue(root=_VariableValue.NullValue(type="nullValue")) # type: ignore + else: + return VariableValue(__root__=_VariableValue.NullValue(type="nullValue")) # type: ignore + + +class VariableValue(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _VariableValue.IntegerValue, + _VariableValue.BooleanValue, + _VariableValue.DoubleValue, + _VariableValue.StringValue, + _VariableValue.CharValue, + _VariableValue.MapValue, + _VariableValue.ListValue, + _VariableValue.BinaryTreeValue, + _VariableValue.SinglyLinkedListValue, + _VariableValue.DoublyLinkedListValue, + _VariableValue.NullValue, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _VariableValue.IntegerValue, + _VariableValue.BooleanValue, + _VariableValue.DoubleValue, + _VariableValue.StringValue, + _VariableValue.CharValue, + _VariableValue.MapValue, + _VariableValue.ListValue, + _VariableValue.BinaryTreeValue, + _VariableValue.SinglyLinkedListValue, + _VariableValue.DoublyLinkedListValue, + _VariableValue.NullValue, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _VariableValue.IntegerValue, + _VariableValue.BooleanValue, + _VariableValue.DoubleValue, + _VariableValue.StringValue, + _VariableValue.CharValue, + _VariableValue.MapValue, + _VariableValue.ListValue, + _VariableValue.BinaryTreeValue, + _VariableValue.SinglyLinkedListValue, + _VariableValue.DoublyLinkedListValue, + _VariableValue.NullValue, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _VariableValue.IntegerValue, + _VariableValue.BooleanValue, + _VariableValue.DoubleValue, + _VariableValue.StringValue, + _VariableValue.CharValue, + _VariableValue.MapValue, + _VariableValue.ListValue, + _VariableValue.BinaryTreeValue, + _VariableValue.SinglyLinkedListValue, + _VariableValue.DoublyLinkedListValue, + _VariableValue.NullValue, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + integer_value: typing.Callable[[int], T_Result], + boolean_value: typing.Callable[[bool], T_Result], + double_value: typing.Callable[[float], T_Result], + string_value: typing.Callable[[str], T_Result], + char_value: typing.Callable[[str], T_Result], + map_value: typing.Callable[["resources_commons_types_map_value_MapValue"], T_Result], + list_value: typing.Callable[[typing.List["resources_commons_types_variable_value_VariableValue"]], T_Result], + binary_tree_value: typing.Callable[[resources_commons_types_binary_tree_value_BinaryTreeValue], T_Result], + singly_linked_list_value: typing.Callable[ + [resources_commons_types_singly_linked_list_value_SinglyLinkedListValue], T_Result + ], + doubly_linked_list_value: typing.Callable[ + [resources_commons_types_doubly_linked_list_value_DoublyLinkedListValue], T_Result + ], + null_value: typing.Callable[[], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "integerValue": + return integer_value(unioned_value.value) + if unioned_value.type == "booleanValue": + return boolean_value(unioned_value.value) + if unioned_value.type == "doubleValue": + return double_value(unioned_value.value) + if unioned_value.type == "stringValue": + return string_value(unioned_value.value) + if unioned_value.type == "charValue": + return char_value(unioned_value.value) + if unioned_value.type == "mapValue": + return map_value( + resources_commons_types_map_value_MapValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "listValue": + return list_value(unioned_value.value) + if unioned_value.type == "binaryTreeValue": + return binary_tree_value( + resources_commons_types_binary_tree_value_BinaryTreeValue( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "singlyLinkedListValue": + return singly_linked_list_value( + resources_commons_types_singly_linked_list_value_SinglyLinkedListValue( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "doublyLinkedListValue": + return doubly_linked_list_value( + resources_commons_types_doubly_linked_list_value_DoublyLinkedListValue( + **unioned_value.dict(exclude_unset=True, exclude={"type"}) + ) + ) + if unioned_value.type == "nullValue": + return null_value() + + +from .variable_value import VariableValue as resources_commons_types_variable_value_VariableValue # noqa: E402, F401, I001 +from .key_value_pair import KeyValuePair as resources_commons_types_key_value_pair_KeyValuePair # noqa: E402, F401, I001 +from .map_value import MapValue as resources_commons_types_map_value_MapValue # noqa: E402, F401, I001 + + +class _VariableValue: + class IntegerValue(UniversalBaseModel): + type: typing.Literal["integerValue"] = "integerValue" + value: int + + class BooleanValue(UniversalBaseModel): + type: typing.Literal["booleanValue"] = "booleanValue" + value: bool + + class DoubleValue(UniversalBaseModel): + type: typing.Literal["doubleValue"] = "doubleValue" + value: float + + class StringValue(UniversalBaseModel): + type: typing.Literal["stringValue"] = "stringValue" + value: str + + class CharValue(UniversalBaseModel): + type: typing.Literal["charValue"] = "charValue" + value: str + + class MapValue(resources_commons_types_map_value_MapValue): + type: typing.Literal["mapValue"] = "mapValue" + + class ListValue(UniversalBaseModel): + type: typing.Literal["listValue"] = "listValue" + value: typing.List[resources_commons_types_variable_value_VariableValue] + + class BinaryTreeValue(resources_commons_types_binary_tree_value_BinaryTreeValue): + type: typing.Literal["binaryTreeValue"] = "binaryTreeValue" + + class SinglyLinkedListValue(resources_commons_types_singly_linked_list_value_SinglyLinkedListValue): + type: typing.Literal["singlyLinkedListValue"] = "singlyLinkedListValue" + + class DoublyLinkedListValue(resources_commons_types_doubly_linked_list_value_DoublyLinkedListValue): + type: typing.Literal["doublyLinkedListValue"] = "doublyLinkedListValue" + + class NullValue(UniversalBaseModel): + type: typing.Literal["nullValue"] = "nullValue" + + +update_forward_refs(_VariableValue.MapValue) +update_forward_refs(_VariableValue.ListValue) diff --git a/seed/fastapi/trace/resources/commons/types/list_type.py b/seed/fastapi/trace/resources/commons/types/list_type.py index f18657d12e1..9dc370dd81f 100644 --- a/seed/fastapi/trace/resources/commons/types/list_type.py +++ b/seed/fastapi/trace/resources/commons/types/list_type.py @@ -1,28 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .list_type_all import ListType as ListType -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class ListType(UniversalBaseModel): - value_type: "VariableType" = pydantic.Field(alias="valueType") - is_fixed_length: typing.Optional[bool] = pydantic.Field(alias="isFixedLength", default=None) - """ - Whether this list is fixed-size (for languages that supports fixed-size lists). Defaults to false. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .variable_type import VariableType # noqa: E402, F401, I001 - -update_forward_refs(ListType) +__all__ = ["ListType"] diff --git a/seed/fastapi/trace/resources/commons/types/list_type_all.py b/seed/fastapi/trace/resources/commons/types/list_type_all.py new file mode 100644 index 00000000000..2f1dc6916db --- /dev/null +++ b/seed/fastapi/trace/resources/commons/types/list_type_all.py @@ -0,0 +1,259 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs + +T_Result = typing.TypeVar("T_Result") + + +class ListType(UniversalBaseModel): + value_type: "resources_commons_types_variable_type_VariableType" = pydantic.Field(alias="valueType") + is_fixed_length: typing.Optional[bool] = pydantic.Field(alias="isFixedLength", default=None) + """ + Whether this list is fixed-size (for languages that supports fixed-size lists). Defaults to false. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class MapType(UniversalBaseModel): + key_type: "resources_commons_types_variable_type_VariableType" = pydantic.Field(alias="keyType") + value_type: "resources_commons_types_variable_type_VariableType" = pydantic.Field(alias="valueType") + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.forbid + + +class _Factory: + def integer_type(self) -> resources_commons_types_variable_type_VariableType: + if IS_PYDANTIC_V2: + return VariableType(root=_VariableType.IntegerType(type="integerType")) # type: ignore + else: + return VariableType(__root__=_VariableType.IntegerType(type="integerType")) # type: ignore + + def double_type(self) -> resources_commons_types_variable_type_VariableType: + if IS_PYDANTIC_V2: + return VariableType(root=_VariableType.DoubleType(type="doubleType")) # type: ignore + else: + return VariableType(__root__=_VariableType.DoubleType(type="doubleType")) # type: ignore + + def boolean_type(self) -> resources_commons_types_variable_type_VariableType: + if IS_PYDANTIC_V2: + return VariableType(root=_VariableType.BooleanType(type="booleanType")) # type: ignore + else: + return VariableType(__root__=_VariableType.BooleanType(type="booleanType")) # type: ignore + + def string_type(self) -> resources_commons_types_variable_type_VariableType: + if IS_PYDANTIC_V2: + return VariableType(root=_VariableType.StringType(type="stringType")) # type: ignore + else: + return VariableType(__root__=_VariableType.StringType(type="stringType")) # type: ignore + + def char_type(self) -> resources_commons_types_variable_type_VariableType: + if IS_PYDANTIC_V2: + return VariableType(root=_VariableType.CharType(type="charType")) # type: ignore + else: + return VariableType(__root__=_VariableType.CharType(type="charType")) # type: ignore + + def list_type( + self, value: resources_commons_types_list_type_ListType + ) -> resources_commons_types_variable_type_VariableType: + if IS_PYDANTIC_V2: + return VariableType(root=_VariableType.ListType(**value.dict(exclude_unset=True), type="listType")) # type: ignore + else: + return VariableType(__root__=_VariableType.ListType(**value.dict(exclude_unset=True), type="listType")) # type: ignore + + def map_type( + self, value: resources_commons_types_map_type_MapType + ) -> resources_commons_types_variable_type_VariableType: + if IS_PYDANTIC_V2: + return VariableType(root=_VariableType.MapType(**value.dict(exclude_unset=True), type="mapType")) # type: ignore + else: + return VariableType(__root__=_VariableType.MapType(**value.dict(exclude_unset=True), type="mapType")) # type: ignore + + def binary_tree_type(self) -> resources_commons_types_variable_type_VariableType: + if IS_PYDANTIC_V2: + return VariableType(root=_VariableType.BinaryTreeType(type="binaryTreeType")) # type: ignore + else: + return VariableType(__root__=_VariableType.BinaryTreeType(type="binaryTreeType")) # type: ignore + + def singly_linked_list_type(self) -> resources_commons_types_variable_type_VariableType: + if IS_PYDANTIC_V2: + return VariableType(root=_VariableType.SinglyLinkedListType(type="singlyLinkedListType")) # type: ignore + else: + return VariableType(__root__=_VariableType.SinglyLinkedListType(type="singlyLinkedListType")) # type: ignore + + def doubly_linked_list_type(self) -> resources_commons_types_variable_type_VariableType: + if IS_PYDANTIC_V2: + return VariableType(root=_VariableType.DoublyLinkedListType(type="doublyLinkedListType")) # type: ignore + else: + return VariableType(__root__=_VariableType.DoublyLinkedListType(type="doublyLinkedListType")) # type: ignore + + +class VariableType(UniversalRootModel): + factory: typing.ClassVar[_Factory] = _Factory() + + if IS_PYDANTIC_V2: + root: typing_extensions.Annotated[ + typing.Union[ + _VariableType.IntegerType, + _VariableType.DoubleType, + _VariableType.BooleanType, + _VariableType.StringType, + _VariableType.CharType, + _VariableType.ListType, + _VariableType.MapType, + _VariableType.BinaryTreeType, + _VariableType.SinglyLinkedListType, + _VariableType.DoublyLinkedListType, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _VariableType.IntegerType, + _VariableType.DoubleType, + _VariableType.BooleanType, + _VariableType.StringType, + _VariableType.CharType, + _VariableType.ListType, + _VariableType.MapType, + _VariableType.BinaryTreeType, + _VariableType.SinglyLinkedListType, + _VariableType.DoublyLinkedListType, + ]: + return self.root + else: + __root__: typing_extensions.Annotated[ + typing.Union[ + _VariableType.IntegerType, + _VariableType.DoubleType, + _VariableType.BooleanType, + _VariableType.StringType, + _VariableType.CharType, + _VariableType.ListType, + _VariableType.MapType, + _VariableType.BinaryTreeType, + _VariableType.SinglyLinkedListType, + _VariableType.DoublyLinkedListType, + ], + pydantic.Field(discriminator="type"), + ] + + def get_as_union( + self, + ) -> typing.Union[ + _VariableType.IntegerType, + _VariableType.DoubleType, + _VariableType.BooleanType, + _VariableType.StringType, + _VariableType.CharType, + _VariableType.ListType, + _VariableType.MapType, + _VariableType.BinaryTreeType, + _VariableType.SinglyLinkedListType, + _VariableType.DoublyLinkedListType, + ]: + return self.__root__ + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + if IS_PYDANTIC_V2: + return self.root.dict(**kwargs) + else: + return self.__root__.dict(**kwargs) + + def visit( + self, + integer_type: typing.Callable[[], T_Result], + double_type: typing.Callable[[], T_Result], + boolean_type: typing.Callable[[], T_Result], + string_type: typing.Callable[[], T_Result], + char_type: typing.Callable[[], T_Result], + list_type: typing.Callable[["resources_commons_types_list_type_ListType"], T_Result], + map_type: typing.Callable[["resources_commons_types_map_type_MapType"], T_Result], + binary_tree_type: typing.Callable[[], T_Result], + singly_linked_list_type: typing.Callable[[], T_Result], + doubly_linked_list_type: typing.Callable[[], T_Result], + ) -> T_Result: + unioned_value = self.get_as_union() + if unioned_value.type == "integerType": + return integer_type() + if unioned_value.type == "doubleType": + return double_type() + if unioned_value.type == "booleanType": + return boolean_type() + if unioned_value.type == "stringType": + return string_type() + if unioned_value.type == "charType": + return char_type() + if unioned_value.type == "listType": + return list_type( + resources_commons_types_list_type_ListType(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "mapType": + return map_type( + resources_commons_types_map_type_MapType(**unioned_value.dict(exclude_unset=True, exclude={"type"})) + ) + if unioned_value.type == "binaryTreeType": + return binary_tree_type() + if unioned_value.type == "singlyLinkedListType": + return singly_linked_list_type() + if unioned_value.type == "doublyLinkedListType": + return doubly_linked_list_type() + + +from .variable_type import VariableType as resources_commons_types_variable_type_VariableType # noqa: E402, F401, I001 +from .list_type import ListType as resources_commons_types_list_type_ListType # noqa: E402, F401, I001 +from .map_type import MapType as resources_commons_types_map_type_MapType # noqa: E402, F401, I001 + + +class _VariableType: + class IntegerType(UniversalBaseModel): + type: typing.Literal["integerType"] = "integerType" + + class DoubleType(UniversalBaseModel): + type: typing.Literal["doubleType"] = "doubleType" + + class BooleanType(UniversalBaseModel): + type: typing.Literal["booleanType"] = "booleanType" + + class StringType(UniversalBaseModel): + type: typing.Literal["stringType"] = "stringType" + + class CharType(UniversalBaseModel): + type: typing.Literal["charType"] = "charType" + + class ListType(resources_commons_types_list_type_ListType): + type: typing.Literal["listType"] = "listType" + + class MapType(resources_commons_types_map_type_MapType): + type: typing.Literal["mapType"] = "mapType" + + class BinaryTreeType(UniversalBaseModel): + type: typing.Literal["binaryTreeType"] = "binaryTreeType" + + class SinglyLinkedListType(UniversalBaseModel): + type: typing.Literal["singlyLinkedListType"] = "singlyLinkedListType" + + class DoublyLinkedListType(UniversalBaseModel): + type: typing.Literal["doublyLinkedListType"] = "doublyLinkedListType" + + +update_forward_refs(_VariableType.ListType) +update_forward_refs(_VariableType.MapType) diff --git a/seed/fastapi/trace/resources/commons/types/map_type.py b/seed/fastapi/trace/resources/commons/types/map_type.py index e975b56d698..ef01538cf86 100644 --- a/seed/fastapi/trace/resources/commons/types/map_type.py +++ b/seed/fastapi/trace/resources/commons/types/map_type.py @@ -1,25 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .list_type_all import MapType as MapType -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class MapType(UniversalBaseModel): - key_type: "VariableType" = pydantic.Field(alias="keyType") - value_type: "VariableType" = pydantic.Field(alias="valueType") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .variable_type import VariableType # noqa: E402, F401, I001 - -update_forward_refs(MapType) +__all__ = ["MapType"] diff --git a/seed/fastapi/trace/resources/commons/types/map_value.py b/seed/fastapi/trace/resources/commons/types/map_value.py index 9d70dc4b7ff..4c2b22313ee 100644 --- a/seed/fastapi/trace/resources/commons/types/map_value.py +++ b/seed/fastapi/trace/resources/commons/types/map_value.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .key_value_pair_all import MapValue as MapValue -import typing - -import pydantic -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class MapValue(UniversalBaseModel): - key_value_pairs: typing.List["KeyValuePair"] = pydantic.Field(alias="keyValuePairs") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="forbid") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid - - -from .key_value_pair import KeyValuePair # noqa: E402, F401, I001 - -update_forward_refs(MapValue) +__all__ = ["MapValue"] diff --git a/seed/fastapi/trace/resources/commons/types/variable_type.py b/seed/fastapi/trace/resources/commons/types/variable_type.py index 2aa4019ec99..e9fccef8185 100644 --- a/seed/fastapi/trace/resources/commons/types/variable_type.py +++ b/seed/fastapi/trace/resources/commons/types/variable_type.py @@ -1,228 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .list_type_all import VariableType as VariableType -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def integer_type(self) -> VariableType: - if IS_PYDANTIC_V2: - return VariableType(root=_VariableType.IntegerType(type="integerType")) # type: ignore - else: - return VariableType(__root__=_VariableType.IntegerType(type="integerType")) # type: ignore - - def double_type(self) -> VariableType: - if IS_PYDANTIC_V2: - return VariableType(root=_VariableType.DoubleType(type="doubleType")) # type: ignore - else: - return VariableType(__root__=_VariableType.DoubleType(type="doubleType")) # type: ignore - - def boolean_type(self) -> VariableType: - if IS_PYDANTIC_V2: - return VariableType(root=_VariableType.BooleanType(type="booleanType")) # type: ignore - else: - return VariableType(__root__=_VariableType.BooleanType(type="booleanType")) # type: ignore - - def string_type(self) -> VariableType: - if IS_PYDANTIC_V2: - return VariableType(root=_VariableType.StringType(type="stringType")) # type: ignore - else: - return VariableType(__root__=_VariableType.StringType(type="stringType")) # type: ignore - - def char_type(self) -> VariableType: - if IS_PYDANTIC_V2: - return VariableType(root=_VariableType.CharType(type="charType")) # type: ignore - else: - return VariableType(__root__=_VariableType.CharType(type="charType")) # type: ignore - - def list_type(self, value: resources_commons_types_list_type_ListType) -> VariableType: - if IS_PYDANTIC_V2: - return VariableType(root=_VariableType.ListType(**value.dict(exclude_unset=True), type="listType")) # type: ignore - else: - return VariableType(__root__=_VariableType.ListType(**value.dict(exclude_unset=True), type="listType")) # type: ignore - - def map_type(self, value: resources_commons_types_map_type_MapType) -> VariableType: - if IS_PYDANTIC_V2: - return VariableType(root=_VariableType.MapType(**value.dict(exclude_unset=True), type="mapType")) # type: ignore - else: - return VariableType(__root__=_VariableType.MapType(**value.dict(exclude_unset=True), type="mapType")) # type: ignore - - def binary_tree_type(self) -> VariableType: - if IS_PYDANTIC_V2: - return VariableType(root=_VariableType.BinaryTreeType(type="binaryTreeType")) # type: ignore - else: - return VariableType(__root__=_VariableType.BinaryTreeType(type="binaryTreeType")) # type: ignore - - def singly_linked_list_type(self) -> VariableType: - if IS_PYDANTIC_V2: - return VariableType(root=_VariableType.SinglyLinkedListType(type="singlyLinkedListType")) # type: ignore - else: - return VariableType(__root__=_VariableType.SinglyLinkedListType(type="singlyLinkedListType")) # type: ignore - - def doubly_linked_list_type(self) -> VariableType: - if IS_PYDANTIC_V2: - return VariableType(root=_VariableType.DoublyLinkedListType(type="doublyLinkedListType")) # type: ignore - else: - return VariableType(__root__=_VariableType.DoublyLinkedListType(type="doublyLinkedListType")) # type: ignore - - -class VariableType(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[ - _VariableType.IntegerType, - _VariableType.DoubleType, - _VariableType.BooleanType, - _VariableType.StringType, - _VariableType.CharType, - _VariableType.ListType, - _VariableType.MapType, - _VariableType.BinaryTreeType, - _VariableType.SinglyLinkedListType, - _VariableType.DoublyLinkedListType, - ], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[ - _VariableType.IntegerType, - _VariableType.DoubleType, - _VariableType.BooleanType, - _VariableType.StringType, - _VariableType.CharType, - _VariableType.ListType, - _VariableType.MapType, - _VariableType.BinaryTreeType, - _VariableType.SinglyLinkedListType, - _VariableType.DoublyLinkedListType, - ]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[ - _VariableType.IntegerType, - _VariableType.DoubleType, - _VariableType.BooleanType, - _VariableType.StringType, - _VariableType.CharType, - _VariableType.ListType, - _VariableType.MapType, - _VariableType.BinaryTreeType, - _VariableType.SinglyLinkedListType, - _VariableType.DoublyLinkedListType, - ], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[ - _VariableType.IntegerType, - _VariableType.DoubleType, - _VariableType.BooleanType, - _VariableType.StringType, - _VariableType.CharType, - _VariableType.ListType, - _VariableType.MapType, - _VariableType.BinaryTreeType, - _VariableType.SinglyLinkedListType, - _VariableType.DoublyLinkedListType, - ]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - integer_type: typing.Callable[[], T_Result], - double_type: typing.Callable[[], T_Result], - boolean_type: typing.Callable[[], T_Result], - string_type: typing.Callable[[], T_Result], - char_type: typing.Callable[[], T_Result], - list_type: typing.Callable[["resources_commons_types_list_type_ListType"], T_Result], - map_type: typing.Callable[["resources_commons_types_map_type_MapType"], T_Result], - binary_tree_type: typing.Callable[[], T_Result], - singly_linked_list_type: typing.Callable[[], T_Result], - doubly_linked_list_type: typing.Callable[[], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "integerType": - return integer_type() - if unioned_value.type == "doubleType": - return double_type() - if unioned_value.type == "booleanType": - return boolean_type() - if unioned_value.type == "stringType": - return string_type() - if unioned_value.type == "charType": - return char_type() - if unioned_value.type == "listType": - return list_type( - resources_commons_types_list_type_ListType(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "mapType": - return map_type( - resources_commons_types_map_type_MapType(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "binaryTreeType": - return binary_tree_type() - if unioned_value.type == "singlyLinkedListType": - return singly_linked_list_type() - if unioned_value.type == "doublyLinkedListType": - return doubly_linked_list_type() - - -from .list_type import ListType as resources_commons_types_list_type_ListType # noqa: E402, F401, I001 -from .map_type import MapType as resources_commons_types_map_type_MapType # noqa: E402, F401, I001 - - -class _VariableType: - class IntegerType(UniversalBaseModel): - type: typing.Literal["integerType"] = "integerType" - - class DoubleType(UniversalBaseModel): - type: typing.Literal["doubleType"] = "doubleType" - - class BooleanType(UniversalBaseModel): - type: typing.Literal["booleanType"] = "booleanType" - - class StringType(UniversalBaseModel): - type: typing.Literal["stringType"] = "stringType" - - class CharType(UniversalBaseModel): - type: typing.Literal["charType"] = "charType" - - class ListType(resources_commons_types_list_type_ListType): - type: typing.Literal["listType"] = "listType" - - class MapType(resources_commons_types_map_type_MapType): - type: typing.Literal["mapType"] = "mapType" - - class BinaryTreeType(UniversalBaseModel): - type: typing.Literal["binaryTreeType"] = "binaryTreeType" - - class SinglyLinkedListType(UniversalBaseModel): - type: typing.Literal["singlyLinkedListType"] = "singlyLinkedListType" - - class DoublyLinkedListType(UniversalBaseModel): - type: typing.Literal["doublyLinkedListType"] = "doublyLinkedListType" - - -update_forward_refs(_VariableType.ListType) -update_forward_refs(_VariableType.MapType) -update_forward_refs(VariableType) +__all__ = ["VariableType"] diff --git a/seed/fastapi/trace/resources/commons/types/variable_value.py b/seed/fastapi/trace/resources/commons/types/variable_value.py index c42436da556..649af6257e3 100644 --- a/seed/fastapi/trace/resources/commons/types/variable_value.py +++ b/seed/fastapi/trace/resources/commons/types/variable_value.py @@ -1,295 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .key_value_pair_all import VariableValue as VariableValue -import typing - -import pydantic -import typing_extensions -from ....core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, UniversalRootModel, update_forward_refs -from .binary_tree_value import BinaryTreeValue as resources_commons_types_binary_tree_value_BinaryTreeValue -from .doubly_linked_list_value import ( - DoublyLinkedListValue as resources_commons_types_doubly_linked_list_value_DoublyLinkedListValue, -) -from .singly_linked_list_value import ( - SinglyLinkedListValue as resources_commons_types_singly_linked_list_value_SinglyLinkedListValue, -) - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def integer_value(self, value: int) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue(root=_VariableValue.IntegerValue(type="integerValue", value=value)) # type: ignore - else: - return VariableValue(__root__=_VariableValue.IntegerValue(type="integerValue", value=value)) # type: ignore - - def boolean_value(self, value: bool) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue(root=_VariableValue.BooleanValue(type="booleanValue", value=value)) # type: ignore - else: - return VariableValue(__root__=_VariableValue.BooleanValue(type="booleanValue", value=value)) # type: ignore - - def double_value(self, value: float) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue(root=_VariableValue.DoubleValue(type="doubleValue", value=value)) # type: ignore - else: - return VariableValue(__root__=_VariableValue.DoubleValue(type="doubleValue", value=value)) # type: ignore - - def string_value(self, value: str) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue(root=_VariableValue.StringValue(type="stringValue", value=value)) # type: ignore - else: - return VariableValue(__root__=_VariableValue.StringValue(type="stringValue", value=value)) # type: ignore - - def char_value(self, value: str) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue(root=_VariableValue.CharValue(type="charValue", value=value)) # type: ignore - else: - return VariableValue(__root__=_VariableValue.CharValue(type="charValue", value=value)) # type: ignore - - def map_value(self, value: resources_commons_types_map_value_MapValue) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue(root=_VariableValue.MapValue(**value.dict(exclude_unset=True), type="mapValue")) # type: ignore - else: - return VariableValue(__root__=_VariableValue.MapValue(**value.dict(exclude_unset=True), type="mapValue")) # type: ignore - - def list_value(self, value: typing.List[VariableValue]) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue(root=_VariableValue.ListValue(type="listValue", value=value)) # type: ignore - else: - return VariableValue(__root__=_VariableValue.ListValue(type="listValue", value=value)) # type: ignore - - def binary_tree_value(self, value: resources_commons_types_binary_tree_value_BinaryTreeValue) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue( - root=_VariableValue.BinaryTreeValue(**value.dict(exclude_unset=True), type="binaryTreeValue") - ) # type: ignore - else: - return VariableValue( - __root__=_VariableValue.BinaryTreeValue(**value.dict(exclude_unset=True), type="binaryTreeValue") - ) # type: ignore - - def singly_linked_list_value( - self, value: resources_commons_types_singly_linked_list_value_SinglyLinkedListValue - ) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue( - root=_VariableValue.SinglyLinkedListValue( - **value.dict(exclude_unset=True), type="singlyLinkedListValue" - ) - ) # type: ignore - else: - return VariableValue( - __root__=_VariableValue.SinglyLinkedListValue( - **value.dict(exclude_unset=True), type="singlyLinkedListValue" - ) - ) # type: ignore - - def doubly_linked_list_value( - self, value: resources_commons_types_doubly_linked_list_value_DoublyLinkedListValue - ) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue( - root=_VariableValue.DoublyLinkedListValue( - **value.dict(exclude_unset=True), type="doublyLinkedListValue" - ) - ) # type: ignore - else: - return VariableValue( - __root__=_VariableValue.DoublyLinkedListValue( - **value.dict(exclude_unset=True), type="doublyLinkedListValue" - ) - ) # type: ignore - - def null_value(self) -> VariableValue: - if IS_PYDANTIC_V2: - return VariableValue(root=_VariableValue.NullValue(type="nullValue")) # type: ignore - else: - return VariableValue(__root__=_VariableValue.NullValue(type="nullValue")) # type: ignore - - -class VariableValue(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[ - _VariableValue.IntegerValue, - _VariableValue.BooleanValue, - _VariableValue.DoubleValue, - _VariableValue.StringValue, - _VariableValue.CharValue, - _VariableValue.MapValue, - _VariableValue.ListValue, - _VariableValue.BinaryTreeValue, - _VariableValue.SinglyLinkedListValue, - _VariableValue.DoublyLinkedListValue, - _VariableValue.NullValue, - ], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[ - _VariableValue.IntegerValue, - _VariableValue.BooleanValue, - _VariableValue.DoubleValue, - _VariableValue.StringValue, - _VariableValue.CharValue, - _VariableValue.MapValue, - _VariableValue.ListValue, - _VariableValue.BinaryTreeValue, - _VariableValue.SinglyLinkedListValue, - _VariableValue.DoublyLinkedListValue, - _VariableValue.NullValue, - ]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[ - _VariableValue.IntegerValue, - _VariableValue.BooleanValue, - _VariableValue.DoubleValue, - _VariableValue.StringValue, - _VariableValue.CharValue, - _VariableValue.MapValue, - _VariableValue.ListValue, - _VariableValue.BinaryTreeValue, - _VariableValue.SinglyLinkedListValue, - _VariableValue.DoublyLinkedListValue, - _VariableValue.NullValue, - ], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[ - _VariableValue.IntegerValue, - _VariableValue.BooleanValue, - _VariableValue.DoubleValue, - _VariableValue.StringValue, - _VariableValue.CharValue, - _VariableValue.MapValue, - _VariableValue.ListValue, - _VariableValue.BinaryTreeValue, - _VariableValue.SinglyLinkedListValue, - _VariableValue.DoublyLinkedListValue, - _VariableValue.NullValue, - ]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - integer_value: typing.Callable[[int], T_Result], - boolean_value: typing.Callable[[bool], T_Result], - double_value: typing.Callable[[float], T_Result], - string_value: typing.Callable[[str], T_Result], - char_value: typing.Callable[[str], T_Result], - map_value: typing.Callable[["resources_commons_types_map_value_MapValue"], T_Result], - list_value: typing.Callable[[typing.List["VariableValue"]], T_Result], - binary_tree_value: typing.Callable[[resources_commons_types_binary_tree_value_BinaryTreeValue], T_Result], - singly_linked_list_value: typing.Callable[ - [resources_commons_types_singly_linked_list_value_SinglyLinkedListValue], T_Result - ], - doubly_linked_list_value: typing.Callable[ - [resources_commons_types_doubly_linked_list_value_DoublyLinkedListValue], T_Result - ], - null_value: typing.Callable[[], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "integerValue": - return integer_value(unioned_value.value) - if unioned_value.type == "booleanValue": - return boolean_value(unioned_value.value) - if unioned_value.type == "doubleValue": - return double_value(unioned_value.value) - if unioned_value.type == "stringValue": - return string_value(unioned_value.value) - if unioned_value.type == "charValue": - return char_value(unioned_value.value) - if unioned_value.type == "mapValue": - return map_value( - resources_commons_types_map_value_MapValue(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "listValue": - return list_value(unioned_value.value) - if unioned_value.type == "binaryTreeValue": - return binary_tree_value( - resources_commons_types_binary_tree_value_BinaryTreeValue( - **unioned_value.dict(exclude_unset=True, exclude={"type"}) - ) - ) - if unioned_value.type == "singlyLinkedListValue": - return singly_linked_list_value( - resources_commons_types_singly_linked_list_value_SinglyLinkedListValue( - **unioned_value.dict(exclude_unset=True, exclude={"type"}) - ) - ) - if unioned_value.type == "doublyLinkedListValue": - return doubly_linked_list_value( - resources_commons_types_doubly_linked_list_value_DoublyLinkedListValue( - **unioned_value.dict(exclude_unset=True, exclude={"type"}) - ) - ) - if unioned_value.type == "nullValue": - return null_value() - - -from .map_value import MapValue as resources_commons_types_map_value_MapValue # noqa: E402, F401, I001 -from .key_value_pair import KeyValuePair # noqa: E402, F401, I001 - - -class _VariableValue: - class IntegerValue(UniversalBaseModel): - type: typing.Literal["integerValue"] = "integerValue" - value: int - - class BooleanValue(UniversalBaseModel): - type: typing.Literal["booleanValue"] = "booleanValue" - value: bool - - class DoubleValue(UniversalBaseModel): - type: typing.Literal["doubleValue"] = "doubleValue" - value: float - - class StringValue(UniversalBaseModel): - type: typing.Literal["stringValue"] = "stringValue" - value: str - - class CharValue(UniversalBaseModel): - type: typing.Literal["charValue"] = "charValue" - value: str - - class MapValue(resources_commons_types_map_value_MapValue): - type: typing.Literal["mapValue"] = "mapValue" - - class ListValue(UniversalBaseModel): - type: typing.Literal["listValue"] = "listValue" - value: typing.List[VariableValue] - - class BinaryTreeValue(resources_commons_types_binary_tree_value_BinaryTreeValue): - type: typing.Literal["binaryTreeValue"] = "binaryTreeValue" - - class SinglyLinkedListValue(resources_commons_types_singly_linked_list_value_SinglyLinkedListValue): - type: typing.Literal["singlyLinkedListValue"] = "singlyLinkedListValue" - - class DoublyLinkedListValue(resources_commons_types_doubly_linked_list_value_DoublyLinkedListValue): - type: typing.Literal["doublyLinkedListValue"] = "doublyLinkedListValue" - - class NullValue(UniversalBaseModel): - type: typing.Literal["nullValue"] = "nullValue" - - -update_forward_refs(_VariableValue.MapValue) -update_forward_refs(_VariableValue.ListValue) -update_forward_refs(VariableValue) +__all__ = ["VariableValue"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/__init__.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/__init__.py index c53a83b40f4..439d8326575 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/__init__.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/__init__.py @@ -6,6 +6,13 @@ from .resources import ( A, Acai, + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, Animal, Berry, BranchNode, @@ -14,6 +21,19 @@ ContainerValue_List, ContainerValue_Optional, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, FieldName, FieldValue, FieldValue_ContainerValue, @@ -21,11 +41,31 @@ FieldValue_PrimitiveValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, PrimitiveValue, a, ast, @@ -35,6 +75,13 @@ __all__ = [ "A", "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", "Animal", "Berry", "BranchNode", @@ -43,6 +90,19 @@ "ContainerValue_List", "ContainerValue_Optional", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", "FieldName", "FieldValue", "FieldValue_ContainerValue", @@ -50,12 +110,32 @@ "FieldValue_PrimitiveValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", "ImportingA", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", "PrimitiveValue", "RootType", "a", diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/__init__.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/__init__.py index 80b9a6e537f..c8f7e3eea46 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/__init__.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/__init__.py @@ -6,6 +6,13 @@ from .a import A from .ast import ( Acai, + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, Animal, Berry, BranchNode, @@ -14,6 +21,19 @@ ContainerValue_List, ContainerValue_Optional, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, FieldName, FieldValue, FieldValue_ContainerValue, @@ -21,17 +41,44 @@ FieldValue_PrimitiveValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, PrimitiveValue, ) __all__ = [ "A", "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", "Animal", "Berry", "BranchNode", @@ -40,6 +87,19 @@ "ContainerValue_List", "ContainerValue_Optional", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", "FieldName", "FieldValue", "FieldValue_ContainerValue", @@ -47,11 +107,31 @@ "FieldValue_PrimitiveValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", "PrimitiveValue", "a", "ast", diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/__init__.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/__init__.py index 1a7e748724d..6db0c20963d 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/__init__.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/__init__.py @@ -2,19 +2,61 @@ # isort: skip_file -from .acai import Acai -from .animal import Animal -from .berry import Berry -from .branch_node import BranchNode -from .cat import Cat -from .container_value import ContainerValue, ContainerValue_List, ContainerValue_Optional -from .dog import Dog +from .acai_all import Acai, Animal, Berry, Cat, Dog, Fig, Fruit +from .and_operator_all import ( + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, +) +from .branch_node_all import BranchNode, Node +from .container_value_all import ( + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, +) from .field_name import FieldName -from .field_value import FieldValue, FieldValue_ContainerValue, FieldValue_ObjectValue, FieldValue_PrimitiveValue -from .fig import Fig -from .fruit import Fruit from .leaf_node import LeafNode -from .node import Node from .nodes_wrapper import NodesWrapper from .object_field_value import ObjectFieldValue from .object_value import ObjectValue @@ -22,6 +64,13 @@ __all__ = [ "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", "Animal", "Berry", "BranchNode", @@ -30,6 +79,19 @@ "ContainerValue_List", "ContainerValue_Optional", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", "FieldName", "FieldValue", "FieldValue_ContainerValue", @@ -37,10 +99,30 @@ "FieldValue_PrimitiveValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", "PrimitiveValue", ] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/acai.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/acai.py index 80f59ceac55..06dc06d5aa6 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/acai.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/acai.py @@ -1,16 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import typing +from .acai_all import Acai as Acai -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2 -from .berry import Berry - - -class Acai(Berry): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow +__all__ = ["Acai"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/acai_all.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/acai_all.py new file mode 100644 index 00000000000..cf15b44d543 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/acai_all.py @@ -0,0 +1,83 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .acai import Acai as resources_ast_acai_Acai + from .cat import Cat as resources_ast_cat_Cat + from .dog import Dog as resources_ast_dog_Dog + from .fig import Fig as resources_ast_fig_Fig + + +class Acai(resources_ast_berry_Berry): + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +Animal = typing.Union["resources_ast_cat_Cat", "resources_ast_dog_Dog"] + + +class Berry(UniversalBaseModel): + animal: "resources_ast_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class Cat(UniversalBaseModel): + fruit: "resources_ast_fruit_Fruit" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class Dog(UniversalBaseModel): + fruit: "resources_ast_fruit_Fruit" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .fig import Fig as resources_ast_fig_Fig # noqa: E402, F401, I001 +from .fruit import Fruit as resources_ast_fruit_Fruit # noqa: E402, F401, I001 + + +class Fig(UniversalBaseModel): + animal: "resources_ast_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .berry import Berry as resources_ast_berry_Berry # noqa: E402, F401, I001 +from .acai import Acai as resources_ast_acai_Acai # noqa: E402, F401, I001 +from .cat import Cat as resources_ast_cat_Cat # noqa: E402, F401, I001 +from .dog import Dog as resources_ast_dog_Dog # noqa: E402, F401, I001 +from .animal import Animal as resources_ast_animal_Animal # noqa: E402, F401, I001 + +Fruit = typing.Union["resources_ast_acai_Acai", "resources_ast_fig_Fig"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/and_operator.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/and_operator.py new file mode 100644 index 00000000000..f3c921a6c39 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/and_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperator as AndOperator + +__all__ = ["AndOperator"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/and_operator_all.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/and_operator_all.py new file mode 100644 index 00000000000..c35103109ad --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/and_operator_all.py @@ -0,0 +1,458 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class AndOperator(UniversalBaseModel): + """ + Deep circular reference pattern mimicking elevenlabs AST operators + """ + + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class AndOperatorChild_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class AndOperatorChild_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class AndOperatorChild_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class AndOperatorChild_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class AndOperatorChild_BooleanLiteral(UniversalBaseModel): + value: bool + type: typing.Literal["boolean_literal"] = "boolean_literal" + + +AndOperatorChild = typing.Union[ + AndOperatorChild_AndOperator, + AndOperatorChild_OrOperator, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_BooleanLiteral, +] + + +class EqualsOperator(UniversalBaseModel): + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_StringLiteral(UniversalBaseModel): + value: str + type: typing.Literal["string_literal"] = "string_literal" + + +EqualsOperatorLeft = typing.Union[ + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_StringLiteral, +] + + +class EqualsOperatorRight_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_StringLiteral(UniversalBaseModel): + value: str + type: typing.Literal["string_literal"] = "string_literal" + + +EqualsOperatorRight = typing.Union[ + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_StringLiteral, +] + + +class GreaterThanOperator(UniversalBaseModel): + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_NumberLiteral(UniversalBaseModel): + value: float + type: typing.Literal["number_literal"] = "number_literal" + + +GreaterThanOperatorLeft = typing.Union[ + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, +] + + +class GreaterThanOperatorRight_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_NumberLiteral(UniversalBaseModel): + value: float + type: typing.Literal["number_literal"] = "number_literal" + + +GreaterThanOperatorRight = typing.Union[ + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_OrOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, +] + + +class OrOperator(UniversalBaseModel): + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class OrOperatorChild_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class OrOperatorChild_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class OrOperatorChild_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class OrOperatorChild_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .equals_operator import EqualsOperator as resources_ast_equals_operator_EqualsOperator # noqa: E402, F401, I001 +from .greater_than_operator import GreaterThanOperator as resources_ast_greater_than_operator_GreaterThanOperator # noqa: E402, F401, I001 +from .or_operator import OrOperator as resources_ast_or_operator_OrOperator # noqa: E402, F401, I001 +from .and_operator import AndOperator as resources_ast_and_operator_AndOperator # noqa: E402, F401, I001 + + +class OrOperatorChild_BooleanLiteral(UniversalBaseModel): + value: bool + type: typing.Literal["boolean_literal"] = "boolean_literal" + + +OrOperatorChild = typing.Union[ + OrOperatorChild_AndOperator, + OrOperatorChild_OrOperator, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_BooleanLiteral, +] +from .and_operator_child import AndOperatorChild as resources_ast_and_operator_child_AndOperatorChild # noqa: E402, F401, I001 +from .or_operator_child import OrOperatorChild as resources_ast_or_operator_child_OrOperatorChild # noqa: E402, F401, I001 +from .equals_operator_left import EqualsOperatorLeft as resources_ast_equals_operator_left_EqualsOperatorLeft # noqa: E402, F401, I001 +from .equals_operator_right import EqualsOperatorRight as resources_ast_equals_operator_right_EqualsOperatorRight # noqa: E402, F401, I001 +from .greater_than_operator_left import ( + GreaterThanOperatorLeft as resources_ast_greater_than_operator_left_GreaterThanOperatorLeft, +) # noqa: E402, F401, I001 +from .greater_than_operator_right import ( + GreaterThanOperatorRight as resources_ast_greater_than_operator_right_GreaterThanOperatorRight, +) # noqa: E402, F401, I001 diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/and_operator_child.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/and_operator_child.py new file mode 100644 index 00000000000..0c043b87dbb --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/and_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperatorChild as AndOperatorChild + +__all__ = ["AndOperatorChild"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/animal.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/animal.py index ce527295dff..bc07c7d3b20 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/animal.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/animal.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Animal as Animal -import typing - -if typing.TYPE_CHECKING: - from .cat import Cat - from .dog import Dog -Animal = typing.Union["Cat", "Dog"] +__all__ = ["Animal"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/berry.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/berry.py index 35cd2f2f45b..1131a180b1a 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/berry.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/berry.py @@ -1,28 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Berry as Berry -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Berry(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Berry) +__all__ = ["Berry"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/branch_node.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/branch_node.py index a8379bb539d..e53f75d7362 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/branch_node.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/branch_node.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .branch_node_all import BranchNode as BranchNode -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class BranchNode(UniversalBaseModel): - children: typing.List["Node"] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .node import Node # noqa: E402, F401, I001 - -update_forward_refs(BranchNode) +__all__ = ["BranchNode"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/branch_node_all.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/branch_node_all.py new file mode 100644 index 00000000000..8fd76b0671e --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/branch_node_all.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .leaf_node import LeafNode + +if typing.TYPE_CHECKING: + from .branch_node import BranchNode as resources_ast_branch_node_BranchNode + + +class BranchNode(UniversalBaseModel): + children: typing.List["resources_ast_node_Node"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .branch_node import BranchNode as resources_ast_branch_node_BranchNode # noqa: E402, F401, I001 +from .node import Node as resources_ast_node_Node # noqa: E402, F401, I001 + +Node = typing.Union["resources_ast_branch_node_BranchNode", LeafNode] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/cat.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/cat.py index d16d91b4c52..3d1211c6497 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/cat.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/cat.py @@ -1,28 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Cat as Cat -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Cat(UniversalBaseModel): - fruit: "Fruit" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .berry import Berry # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .fruit import Fruit # noqa: E402, F401, I001 - -update_forward_refs(Cat) +__all__ = ["Cat"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/container_value.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/container_value.py index 488658dfe89..d3b9fbcdba7 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/container_value.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/container_value.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -from ...core.pydantic_utilities import UniversalBaseModel, update_forward_refs - - -class ContainerValue_List(UniversalBaseModel): - value: typing.List["FieldValue"] - type: typing.Literal["list"] = "list" - - -class ContainerValue_Optional(UniversalBaseModel): - value: typing.Optional["FieldValue"] = None - type: typing.Literal["optional"] = "optional" - - -ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] -from .field_value import FieldValue # noqa: E402, F401, I001 - -update_forward_refs(ContainerValue_List) -update_forward_refs(ContainerValue_Optional) +__all__ = ["ContainerValue"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/container_value_all.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/container_value_all.py new file mode 100644 index 00000000000..74125e7c7ef --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/container_value_all.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs +from .primitive_value import PrimitiveValue + + +class ContainerValue_List(UniversalBaseModel): + value: typing.List["resources_ast_field_value_FieldValue"] + type: typing.Literal["list"] = "list" + + +class ContainerValue_Optional(UniversalBaseModel): + value: typing.Optional["resources_ast_field_value_FieldValue"] = None + type: typing.Literal["optional"] = "optional" + + +ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] +from .field_value import FieldValue as resources_ast_field_value_FieldValue # noqa: E402, F401, I001 + + +class FieldValue_PrimitiveValue(UniversalBaseModel): + value: PrimitiveValue + type: typing.Literal["primitive_value"] = "primitive_value" + + +class FieldValue_ObjectValue(UniversalBaseModel): + type: typing.Literal["object_value"] = "object_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class FieldValue_ContainerValue(UniversalBaseModel): + value: "resources_ast_container_value_ContainerValue" + type: typing.Literal["container_value"] = "container_value" + + +FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] +from .container_value import ContainerValue as resources_ast_container_value_ContainerValue # noqa: E402, F401, I001 + +update_forward_refs(ContainerValue_List) +update_forward_refs(ContainerValue_Optional) +update_forward_refs(FieldValue_ContainerValue) diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/dog.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/dog.py index ccd6d40a768..bc696fce765 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/dog.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/dog.py @@ -1,28 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Dog as Dog -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Dog(UniversalBaseModel): - fruit: "Fruit" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .berry import Berry # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .fruit import Fruit # noqa: E402, F401, I001 - -update_forward_refs(Dog) +__all__ = ["Dog"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/equals_operator.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/equals_operator.py new file mode 100644 index 00000000000..3a95724f67a --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/equals_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperator as EqualsOperator + +__all__ = ["EqualsOperator"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/equals_operator_left.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/equals_operator_left.py new file mode 100644 index 00000000000..53901b8504e --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/equals_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorLeft as EqualsOperatorLeft + +__all__ = ["EqualsOperatorLeft"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/equals_operator_right.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/equals_operator_right.py new file mode 100644 index 00000000000..4348ffe8d3f --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/equals_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorRight as EqualsOperatorRight + +__all__ = ["EqualsOperatorRight"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/field_value.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/field_value.py index d52fbfd0757..88d4a5e9c2d 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/field_value.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/field_value.py @@ -1,36 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .primitive_value import PrimitiveValue - - -class FieldValue_PrimitiveValue(UniversalBaseModel): - value: PrimitiveValue - type: typing.Literal["primitive_value"] = "primitive_value" - - -class FieldValue_ObjectValue(UniversalBaseModel): - type: typing.Literal["object_value"] = "object_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class FieldValue_ContainerValue(UniversalBaseModel): - value: "ContainerValue" - type: typing.Literal["container_value"] = "container_value" - - -FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] -from .container_value import ContainerValue # noqa: E402, F401, I001 - -update_forward_refs(FieldValue_ContainerValue) +__all__ = ["FieldValue"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/fig.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/fig.py index f2c5b83eb79..cf5006340ba 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/fig.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/fig.py @@ -1,28 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Fig as Fig -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Fig(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .berry import Berry # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Fig) +__all__ = ["Fig"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/fruit.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/fruit.py index 0a4a5e8b439..6f9ff11e1b4 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/fruit.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/fruit.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Fruit as Fruit -import typing - -if typing.TYPE_CHECKING: - from .acai import Acai - from .fig import Fig -Fruit = typing.Union["Acai", "Fig"] +__all__ = ["Fruit"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/greater_than_operator.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/greater_than_operator.py new file mode 100644 index 00000000000..56a53f19013 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/greater_than_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperator as GreaterThanOperator + +__all__ = ["GreaterThanOperator"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/greater_than_operator_left.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/greater_than_operator_left.py new file mode 100644 index 00000000000..0958d95ca84 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/greater_than_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorLeft as GreaterThanOperatorLeft + +__all__ = ["GreaterThanOperatorLeft"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/greater_than_operator_right.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/greater_than_operator_right.py new file mode 100644 index 00000000000..20234cb9d0e --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/greater_than_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorRight as GreaterThanOperatorRight + +__all__ = ["GreaterThanOperatorRight"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/node.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/node.py index 50575ba6722..f8d6f92d33c 100644 --- a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/node.py +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/node.py @@ -1,11 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .branch_node_all import Node as Node -import typing - -from .leaf_node import LeafNode - -if typing.TYPE_CHECKING: - from .branch_node import BranchNode -Node = typing.Union["BranchNode", LeafNode] +__all__ = ["Node"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/or_operator.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/or_operator.py new file mode 100644 index 00000000000..04bc907e4c8 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/or_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperator as OrOperator + +__all__ = ["OrOperator"] diff --git a/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/or_operator_child.py b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/or_operator_child.py new file mode 100644 index 00000000000..49d1ffed627 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-custom-config/src/seed/api/resources/ast/or_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperatorChild as OrOperatorChild + +__all__ = ["OrOperatorChild"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/__init__.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/__init__.py index c53a83b40f4..439d8326575 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/__init__.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/__init__.py @@ -6,6 +6,13 @@ from .resources import ( A, Acai, + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, Animal, Berry, BranchNode, @@ -14,6 +21,19 @@ ContainerValue_List, ContainerValue_Optional, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, FieldName, FieldValue, FieldValue_ContainerValue, @@ -21,11 +41,31 @@ FieldValue_PrimitiveValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, PrimitiveValue, a, ast, @@ -35,6 +75,13 @@ __all__ = [ "A", "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", "Animal", "Berry", "BranchNode", @@ -43,6 +90,19 @@ "ContainerValue_List", "ContainerValue_Optional", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", "FieldName", "FieldValue", "FieldValue_ContainerValue", @@ -50,12 +110,32 @@ "FieldValue_PrimitiveValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", "ImportingA", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", "PrimitiveValue", "RootType", "a", diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/__init__.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/__init__.py index 80b9a6e537f..c8f7e3eea46 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/__init__.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/__init__.py @@ -6,6 +6,13 @@ from .a import A from .ast import ( Acai, + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, Animal, Berry, BranchNode, @@ -14,6 +21,19 @@ ContainerValue_List, ContainerValue_Optional, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, FieldName, FieldValue, FieldValue_ContainerValue, @@ -21,17 +41,44 @@ FieldValue_PrimitiveValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, PrimitiveValue, ) __all__ = [ "A", "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", "Animal", "Berry", "BranchNode", @@ -40,6 +87,19 @@ "ContainerValue_List", "ContainerValue_Optional", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", "FieldName", "FieldValue", "FieldValue_ContainerValue", @@ -47,11 +107,31 @@ "FieldValue_PrimitiveValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", "PrimitiveValue", "a", "ast", diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/__init__.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/__init__.py index 1a7e748724d..6db0c20963d 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/__init__.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/__init__.py @@ -2,19 +2,61 @@ # isort: skip_file -from .acai import Acai -from .animal import Animal -from .berry import Berry -from .branch_node import BranchNode -from .cat import Cat -from .container_value import ContainerValue, ContainerValue_List, ContainerValue_Optional -from .dog import Dog +from .acai_all import Acai, Animal, Berry, Cat, Dog, Fig, Fruit +from .and_operator_all import ( + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, +) +from .branch_node_all import BranchNode, Node +from .container_value_all import ( + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, +) from .field_name import FieldName -from .field_value import FieldValue, FieldValue_ContainerValue, FieldValue_ObjectValue, FieldValue_PrimitiveValue -from .fig import Fig -from .fruit import Fruit from .leaf_node import LeafNode -from .node import Node from .nodes_wrapper import NodesWrapper from .object_field_value import ObjectFieldValue from .object_value import ObjectValue @@ -22,6 +64,13 @@ __all__ = [ "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", "Animal", "Berry", "BranchNode", @@ -30,6 +79,19 @@ "ContainerValue_List", "ContainerValue_Optional", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", "FieldName", "FieldValue", "FieldValue_ContainerValue", @@ -37,10 +99,30 @@ "FieldValue_PrimitiveValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", "PrimitiveValue", ] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/acai.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/acai.py index 88f2b3466d8..06dc06d5aa6 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/acai.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/acai.py @@ -1,28 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Acai as Acai -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Acai(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .berry import Berry # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Acai) +__all__ = ["Acai"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/acai_all.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/acai_all.py new file mode 100644 index 00000000000..4088d4264a2 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/acai_all.py @@ -0,0 +1,85 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .acai import Acai as resources_ast_acai_Acai + from .cat import Cat as resources_ast_cat_Cat + from .dog import Dog as resources_ast_dog_Dog + from .fig import Fig as resources_ast_fig_Fig + + +class Acai(UniversalBaseModel): + animal: "resources_ast_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +Animal = typing.Union["resources_ast_cat_Cat", "resources_ast_dog_Dog"] + + +class Berry(UniversalBaseModel): + animal: "resources_ast_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class Cat(UniversalBaseModel): + fruit: "resources_ast_fruit_Fruit" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class Dog(UniversalBaseModel): + fruit: "resources_ast_fruit_Fruit" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .fig import Fig as resources_ast_fig_Fig # noqa: E402, F401, I001 +from .fruit import Fruit as resources_ast_fruit_Fruit # noqa: E402, F401, I001 + + +class Fig(UniversalBaseModel): + animal: "resources_ast_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .berry import Berry as resources_ast_berry_Berry # noqa: E402, F401, I001 +from .cat import Cat as resources_ast_cat_Cat # noqa: E402, F401, I001 +from .dog import Dog as resources_ast_dog_Dog # noqa: E402, F401, I001 +from .animal import Animal as resources_ast_animal_Animal # noqa: E402, F401, I001 +from .acai import Acai as resources_ast_acai_Acai # noqa: E402, F401, I001 + +Fruit = typing.Union["resources_ast_acai_Acai", "resources_ast_fig_Fig"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/and_operator.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/and_operator.py new file mode 100644 index 00000000000..f3c921a6c39 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/and_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperator as AndOperator + +__all__ = ["AndOperator"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/and_operator_all.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/and_operator_all.py new file mode 100644 index 00000000000..c35103109ad --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/and_operator_all.py @@ -0,0 +1,458 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class AndOperator(UniversalBaseModel): + """ + Deep circular reference pattern mimicking elevenlabs AST operators + """ + + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class AndOperatorChild_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class AndOperatorChild_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class AndOperatorChild_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class AndOperatorChild_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class AndOperatorChild_BooleanLiteral(UniversalBaseModel): + value: bool + type: typing.Literal["boolean_literal"] = "boolean_literal" + + +AndOperatorChild = typing.Union[ + AndOperatorChild_AndOperator, + AndOperatorChild_OrOperator, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_BooleanLiteral, +] + + +class EqualsOperator(UniversalBaseModel): + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_StringLiteral(UniversalBaseModel): + value: str + type: typing.Literal["string_literal"] = "string_literal" + + +EqualsOperatorLeft = typing.Union[ + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_StringLiteral, +] + + +class EqualsOperatorRight_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_StringLiteral(UniversalBaseModel): + value: str + type: typing.Literal["string_literal"] = "string_literal" + + +EqualsOperatorRight = typing.Union[ + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_StringLiteral, +] + + +class GreaterThanOperator(UniversalBaseModel): + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_NumberLiteral(UniversalBaseModel): + value: float + type: typing.Literal["number_literal"] = "number_literal" + + +GreaterThanOperatorLeft = typing.Union[ + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, +] + + +class GreaterThanOperatorRight_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_NumberLiteral(UniversalBaseModel): + value: float + type: typing.Literal["number_literal"] = "number_literal" + + +GreaterThanOperatorRight = typing.Union[ + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_OrOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, +] + + +class OrOperator(UniversalBaseModel): + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class OrOperatorChild_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["resources_ast_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class OrOperatorChild_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["resources_ast_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class OrOperatorChild_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "resources_ast_equals_operator_left_EqualsOperatorLeft" + right: "resources_ast_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class OrOperatorChild_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "resources_ast_greater_than_operator_left_GreaterThanOperatorLeft" + right: "resources_ast_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .equals_operator import EqualsOperator as resources_ast_equals_operator_EqualsOperator # noqa: E402, F401, I001 +from .greater_than_operator import GreaterThanOperator as resources_ast_greater_than_operator_GreaterThanOperator # noqa: E402, F401, I001 +from .or_operator import OrOperator as resources_ast_or_operator_OrOperator # noqa: E402, F401, I001 +from .and_operator import AndOperator as resources_ast_and_operator_AndOperator # noqa: E402, F401, I001 + + +class OrOperatorChild_BooleanLiteral(UniversalBaseModel): + value: bool + type: typing.Literal["boolean_literal"] = "boolean_literal" + + +OrOperatorChild = typing.Union[ + OrOperatorChild_AndOperator, + OrOperatorChild_OrOperator, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_BooleanLiteral, +] +from .and_operator_child import AndOperatorChild as resources_ast_and_operator_child_AndOperatorChild # noqa: E402, F401, I001 +from .or_operator_child import OrOperatorChild as resources_ast_or_operator_child_OrOperatorChild # noqa: E402, F401, I001 +from .equals_operator_left import EqualsOperatorLeft as resources_ast_equals_operator_left_EqualsOperatorLeft # noqa: E402, F401, I001 +from .equals_operator_right import EqualsOperatorRight as resources_ast_equals_operator_right_EqualsOperatorRight # noqa: E402, F401, I001 +from .greater_than_operator_left import ( + GreaterThanOperatorLeft as resources_ast_greater_than_operator_left_GreaterThanOperatorLeft, +) # noqa: E402, F401, I001 +from .greater_than_operator_right import ( + GreaterThanOperatorRight as resources_ast_greater_than_operator_right_GreaterThanOperatorRight, +) # noqa: E402, F401, I001 diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/and_operator_child.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/and_operator_child.py new file mode 100644 index 00000000000..0c043b87dbb --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/and_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperatorChild as AndOperatorChild + +__all__ = ["AndOperatorChild"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/animal.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/animal.py index ce527295dff..bc07c7d3b20 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/animal.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/animal.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Animal as Animal -import typing - -if typing.TYPE_CHECKING: - from .cat import Cat - from .dog import Dog -Animal = typing.Union["Cat", "Dog"] +__all__ = ["Animal"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/berry.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/berry.py index 35cd2f2f45b..1131a180b1a 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/berry.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/berry.py @@ -1,28 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Berry as Berry -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Berry(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Berry) +__all__ = ["Berry"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/branch_node.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/branch_node.py index a8379bb539d..e53f75d7362 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/branch_node.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/branch_node.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .branch_node_all import BranchNode as BranchNode -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class BranchNode(UniversalBaseModel): - children: typing.List["Node"] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .node import Node # noqa: E402, F401, I001 - -update_forward_refs(BranchNode) +__all__ = ["BranchNode"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/branch_node_all.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/branch_node_all.py new file mode 100644 index 00000000000..8fd76b0671e --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/branch_node_all.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .leaf_node import LeafNode + +if typing.TYPE_CHECKING: + from .branch_node import BranchNode as resources_ast_branch_node_BranchNode + + +class BranchNode(UniversalBaseModel): + children: typing.List["resources_ast_node_Node"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .branch_node import BranchNode as resources_ast_branch_node_BranchNode # noqa: E402, F401, I001 +from .node import Node as resources_ast_node_Node # noqa: E402, F401, I001 + +Node = typing.Union["resources_ast_branch_node_BranchNode", LeafNode] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/cat.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/cat.py index d16d91b4c52..3d1211c6497 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/cat.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/cat.py @@ -1,28 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Cat as Cat -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Cat(UniversalBaseModel): - fruit: "Fruit" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .berry import Berry # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .fruit import Fruit # noqa: E402, F401, I001 - -update_forward_refs(Cat) +__all__ = ["Cat"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value.py index 488658dfe89..d3b9fbcdba7 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -from ...core.pydantic_utilities import UniversalBaseModel, update_forward_refs - - -class ContainerValue_List(UniversalBaseModel): - value: typing.List["FieldValue"] - type: typing.Literal["list"] = "list" - - -class ContainerValue_Optional(UniversalBaseModel): - value: typing.Optional["FieldValue"] = None - type: typing.Literal["optional"] = "optional" - - -ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] -from .field_value import FieldValue # noqa: E402, F401, I001 - -update_forward_refs(ContainerValue_List) -update_forward_refs(ContainerValue_Optional) +__all__ = ["ContainerValue"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value_all.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value_all.py new file mode 100644 index 00000000000..74125e7c7ef --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value_all.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs +from .primitive_value import PrimitiveValue + + +class ContainerValue_List(UniversalBaseModel): + value: typing.List["resources_ast_field_value_FieldValue"] + type: typing.Literal["list"] = "list" + + +class ContainerValue_Optional(UniversalBaseModel): + value: typing.Optional["resources_ast_field_value_FieldValue"] = None + type: typing.Literal["optional"] = "optional" + + +ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] +from .field_value import FieldValue as resources_ast_field_value_FieldValue # noqa: E402, F401, I001 + + +class FieldValue_PrimitiveValue(UniversalBaseModel): + value: PrimitiveValue + type: typing.Literal["primitive_value"] = "primitive_value" + + +class FieldValue_ObjectValue(UniversalBaseModel): + type: typing.Literal["object_value"] = "object_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class FieldValue_ContainerValue(UniversalBaseModel): + value: "resources_ast_container_value_ContainerValue" + type: typing.Literal["container_value"] = "container_value" + + +FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] +from .container_value import ContainerValue as resources_ast_container_value_ContainerValue # noqa: E402, F401, I001 + +update_forward_refs(ContainerValue_List) +update_forward_refs(ContainerValue_Optional) +update_forward_refs(FieldValue_ContainerValue) diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/dog.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/dog.py index ccd6d40a768..bc696fce765 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/dog.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/dog.py @@ -1,28 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Dog as Dog -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Dog(UniversalBaseModel): - fruit: "Fruit" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .berry import Berry # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .fruit import Fruit # noqa: E402, F401, I001 - -update_forward_refs(Dog) +__all__ = ["Dog"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/equals_operator.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/equals_operator.py new file mode 100644 index 00000000000..3a95724f67a --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/equals_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperator as EqualsOperator + +__all__ = ["EqualsOperator"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/equals_operator_left.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/equals_operator_left.py new file mode 100644 index 00000000000..53901b8504e --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/equals_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorLeft as EqualsOperatorLeft + +__all__ = ["EqualsOperatorLeft"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/equals_operator_right.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/equals_operator_right.py new file mode 100644 index 00000000000..4348ffe8d3f --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/equals_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorRight as EqualsOperatorRight + +__all__ = ["EqualsOperatorRight"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/field_value.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/field_value.py index d52fbfd0757..88d4a5e9c2d 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/field_value.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/field_value.py @@ -1,36 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .primitive_value import PrimitiveValue - - -class FieldValue_PrimitiveValue(UniversalBaseModel): - value: PrimitiveValue - type: typing.Literal["primitive_value"] = "primitive_value" - - -class FieldValue_ObjectValue(UniversalBaseModel): - type: typing.Literal["object_value"] = "object_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class FieldValue_ContainerValue(UniversalBaseModel): - value: "ContainerValue" - type: typing.Literal["container_value"] = "container_value" - - -FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] -from .container_value import ContainerValue # noqa: E402, F401, I001 - -update_forward_refs(FieldValue_ContainerValue) +__all__ = ["FieldValue"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/fig.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/fig.py index f2c5b83eb79..cf5006340ba 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/fig.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/fig.py @@ -1,28 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Fig as Fig -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Fig(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .berry import Berry # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Fig) +__all__ = ["Fig"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/fruit.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/fruit.py index 0a4a5e8b439..6f9ff11e1b4 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/fruit.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/fruit.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Fruit as Fruit -import typing - -if typing.TYPE_CHECKING: - from .acai import Acai - from .fig import Fig -Fruit = typing.Union["Acai", "Fig"] +__all__ = ["Fruit"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/greater_than_operator.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/greater_than_operator.py new file mode 100644 index 00000000000..56a53f19013 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/greater_than_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperator as GreaterThanOperator + +__all__ = ["GreaterThanOperator"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/greater_than_operator_left.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/greater_than_operator_left.py new file mode 100644 index 00000000000..0958d95ca84 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/greater_than_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorLeft as GreaterThanOperatorLeft + +__all__ = ["GreaterThanOperatorLeft"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/greater_than_operator_right.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/greater_than_operator_right.py new file mode 100644 index 00000000000..20234cb9d0e --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/greater_than_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorRight as GreaterThanOperatorRight + +__all__ = ["GreaterThanOperatorRight"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/node.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/node.py index 50575ba6722..f8d6f92d33c 100644 --- a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/node.py +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/node.py @@ -1,11 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .branch_node_all import Node as Node -import typing - -from .leaf_node import LeafNode - -if typing.TYPE_CHECKING: - from .branch_node import BranchNode -Node = typing.Union["BranchNode", LeafNode] +__all__ = ["Node"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/or_operator.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/or_operator.py new file mode 100644 index 00000000000..04bc907e4c8 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/or_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperator as OrOperator + +__all__ = ["OrOperator"] diff --git a/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/or_operator_child.py b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/or_operator_child.py new file mode 100644 index 00000000000..49d1ffed627 --- /dev/null +++ b/seed/pydantic/circular-references-advanced/no-inheritance-for-extended-models/src/seed/api/resources/ast/or_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperatorChild as OrOperatorChild + +__all__ = ["OrOperatorChild"] diff --git a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/__init__.py b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/__init__.py index 8240ece24e6..73d0665dabc 100644 --- a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/__init__.py +++ b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/__init__.py @@ -2,14 +2,19 @@ # isort: skip_file -from .container_value import ContainerValue, ContainerValue_List, ContainerValue_Optional -from .field_value import FieldValue, FieldValue_ContainerValue, FieldValue_ObjectValue, FieldValue_PrimitiveValue +from .container_value_all import ( + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, +) from .json_like import JsonLike from .object_value import ObjectValue from .primitive_value import PrimitiveValue -from .t import T -from .tor_u import TorU -from .u import U +from .t_all import T, TorU, U __all__ = [ "ContainerValue", diff --git a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/container_value.py b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/container_value.py index 488658dfe89..d3b9fbcdba7 100644 --- a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/container_value.py +++ b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/container_value.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -from ...core.pydantic_utilities import UniversalBaseModel, update_forward_refs - - -class ContainerValue_List(UniversalBaseModel): - value: typing.List["FieldValue"] - type: typing.Literal["list"] = "list" - - -class ContainerValue_Optional(UniversalBaseModel): - value: typing.Optional["FieldValue"] = None - type: typing.Literal["optional"] = "optional" - - -ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] -from .field_value import FieldValue # noqa: E402, F401, I001 - -update_forward_refs(ContainerValue_List) -update_forward_refs(ContainerValue_Optional) +__all__ = ["ContainerValue"] diff --git a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/container_value_all.py b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/container_value_all.py new file mode 100644 index 00000000000..74125e7c7ef --- /dev/null +++ b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/container_value_all.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs +from .primitive_value import PrimitiveValue + + +class ContainerValue_List(UniversalBaseModel): + value: typing.List["resources_ast_field_value_FieldValue"] + type: typing.Literal["list"] = "list" + + +class ContainerValue_Optional(UniversalBaseModel): + value: typing.Optional["resources_ast_field_value_FieldValue"] = None + type: typing.Literal["optional"] = "optional" + + +ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] +from .field_value import FieldValue as resources_ast_field_value_FieldValue # noqa: E402, F401, I001 + + +class FieldValue_PrimitiveValue(UniversalBaseModel): + value: PrimitiveValue + type: typing.Literal["primitive_value"] = "primitive_value" + + +class FieldValue_ObjectValue(UniversalBaseModel): + type: typing.Literal["object_value"] = "object_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class FieldValue_ContainerValue(UniversalBaseModel): + value: "resources_ast_container_value_ContainerValue" + type: typing.Literal["container_value"] = "container_value" + + +FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] +from .container_value import ContainerValue as resources_ast_container_value_ContainerValue # noqa: E402, F401, I001 + +update_forward_refs(ContainerValue_List) +update_forward_refs(ContainerValue_Optional) +update_forward_refs(FieldValue_ContainerValue) diff --git a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/field_value.py b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/field_value.py index d52fbfd0757..88d4a5e9c2d 100644 --- a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/field_value.py +++ b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/field_value.py @@ -1,36 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .primitive_value import PrimitiveValue - - -class FieldValue_PrimitiveValue(UniversalBaseModel): - value: PrimitiveValue - type: typing.Literal["primitive_value"] = "primitive_value" - - -class FieldValue_ObjectValue(UniversalBaseModel): - type: typing.Literal["object_value"] = "object_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class FieldValue_ContainerValue(UniversalBaseModel): - value: "ContainerValue" - type: typing.Literal["container_value"] = "container_value" - - -FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] -from .container_value import ContainerValue # noqa: E402, F401, I001 - -update_forward_refs(FieldValue_ContainerValue) +__all__ = ["FieldValue"] diff --git a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/t.py b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/t.py index 6f8ccdda576..7890c29fb10 100644 --- a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/t.py +++ b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/t.py @@ -1,25 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import T as T -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class T(UniversalBaseModel): - child: "TorU" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .u import U # noqa: E402, F401, I001 -from .tor_u import TorU # noqa: E402, F401, I001 - -update_forward_refs(T) +__all__ = ["T"] diff --git a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/t_all.py b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/t_all.py new file mode 100644 index 00000000000..95554fe0486 --- /dev/null +++ b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/t_all.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .t import T as resources_ast_t_T + from .u import U as resources_ast_u_U + + +class T(UniversalBaseModel): + child: "resources_ast_tor_u_TorU" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .u import U as resources_ast_u_U # noqa: E402, F401, I001 +from .tor_u import TorU as resources_ast_tor_u_TorU # noqa: E402, F401, I001 + +TorU = typing.Union["resources_ast_t_T", "resources_ast_u_U"] + + +class U(UniversalBaseModel): + child: "resources_ast_t_T" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .t import T as resources_ast_t_T # noqa: E402, F401, I001 diff --git a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/tor_u.py b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/tor_u.py index 5409b5f1551..fd9fb53be9a 100644 --- a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/tor_u.py +++ b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/tor_u.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import TorU as TorU -import typing - -if typing.TYPE_CHECKING: - from .t import T - from .u import U -TorU = typing.Union["T", "U"] +__all__ = ["TorU"] diff --git a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/u.py b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/u.py index 8d038a2bcd3..85016723b61 100644 --- a/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/u.py +++ b/seed/pydantic/circular-references/no-custom-config/src/seed/api/resources/ast/u.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import U as U -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class U(UniversalBaseModel): - child: "T" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .t import T # noqa: E402, F401, I001 - -update_forward_refs(U) +__all__ = ["U"] diff --git a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/__init__.py b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/__init__.py index 8240ece24e6..73d0665dabc 100644 --- a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/__init__.py +++ b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/__init__.py @@ -2,14 +2,19 @@ # isort: skip_file -from .container_value import ContainerValue, ContainerValue_List, ContainerValue_Optional -from .field_value import FieldValue, FieldValue_ContainerValue, FieldValue_ObjectValue, FieldValue_PrimitiveValue +from .container_value_all import ( + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, +) from .json_like import JsonLike from .object_value import ObjectValue from .primitive_value import PrimitiveValue -from .t import T -from .tor_u import TorU -from .u import U +from .t_all import T, TorU, U __all__ = [ "ContainerValue", diff --git a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value.py b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value.py index 488658dfe89..d3b9fbcdba7 100644 --- a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value.py +++ b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -from ...core.pydantic_utilities import UniversalBaseModel, update_forward_refs - - -class ContainerValue_List(UniversalBaseModel): - value: typing.List["FieldValue"] - type: typing.Literal["list"] = "list" - - -class ContainerValue_Optional(UniversalBaseModel): - value: typing.Optional["FieldValue"] = None - type: typing.Literal["optional"] = "optional" - - -ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] -from .field_value import FieldValue # noqa: E402, F401, I001 - -update_forward_refs(ContainerValue_List) -update_forward_refs(ContainerValue_Optional) +__all__ = ["ContainerValue"] diff --git a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value_all.py b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value_all.py new file mode 100644 index 00000000000..74125e7c7ef --- /dev/null +++ b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/container_value_all.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs +from .primitive_value import PrimitiveValue + + +class ContainerValue_List(UniversalBaseModel): + value: typing.List["resources_ast_field_value_FieldValue"] + type: typing.Literal["list"] = "list" + + +class ContainerValue_Optional(UniversalBaseModel): + value: typing.Optional["resources_ast_field_value_FieldValue"] = None + type: typing.Literal["optional"] = "optional" + + +ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] +from .field_value import FieldValue as resources_ast_field_value_FieldValue # noqa: E402, F401, I001 + + +class FieldValue_PrimitiveValue(UniversalBaseModel): + value: PrimitiveValue + type: typing.Literal["primitive_value"] = "primitive_value" + + +class FieldValue_ObjectValue(UniversalBaseModel): + type: typing.Literal["object_value"] = "object_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class FieldValue_ContainerValue(UniversalBaseModel): + value: "resources_ast_container_value_ContainerValue" + type: typing.Literal["container_value"] = "container_value" + + +FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] +from .container_value import ContainerValue as resources_ast_container_value_ContainerValue # noqa: E402, F401, I001 + +update_forward_refs(ContainerValue_List) +update_forward_refs(ContainerValue_Optional) +update_forward_refs(FieldValue_ContainerValue) diff --git a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/field_value.py b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/field_value.py index d52fbfd0757..88d4a5e9c2d 100644 --- a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/field_value.py +++ b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/field_value.py @@ -1,36 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .primitive_value import PrimitiveValue - - -class FieldValue_PrimitiveValue(UniversalBaseModel): - value: PrimitiveValue - type: typing.Literal["primitive_value"] = "primitive_value" - - -class FieldValue_ObjectValue(UniversalBaseModel): - type: typing.Literal["object_value"] = "object_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class FieldValue_ContainerValue(UniversalBaseModel): - value: "ContainerValue" - type: typing.Literal["container_value"] = "container_value" - - -FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] -from .container_value import ContainerValue # noqa: E402, F401, I001 - -update_forward_refs(FieldValue_ContainerValue) +__all__ = ["FieldValue"] diff --git a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/t.py b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/t.py index 6f8ccdda576..7890c29fb10 100644 --- a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/t.py +++ b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/t.py @@ -1,25 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import T as T -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class T(UniversalBaseModel): - child: "TorU" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .u import U # noqa: E402, F401, I001 -from .tor_u import TorU # noqa: E402, F401, I001 - -update_forward_refs(T) +__all__ = ["T"] diff --git a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/t_all.py b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/t_all.py new file mode 100644 index 00000000000..95554fe0486 --- /dev/null +++ b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/t_all.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .t import T as resources_ast_t_T + from .u import U as resources_ast_u_U + + +class T(UniversalBaseModel): + child: "resources_ast_tor_u_TorU" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .u import U as resources_ast_u_U # noqa: E402, F401, I001 +from .tor_u import TorU as resources_ast_tor_u_TorU # noqa: E402, F401, I001 + +TorU = typing.Union["resources_ast_t_T", "resources_ast_u_U"] + + +class U(UniversalBaseModel): + child: "resources_ast_t_T" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .t import T as resources_ast_t_T # noqa: E402, F401, I001 diff --git a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/tor_u.py b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/tor_u.py index 5409b5f1551..fd9fb53be9a 100644 --- a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/tor_u.py +++ b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/tor_u.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import TorU as TorU -import typing - -if typing.TYPE_CHECKING: - from .t import T - from .u import U -TorU = typing.Union["T", "U"] +__all__ = ["TorU"] diff --git a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/u.py b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/u.py index 8d038a2bcd3..85016723b61 100644 --- a/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/u.py +++ b/seed/pydantic/circular-references/no-inheritance-for-extended-models/src/seed/api/resources/ast/u.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import U as U -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class U(UniversalBaseModel): - child: "T" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .t import T # noqa: E402, F401, I001 - -update_forward_refs(U) +__all__ = ["U"] diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/__init__.py b/seed/pydantic/examples/src/seed/examples/resources/types/__init__.py index d6ec45c5788..5a2ef868930 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/__init__.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/__init__.py @@ -19,14 +19,13 @@ from .moment import Moment from .movie import Movie from .movie_id import MovieId -from .node import Node +from .node_all import Node, Tree from .refresh_token_request import RefreshTokenRequest from .request import Request from .response import Response from .response_type import ResponseType from .stunt_double import StuntDouble from .test import Test, Test_And, Test_Or -from .tree import Tree __all__ = [ "Actor", diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/node.py b/seed/pydantic/examples/src/seed/examples/resources/types/node.py index a9a0b34bbea..2e2b0d00578 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/node.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/node.py @@ -1,56 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .node_all import Node as Node -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Node(UniversalBaseModel): - """ - Examples - -------- - from seed.examples.resources import Node, Tree - - Node( - name="root", - nodes=[ - Node( - name="left", - ), - Node( - name="right", - ), - ], - trees=[ - Tree( - nodes=[ - Node( - name="left", - ), - Node( - name="right", - ), - ], - ) - ], - ) - """ - - name: str - nodes: typing.Optional[typing.List["Node"]] = None - trees: typing.Optional[typing.List["Tree"]] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .tree import Tree # noqa: E402, F401, I001 - -update_forward_refs(Node) +__all__ = ["Node"] diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/node_all.py b/seed/pydantic/examples/src/seed/examples/resources/types/node_all.py new file mode 100644 index 00000000000..c6ed5e38601 --- /dev/null +++ b/seed/pydantic/examples/src/seed/examples/resources/types/node_all.py @@ -0,0 +1,85 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class Node(UniversalBaseModel): + """ + Examples + -------- + from seed.examples.resources import Node, Tree + + Node( + name="root", + nodes=[ + Node( + name="left", + ), + Node( + name="right", + ), + ], + trees=[ + Tree( + nodes=[ + Node( + name="left", + ), + Node( + name="right", + ), + ], + ) + ], + ) + """ + + name: str + nodes: typing.Optional[typing.List["resources_types_node_Node"]] = None + trees: typing.Optional[typing.List["resources_types_tree_Tree"]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .tree import Tree as resources_types_tree_Tree # noqa: E402, F401, I001 + + +class Tree(UniversalBaseModel): + """ + Examples + -------- + from seed.examples.resources import Node, Tree + + Tree( + nodes=[ + Node( + name="left", + ), + Node( + name="right", + ), + ], + ) + """ + + nodes: typing.Optional[typing.List["resources_types_node_Node"]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .node import Node as resources_types_node_Node # noqa: E402, F401, I001 diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/tree.py b/seed/pydantic/examples/src/seed/examples/resources/types/tree.py index e10ea8e435a..70bb4517fd9 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/tree.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/tree.py @@ -1,41 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .node_all import Tree as Tree -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Tree(UniversalBaseModel): - """ - Examples - -------- - from seed.examples.resources import Node, Tree - - Tree( - nodes=[ - Node( - name="left", - ), - Node( - name="right", - ), - ], - ) - """ - - nodes: typing.Optional[typing.List["Node"]] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .node import Node # noqa: E402, F401, I001 - -update_forward_refs(Tree) +__all__ = ["Tree"] diff --git a/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/__init__.py b/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/__init__.py index 01132dec47a..29899b90550 100644 --- a/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/__init__.py +++ b/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/__init__.py @@ -4,9 +4,8 @@ from .conversation import Conversation from .cursor_pages import CursorPages -from .multiple_filter_search_request import MultipleFilterSearchRequest +from .multiple_filter_search_request_all import MultipleFilterSearchRequest, MultipleFilterSearchRequestValue from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator -from .multiple_filter_search_request_value import MultipleFilterSearchRequestValue from .paginated_conversation_response import PaginatedConversationResponse from .search_request import SearchRequest from .search_request_query import SearchRequestQuery diff --git a/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request.py b/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request.py index ddcf719d695..9b434b22531 100644 --- a/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request.py +++ b/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request.py @@ -1,26 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .multiple_filter_search_request_all import MultipleFilterSearchRequest as MultipleFilterSearchRequest -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator - - -class MultipleFilterSearchRequest(UniversalBaseModel): - operator: typing.Optional[MultipleFilterSearchRequestOperator] = None - value: typing.Optional["MultipleFilterSearchRequestValue"] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .multiple_filter_search_request_value import MultipleFilterSearchRequestValue # noqa: E402, F401, I001 - -update_forward_refs(MultipleFilterSearchRequest) +__all__ = ["MultipleFilterSearchRequest"] diff --git a/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request_all.py b/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request_all.py new file mode 100644 index 00000000000..a9de8d9af59 --- /dev/null +++ b/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request_all.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator +from .single_filter_search_request import SingleFilterSearchRequest + +if typing.TYPE_CHECKING: + from .multiple_filter_search_request import ( + MultipleFilterSearchRequest as resources_complex__multiple_filter_search_request_MultipleFilterSearchRequest, + ) + + +class MultipleFilterSearchRequest(UniversalBaseModel): + operator: typing.Optional[MultipleFilterSearchRequestOperator] = None + value: typing.Optional[ + "resources_complex__multiple_filter_search_request_value_MultipleFilterSearchRequestValue" + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .multiple_filter_search_request import ( + MultipleFilterSearchRequest as resources_complex__multiple_filter_search_request_MultipleFilterSearchRequest, +) # noqa: E402, F401, I001 +from .multiple_filter_search_request_value import ( + MultipleFilterSearchRequestValue as resources_complex__multiple_filter_search_request_value_MultipleFilterSearchRequestValue, +) # noqa: E402, F401, I001 + +MultipleFilterSearchRequestValue = typing.Union[ + typing.List["resources_complex__multiple_filter_search_request_MultipleFilterSearchRequest"], + typing.List[SingleFilterSearchRequest], +] diff --git a/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request_value.py b/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request_value.py index 16a7c594785..88ccc5a0991 100644 --- a/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request_value.py +++ b/seed/pydantic/pagination/no-custom-config/src/seed/pagination/resources/complex_/multiple_filter_search_request_value.py @@ -1,13 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .multiple_filter_search_request_all import MultipleFilterSearchRequestValue as MultipleFilterSearchRequestValue -import typing - -from .single_filter_search_request import SingleFilterSearchRequest - -if typing.TYPE_CHECKING: - from .multiple_filter_search_request import MultipleFilterSearchRequest -MultipleFilterSearchRequestValue = typing.Union[ - typing.List["MultipleFilterSearchRequest"], typing.List[SingleFilterSearchRequest] -] +__all__ = ["MultipleFilterSearchRequestValue"] diff --git a/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/__init__.py b/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/__init__.py index 01132dec47a..29899b90550 100644 --- a/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/__init__.py +++ b/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/__init__.py @@ -4,9 +4,8 @@ from .conversation import Conversation from .cursor_pages import CursorPages -from .multiple_filter_search_request import MultipleFilterSearchRequest +from .multiple_filter_search_request_all import MultipleFilterSearchRequest, MultipleFilterSearchRequestValue from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator -from .multiple_filter_search_request_value import MultipleFilterSearchRequestValue from .paginated_conversation_response import PaginatedConversationResponse from .search_request import SearchRequest from .search_request_query import SearchRequestQuery diff --git a/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request.py b/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request.py index ddcf719d695..9b434b22531 100644 --- a/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request.py +++ b/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request.py @@ -1,26 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .multiple_filter_search_request_all import MultipleFilterSearchRequest as MultipleFilterSearchRequest -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator - - -class MultipleFilterSearchRequest(UniversalBaseModel): - operator: typing.Optional[MultipleFilterSearchRequestOperator] = None - value: typing.Optional["MultipleFilterSearchRequestValue"] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .multiple_filter_search_request_value import MultipleFilterSearchRequestValue # noqa: E402, F401, I001 - -update_forward_refs(MultipleFilterSearchRequest) +__all__ = ["MultipleFilterSearchRequest"] diff --git a/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request_all.py b/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request_all.py new file mode 100644 index 00000000000..84399291b52 --- /dev/null +++ b/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request_all.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .multiple_filter_search_request_operator import MultipleFilterSearchRequestOperator +from .single_filter_search_request import SingleFilterSearchRequest + +if typing.TYPE_CHECKING: + from .multiple_filter_search_request import ( + MultipleFilterSearchRequest as resources_complex__multiple_filter_search_request_MultipleFilterSearchRequest, + ) + + +class MultipleFilterSearchRequest(UniversalBaseModel): + operator: typing.Optional[MultipleFilterSearchRequestOperator] = None + value: typing.Optional[ + "resources_complex__multiple_filter_search_request_value_MultipleFilterSearchRequestValue" + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .multiple_filter_search_request_value import ( + MultipleFilterSearchRequestValue as resources_complex__multiple_filter_search_request_value_MultipleFilterSearchRequestValue, +) # noqa: E402, F401, I001 +from .multiple_filter_search_request import ( + MultipleFilterSearchRequest as resources_complex__multiple_filter_search_request_MultipleFilterSearchRequest, +) # noqa: E402, F401, I001 + +MultipleFilterSearchRequestValue = typing.Union[ + typing.List["resources_complex__multiple_filter_search_request_MultipleFilterSearchRequest"], + typing.List[SingleFilterSearchRequest], +] diff --git a/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request_value.py b/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request_value.py index 16a7c594785..88ccc5a0991 100644 --- a/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request_value.py +++ b/seed/pydantic/pagination/no-inheritance-for-extended-models/src/seed/pagination/resources/complex_/multiple_filter_search_request_value.py @@ -1,13 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .multiple_filter_search_request_all import MultipleFilterSearchRequestValue as MultipleFilterSearchRequestValue -import typing - -from .single_filter_search_request import SingleFilterSearchRequest - -if typing.TYPE_CHECKING: - from .multiple_filter_search_request import MultipleFilterSearchRequest -MultipleFilterSearchRequestValue = typing.Union[ - typing.List["MultipleFilterSearchRequest"], typing.List[SingleFilterSearchRequest] -] +__all__ = ["MultipleFilterSearchRequestValue"] diff --git a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/__init__.py b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/__init__.py index b958e07559c..ba6a1ca8220 100644 --- a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/__init__.py +++ b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/__init__.py @@ -2,12 +2,6 @@ # isort: skip_file -from .account import Account -from .base_resource import BaseResource -from .memo import Memo -from .patient import Patient -from .practitioner import Practitioner -from .resource_list import ResourceList -from .script import Script +from .account_all import Account, BaseResource, Memo, Patient, Practitioner, ResourceList, Script __all__ = ["Account", "BaseResource", "Memo", "Patient", "Practitioner", "ResourceList", "Script"] diff --git a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/account.py b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/account.py index de00d2549f9..c8df55e2e86 100644 --- a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/account.py +++ b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/account.py @@ -1,31 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Account as Account -import typing - -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs - - -class Account(BaseResource): - resource_type: typing.Literal["Account"] = "Account" - name: str - patient: typing.Optional["Patient"] = None - practitioner: typing.Optional["Practitioner"] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .base_resource import BaseResource # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 -from .patient import Patient # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 -from .script import Script # noqa: E402, F401, I001 - -update_forward_refs(Account) +__all__ = ["Account"] diff --git a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/account_all.py b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/account_all.py new file mode 100644 index 00000000000..205887da70c --- /dev/null +++ b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/account_all.py @@ -0,0 +1,106 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from .core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .account import Account as account_Account + from .patient import Patient as patient_Patient + from .practitioner import Practitioner as practitioner_Practitioner + from .script import Script as script_Script + + +class Account(base_resource_BaseResource): + resource_type: typing.Literal["Account"] = "Account" + name: str + patient: typing.Optional["patient_Patient"] = None + practitioner: typing.Optional["practitioner_Practitioner"] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class BaseResource(UniversalBaseModel): + id: str + related_resources: typing.List["resource_list_ResourceList"] + memo: "memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .resource_list import ResourceList as resource_list_ResourceList # noqa: E402, F401, I001 + + +class Memo(UniversalBaseModel): + description: str + account: typing.Optional["account_Account"] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .patient import Patient as patient_Patient # noqa: E402, F401, I001 + + +class Patient(base_resource_BaseResource): + resource_type: typing.Literal["Patient"] = "Patient" + name: str + scripts: typing.List["script_Script"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .base_resource import BaseResource as base_resource_BaseResource # noqa: E402, F401, I001 +from .memo import Memo as memo_Memo # noqa: E402, F401, I001 +from .practitioner import Practitioner as practitioner_Practitioner # noqa: E402, F401, I001 +from .script import Script as script_Script # noqa: E402, F401, I001 +from .account import Account as account_Account # noqa: E402, F401, I001 + + +class Practitioner(base_resource_BaseResource): + resource_type: typing.Literal["Practitioner"] = "Practitioner" + name: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +ResourceList = typing.Union["account_Account", "patient_Patient", "practitioner_Practitioner", "script_Script"] + + +class Script(base_resource_BaseResource): + resource_type: typing.Literal["Script"] = "Script" + name: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow diff --git a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/base_resource.py b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/base_resource.py index 6e46a114e7b..5da3c7b44de 100644 --- a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/base_resource.py +++ b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/base_resource.py @@ -1,31 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import BaseResource as BaseResource -import typing - -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class BaseResource(UniversalBaseModel): - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .account import Account # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 -from .patient import Patient # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 -from .script import Script # noqa: E402, F401, I001 -from .resource_list import ResourceList # noqa: E402, F401, I001 - -update_forward_refs(BaseResource) +__all__ = ["BaseResource"] diff --git a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/memo.py b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/memo.py index 256ea9998d3..98072e88536 100644 --- a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/memo.py +++ b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/memo.py @@ -1,29 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Memo as Memo -import typing - -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Memo(UniversalBaseModel): - description: str - account: typing.Optional["Account"] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .account import Account # noqa: E402, F401, I001 -from .base_resource import BaseResource # noqa: E402, F401, I001 -from .patient import Patient # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 -from .script import Script # noqa: E402, F401, I001 - -update_forward_refs(Memo) +__all__ = ["Memo"] diff --git a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/patient.py b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/patient.py index 538bebe64ae..4585fa44111 100644 --- a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/patient.py +++ b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/patient.py @@ -1,30 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Patient as Patient -import typing - -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs - - -class Patient(BaseResource): - resource_type: typing.Literal["Patient"] = "Patient" - name: str - scripts: typing.List["Script"] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .base_resource import BaseResource # noqa: E402, F401, I001 -from .account import Account # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 -from .script import Script # noqa: E402, F401, I001 - -update_forward_refs(Patient) +__all__ = ["Patient"] diff --git a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/practitioner.py b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/practitioner.py index fc90cf56e84..7c6f6187af5 100644 --- a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/practitioner.py +++ b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/practitioner.py @@ -1,19 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import typing +from .account_all import Practitioner as Practitioner -import pydantic -from .base_resource import BaseResource -from .core.pydantic_utilities import IS_PYDANTIC_V2 - - -class Practitioner(BaseResource): - resource_type: typing.Literal["Practitioner"] = "Practitioner" - name: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow +__all__ = ["Practitioner"] diff --git a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/resource_list.py b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/resource_list.py index fb879a7c9d7..d247c3c8672 100644 --- a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/resource_list.py +++ b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/resource_list.py @@ -1,12 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import ResourceList as ResourceList -import typing - -if typing.TYPE_CHECKING: - from .account import Account - from .patient import Patient - from .practitioner import Practitioner - from .script import Script -ResourceList = typing.Union["Account", "Patient", "Practitioner", "Script"] +__all__ = ["ResourceList"] diff --git a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/script.py b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/script.py index e50ec312a75..682ca1a5f1a 100644 --- a/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/script.py +++ b/seed/pydantic/simple-fhir/no-custom-config/src/seed/api/script.py @@ -1,19 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import typing +from .account_all import Script as Script -import pydantic -from .base_resource import BaseResource -from .core.pydantic_utilities import IS_PYDANTIC_V2 - - -class Script(BaseResource): - resource_type: typing.Literal["Script"] = "Script" - name: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow +__all__ = ["Script"] diff --git a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/__init__.py b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/__init__.py index b958e07559c..ba6a1ca8220 100644 --- a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/__init__.py +++ b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/__init__.py @@ -2,12 +2,6 @@ # isort: skip_file -from .account import Account -from .base_resource import BaseResource -from .memo import Memo -from .patient import Patient -from .practitioner import Practitioner -from .resource_list import ResourceList -from .script import Script +from .account_all import Account, BaseResource, Memo, Patient, Practitioner, ResourceList, Script __all__ = ["Account", "BaseResource", "Memo", "Patient", "Practitioner", "ResourceList", "Script"] diff --git a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/account.py b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/account.py index 97163b2de13..c8df55e2e86 100644 --- a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/account.py +++ b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/account.py @@ -1,35 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Account as Account -import typing - -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Account(UniversalBaseModel): - resource_type: typing.Literal["Account"] = "Account" - name: str - patient: typing.Optional["Patient"] = None - practitioner: typing.Optional["Practitioner"] = None - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .base_resource import BaseResource # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 -from .patient import Patient # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 -from .script import Script # noqa: E402, F401, I001 -from .resource_list import ResourceList # noqa: E402, F401, I001 - -update_forward_refs(Account) +__all__ = ["Account"] diff --git a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/account_all.py b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/account_all.py new file mode 100644 index 00000000000..02f54e8426c --- /dev/null +++ b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/account_all.py @@ -0,0 +1,114 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from .core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .account import Account as account_Account + from .patient import Patient as patient_Patient + from .practitioner import Practitioner as practitioner_Practitioner + from .script import Script as script_Script + + +class Account(UniversalBaseModel): + resource_type: typing.Literal["Account"] = "Account" + name: str + patient: typing.Optional["patient_Patient"] = None + practitioner: typing.Optional["practitioner_Practitioner"] = None + id: str + related_resources: typing.List["resource_list_ResourceList"] + memo: "memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class BaseResource(UniversalBaseModel): + id: str + related_resources: typing.List["resource_list_ResourceList"] + memo: "memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class Memo(UniversalBaseModel): + description: str + account: typing.Optional["account_Account"] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class Patient(UniversalBaseModel): + resource_type: typing.Literal["Patient"] = "Patient" + name: str + scripts: typing.List["script_Script"] + id: str + related_resources: typing.List["resource_list_ResourceList"] + memo: "memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class Practitioner(UniversalBaseModel): + resource_type: typing.Literal["Practitioner"] = "Practitioner" + name: str + id: str + related_resources: typing.List["resource_list_ResourceList"] + memo: "memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +ResourceList = typing.Union["account_Account", "patient_Patient", "practitioner_Practitioner", "script_Script"] + + +class Script(UniversalBaseModel): + resource_type: typing.Literal["Script"] = "Script" + name: str + id: str + related_resources: typing.List["resource_list_ResourceList"] + memo: "memo_Memo" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .base_resource import BaseResource as base_resource_BaseResource # noqa: E402, F401, I001 +from .memo import Memo as memo_Memo # noqa: E402, F401, I001 +from .patient import Patient as patient_Patient # noqa: E402, F401, I001 +from .practitioner import Practitioner as practitioner_Practitioner # noqa: E402, F401, I001 +from .script import Script as script_Script # noqa: E402, F401, I001 +from .account import Account as account_Account # noqa: E402, F401, I001 +from .resource_list import ResourceList as resource_list_ResourceList # noqa: E402, F401, I001 diff --git a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/base_resource.py b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/base_resource.py index 6e46a114e7b..5da3c7b44de 100644 --- a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/base_resource.py +++ b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/base_resource.py @@ -1,31 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import BaseResource as BaseResource -import typing - -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class BaseResource(UniversalBaseModel): - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .account import Account # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 -from .patient import Patient # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 -from .script import Script # noqa: E402, F401, I001 -from .resource_list import ResourceList # noqa: E402, F401, I001 - -update_forward_refs(BaseResource) +__all__ = ["BaseResource"] diff --git a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/memo.py b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/memo.py index 256ea9998d3..98072e88536 100644 --- a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/memo.py +++ b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/memo.py @@ -1,29 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Memo as Memo -import typing - -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Memo(UniversalBaseModel): - description: str - account: typing.Optional["Account"] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .account import Account # noqa: E402, F401, I001 -from .base_resource import BaseResource # noqa: E402, F401, I001 -from .patient import Patient # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 -from .script import Script # noqa: E402, F401, I001 - -update_forward_refs(Memo) +__all__ = ["Memo"] diff --git a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/patient.py b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/patient.py index edf1f796240..4585fa44111 100644 --- a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/patient.py +++ b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/patient.py @@ -1,34 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Patient as Patient -import typing - -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Patient(UniversalBaseModel): - resource_type: typing.Literal["Patient"] = "Patient" - name: str - scripts: typing.List["Script"] - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .account import Account # noqa: E402, F401, I001 -from .base_resource import BaseResource # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 -from .script import Script # noqa: E402, F401, I001 -from .resource_list import ResourceList # noqa: E402, F401, I001 - -update_forward_refs(Patient) +__all__ = ["Patient"] diff --git a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/practitioner.py b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/practitioner.py index 28301e28c76..7c6f6187af5 100644 --- a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/practitioner.py +++ b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/practitioner.py @@ -1,33 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Practitioner as Practitioner -import typing - -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Practitioner(UniversalBaseModel): - resource_type: typing.Literal["Practitioner"] = "Practitioner" - name: str - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .account import Account # noqa: E402, F401, I001 -from .base_resource import BaseResource # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 -from .patient import Patient # noqa: E402, F401, I001 -from .script import Script # noqa: E402, F401, I001 -from .resource_list import ResourceList # noqa: E402, F401, I001 - -update_forward_refs(Practitioner) +__all__ = ["Practitioner"] diff --git a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/resource_list.py b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/resource_list.py index fb879a7c9d7..d247c3c8672 100644 --- a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/resource_list.py +++ b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/resource_list.py @@ -1,12 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import ResourceList as ResourceList -import typing - -if typing.TYPE_CHECKING: - from .account import Account - from .patient import Patient - from .practitioner import Practitioner - from .script import Script -ResourceList = typing.Union["Account", "Patient", "Practitioner", "Script"] +__all__ = ["ResourceList"] diff --git a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/script.py b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/script.py index 65fc09039ed..682ca1a5f1a 100644 --- a/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/script.py +++ b/seed/pydantic/simple-fhir/no-inheritance-for-extended-models/src/seed/api/script.py @@ -1,33 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .account_all import Script as Script -import typing - -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Script(UniversalBaseModel): - resource_type: typing.Literal["Script"] = "Script" - name: str - id: str - related_resources: typing.List["ResourceList"] - memo: "Memo" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .account import Account # noqa: E402, F401, I001 -from .base_resource import BaseResource # noqa: E402, F401, I001 -from .memo import Memo # noqa: E402, F401, I001 -from .patient import Patient # noqa: E402, F401, I001 -from .practitioner import Practitioner # noqa: E402, F401, I001 -from .resource_list import ResourceList # noqa: E402, F401, I001 - -update_forward_refs(Script) +__all__ = ["Script"] diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/__init__.py b/seed/pydantic/trace/src/seed/trace/resources/commons/__init__.py index 6ce8b605f34..e7f8c4bb437 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/__init__.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/__init__.py @@ -5,9 +5,9 @@ from .binary_tree_node_and_tree_value import BinaryTreeNodeAndTreeValue from .binary_tree_node_value import BinaryTreeNodeValue from .binary_tree_value import BinaryTreeValue -from .debug_key_value_pairs import DebugKeyValuePairs -from .debug_map_value import DebugMapValue -from .debug_variable_value import ( +from .debug_key_value_pairs_all import ( + DebugKeyValuePairs, + DebugMapValue, DebugVariableValue, DebugVariableValue_BinaryTreeNodeValue, DebugVariableValue_BooleanValue, @@ -28,33 +28,9 @@ from .doubly_linked_list_value import DoublyLinkedListValue from .file_info import FileInfo from .generic_value import GenericValue -from .key_value_pair import KeyValuePair -from .language import Language -from .list_type import ListType -from .map_type import MapType -from .map_value import MapValue -from .node_id import NodeId -from .problem_id import ProblemId -from .singly_linked_list_node_and_list_value import SinglyLinkedListNodeAndListValue -from .singly_linked_list_node_value import SinglyLinkedListNodeValue -from .singly_linked_list_value import SinglyLinkedListValue -from .test_case import TestCase -from .test_case_with_expected_result import TestCaseWithExpectedResult -from .user_id import UserId -from .variable_type import ( - VariableType, - VariableType_BinaryTreeType, - VariableType_BooleanType, - VariableType_CharType, - VariableType_DoubleType, - VariableType_DoublyLinkedListType, - VariableType_IntegerType, - VariableType_ListType, - VariableType_MapType, - VariableType_SinglyLinkedListType, - VariableType_StringType, -) -from .variable_value import ( +from .key_value_pair_all import ( + KeyValuePair, + MapValue, VariableValue, VariableValue_BinaryTreeValue, VariableValue_BooleanValue, @@ -68,6 +44,30 @@ VariableValue_SinglyLinkedListValue, VariableValue_StringValue, ) +from .language import Language +from .list_type_all import ( + ListType, + MapType, + VariableType, + VariableType_BinaryTreeType, + VariableType_BooleanType, + VariableType_CharType, + VariableType_DoubleType, + VariableType_DoublyLinkedListType, + VariableType_IntegerType, + VariableType_ListType, + VariableType_MapType, + VariableType_SinglyLinkedListType, + VariableType_StringType, +) +from .node_id import NodeId +from .problem_id import ProblemId +from .singly_linked_list_node_and_list_value import SinglyLinkedListNodeAndListValue +from .singly_linked_list_node_value import SinglyLinkedListNodeValue +from .singly_linked_list_value import SinglyLinkedListValue +from .test_case import TestCase +from .test_case_with_expected_result import TestCaseWithExpectedResult +from .user_id import UserId __all__ = [ "BinaryTreeNodeAndTreeValue", diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs.py b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs.py index 0e40214e40d..02c2427d2c0 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs.py @@ -1,26 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .debug_key_value_pairs_all import DebugKeyValuePairs as DebugKeyValuePairs -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class DebugKeyValuePairs(UniversalBaseModel): - key: "DebugVariableValue" - value: "DebugVariableValue" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .debug_map_value import DebugMapValue # noqa: E402, F401, I001 -from .debug_variable_value import DebugVariableValue # noqa: E402, F401, I001 - -update_forward_refs(DebugKeyValuePairs) +__all__ = ["DebugKeyValuePairs"] diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs_all.py b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs_all.py new file mode 100644 index 00000000000..3c0dad08722 --- /dev/null +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs_all.py @@ -0,0 +1,179 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs +from .binary_tree_value import BinaryTreeValue +from .doubly_linked_list_value import DoublyLinkedListValue +from .node_id import NodeId +from .singly_linked_list_value import SinglyLinkedListValue + + +class DebugKeyValuePairs(UniversalBaseModel): + key: "resources_commons_debug_variable_value_DebugVariableValue" + value: "resources_commons_debug_variable_value_DebugVariableValue" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class DebugMapValue(UniversalBaseModel): + key_value_pairs: typing.List["resources_commons_debug_key_value_pairs_DebugKeyValuePairs"] = pydantic.Field( + alias="keyValuePairs" + ) + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class DebugVariableValue_IntegerValue(UniversalBaseModel): + value: int + type: typing.Literal["integerValue"] = "integerValue" + + +class DebugVariableValue_BooleanValue(UniversalBaseModel): + value: bool + type: typing.Literal["booleanValue"] = "booleanValue" + + +class DebugVariableValue_DoubleValue(UniversalBaseModel): + value: float + type: typing.Literal["doubleValue"] = "doubleValue" + + +class DebugVariableValue_StringValue(UniversalBaseModel): + value: str + type: typing.Literal["stringValue"] = "stringValue" + + +class DebugVariableValue_CharValue(UniversalBaseModel): + value: str + type: typing.Literal["charValue"] = "charValue" + + +class DebugVariableValue_MapValue(UniversalBaseModel): + type: typing.Literal["mapValue"] = "mapValue" + key_value_pairs: typing.List["resources_commons_debug_key_value_pairs_DebugKeyValuePairs"] = pydantic.Field( + alias="keyValuePairs" + ) + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .debug_map_value import DebugMapValue as resources_commons_debug_map_value_DebugMapValue # noqa: E402, F401, I001 + + +class DebugVariableValue_ListValue(UniversalBaseModel): + value: typing.List["resources_commons_debug_variable_value_DebugVariableValue"] + type: typing.Literal["listValue"] = "listValue" + + +class DebugVariableValue_BinaryTreeNodeValue(UniversalBaseModel): + type: typing.Literal["binaryTreeNodeValue"] = "binaryTreeNodeValue" + node_id: NodeId = pydantic.Field(alias="nodeId") + full_tree: BinaryTreeValue = pydantic.Field(alias="fullTree") + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class DebugVariableValue_SinglyLinkedListNodeValue(UniversalBaseModel): + type: typing.Literal["singlyLinkedListNodeValue"] = "singlyLinkedListNodeValue" + node_id: NodeId = pydantic.Field(alias="nodeId") + full_list: SinglyLinkedListValue = pydantic.Field(alias="fullList") + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class DebugVariableValue_DoublyLinkedListNodeValue(UniversalBaseModel): + type: typing.Literal["doublyLinkedListNodeValue"] = "doublyLinkedListNodeValue" + node_id: NodeId = pydantic.Field(alias="nodeId") + full_list: DoublyLinkedListValue = pydantic.Field(alias="fullList") + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class DebugVariableValue_UndefinedValue(UniversalBaseModel): + type: typing.Literal["undefinedValue"] = "undefinedValue" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class DebugVariableValue_NullValue(UniversalBaseModel): + type: typing.Literal["nullValue"] = "nullValue" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class DebugVariableValue_GenericValue(UniversalBaseModel): + type: typing.Literal["genericValue"] = "genericValue" + stringified_type: typing.Optional[str] = pydantic.Field(alias="stringifiedType", default=None) + stringified_value: str = pydantic.Field(alias="stringifiedValue") + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +DebugVariableValue = typing.Union[ + DebugVariableValue_IntegerValue, + DebugVariableValue_BooleanValue, + DebugVariableValue_DoubleValue, + DebugVariableValue_StringValue, + DebugVariableValue_CharValue, + DebugVariableValue_MapValue, + DebugVariableValue_ListValue, + DebugVariableValue_BinaryTreeNodeValue, + DebugVariableValue_SinglyLinkedListNodeValue, + DebugVariableValue_DoublyLinkedListNodeValue, + DebugVariableValue_UndefinedValue, + DebugVariableValue_NullValue, + DebugVariableValue_GenericValue, +] +from .debug_variable_value import DebugVariableValue as resources_commons_debug_variable_value_DebugVariableValue # noqa: E402, F401, I001 +from .debug_key_value_pairs import DebugKeyValuePairs as resources_commons_debug_key_value_pairs_DebugKeyValuePairs # noqa: E402, F401, I001 + +update_forward_refs(DebugVariableValue_ListValue) diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_map_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_map_value.py index a0fe1604483..9b4997f82d4 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_map_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_map_value.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .debug_key_value_pairs_all import DebugMapValue as DebugMapValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class DebugMapValue(UniversalBaseModel): - key_value_pairs: typing.List["DebugKeyValuePairs"] = pydantic.Field(alias="keyValuePairs") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .debug_key_value_pairs import DebugKeyValuePairs # noqa: E402, F401, I001 - -update_forward_refs(DebugMapValue) +__all__ = ["DebugMapValue"] diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_variable_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_variable_value.py index 985a89141ae..0a3286a6c0a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_variable_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_variable_value.py @@ -1,152 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .debug_key_value_pairs_all import DebugVariableValue as DebugVariableValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .binary_tree_value import BinaryTreeValue -from .doubly_linked_list_value import DoublyLinkedListValue -from .node_id import NodeId -from .singly_linked_list_value import SinglyLinkedListValue - - -class DebugVariableValue_IntegerValue(UniversalBaseModel): - value: int - type: typing.Literal["integerValue"] = "integerValue" - - -class DebugVariableValue_BooleanValue(UniversalBaseModel): - value: bool - type: typing.Literal["booleanValue"] = "booleanValue" - - -class DebugVariableValue_DoubleValue(UniversalBaseModel): - value: float - type: typing.Literal["doubleValue"] = "doubleValue" - - -class DebugVariableValue_StringValue(UniversalBaseModel): - value: str - type: typing.Literal["stringValue"] = "stringValue" - - -class DebugVariableValue_CharValue(UniversalBaseModel): - value: str - type: typing.Literal["charValue"] = "charValue" - - -class DebugVariableValue_MapValue(UniversalBaseModel): - type: typing.Literal["mapValue"] = "mapValue" - key_value_pairs: typing.List["DebugKeyValuePairs"] = pydantic.Field(alias="keyValuePairs") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .debug_map_value import DebugMapValue # noqa: E402, F401, I001 - - -class DebugVariableValue_ListValue(UniversalBaseModel): - value: typing.List["DebugVariableValue"] - type: typing.Literal["listValue"] = "listValue" - - -class DebugVariableValue_BinaryTreeNodeValue(UniversalBaseModel): - type: typing.Literal["binaryTreeNodeValue"] = "binaryTreeNodeValue" - node_id: NodeId = pydantic.Field(alias="nodeId") - full_tree: BinaryTreeValue = pydantic.Field(alias="fullTree") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class DebugVariableValue_SinglyLinkedListNodeValue(UniversalBaseModel): - type: typing.Literal["singlyLinkedListNodeValue"] = "singlyLinkedListNodeValue" - node_id: NodeId = pydantic.Field(alias="nodeId") - full_list: SinglyLinkedListValue = pydantic.Field(alias="fullList") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class DebugVariableValue_DoublyLinkedListNodeValue(UniversalBaseModel): - type: typing.Literal["doublyLinkedListNodeValue"] = "doublyLinkedListNodeValue" - node_id: NodeId = pydantic.Field(alias="nodeId") - full_list: DoublyLinkedListValue = pydantic.Field(alias="fullList") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class DebugVariableValue_UndefinedValue(UniversalBaseModel): - type: typing.Literal["undefinedValue"] = "undefinedValue" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class DebugVariableValue_NullValue(UniversalBaseModel): - type: typing.Literal["nullValue"] = "nullValue" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class DebugVariableValue_GenericValue(UniversalBaseModel): - type: typing.Literal["genericValue"] = "genericValue" - stringified_type: typing.Optional[str] = pydantic.Field(alias="stringifiedType", default=None) - stringified_value: str = pydantic.Field(alias="stringifiedValue") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -DebugVariableValue = typing.Union[ - DebugVariableValue_IntegerValue, - DebugVariableValue_BooleanValue, - DebugVariableValue_DoubleValue, - DebugVariableValue_StringValue, - DebugVariableValue_CharValue, - DebugVariableValue_MapValue, - DebugVariableValue_ListValue, - DebugVariableValue_BinaryTreeNodeValue, - DebugVariableValue_SinglyLinkedListNodeValue, - DebugVariableValue_DoublyLinkedListNodeValue, - DebugVariableValue_UndefinedValue, - DebugVariableValue_NullValue, - DebugVariableValue_GenericValue, -] -from .debug_key_value_pairs import DebugKeyValuePairs # noqa: E402, F401, I001 - -update_forward_refs(DebugVariableValue_MapValue) -update_forward_refs(DebugVariableValue_ListValue) +__all__ = ["DebugVariableValue"] diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair.py b/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair.py index 87122b8a54e..846326b8355 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair.py @@ -1,26 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .key_value_pair_all import KeyValuePair as KeyValuePair -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class KeyValuePair(UniversalBaseModel): - key: "VariableValue" - value: "VariableValue" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .map_value import MapValue # noqa: E402, F401, I001 -from .variable_value import VariableValue # noqa: E402, F401, I001 - -update_forward_refs(KeyValuePair) +__all__ = ["KeyValuePair"] diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair_all.py b/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair_all.py new file mode 100644 index 00000000000..52e81010779 --- /dev/null +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair_all.py @@ -0,0 +1,153 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs +from .binary_tree_node_value import BinaryTreeNodeValue +from .doubly_linked_list_node_value import DoublyLinkedListNodeValue +from .node_id import NodeId +from .singly_linked_list_node_value import SinglyLinkedListNodeValue + + +class KeyValuePair(UniversalBaseModel): + key: "resources_commons_variable_value_VariableValue" + value: "resources_commons_variable_value_VariableValue" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class MapValue(UniversalBaseModel): + key_value_pairs: typing.List["resources_commons_key_value_pair_KeyValuePair"] = pydantic.Field( + alias="keyValuePairs" + ) + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableValue_IntegerValue(UniversalBaseModel): + value: int + type: typing.Literal["integerValue"] = "integerValue" + + +class VariableValue_BooleanValue(UniversalBaseModel): + value: bool + type: typing.Literal["booleanValue"] = "booleanValue" + + +class VariableValue_DoubleValue(UniversalBaseModel): + value: float + type: typing.Literal["doubleValue"] = "doubleValue" + + +class VariableValue_StringValue(UniversalBaseModel): + value: str + type: typing.Literal["stringValue"] = "stringValue" + + +class VariableValue_CharValue(UniversalBaseModel): + value: str + type: typing.Literal["charValue"] = "charValue" + + +class VariableValue_MapValue(UniversalBaseModel): + type: typing.Literal["mapValue"] = "mapValue" + key_value_pairs: typing.List["resources_commons_key_value_pair_KeyValuePair"] = pydantic.Field( + alias="keyValuePairs" + ) + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .map_value import MapValue as resources_commons_map_value_MapValue # noqa: E402, F401, I001 + + +class VariableValue_ListValue(UniversalBaseModel): + value: typing.List["resources_commons_variable_value_VariableValue"] + type: typing.Literal["listValue"] = "listValue" + + +class VariableValue_BinaryTreeValue(UniversalBaseModel): + type: typing.Literal["binaryTreeValue"] = "binaryTreeValue" + root: typing.Optional[NodeId] = None + nodes: typing.Dict[NodeId, BinaryTreeNodeValue] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableValue_SinglyLinkedListValue(UniversalBaseModel): + type: typing.Literal["singlyLinkedListValue"] = "singlyLinkedListValue" + head: typing.Optional[NodeId] = None + nodes: typing.Dict[NodeId, SinglyLinkedListNodeValue] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableValue_DoublyLinkedListValue(UniversalBaseModel): + type: typing.Literal["doublyLinkedListValue"] = "doublyLinkedListValue" + head: typing.Optional[NodeId] = None + nodes: typing.Dict[NodeId, DoublyLinkedListNodeValue] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableValue_NullValue(UniversalBaseModel): + type: typing.Literal["nullValue"] = "nullValue" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +VariableValue = typing.Union[ + VariableValue_IntegerValue, + VariableValue_BooleanValue, + VariableValue_DoubleValue, + VariableValue_StringValue, + VariableValue_CharValue, + VariableValue_MapValue, + VariableValue_ListValue, + VariableValue_BinaryTreeValue, + VariableValue_SinglyLinkedListValue, + VariableValue_DoublyLinkedListValue, + VariableValue_NullValue, +] +from .variable_value import VariableValue as resources_commons_variable_value_VariableValue # noqa: E402, F401, I001 +from .key_value_pair import KeyValuePair as resources_commons_key_value_pair_KeyValuePair # noqa: E402, F401, I001 + +update_forward_refs(VariableValue_ListValue) diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/list_type.py b/seed/pydantic/trace/src/seed/trace/resources/commons/list_type.py index ec79ca2ea44..9dc370dd81f 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/list_type.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/list_type.py @@ -1,29 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .list_type_all import ListType as ListType -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class ListType(UniversalBaseModel): - value_type: "VariableType" = pydantic.Field(alias="valueType") - is_fixed_length: typing.Optional[bool] = pydantic.Field(alias="isFixedLength", default=None) - """ - Whether this list is fixed-size (for languages that supports fixed-size lists). Defaults to false. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .map_type import MapType # noqa: E402, F401, I001 -from .variable_type import VariableType # noqa: E402, F401, I001 - -update_forward_refs(ListType) +__all__ = ["ListType"] diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/list_type_all.py b/seed/pydantic/trace/src/seed/trace/resources/commons/list_type_all.py new file mode 100644 index 00000000000..b227f7f1eea --- /dev/null +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/list_type_all.py @@ -0,0 +1,168 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ListType(UniversalBaseModel): + value_type: "resources_commons_variable_type_VariableType" = pydantic.Field(alias="valueType") + is_fixed_length: typing.Optional[bool] = pydantic.Field(alias="isFixedLength", default=None) + """ + Whether this list is fixed-size (for languages that supports fixed-size lists). Defaults to false. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class MapType(UniversalBaseModel): + key_type: "resources_commons_variable_type_VariableType" = pydantic.Field(alias="keyType") + value_type: "resources_commons_variable_type_VariableType" = pydantic.Field(alias="valueType") + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableType_IntegerType(UniversalBaseModel): + type: typing.Literal["integerType"] = "integerType" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableType_DoubleType(UniversalBaseModel): + type: typing.Literal["doubleType"] = "doubleType" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableType_BooleanType(UniversalBaseModel): + type: typing.Literal["booleanType"] = "booleanType" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableType_StringType(UniversalBaseModel): + type: typing.Literal["stringType"] = "stringType" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableType_CharType(UniversalBaseModel): + type: typing.Literal["charType"] = "charType" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableType_ListType(UniversalBaseModel): + type: typing.Literal["listType"] = "listType" + value_type: "resources_commons_variable_type_VariableType" = pydantic.Field(alias="valueType") + is_fixed_length: typing.Optional[bool] = pydantic.Field(alias="isFixedLength", default=None) + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableType_MapType(UniversalBaseModel): + type: typing.Literal["mapType"] = "mapType" + key_type: "resources_commons_variable_type_VariableType" = pydantic.Field(alias="keyType") + value_type: "resources_commons_variable_type_VariableType" = pydantic.Field(alias="valueType") + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +from .map_type import MapType as resources_commons_map_type_MapType # noqa: E402, F401, I001 +from .list_type import ListType as resources_commons_list_type_ListType # noqa: E402, F401, I001 + + +class VariableType_BinaryTreeType(UniversalBaseModel): + type: typing.Literal["binaryTreeType"] = "binaryTreeType" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableType_SinglyLinkedListType(UniversalBaseModel): + type: typing.Literal["singlyLinkedListType"] = "singlyLinkedListType" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +class VariableType_DoublyLinkedListType(UniversalBaseModel): + type: typing.Literal["doublyLinkedListType"] = "doublyLinkedListType" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 + else: + + class Config: + extra = pydantic.Extra.allow + + +VariableType = typing.Union[ + VariableType_IntegerType, + VariableType_DoubleType, + VariableType_BooleanType, + VariableType_StringType, + VariableType_CharType, + VariableType_ListType, + VariableType_MapType, + VariableType_BinaryTreeType, + VariableType_SinglyLinkedListType, + VariableType_DoublyLinkedListType, +] +from .variable_type import VariableType as resources_commons_variable_type_VariableType # noqa: E402, F401, I001 diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/map_type.py b/seed/pydantic/trace/src/seed/trace/resources/commons/map_type.py index eb59f496fa3..ef01538cf86 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/map_type.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/map_type.py @@ -1,26 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .list_type_all import MapType as MapType -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class MapType(UniversalBaseModel): - key_type: "VariableType" = pydantic.Field(alias="keyType") - value_type: "VariableType" = pydantic.Field(alias="valueType") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .list_type import ListType # noqa: E402, F401, I001 -from .variable_type import VariableType # noqa: E402, F401, I001 - -update_forward_refs(MapType) +__all__ = ["MapType"] diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/map_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/map_value.py index 7625d5146bc..4c2b22313ee 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/map_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/map_value.py @@ -1,24 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .key_value_pair_all import MapValue as MapValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class MapValue(UniversalBaseModel): - key_value_pairs: typing.List["KeyValuePair"] = pydantic.Field(alias="keyValuePairs") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .key_value_pair import KeyValuePair # noqa: E402, F401, I001 - -update_forward_refs(MapValue) +__all__ = ["MapValue"] diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/variable_type.py b/seed/pydantic/trace/src/seed/trace/resources/commons/variable_type.py index 51a6766e471..e9fccef8185 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/variable_type.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/variable_type.py @@ -1,142 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .list_type_all import VariableType as VariableType -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class VariableType_IntegerType(UniversalBaseModel): - type: typing.Literal["integerType"] = "integerType" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableType_DoubleType(UniversalBaseModel): - type: typing.Literal["doubleType"] = "doubleType" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableType_BooleanType(UniversalBaseModel): - type: typing.Literal["booleanType"] = "booleanType" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableType_StringType(UniversalBaseModel): - type: typing.Literal["stringType"] = "stringType" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableType_CharType(UniversalBaseModel): - type: typing.Literal["charType"] = "charType" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableType_ListType(UniversalBaseModel): - type: typing.Literal["listType"] = "listType" - value_type: "VariableType" = pydantic.Field(alias="valueType") - is_fixed_length: typing.Optional[bool] = pydantic.Field(alias="isFixedLength", default=None) - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableType_MapType(UniversalBaseModel): - type: typing.Literal["mapType"] = "mapType" - key_type: "VariableType" = pydantic.Field(alias="keyType") - value_type: "VariableType" = pydantic.Field(alias="valueType") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .list_type import ListType # noqa: E402, F401, I001 -from .map_type import MapType # noqa: E402, F401, I001 - - -class VariableType_BinaryTreeType(UniversalBaseModel): - type: typing.Literal["binaryTreeType"] = "binaryTreeType" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableType_SinglyLinkedListType(UniversalBaseModel): - type: typing.Literal["singlyLinkedListType"] = "singlyLinkedListType" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableType_DoublyLinkedListType(UniversalBaseModel): - type: typing.Literal["doublyLinkedListType"] = "doublyLinkedListType" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -VariableType = typing.Union[ - VariableType_IntegerType, - VariableType_DoubleType, - VariableType_BooleanType, - VariableType_StringType, - VariableType_CharType, - VariableType_ListType, - VariableType_MapType, - VariableType_BinaryTreeType, - VariableType_SinglyLinkedListType, - VariableType_DoublyLinkedListType, -] -update_forward_refs(VariableType_ListType) -update_forward_refs(VariableType_MapType) +__all__ = ["VariableType"] diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/variable_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/variable_value.py index 2978dd5c31f..649af6257e3 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/variable_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/variable_value.py @@ -1,126 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .key_value_pair_all import VariableValue as VariableValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .binary_tree_node_value import BinaryTreeNodeValue -from .doubly_linked_list_node_value import DoublyLinkedListNodeValue -from .node_id import NodeId -from .singly_linked_list_node_value import SinglyLinkedListNodeValue - - -class VariableValue_IntegerValue(UniversalBaseModel): - value: int - type: typing.Literal["integerValue"] = "integerValue" - - -class VariableValue_BooleanValue(UniversalBaseModel): - value: bool - type: typing.Literal["booleanValue"] = "booleanValue" - - -class VariableValue_DoubleValue(UniversalBaseModel): - value: float - type: typing.Literal["doubleValue"] = "doubleValue" - - -class VariableValue_StringValue(UniversalBaseModel): - value: str - type: typing.Literal["stringValue"] = "stringValue" - - -class VariableValue_CharValue(UniversalBaseModel): - value: str - type: typing.Literal["charValue"] = "charValue" - - -class VariableValue_MapValue(UniversalBaseModel): - type: typing.Literal["mapValue"] = "mapValue" - key_value_pairs: typing.List["KeyValuePair"] = pydantic.Field(alias="keyValuePairs") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -from .map_value import MapValue # noqa: E402, F401, I001 - - -class VariableValue_ListValue(UniversalBaseModel): - value: typing.List["VariableValue"] - type: typing.Literal["listValue"] = "listValue" - - -class VariableValue_BinaryTreeValue(UniversalBaseModel): - type: typing.Literal["binaryTreeValue"] = "binaryTreeValue" - root: typing.Optional[NodeId] = None - nodes: typing.Dict[NodeId, BinaryTreeNodeValue] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableValue_SinglyLinkedListValue(UniversalBaseModel): - type: typing.Literal["singlyLinkedListValue"] = "singlyLinkedListValue" - head: typing.Optional[NodeId] = None - nodes: typing.Dict[NodeId, SinglyLinkedListNodeValue] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableValue_DoublyLinkedListValue(UniversalBaseModel): - type: typing.Literal["doublyLinkedListValue"] = "doublyLinkedListValue" - head: typing.Optional[NodeId] = None - nodes: typing.Dict[NodeId, DoublyLinkedListNodeValue] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class VariableValue_NullValue(UniversalBaseModel): - type: typing.Literal["nullValue"] = "nullValue" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -VariableValue = typing.Union[ - VariableValue_IntegerValue, - VariableValue_BooleanValue, - VariableValue_DoubleValue, - VariableValue_StringValue, - VariableValue_CharValue, - VariableValue_MapValue, - VariableValue_ListValue, - VariableValue_BinaryTreeValue, - VariableValue_SinglyLinkedListValue, - VariableValue_DoublyLinkedListValue, - VariableValue_NullValue, -] -from .key_value_pair import KeyValuePair # noqa: E402, F401, I001 - -update_forward_refs(VariableValue_MapValue) -update_forward_refs(VariableValue_ListValue) +__all__ = ["VariableValue"] diff --git a/seed/python-sdk/accept-header/poetry.lock b/seed/python-sdk/accept-header/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/accept-header/poetry.lock +++ b/seed/python-sdk/accept-header/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/alias-extends/no-custom-config/poetry.lock b/seed/python-sdk/alias-extends/no-custom-config/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/alias-extends/no-custom-config/poetry.lock +++ b/seed/python-sdk/alias-extends/no-custom-config/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/alias-extends/no-inheritance-for-extended-models/poetry.lock b/seed/python-sdk/alias-extends/no-inheritance-for-extended-models/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/alias-extends/no-inheritance-for-extended-models/poetry.lock +++ b/seed/python-sdk/alias-extends/no-inheritance-for-extended-models/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/alias/poetry.lock b/seed/python-sdk/alias/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/alias/poetry.lock +++ b/seed/python-sdk/alias/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/any-auth/poetry.lock b/seed/python-sdk/any-auth/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/any-auth/poetry.lock +++ b/seed/python-sdk/any-auth/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/api-wide-base-path/poetry.lock b/seed/python-sdk/api-wide-base-path/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/api-wide-base-path/poetry.lock +++ b/seed/python-sdk/api-wide-base-path/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/audiences/poetry.lock b/seed/python-sdk/audiences/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/audiences/poetry.lock +++ b/seed/python-sdk/audiences/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/auth-environment-variables/poetry.lock b/seed/python-sdk/auth-environment-variables/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/auth-environment-variables/poetry.lock +++ b/seed/python-sdk/auth-environment-variables/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/basic-auth-environment-variables/poetry.lock b/seed/python-sdk/basic-auth-environment-variables/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/basic-auth-environment-variables/poetry.lock +++ b/seed/python-sdk/basic-auth-environment-variables/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/basic-auth/poetry.lock b/seed/python-sdk/basic-auth/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/basic-auth/poetry.lock +++ b/seed/python-sdk/basic-auth/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/bearer-token-environment-variable/poetry.lock b/seed/python-sdk/bearer-token-environment-variable/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/bearer-token-environment-variable/poetry.lock +++ b/seed/python-sdk/bearer-token-environment-variable/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/bytes-download/poetry.lock b/seed/python-sdk/bytes-download/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/bytes-download/poetry.lock +++ b/seed/python-sdk/bytes-download/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/bytes-upload/poetry.lock b/seed/python-sdk/bytes-upload/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/bytes-upload/poetry.lock +++ b/seed/python-sdk/bytes-upload/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/poetry.lock b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/poetry.lock +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/__init__.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/__init__.py index 436e800ebf8..f165f36681b 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/__init__.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/__init__.py @@ -11,6 +11,13 @@ from .a import A from .ast import ( Acai, + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, Animal, Berry, BranchNode, @@ -19,6 +26,19 @@ ContainerValue_List, ContainerValue_Optional, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, FieldName, FieldValue, FieldValue_ContainerValue, @@ -26,11 +46,31 @@ FieldValue_PrimitiveValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, PrimitiveValue, ) from .client import AsyncSeedApi, SeedApi @@ -38,6 +78,13 @@ _dynamic_imports: typing.Dict[str, str] = { "A": ".a", "Acai": ".ast", + "AndOperator": ".ast", + "AndOperatorChild": ".ast", + "AndOperatorChild_AndOperator": ".ast", + "AndOperatorChild_BooleanLiteral": ".ast", + "AndOperatorChild_EqOperator": ".ast", + "AndOperatorChild_GtOperator": ".ast", + "AndOperatorChild_OrOperator": ".ast", "Animal": ".ast", "AsyncSeedApi": ".client", "Berry": ".ast", @@ -47,6 +94,19 @@ "ContainerValue_List": ".ast", "ContainerValue_Optional": ".ast", "Dog": ".ast", + "EqualsOperator": ".ast", + "EqualsOperatorLeft": ".ast", + "EqualsOperatorLeft_AndOperator": ".ast", + "EqualsOperatorLeft_EqOperator": ".ast", + "EqualsOperatorLeft_GtOperator": ".ast", + "EqualsOperatorLeft_OrOperator": ".ast", + "EqualsOperatorLeft_StringLiteral": ".ast", + "EqualsOperatorRight": ".ast", + "EqualsOperatorRight_AndOperator": ".ast", + "EqualsOperatorRight_EqOperator": ".ast", + "EqualsOperatorRight_GtOperator": ".ast", + "EqualsOperatorRight_OrOperator": ".ast", + "EqualsOperatorRight_StringLiteral": ".ast", "FieldName": ".ast", "FieldValue": ".ast", "FieldValue_ContainerValue": ".ast", @@ -54,12 +114,32 @@ "FieldValue_PrimitiveValue": ".ast", "Fig": ".ast", "Fruit": ".ast", + "GreaterThanOperator": ".ast", + "GreaterThanOperatorLeft": ".ast", + "GreaterThanOperatorLeft_AndOperator": ".ast", + "GreaterThanOperatorLeft_EqOperator": ".ast", + "GreaterThanOperatorLeft_GtOperator": ".ast", + "GreaterThanOperatorLeft_NumberLiteral": ".ast", + "GreaterThanOperatorLeft_OrOperator": ".ast", + "GreaterThanOperatorRight": ".ast", + "GreaterThanOperatorRight_AndOperator": ".ast", + "GreaterThanOperatorRight_EqOperator": ".ast", + "GreaterThanOperatorRight_GtOperator": ".ast", + "GreaterThanOperatorRight_NumberLiteral": ".ast", + "GreaterThanOperatorRight_OrOperator": ".ast", "ImportingA": ".types", "LeafNode": ".ast", "Node": ".ast", "NodesWrapper": ".ast", "ObjectFieldValue": ".ast", "ObjectValue": ".ast", + "OrOperator": ".ast", + "OrOperatorChild": ".ast", + "OrOperatorChild_AndOperator": ".ast", + "OrOperatorChild_BooleanLiteral": ".ast", + "OrOperatorChild_EqOperator": ".ast", + "OrOperatorChild_GtOperator": ".ast", + "OrOperatorChild_OrOperator": ".ast", "PrimitiveValue": ".ast", "RootType": ".types", "SeedApi": ".client", @@ -93,6 +173,13 @@ def __dir__(): __all__ = [ "A", "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", "Animal", "AsyncSeedApi", "Berry", @@ -102,6 +189,19 @@ def __dir__(): "ContainerValue_List", "ContainerValue_Optional", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", "FieldName", "FieldValue", "FieldValue_ContainerValue", @@ -109,12 +209,32 @@ def __dir__(): "FieldValue_PrimitiveValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", "ImportingA", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", "PrimitiveValue", "RootType", "SeedApi", diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/__init__.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/__init__.py index bc9eaa84a94..b658bb6b991 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/__init__.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/__init__.py @@ -8,6 +8,13 @@ if typing.TYPE_CHECKING: from .types import ( Acai, + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, Animal, Berry, BranchNode, @@ -16,6 +23,19 @@ ContainerValue_List, ContainerValue_Optional, Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, FieldName, FieldValue, FieldValue_ContainerValue, @@ -23,15 +43,42 @@ FieldValue_PrimitiveValue, Fig, Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, LeafNode, Node, NodesWrapper, ObjectFieldValue, ObjectValue, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, PrimitiveValue, ) _dynamic_imports: typing.Dict[str, str] = { "Acai": ".types", + "AndOperator": ".types", + "AndOperatorChild": ".types", + "AndOperatorChild_AndOperator": ".types", + "AndOperatorChild_BooleanLiteral": ".types", + "AndOperatorChild_EqOperator": ".types", + "AndOperatorChild_GtOperator": ".types", + "AndOperatorChild_OrOperator": ".types", "Animal": ".types", "Berry": ".types", "BranchNode": ".types", @@ -40,6 +87,19 @@ "ContainerValue_List": ".types", "ContainerValue_Optional": ".types", "Dog": ".types", + "EqualsOperator": ".types", + "EqualsOperatorLeft": ".types", + "EqualsOperatorLeft_AndOperator": ".types", + "EqualsOperatorLeft_EqOperator": ".types", + "EqualsOperatorLeft_GtOperator": ".types", + "EqualsOperatorLeft_OrOperator": ".types", + "EqualsOperatorLeft_StringLiteral": ".types", + "EqualsOperatorRight": ".types", + "EqualsOperatorRight_AndOperator": ".types", + "EqualsOperatorRight_EqOperator": ".types", + "EqualsOperatorRight_GtOperator": ".types", + "EqualsOperatorRight_OrOperator": ".types", + "EqualsOperatorRight_StringLiteral": ".types", "FieldName": ".types", "FieldValue": ".types", "FieldValue_ContainerValue": ".types", @@ -47,11 +107,31 @@ "FieldValue_PrimitiveValue": ".types", "Fig": ".types", "Fruit": ".types", + "GreaterThanOperator": ".types", + "GreaterThanOperatorLeft": ".types", + "GreaterThanOperatorLeft_AndOperator": ".types", + "GreaterThanOperatorLeft_EqOperator": ".types", + "GreaterThanOperatorLeft_GtOperator": ".types", + "GreaterThanOperatorLeft_NumberLiteral": ".types", + "GreaterThanOperatorLeft_OrOperator": ".types", + "GreaterThanOperatorRight": ".types", + "GreaterThanOperatorRight_AndOperator": ".types", + "GreaterThanOperatorRight_EqOperator": ".types", + "GreaterThanOperatorRight_GtOperator": ".types", + "GreaterThanOperatorRight_NumberLiteral": ".types", + "GreaterThanOperatorRight_OrOperator": ".types", "LeafNode": ".types", "Node": ".types", "NodesWrapper": ".types", "ObjectFieldValue": ".types", "ObjectValue": ".types", + "OrOperator": ".types", + "OrOperatorChild": ".types", + "OrOperatorChild_AndOperator": ".types", + "OrOperatorChild_BooleanLiteral": ".types", + "OrOperatorChild_EqOperator": ".types", + "OrOperatorChild_GtOperator": ".types", + "OrOperatorChild_OrOperator": ".types", "PrimitiveValue": ".types", } @@ -79,6 +159,13 @@ def __dir__(): __all__ = [ "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", "Animal", "Berry", "BranchNode", @@ -87,6 +174,19 @@ def __dir__(): "ContainerValue_List", "ContainerValue_Optional", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", "FieldName", "FieldValue", "FieldValue_ContainerValue", @@ -94,10 +194,30 @@ def __dir__(): "FieldValue_PrimitiveValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", "PrimitiveValue", ] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/__init__.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/__init__.py index 5a1ddab8ad1..cd2955fc318 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/__init__.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/__init__.py @@ -6,45 +6,127 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .acai import Acai - from .animal import Animal - from .berry import Berry - from .branch_node import BranchNode - from .cat import Cat - from .container_value import ContainerValue, ContainerValue_List, ContainerValue_Optional - from .dog import Dog + from .acai_all import Acai, Animal, Berry, Cat, Dog, Fig, Fruit + from .and_operator_all import ( + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, + ) + from .branch_node_all import BranchNode, Node + from .container_value_all import ( + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, + ) from .field_name import FieldName - from .field_value import FieldValue, FieldValue_ContainerValue, FieldValue_ObjectValue, FieldValue_PrimitiveValue - from .fig import Fig - from .fruit import Fruit from .leaf_node import LeafNode - from .node import Node from .nodes_wrapper import NodesWrapper from .object_field_value import ObjectFieldValue from .object_value import ObjectValue from .primitive_value import PrimitiveValue _dynamic_imports: typing.Dict[str, str] = { - "Acai": ".acai", - "Animal": ".animal", - "Berry": ".berry", - "BranchNode": ".branch_node", - "Cat": ".cat", - "ContainerValue": ".container_value", - "ContainerValue_List": ".container_value", - "ContainerValue_Optional": ".container_value", - "Dog": ".dog", + "Acai": ".acai_all", + "AndOperator": ".and_operator_all", + "AndOperatorChild": ".and_operator_all", + "AndOperatorChild_AndOperator": ".and_operator_all", + "AndOperatorChild_BooleanLiteral": ".and_operator_all", + "AndOperatorChild_EqOperator": ".and_operator_all", + "AndOperatorChild_GtOperator": ".and_operator_all", + "AndOperatorChild_OrOperator": ".and_operator_all", + "Animal": ".acai_all", + "Berry": ".acai_all", + "BranchNode": ".branch_node_all", + "Cat": ".acai_all", + "ContainerValue": ".container_value_all", + "ContainerValue_List": ".container_value_all", + "ContainerValue_Optional": ".container_value_all", + "Dog": ".acai_all", + "EqualsOperator": ".and_operator_all", + "EqualsOperatorLeft": ".and_operator_all", + "EqualsOperatorLeft_AndOperator": ".and_operator_all", + "EqualsOperatorLeft_EqOperator": ".and_operator_all", + "EqualsOperatorLeft_GtOperator": ".and_operator_all", + "EqualsOperatorLeft_OrOperator": ".and_operator_all", + "EqualsOperatorLeft_StringLiteral": ".and_operator_all", + "EqualsOperatorRight": ".and_operator_all", + "EqualsOperatorRight_AndOperator": ".and_operator_all", + "EqualsOperatorRight_EqOperator": ".and_operator_all", + "EqualsOperatorRight_GtOperator": ".and_operator_all", + "EqualsOperatorRight_OrOperator": ".and_operator_all", + "EqualsOperatorRight_StringLiteral": ".and_operator_all", "FieldName": ".field_name", - "FieldValue": ".field_value", - "FieldValue_ContainerValue": ".field_value", - "FieldValue_ObjectValue": ".field_value", - "FieldValue_PrimitiveValue": ".field_value", - "Fig": ".fig", - "Fruit": ".fruit", + "FieldValue": ".container_value_all", + "FieldValue_ContainerValue": ".container_value_all", + "FieldValue_ObjectValue": ".container_value_all", + "FieldValue_PrimitiveValue": ".container_value_all", + "Fig": ".acai_all", + "Fruit": ".acai_all", + "GreaterThanOperator": ".and_operator_all", + "GreaterThanOperatorLeft": ".and_operator_all", + "GreaterThanOperatorLeft_AndOperator": ".and_operator_all", + "GreaterThanOperatorLeft_EqOperator": ".and_operator_all", + "GreaterThanOperatorLeft_GtOperator": ".and_operator_all", + "GreaterThanOperatorLeft_NumberLiteral": ".and_operator_all", + "GreaterThanOperatorLeft_OrOperator": ".and_operator_all", + "GreaterThanOperatorRight": ".and_operator_all", + "GreaterThanOperatorRight_AndOperator": ".and_operator_all", + "GreaterThanOperatorRight_EqOperator": ".and_operator_all", + "GreaterThanOperatorRight_GtOperator": ".and_operator_all", + "GreaterThanOperatorRight_NumberLiteral": ".and_operator_all", + "GreaterThanOperatorRight_OrOperator": ".and_operator_all", "LeafNode": ".leaf_node", - "Node": ".node", + "Node": ".branch_node_all", "NodesWrapper": ".nodes_wrapper", "ObjectFieldValue": ".object_field_value", "ObjectValue": ".object_value", + "OrOperator": ".and_operator_all", + "OrOperatorChild": ".and_operator_all", + "OrOperatorChild_AndOperator": ".and_operator_all", + "OrOperatorChild_BooleanLiteral": ".and_operator_all", + "OrOperatorChild_EqOperator": ".and_operator_all", + "OrOperatorChild_GtOperator": ".and_operator_all", + "OrOperatorChild_OrOperator": ".and_operator_all", "PrimitiveValue": ".primitive_value", } @@ -72,6 +154,13 @@ def __dir__(): __all__ = [ "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", "Animal", "Berry", "BranchNode", @@ -80,6 +169,19 @@ def __dir__(): "ContainerValue_List", "ContainerValue_Optional", "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", "FieldName", "FieldValue", "FieldValue_ContainerValue", @@ -87,10 +189,30 @@ def __dir__(): "FieldValue_PrimitiveValue", "Fig", "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", "LeafNode", "Node", "NodesWrapper", "ObjectFieldValue", "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", "PrimitiveValue", ] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/acai.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/acai.py index dae6ffc645b..06dc06d5aa6 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/acai.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/acai.py @@ -1,30 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Acai as Acai -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Acai(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .berry import Berry # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Acai) +__all__ = ["Acai"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/acai_all.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/acai_all.py new file mode 100644 index 00000000000..19c6d14b159 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/acai_all.py @@ -0,0 +1,95 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .acai import Acai as ast_types_acai_Acai + from .cat import Cat as ast_types_cat_Cat + from .dog import Dog as ast_types_dog_Dog + from .fig import Fig as ast_types_fig_Fig + + +class Acai(UniversalBaseModel): + animal: "ast_types_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +Animal = typing.Union["ast_types_cat_Cat", "ast_types_dog_Dog"] + + +class Berry(UniversalBaseModel): + animal: "ast_types_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class Cat(UniversalBaseModel): + fruit: "ast_types_fruit_Fruit" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class Dog(UniversalBaseModel): + fruit: "ast_types_fruit_Fruit" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .fig import Fig as ast_types_fig_Fig # noqa: E402, F401, I001 +from .fruit import Fruit as ast_types_fruit_Fruit # noqa: E402, F401, I001 + + +class Fig(UniversalBaseModel): + animal: "ast_types_animal_Animal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .berry import Berry as ast_types_berry_Berry # noqa: E402, F401, I001 +from .cat import Cat as ast_types_cat_Cat # noqa: E402, F401, I001 +from .dog import Dog as ast_types_dog_Dog # noqa: E402, F401, I001 +from .animal import Animal as ast_types_animal_Animal # noqa: E402, F401, I001 +from .acai import Acai as ast_types_acai_Acai # noqa: E402, F401, I001 + +Fruit = typing.Union["ast_types_acai_Acai", "ast_types_fig_Fig"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/and_operator.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/and_operator.py new file mode 100644 index 00000000000..f3c921a6c39 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/and_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperator as AndOperator + +__all__ = ["AndOperator"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/and_operator_all.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/and_operator_all.py new file mode 100644 index 00000000000..7b1faa72c9e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/and_operator_all.py @@ -0,0 +1,562 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class AndOperator(UniversalBaseModel): + """ + Deep circular reference pattern mimicking elevenlabs AST operators + """ + + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AndOperatorChild_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AndOperatorChild_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AndOperatorChild_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AndOperatorChild_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AndOperatorChild_BooleanLiteral(UniversalBaseModel): + value: bool + type: typing.Literal["boolean_literal"] = "boolean_literal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +AndOperatorChild = typing.Union[ + AndOperatorChild_AndOperator, + AndOperatorChild_OrOperator, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_BooleanLiteral, +] + + +class EqualsOperator(UniversalBaseModel): + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_StringLiteral(UniversalBaseModel): + value: str + type: typing.Literal["string_literal"] = "string_literal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +EqualsOperatorLeft = typing.Union[ + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_StringLiteral, +] + + +class EqualsOperatorRight_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_StringLiteral(UniversalBaseModel): + value: str + type: typing.Literal["string_literal"] = "string_literal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +EqualsOperatorRight = typing.Union[ + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_StringLiteral, +] + + +class GreaterThanOperator(UniversalBaseModel): + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_NumberLiteral(UniversalBaseModel): + value: float + type: typing.Literal["number_literal"] = "number_literal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +GreaterThanOperatorLeft = typing.Union[ + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, +] + + +class GreaterThanOperatorRight_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_NumberLiteral(UniversalBaseModel): + value: float + type: typing.Literal["number_literal"] = "number_literal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +GreaterThanOperatorRight = typing.Union[ + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_OrOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, +] + + +class OrOperator(UniversalBaseModel): + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OrOperatorChild_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OrOperatorChild_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OrOperatorChild_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OrOperatorChild_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .equals_operator import EqualsOperator as ast_types_equals_operator_EqualsOperator # noqa: E402, F401, I001 +from .greater_than_operator import GreaterThanOperator as ast_types_greater_than_operator_GreaterThanOperator # noqa: E402, F401, I001 +from .or_operator import OrOperator as ast_types_or_operator_OrOperator # noqa: E402, F401, I001 +from .and_operator import AndOperator as ast_types_and_operator_AndOperator # noqa: E402, F401, I001 + + +class OrOperatorChild_BooleanLiteral(UniversalBaseModel): + value: bool + type: typing.Literal["boolean_literal"] = "boolean_literal" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +OrOperatorChild = typing.Union[ + OrOperatorChild_AndOperator, + OrOperatorChild_OrOperator, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_BooleanLiteral, +] +from .and_operator_child import AndOperatorChild as ast_types_and_operator_child_AndOperatorChild # noqa: E402, F401, I001 +from .or_operator_child import OrOperatorChild as ast_types_or_operator_child_OrOperatorChild # noqa: E402, F401, I001 +from .equals_operator_left import EqualsOperatorLeft as ast_types_equals_operator_left_EqualsOperatorLeft # noqa: E402, F401, I001 +from .equals_operator_right import EqualsOperatorRight as ast_types_equals_operator_right_EqualsOperatorRight # noqa: E402, F401, I001 +from .greater_than_operator_left import ( + GreaterThanOperatorLeft as ast_types_greater_than_operator_left_GreaterThanOperatorLeft, +) # noqa: E402, F401, I001 +from .greater_than_operator_right import ( + GreaterThanOperatorRight as ast_types_greater_than_operator_right_GreaterThanOperatorRight, +) # noqa: E402, F401, I001 diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/and_operator_child.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/and_operator_child.py new file mode 100644 index 00000000000..0c043b87dbb --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/and_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperatorChild as AndOperatorChild + +__all__ = ["AndOperatorChild"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/animal.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/animal.py index ce527295dff..bc07c7d3b20 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/animal.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/animal.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Animal as Animal -import typing - -if typing.TYPE_CHECKING: - from .cat import Cat - from .dog import Dog -Animal = typing.Union["Cat", "Dog"] +__all__ = ["Animal"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/berry.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/berry.py index 334261046a6..1131a180b1a 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/berry.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/berry.py @@ -1,30 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Berry as Berry -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Berry(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Berry) +__all__ = ["Berry"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/branch_node.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/branch_node.py index 3299d0b4e52..e53f75d7362 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/branch_node.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/branch_node.py @@ -1,26 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .branch_node_all import BranchNode as BranchNode -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class BranchNode(UniversalBaseModel): - children: typing.List["Node"] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .node import Node # noqa: E402, F401, I001 - -update_forward_refs(BranchNode) +__all__ = ["BranchNode"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/branch_node_all.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/branch_node_all.py new file mode 100644 index 00000000000..cef2462d79a --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/branch_node_all.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .leaf_node import LeafNode + +if typing.TYPE_CHECKING: + from .branch_node import BranchNode as ast_types_branch_node_BranchNode + + +class BranchNode(UniversalBaseModel): + children: typing.List["ast_types_node_Node"] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .branch_node import BranchNode as ast_types_branch_node_BranchNode # noqa: E402, F401, I001 +from .node import Node as ast_types_node_Node # noqa: E402, F401, I001 + +Node = typing.Union["ast_types_branch_node_BranchNode", LeafNode] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/cat.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/cat.py index 2e83f479949..3d1211c6497 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/cat.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/cat.py @@ -1,30 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Cat as Cat -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Cat(UniversalBaseModel): - fruit: "Fruit" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .berry import Berry # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .fruit import Fruit # noqa: E402, F401, I001 - -update_forward_refs(Cat) +__all__ = ["Cat"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/container_value.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/container_value.py index 3512c8df435..d3b9fbcdba7 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/container_value.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/container_value.py @@ -1,41 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class ContainerValue_List(UniversalBaseModel): - value: typing.List["FieldValue"] - type: typing.Literal["list"] = "list" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -class ContainerValue_Optional(UniversalBaseModel): - value: typing.Optional["FieldValue"] = None - type: typing.Literal["optional"] = "optional" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] -from .field_value import FieldValue # noqa: E402, F401, I001 - -update_forward_refs(ContainerValue_List) -update_forward_refs(ContainerValue_Optional) +__all__ = ["ContainerValue"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/container_value_all.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/container_value_all.py new file mode 100644 index 00000000000..0d4bc73d8f4 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/container_value_all.py @@ -0,0 +1,86 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs +from .primitive_value import PrimitiveValue + + +class ContainerValue_List(UniversalBaseModel): + value: typing.List["ast_types_field_value_FieldValue"] + type: typing.Literal["list"] = "list" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +class ContainerValue_Optional(UniversalBaseModel): + value: typing.Optional["ast_types_field_value_FieldValue"] = None + type: typing.Literal["optional"] = "optional" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] +from .field_value import FieldValue as ast_types_field_value_FieldValue # noqa: E402, F401, I001 + + +class FieldValue_PrimitiveValue(UniversalBaseModel): + value: PrimitiveValue + type: typing.Literal["primitive_value"] = "primitive_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +class FieldValue_ObjectValue(UniversalBaseModel): + type: typing.Literal["object_value"] = "object_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FieldValue_ContainerValue(UniversalBaseModel): + value: "ast_types_container_value_ContainerValue" + type: typing.Literal["container_value"] = "container_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] +from .container_value import ContainerValue as ast_types_container_value_ContainerValue # noqa: E402, F401, I001 + +update_forward_refs(ContainerValue_List) +update_forward_refs(ContainerValue_Optional) +update_forward_refs(FieldValue_ContainerValue) diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/dog.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/dog.py index 52b61357865..bc696fce765 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/dog.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/dog.py @@ -1,30 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Dog as Dog -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Dog(UniversalBaseModel): - fruit: "Fruit" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .berry import Berry # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .fig import Fig # noqa: E402, F401, I001 -from .fruit import Fruit # noqa: E402, F401, I001 - -update_forward_refs(Dog) +__all__ = ["Dog"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/equals_operator.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/equals_operator.py new file mode 100644 index 00000000000..3a95724f67a --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/equals_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperator as EqualsOperator + +__all__ = ["EqualsOperator"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/equals_operator_left.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/equals_operator_left.py new file mode 100644 index 00000000000..53901b8504e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/equals_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorLeft as EqualsOperatorLeft + +__all__ = ["EqualsOperatorLeft"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/equals_operator_right.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/equals_operator_right.py new file mode 100644 index 00000000000..4348ffe8d3f --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/equals_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorRight as EqualsOperatorRight + +__all__ = ["EqualsOperatorRight"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/field_value.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/field_value.py index 2aa54df1b0e..88d4a5e9c2d 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/field_value.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/field_value.py @@ -1,54 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .primitive_value import PrimitiveValue - - -class FieldValue_PrimitiveValue(UniversalBaseModel): - value: PrimitiveValue - type: typing.Literal["primitive_value"] = "primitive_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -class FieldValue_ObjectValue(UniversalBaseModel): - type: typing.Literal["object_value"] = "object_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class FieldValue_ContainerValue(UniversalBaseModel): - value: "ContainerValue" - type: typing.Literal["container_value"] = "container_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] -from .container_value import ContainerValue # noqa: E402, F401, I001 - -update_forward_refs(FieldValue_ContainerValue) +__all__ = ["FieldValue"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/fig.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/fig.py index 8909278fc5f..cf5006340ba 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/fig.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/fig.py @@ -1,30 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Fig as Fig -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class Fig(UniversalBaseModel): - animal: "Animal" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .acai import Acai # noqa: E402, F401, I001 -from .berry import Berry # noqa: E402, F401, I001 -from .cat import Cat # noqa: E402, F401, I001 -from .dog import Dog # noqa: E402, F401, I001 -from .animal import Animal # noqa: E402, F401, I001 - -update_forward_refs(Fig) +__all__ = ["Fig"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/fruit.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/fruit.py index 0a4a5e8b439..6f9ff11e1b4 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/fruit.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/fruit.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .acai_all import Fruit as Fruit -import typing - -if typing.TYPE_CHECKING: - from .acai import Acai - from .fig import Fig -Fruit = typing.Union["Acai", "Fig"] +__all__ = ["Fruit"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/greater_than_operator.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/greater_than_operator.py new file mode 100644 index 00000000000..56a53f19013 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/greater_than_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperator as GreaterThanOperator + +__all__ = ["GreaterThanOperator"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/greater_than_operator_left.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/greater_than_operator_left.py new file mode 100644 index 00000000000..0958d95ca84 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/greater_than_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorLeft as GreaterThanOperatorLeft + +__all__ = ["GreaterThanOperatorLeft"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/greater_than_operator_right.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/greater_than_operator_right.py new file mode 100644 index 00000000000..20234cb9d0e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/greater_than_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorRight as GreaterThanOperatorRight + +__all__ = ["GreaterThanOperatorRight"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/node.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/node.py index 50575ba6722..f8d6f92d33c 100644 --- a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/node.py +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/node.py @@ -1,11 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .branch_node_all import Node as Node -import typing - -from .leaf_node import LeafNode - -if typing.TYPE_CHECKING: - from .branch_node import BranchNode -Node = typing.Union["BranchNode", LeafNode] +__all__ = ["Node"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/or_operator.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/or_operator.py new file mode 100644 index 00000000000..04bc907e4c8 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/or_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperator as OrOperator + +__all__ = ["OrOperator"] diff --git a/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/or_operator_child.py b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/or_operator_child.py new file mode 100644 index 00000000000..49d1ffed627 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/no-inheritance-for-extended-models/src/seed/ast/types/or_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperatorChild as OrOperatorChild + +__all__ = ["OrOperatorChild"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/.github/workflows/ci.yml b/seed/python-sdk/circular-references-advanced/pydantic-v1/.github/workflows/ci.yml new file mode 100644 index 00000000000..bfde52e511c --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/.github/workflows/ci.yml @@ -0,0 +1,61 @@ +name: ci + +on: [push] +jobs: + compile: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Compile + run: poetry run mypy . + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + + - name: Test + run: poetry run pytest -rP . + + publish: + needs: [compile, test] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Publish to pypi + run: | + poetry config repositories.remote + poetry --no-interaction -v publish --build --repository remote --username "$" --password "$" + env: + : ${{ secrets. }} + : ${{ secrets. }} diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/.gitignore b/seed/python-sdk/circular-references-advanced/pydantic-v1/.gitignore new file mode 100644 index 00000000000..d2e4ca808d2 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/.gitignore @@ -0,0 +1,5 @@ +.mypy_cache/ +.ruff_cache/ +__pycache__/ +dist/ +poetry.toml diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/README.md b/seed/python-sdk/circular-references-advanced/pydantic-v1/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/poetry.lock b/seed/python-sdk/circular-references-advanced/pydantic-v1/poetry.lock new file mode 100644 index 00000000000..c310762e7c3 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/poetry.lock @@ -0,0 +1,578 @@ +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. + +[[package]] +name = "anyio" +version = "4.5.2" +description = "High level compatibility layer for multiple asynchronous event loop implementations" +optional = false +python-versions = ">=3.8" +files = [ + {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, + {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, +] + +[package.dependencies] +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +idna = ">=2.8" +sniffio = ">=1.1" +typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} + +[package.extras] +doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] +trio = ["trio (>=0.26.1)"] + +[[package]] +name = "certifi" +version = "2025.10.5" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.7" +files = [ + {file = "certifi-2025.10.5-py3-none-any.whl", hash = "sha256:0f212c2744a9bb6de0c56639a6f68afe01ecd92d91f14ae897c4fe7bbeeef0de"}, + {file = "certifi-2025.10.5.tar.gz", hash = "sha256:47c09d31ccf2acf0be3f701ea53595ee7e0b8fa08801c6624be771df09ae7b43"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.0" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"}, + {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "h11" +version = "0.16.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.8" +files = [ + {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, + {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, + {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.16" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<1.0)"] + +[[package]] +name = "httpx" +version = "0.28.1" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, + {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "idna" +version = "3.11" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.8" +files = [ + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, +] + +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + +[[package]] +name = "iniconfig" +version = "2.1.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.8" +files = [ + {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"}, + {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, +] + +[[package]] +name = "mypy" +version = "1.13.0" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, + {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, + {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, + {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, + {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, + {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, + {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, + {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, + {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, + {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, + {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, + {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, + {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, + {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, + {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, + {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, + {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, + {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, + {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, + {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, + {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, + {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, +] + +[package.dependencies] +mypy-extensions = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=4.6.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.8" +files = [ + {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, + {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, +] + +[[package]] +name = "packaging" +version = "25.0" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, + {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "pydantic" +version = "1.10.14" +description = "Data validation and settings management using python type hints" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic-1.10.14-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7f4fcec873f90537c382840f330b90f4715eebc2bc9925f04cb92de593eae054"}, + {file = "pydantic-1.10.14-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8e3a76f571970fcd3c43ad982daf936ae39b3e90b8a2e96c04113a369869dc87"}, + {file = "pydantic-1.10.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82d886bd3c3fbeaa963692ef6b643159ccb4b4cefaf7ff1617720cbead04fd1d"}, + {file = "pydantic-1.10.14-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:798a3d05ee3b71967844a1164fd5bdb8c22c6d674f26274e78b9f29d81770c4e"}, + {file = "pydantic-1.10.14-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:23d47a4b57a38e8652bcab15a658fdb13c785b9ce217cc3a729504ab4e1d6bc9"}, + {file = "pydantic-1.10.14-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f9f674b5c3bebc2eba401de64f29948ae1e646ba2735f884d1594c5f675d6f2a"}, + {file = "pydantic-1.10.14-cp310-cp310-win_amd64.whl", hash = "sha256:24a7679fab2e0eeedb5a8924fc4a694b3bcaac7d305aeeac72dd7d4e05ecbebf"}, + {file = "pydantic-1.10.14-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9d578ac4bf7fdf10ce14caba6f734c178379bd35c486c6deb6f49006e1ba78a7"}, + {file = "pydantic-1.10.14-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fa7790e94c60f809c95602a26d906eba01a0abee9cc24150e4ce2189352deb1b"}, + {file = "pydantic-1.10.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aad4e10efa5474ed1a611b6d7f0d130f4aafadceb73c11d9e72823e8f508e663"}, + {file = "pydantic-1.10.14-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1245f4f61f467cb3dfeced2b119afef3db386aec3d24a22a1de08c65038b255f"}, + {file = "pydantic-1.10.14-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:21efacc678a11114c765eb52ec0db62edffa89e9a562a94cbf8fa10b5db5c046"}, + {file = "pydantic-1.10.14-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:412ab4a3f6dbd2bf18aefa9f79c7cca23744846b31f1d6555c2ee2b05a2e14ca"}, + {file = "pydantic-1.10.14-cp311-cp311-win_amd64.whl", hash = "sha256:e897c9f35281f7889873a3e6d6b69aa1447ceb024e8495a5f0d02ecd17742a7f"}, + {file = "pydantic-1.10.14-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d604be0f0b44d473e54fdcb12302495fe0467c56509a2f80483476f3ba92b33c"}, + {file = "pydantic-1.10.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a42c7d17706911199798d4c464b352e640cab4351efe69c2267823d619a937e5"}, + {file = "pydantic-1.10.14-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:596f12a1085e38dbda5cbb874d0973303e34227b400b6414782bf205cc14940c"}, + {file = "pydantic-1.10.14-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bfb113860e9288d0886e3b9e49d9cf4a9d48b441f52ded7d96db7819028514cc"}, + {file = "pydantic-1.10.14-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:bc3ed06ab13660b565eed80887fcfbc0070f0aa0691fbb351657041d3e874efe"}, + {file = "pydantic-1.10.14-cp37-cp37m-win_amd64.whl", hash = "sha256:ad8c2bc677ae5f6dbd3cf92f2c7dc613507eafe8f71719727cbc0a7dec9a8c01"}, + {file = "pydantic-1.10.14-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c37c28449752bb1f47975d22ef2882d70513c546f8f37201e0fec3a97b816eee"}, + {file = "pydantic-1.10.14-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:49a46a0994dd551ec051986806122767cf144b9702e31d47f6d493c336462597"}, + {file = "pydantic-1.10.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53e3819bd20a42470d6dd0fe7fc1c121c92247bca104ce608e609b59bc7a77ee"}, + {file = "pydantic-1.10.14-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0fbb503bbbbab0c588ed3cd21975a1d0d4163b87e360fec17a792f7d8c4ff29f"}, + {file = "pydantic-1.10.14-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:336709883c15c050b9c55a63d6c7ff09be883dbc17805d2b063395dd9d9d0022"}, + {file = "pydantic-1.10.14-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:4ae57b4d8e3312d486e2498d42aed3ece7b51848336964e43abbf9671584e67f"}, + {file = "pydantic-1.10.14-cp38-cp38-win_amd64.whl", hash = "sha256:dba49d52500c35cfec0b28aa8b3ea5c37c9df183ffc7210b10ff2a415c125c4a"}, + {file = "pydantic-1.10.14-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c66609e138c31cba607d8e2a7b6a5dc38979a06c900815495b2d90ce6ded35b4"}, + {file = "pydantic-1.10.14-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d986e115e0b39604b9eee3507987368ff8148222da213cd38c359f6f57b3b347"}, + {file = "pydantic-1.10.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:646b2b12df4295b4c3148850c85bff29ef6d0d9621a8d091e98094871a62e5c7"}, + {file = "pydantic-1.10.14-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:282613a5969c47c83a8710cc8bfd1e70c9223feb76566f74683af889faadc0ea"}, + {file = "pydantic-1.10.14-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:466669501d08ad8eb3c4fecd991c5e793c4e0bbd62299d05111d4f827cded64f"}, + {file = "pydantic-1.10.14-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:13e86a19dca96373dcf3190fcb8797d40a6f12f154a244a8d1e8e03b8f280593"}, + {file = "pydantic-1.10.14-cp39-cp39-win_amd64.whl", hash = "sha256:08b6ec0917c30861e3fe71a93be1648a2aa4f62f866142ba21670b24444d7fd8"}, + {file = "pydantic-1.10.14-py3-none-any.whl", hash = "sha256:8ee853cd12ac2ddbf0ecbac1c289f95882b2d4482258048079d13be700aa114c"}, + {file = "pydantic-1.10.14.tar.gz", hash = "sha256:46f17b832fe27de7850896f3afee50ea682220dd218f7e9c88d436788419dca6"}, +] + +[package.dependencies] +typing-extensions = ">=4.2.0" + +[package.extras] +dotenv = ["python-dotenv (>=0.10.4)"] +email = ["email-validator (>=1.0.3)"] + +[[package]] +name = "pydantic-core" +version = "2.27.2" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, + {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"}, + {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"}, + {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"}, + {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"}, + {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"}, + {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"}, + {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"}, + {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"}, + {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"}, + {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"}, + {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"}, + {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"}, + {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"}, + {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"}, + {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"}, + {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"}, + {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + +[[package]] +name = "pytest" +version = "7.4.4" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, + {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} + +[package.extras] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "pytest-asyncio" +version = "0.23.8" +description = "Pytest support for asyncio" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, + {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, +] + +[package.dependencies] +pytest = ">=7.0.0,<9" + +[package.extras] +docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] +testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "ruff" +version = "0.11.5" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruff-0.11.5-py3-none-linux_armv6l.whl", hash = "sha256:2561294e108eb648e50f210671cc56aee590fb6167b594144401532138c66c7b"}, + {file = "ruff-0.11.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ac12884b9e005c12d0bd121f56ccf8033e1614f736f766c118ad60780882a077"}, + {file = "ruff-0.11.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4bfd80a6ec559a5eeb96c33f832418bf0fb96752de0539905cf7b0cc1d31d779"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0947c0a1afa75dcb5db4b34b070ec2bccee869d40e6cc8ab25aca11a7d527794"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ad871ff74b5ec9caa66cb725b85d4ef89b53f8170f47c3406e32ef040400b038"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e6cf918390cfe46d240732d4d72fa6e18e528ca1f60e318a10835cf2fa3dc19f"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:56145ee1478582f61c08f21076dc59153310d606ad663acc00ea3ab5b2125f82"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e5f66f8f1e8c9fc594cbd66fbc5f246a8d91f916cb9667e80208663ec3728304"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80b4df4d335a80315ab9afc81ed1cff62be112bd165e162b5eed8ac55bfc8470"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3068befab73620b8a0cc2431bd46b3cd619bc17d6f7695a3e1bb166b652c382a"}, + {file = "ruff-0.11.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f5da2e710a9641828e09aa98b92c9ebbc60518fdf3921241326ca3e8f8e55b8b"}, + {file = "ruff-0.11.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ef39f19cb8ec98cbc762344921e216f3857a06c47412030374fffd413fb8fd3a"}, + {file = "ruff-0.11.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b2a7cedf47244f431fd11aa5a7e2806dda2e0c365873bda7834e8f7d785ae159"}, + {file = "ruff-0.11.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:81be52e7519f3d1a0beadcf8e974715b2dfc808ae8ec729ecfc79bddf8dbb783"}, + {file = "ruff-0.11.5-py3-none-win32.whl", hash = "sha256:e268da7b40f56e3eca571508a7e567e794f9bfcc0f412c4b607931d3af9c4afe"}, + {file = "ruff-0.11.5-py3-none-win_amd64.whl", hash = "sha256:6c6dc38af3cfe2863213ea25b6dc616d679205732dc0fb673356c2d69608f800"}, + {file = "ruff-0.11.5-py3-none-win_arm64.whl", hash = "sha256:67e241b4314f4eacf14a601d586026a962f4002a475aa702c69980a38087aa4e"}, + {file = "ruff-0.11.5.tar.gz", hash = "sha256:cae2e2439cb88853e421901ec040a758960b576126dab520fa08e9de431d1bef"}, +] + +[[package]] +name = "six" +version = "1.17.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +description = "Sniff out which async library your code is running under" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, + {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, +] + +[[package]] +name = "tomli" +version = "2.3.0" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"}, + {file = "tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba"}, + {file = "tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf"}, + {file = "tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441"}, + {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845"}, + {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c"}, + {file = "tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456"}, + {file = "tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be"}, + {file = "tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac"}, + {file = "tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22"}, + {file = "tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f"}, + {file = "tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52"}, + {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8"}, + {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6"}, + {file = "tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876"}, + {file = "tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878"}, + {file = "tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b"}, + {file = "tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae"}, + {file = "tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b"}, + {file = "tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf"}, + {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f"}, + {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05"}, + {file = "tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606"}, + {file = "tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999"}, + {file = "tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e"}, + {file = "tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3"}, + {file = "tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc"}, + {file = "tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0"}, + {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879"}, + {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005"}, + {file = "tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463"}, + {file = "tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8"}, + {file = "tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77"}, + {file = "tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf"}, + {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530"}, + {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b"}, + {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67"}, + {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f"}, + {file = "tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0"}, + {file = "tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba"}, + {file = "tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b"}, + {file = "tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549"}, +] + +[[package]] +name = "types-python-dateutil" +version = "2.9.0.20241206" +description = "Typing stubs for python-dateutil" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"}, + {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"}, +] + +[[package]] +name = "typing-extensions" +version = "4.13.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, + {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, +] + +[metadata] +lock-version = "2.0" +python-versions = "^3.8" +content-hash = "f58b171d0e03c5868956a34d9c447369d87a2b3a4734444964398baf1185a85f" diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/pyproject.toml b/seed/python-sdk/circular-references-advanced/pydantic-v1/pyproject.toml new file mode 100644 index 00000000000..cec9475f889 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/pyproject.toml @@ -0,0 +1,84 @@ +[project] +name = "fern_circular-references-advanced" + +[tool.poetry] +name = "fern_circular-references-advanced" +version = "0.0.1" +description = "" +readme = "README.md" +authors = [] +keywords = [] + +classifiers = [ + "Intended Audience :: Developers", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: OS Independent", + "Operating System :: POSIX", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed" +] +packages = [ + { include = "seed", from = "src"} +] + +[project.urls] +Repository = 'https://github.com/circular-references-advanced/fern' + +[tool.poetry.dependencies] +python = "^3.8" +httpx = ">=0.21.2" +pydantic = ">= 1.9.2,<= 1.10.14" +pydantic-core = ">=2.18.2" +typing_extensions = ">= 4.0.0" + +[tool.poetry.group.dev.dependencies] +mypy = "==1.13.0" +pytest = "^7.4.0" +pytest-asyncio = "^0.23.5" +python-dateutil = "^2.9.0" +types-python-dateutil = "^2.9.0.20240316" +ruff = "==0.11.5" + +[tool.pytest.ini_options] +testpaths = [ "tests" ] +asyncio_mode = "auto" + +[tool.mypy] +plugins = ["pydantic.mypy"] + +[tool.ruff] +line-length = 120 + +[tool.ruff.lint] +select = [ + "E", # pycodestyle errors + "F", # pyflakes + "I", # isort +] +ignore = [ + "E402", # Module level import not at top of file + "E501", # Line too long + "E711", # Comparison to `None` should be `cond is not None` + "E712", # Avoid equality comparisons to `True`; use `if ...:` checks + "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks + "E722", # Do not use bare `except` + "E731", # Do not assign a `lambda` expression, use a `def` + "F821", # Undefined name + "F841" # Local variable ... is assigned to but never used +] + +[tool.ruff.lint.isort] +section-order = ["future", "standard-library", "third-party", "first-party"] + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/requirements.txt b/seed/python-sdk/circular-references-advanced/pydantic-v1/requirements.txt new file mode 100644 index 00000000000..926a8fc3e38 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/requirements.txt @@ -0,0 +1,4 @@ +httpx>=0.21.2 +pydantic>= 1.9.2,<= 1.10.14 +pydantic-core>=2.18.2 +typing_extensions>= 4.0.0 diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/snippet-templates.json b/seed/python-sdk/circular-references-advanced/pydantic-v1/snippet-templates.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/snippet.json b/seed/python-sdk/circular-references-advanced/pydantic-v1/snippet.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/__init__.py new file mode 100644 index 00000000000..f165f36681b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/__init__.py @@ -0,0 +1,244 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ImportingA, RootType + from . import a, ast + from .a import A + from .ast import ( + Acai, + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, + Animal, + Berry, + BranchNode, + Cat, + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, + FieldName, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, + Fig, + Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, + LeafNode, + Node, + NodesWrapper, + ObjectFieldValue, + ObjectValue, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, + PrimitiveValue, + ) + from .client import AsyncSeedApi, SeedApi + from .version import __version__ +_dynamic_imports: typing.Dict[str, str] = { + "A": ".a", + "Acai": ".ast", + "AndOperator": ".ast", + "AndOperatorChild": ".ast", + "AndOperatorChild_AndOperator": ".ast", + "AndOperatorChild_BooleanLiteral": ".ast", + "AndOperatorChild_EqOperator": ".ast", + "AndOperatorChild_GtOperator": ".ast", + "AndOperatorChild_OrOperator": ".ast", + "Animal": ".ast", + "AsyncSeedApi": ".client", + "Berry": ".ast", + "BranchNode": ".ast", + "Cat": ".ast", + "ContainerValue": ".ast", + "ContainerValue_List": ".ast", + "ContainerValue_Optional": ".ast", + "Dog": ".ast", + "EqualsOperator": ".ast", + "EqualsOperatorLeft": ".ast", + "EqualsOperatorLeft_AndOperator": ".ast", + "EqualsOperatorLeft_EqOperator": ".ast", + "EqualsOperatorLeft_GtOperator": ".ast", + "EqualsOperatorLeft_OrOperator": ".ast", + "EqualsOperatorLeft_StringLiteral": ".ast", + "EqualsOperatorRight": ".ast", + "EqualsOperatorRight_AndOperator": ".ast", + "EqualsOperatorRight_EqOperator": ".ast", + "EqualsOperatorRight_GtOperator": ".ast", + "EqualsOperatorRight_OrOperator": ".ast", + "EqualsOperatorRight_StringLiteral": ".ast", + "FieldName": ".ast", + "FieldValue": ".ast", + "FieldValue_ContainerValue": ".ast", + "FieldValue_ObjectValue": ".ast", + "FieldValue_PrimitiveValue": ".ast", + "Fig": ".ast", + "Fruit": ".ast", + "GreaterThanOperator": ".ast", + "GreaterThanOperatorLeft": ".ast", + "GreaterThanOperatorLeft_AndOperator": ".ast", + "GreaterThanOperatorLeft_EqOperator": ".ast", + "GreaterThanOperatorLeft_GtOperator": ".ast", + "GreaterThanOperatorLeft_NumberLiteral": ".ast", + "GreaterThanOperatorLeft_OrOperator": ".ast", + "GreaterThanOperatorRight": ".ast", + "GreaterThanOperatorRight_AndOperator": ".ast", + "GreaterThanOperatorRight_EqOperator": ".ast", + "GreaterThanOperatorRight_GtOperator": ".ast", + "GreaterThanOperatorRight_NumberLiteral": ".ast", + "GreaterThanOperatorRight_OrOperator": ".ast", + "ImportingA": ".types", + "LeafNode": ".ast", + "Node": ".ast", + "NodesWrapper": ".ast", + "ObjectFieldValue": ".ast", + "ObjectValue": ".ast", + "OrOperator": ".ast", + "OrOperatorChild": ".ast", + "OrOperatorChild_AndOperator": ".ast", + "OrOperatorChild_BooleanLiteral": ".ast", + "OrOperatorChild_EqOperator": ".ast", + "OrOperatorChild_GtOperator": ".ast", + "OrOperatorChild_OrOperator": ".ast", + "PrimitiveValue": ".ast", + "RootType": ".types", + "SeedApi": ".client", + "__version__": ".version", + "a": ".a", + "ast": ".ast", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "A", + "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", + "Animal", + "AsyncSeedApi", + "Berry", + "BranchNode", + "Cat", + "ContainerValue", + "ContainerValue_List", + "ContainerValue_Optional", + "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", + "FieldName", + "FieldValue", + "FieldValue_ContainerValue", + "FieldValue_ObjectValue", + "FieldValue_PrimitiveValue", + "Fig", + "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", + "ImportingA", + "LeafNode", + "Node", + "NodesWrapper", + "ObjectFieldValue", + "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", + "PrimitiveValue", + "RootType", + "SeedApi", + "__version__", + "a", + "ast", +] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/a/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/a/__init__.py new file mode 100644 index 00000000000..64bf1ac038f --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/a/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import A +_dynamic_imports: typing.Dict[str, str] = {"A": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["A"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/a/types/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/a/types/__init__.py new file mode 100644 index 00000000000..d8d24db3188 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/a/types/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .a import A +_dynamic_imports: typing.Dict[str, str] = {"A": ".a"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["A"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/a/types/a.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/a/types/a.py new file mode 100644 index 00000000000..a2bd2462266 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/a/types/a.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import pydantic +from ...types.root_type import RootType + + +class A(RootType): + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/__init__.py new file mode 100644 index 00000000000..b658bb6b991 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/__init__.py @@ -0,0 +1,223 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + Acai, + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, + Animal, + Berry, + BranchNode, + Cat, + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, + FieldName, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, + Fig, + Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, + LeafNode, + Node, + NodesWrapper, + ObjectFieldValue, + ObjectValue, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, + PrimitiveValue, + ) +_dynamic_imports: typing.Dict[str, str] = { + "Acai": ".types", + "AndOperator": ".types", + "AndOperatorChild": ".types", + "AndOperatorChild_AndOperator": ".types", + "AndOperatorChild_BooleanLiteral": ".types", + "AndOperatorChild_EqOperator": ".types", + "AndOperatorChild_GtOperator": ".types", + "AndOperatorChild_OrOperator": ".types", + "Animal": ".types", + "Berry": ".types", + "BranchNode": ".types", + "Cat": ".types", + "ContainerValue": ".types", + "ContainerValue_List": ".types", + "ContainerValue_Optional": ".types", + "Dog": ".types", + "EqualsOperator": ".types", + "EqualsOperatorLeft": ".types", + "EqualsOperatorLeft_AndOperator": ".types", + "EqualsOperatorLeft_EqOperator": ".types", + "EqualsOperatorLeft_GtOperator": ".types", + "EqualsOperatorLeft_OrOperator": ".types", + "EqualsOperatorLeft_StringLiteral": ".types", + "EqualsOperatorRight": ".types", + "EqualsOperatorRight_AndOperator": ".types", + "EqualsOperatorRight_EqOperator": ".types", + "EqualsOperatorRight_GtOperator": ".types", + "EqualsOperatorRight_OrOperator": ".types", + "EqualsOperatorRight_StringLiteral": ".types", + "FieldName": ".types", + "FieldValue": ".types", + "FieldValue_ContainerValue": ".types", + "FieldValue_ObjectValue": ".types", + "FieldValue_PrimitiveValue": ".types", + "Fig": ".types", + "Fruit": ".types", + "GreaterThanOperator": ".types", + "GreaterThanOperatorLeft": ".types", + "GreaterThanOperatorLeft_AndOperator": ".types", + "GreaterThanOperatorLeft_EqOperator": ".types", + "GreaterThanOperatorLeft_GtOperator": ".types", + "GreaterThanOperatorLeft_NumberLiteral": ".types", + "GreaterThanOperatorLeft_OrOperator": ".types", + "GreaterThanOperatorRight": ".types", + "GreaterThanOperatorRight_AndOperator": ".types", + "GreaterThanOperatorRight_EqOperator": ".types", + "GreaterThanOperatorRight_GtOperator": ".types", + "GreaterThanOperatorRight_NumberLiteral": ".types", + "GreaterThanOperatorRight_OrOperator": ".types", + "LeafNode": ".types", + "Node": ".types", + "NodesWrapper": ".types", + "ObjectFieldValue": ".types", + "ObjectValue": ".types", + "OrOperator": ".types", + "OrOperatorChild": ".types", + "OrOperatorChild_AndOperator": ".types", + "OrOperatorChild_BooleanLiteral": ".types", + "OrOperatorChild_EqOperator": ".types", + "OrOperatorChild_GtOperator": ".types", + "OrOperatorChild_OrOperator": ".types", + "PrimitiveValue": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", + "Animal", + "Berry", + "BranchNode", + "Cat", + "ContainerValue", + "ContainerValue_List", + "ContainerValue_Optional", + "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", + "FieldName", + "FieldValue", + "FieldValue_ContainerValue", + "FieldValue_ObjectValue", + "FieldValue_PrimitiveValue", + "Fig", + "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", + "LeafNode", + "Node", + "NodesWrapper", + "ObjectFieldValue", + "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", + "PrimitiveValue", +] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/__init__.py new file mode 100644 index 00000000000..cd2955fc318 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/__init__.py @@ -0,0 +1,218 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .acai_all import Acai, Animal, Berry, Cat, Dog, Fig, Fruit + from .and_operator_all import ( + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, + ) + from .branch_node_all import BranchNode, Node + from .container_value_all import ( + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, + ) + from .field_name import FieldName + from .leaf_node import LeafNode + from .nodes_wrapper import NodesWrapper + from .object_field_value import ObjectFieldValue + from .object_value import ObjectValue + from .primitive_value import PrimitiveValue +_dynamic_imports: typing.Dict[str, str] = { + "Acai": ".acai_all", + "AndOperator": ".and_operator_all", + "AndOperatorChild": ".and_operator_all", + "AndOperatorChild_AndOperator": ".and_operator_all", + "AndOperatorChild_BooleanLiteral": ".and_operator_all", + "AndOperatorChild_EqOperator": ".and_operator_all", + "AndOperatorChild_GtOperator": ".and_operator_all", + "AndOperatorChild_OrOperator": ".and_operator_all", + "Animal": ".acai_all", + "Berry": ".acai_all", + "BranchNode": ".branch_node_all", + "Cat": ".acai_all", + "ContainerValue": ".container_value_all", + "ContainerValue_List": ".container_value_all", + "ContainerValue_Optional": ".container_value_all", + "Dog": ".acai_all", + "EqualsOperator": ".and_operator_all", + "EqualsOperatorLeft": ".and_operator_all", + "EqualsOperatorLeft_AndOperator": ".and_operator_all", + "EqualsOperatorLeft_EqOperator": ".and_operator_all", + "EqualsOperatorLeft_GtOperator": ".and_operator_all", + "EqualsOperatorLeft_OrOperator": ".and_operator_all", + "EqualsOperatorLeft_StringLiteral": ".and_operator_all", + "EqualsOperatorRight": ".and_operator_all", + "EqualsOperatorRight_AndOperator": ".and_operator_all", + "EqualsOperatorRight_EqOperator": ".and_operator_all", + "EqualsOperatorRight_GtOperator": ".and_operator_all", + "EqualsOperatorRight_OrOperator": ".and_operator_all", + "EqualsOperatorRight_StringLiteral": ".and_operator_all", + "FieldName": ".field_name", + "FieldValue": ".container_value_all", + "FieldValue_ContainerValue": ".container_value_all", + "FieldValue_ObjectValue": ".container_value_all", + "FieldValue_PrimitiveValue": ".container_value_all", + "Fig": ".acai_all", + "Fruit": ".acai_all", + "GreaterThanOperator": ".and_operator_all", + "GreaterThanOperatorLeft": ".and_operator_all", + "GreaterThanOperatorLeft_AndOperator": ".and_operator_all", + "GreaterThanOperatorLeft_EqOperator": ".and_operator_all", + "GreaterThanOperatorLeft_GtOperator": ".and_operator_all", + "GreaterThanOperatorLeft_NumberLiteral": ".and_operator_all", + "GreaterThanOperatorLeft_OrOperator": ".and_operator_all", + "GreaterThanOperatorRight": ".and_operator_all", + "GreaterThanOperatorRight_AndOperator": ".and_operator_all", + "GreaterThanOperatorRight_EqOperator": ".and_operator_all", + "GreaterThanOperatorRight_GtOperator": ".and_operator_all", + "GreaterThanOperatorRight_NumberLiteral": ".and_operator_all", + "GreaterThanOperatorRight_OrOperator": ".and_operator_all", + "LeafNode": ".leaf_node", + "Node": ".branch_node_all", + "NodesWrapper": ".nodes_wrapper", + "ObjectFieldValue": ".object_field_value", + "ObjectValue": ".object_value", + "OrOperator": ".and_operator_all", + "OrOperatorChild": ".and_operator_all", + "OrOperatorChild_AndOperator": ".and_operator_all", + "OrOperatorChild_BooleanLiteral": ".and_operator_all", + "OrOperatorChild_EqOperator": ".and_operator_all", + "OrOperatorChild_GtOperator": ".and_operator_all", + "OrOperatorChild_OrOperator": ".and_operator_all", + "PrimitiveValue": ".primitive_value", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", + "Animal", + "Berry", + "BranchNode", + "Cat", + "ContainerValue", + "ContainerValue_List", + "ContainerValue_Optional", + "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", + "FieldName", + "FieldValue", + "FieldValue_ContainerValue", + "FieldValue_ObjectValue", + "FieldValue_PrimitiveValue", + "Fig", + "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", + "LeafNode", + "Node", + "NodesWrapper", + "ObjectFieldValue", + "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", + "PrimitiveValue", +] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/acai.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/acai.py new file mode 100644 index 00000000000..06dc06d5aa6 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/acai.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Acai as Acai + +__all__ = ["Acai"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/acai_all.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/acai_all.py new file mode 100644 index 00000000000..76b81ee5c02 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/acai_all.py @@ -0,0 +1,73 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel + +if typing.TYPE_CHECKING: + from .acai import Acai as ast_types_acai_Acai + from .cat import Cat as ast_types_cat_Cat + from .dog import Dog as ast_types_dog_Dog + from .fig import Fig as ast_types_fig_Fig + + +class Acai(ast_types_berry_Berry): + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +Animal = typing.Union["ast_types_cat_Cat", "ast_types_dog_Dog"] + + +class Berry(UniversalBaseModel): + animal: "ast_types_animal_Animal" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class Cat(UniversalBaseModel): + fruit: "ast_types_fruit_Fruit" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class Dog(UniversalBaseModel): + fruit: "ast_types_fruit_Fruit" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .fig import Fig as ast_types_fig_Fig # noqa: E402, F401, I001 +from .fruit import Fruit as ast_types_fruit_Fruit # noqa: E402, F401, I001 + + +class Fig(UniversalBaseModel): + animal: "ast_types_animal_Animal" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .berry import Berry as ast_types_berry_Berry # noqa: E402, F401, I001 +from .acai import Acai as ast_types_acai_Acai # noqa: E402, F401, I001 +from .cat import Cat as ast_types_cat_Cat # noqa: E402, F401, I001 +from .dog import Dog as ast_types_dog_Dog # noqa: E402, F401, I001 +from .animal import Animal as ast_types_animal_Animal # noqa: E402, F401, I001 + +Fruit = typing.Union["ast_types_acai_Acai", "ast_types_fig_Fig"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/and_operator.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/and_operator.py new file mode 100644 index 00000000000..f3c921a6c39 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/and_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperator as AndOperator + +__all__ = ["AndOperator"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/and_operator_all.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/and_operator_all.py new file mode 100644 index 00000000000..215e77791ac --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/and_operator_all.py @@ -0,0 +1,426 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel + + +class AndOperator(UniversalBaseModel): + """ + Deep circular reference pattern mimicking elevenlabs AST operators + """ + + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AndOperatorChild_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AndOperatorChild_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AndOperatorChild_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AndOperatorChild_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class AndOperatorChild_BooleanLiteral(UniversalBaseModel): + value: bool + type: typing.Literal["boolean_literal"] = "boolean_literal" + + class Config: + frozen = True + smart_union = True + + +AndOperatorChild = typing.Union[ + AndOperatorChild_AndOperator, + AndOperatorChild_OrOperator, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_BooleanLiteral, +] + + +class EqualsOperator(UniversalBaseModel): + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorLeft_StringLiteral(UniversalBaseModel): + value: str + type: typing.Literal["string_literal"] = "string_literal" + + class Config: + frozen = True + smart_union = True + + +EqualsOperatorLeft = typing.Union[ + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_StringLiteral, +] + + +class EqualsOperatorRight_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class EqualsOperatorRight_StringLiteral(UniversalBaseModel): + value: str + type: typing.Literal["string_literal"] = "string_literal" + + class Config: + frozen = True + smart_union = True + + +EqualsOperatorRight = typing.Union[ + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_StringLiteral, +] + + +class GreaterThanOperator(UniversalBaseModel): + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorLeft_NumberLiteral(UniversalBaseModel): + value: float + type: typing.Literal["number_literal"] = "number_literal" + + class Config: + frozen = True + smart_union = True + + +GreaterThanOperatorLeft = typing.Union[ + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, +] + + +class GreaterThanOperatorRight_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GreaterThanOperatorRight_NumberLiteral(UniversalBaseModel): + value: float + type: typing.Literal["number_literal"] = "number_literal" + + class Config: + frozen = True + smart_union = True + + +GreaterThanOperatorRight = typing.Union[ + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_OrOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, +] + + +class OrOperator(UniversalBaseModel): + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OrOperatorChild_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OrOperatorChild_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OrOperatorChild_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class OrOperatorChild_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .equals_operator import EqualsOperator as ast_types_equals_operator_EqualsOperator # noqa: E402, F401, I001 +from .greater_than_operator import GreaterThanOperator as ast_types_greater_than_operator_GreaterThanOperator # noqa: E402, F401, I001 +from .or_operator import OrOperator as ast_types_or_operator_OrOperator # noqa: E402, F401, I001 +from .and_operator import AndOperator as ast_types_and_operator_AndOperator # noqa: E402, F401, I001 + + +class OrOperatorChild_BooleanLiteral(UniversalBaseModel): + value: bool + type: typing.Literal["boolean_literal"] = "boolean_literal" + + class Config: + frozen = True + smart_union = True + + +OrOperatorChild = typing.Union[ + OrOperatorChild_AndOperator, + OrOperatorChild_OrOperator, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_BooleanLiteral, +] +from .and_operator_child import AndOperatorChild as ast_types_and_operator_child_AndOperatorChild # noqa: E402, F401, I001 +from .or_operator_child import OrOperatorChild as ast_types_or_operator_child_OrOperatorChild # noqa: E402, F401, I001 +from .equals_operator_left import EqualsOperatorLeft as ast_types_equals_operator_left_EqualsOperatorLeft # noqa: E402, F401, I001 +from .equals_operator_right import EqualsOperatorRight as ast_types_equals_operator_right_EqualsOperatorRight # noqa: E402, F401, I001 +from .greater_than_operator_left import ( + GreaterThanOperatorLeft as ast_types_greater_than_operator_left_GreaterThanOperatorLeft, +) # noqa: E402, F401, I001 +from .greater_than_operator_right import ( + GreaterThanOperatorRight as ast_types_greater_than_operator_right_GreaterThanOperatorRight, +) # noqa: E402, F401, I001 diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/and_operator_child.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/and_operator_child.py new file mode 100644 index 00000000000..0c043b87dbb --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/and_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperatorChild as AndOperatorChild + +__all__ = ["AndOperatorChild"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/animal.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/animal.py new file mode 100644 index 00000000000..bc07c7d3b20 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/animal.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Animal as Animal + +__all__ = ["Animal"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/berry.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/berry.py new file mode 100644 index 00000000000..1131a180b1a --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/berry.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Berry as Berry + +__all__ = ["Berry"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/branch_node.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/branch_node.py new file mode 100644 index 00000000000..e53f75d7362 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/branch_node.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .branch_node_all import BranchNode as BranchNode + +__all__ = ["BranchNode"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/branch_node_all.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/branch_node_all.py new file mode 100644 index 00000000000..d003f1bc7b3 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/branch_node_all.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel +from .leaf_node import LeafNode + +if typing.TYPE_CHECKING: + from .branch_node import BranchNode as ast_types_branch_node_BranchNode + + +class BranchNode(UniversalBaseModel): + children: typing.List["ast_types_node_Node"] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .branch_node import BranchNode as ast_types_branch_node_BranchNode # noqa: E402, F401, I001 +from .node import Node as ast_types_node_Node # noqa: E402, F401, I001 + +Node = typing.Union["ast_types_branch_node_BranchNode", LeafNode] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/cat.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/cat.py new file mode 100644 index 00000000000..3d1211c6497 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/cat.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Cat as Cat + +__all__ = ["Cat"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/container_value.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/container_value.py new file mode 100644 index 00000000000..d3b9fbcdba7 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/container_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .container_value_all import ContainerValue as ContainerValue + +__all__ = ["ContainerValue"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/container_value_all.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/container_value_all.py new file mode 100644 index 00000000000..9afe7b3822b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/container_value_all.py @@ -0,0 +1,66 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel, update_forward_refs +from .primitive_value import PrimitiveValue + + +class ContainerValue_List(UniversalBaseModel): + value: typing.List["ast_types_field_value_FieldValue"] + type: typing.Literal["list"] = "list" + + class Config: + frozen = True + smart_union = True + + +class ContainerValue_Optional(UniversalBaseModel): + value: typing.Optional["ast_types_field_value_FieldValue"] = None + type: typing.Literal["optional"] = "optional" + + class Config: + frozen = True + smart_union = True + + +ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] +from .field_value import FieldValue as ast_types_field_value_FieldValue # noqa: E402, F401, I001 + + +class FieldValue_PrimitiveValue(UniversalBaseModel): + value: PrimitiveValue + type: typing.Literal["primitive_value"] = "primitive_value" + + class Config: + frozen = True + smart_union = True + + +class FieldValue_ObjectValue(UniversalBaseModel): + type: typing.Literal["object_value"] = "object_value" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FieldValue_ContainerValue(UniversalBaseModel): + value: "ast_types_container_value_ContainerValue" + type: typing.Literal["container_value"] = "container_value" + + class Config: + frozen = True + smart_union = True + + +FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] +from .container_value import ContainerValue as ast_types_container_value_ContainerValue # noqa: E402, F401, I001 + +update_forward_refs(ContainerValue_List) +update_forward_refs(ContainerValue_Optional) +update_forward_refs(FieldValue_ContainerValue) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/dog.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/dog.py new file mode 100644 index 00000000000..bc696fce765 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/dog.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Dog as Dog + +__all__ = ["Dog"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/equals_operator.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/equals_operator.py new file mode 100644 index 00000000000..3a95724f67a --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/equals_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperator as EqualsOperator + +__all__ = ["EqualsOperator"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/equals_operator_left.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/equals_operator_left.py new file mode 100644 index 00000000000..53901b8504e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/equals_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorLeft as EqualsOperatorLeft + +__all__ = ["EqualsOperatorLeft"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/equals_operator_right.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/equals_operator_right.py new file mode 100644 index 00000000000..4348ffe8d3f --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/equals_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorRight as EqualsOperatorRight + +__all__ = ["EqualsOperatorRight"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/field_name.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/field_name.py new file mode 100644 index 00000000000..1f861620af8 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/field_name.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +FieldName = str diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/field_value.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/field_value.py new file mode 100644 index 00000000000..88d4a5e9c2d --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/field_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .container_value_all import FieldValue as FieldValue + +__all__ = ["FieldValue"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/fig.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/fig.py new file mode 100644 index 00000000000..cf5006340ba --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/fig.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Fig as Fig + +__all__ = ["Fig"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/fruit.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/fruit.py new file mode 100644 index 00000000000..6f9ff11e1b4 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/fruit.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Fruit as Fruit + +__all__ = ["Fruit"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/greater_than_operator.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/greater_than_operator.py new file mode 100644 index 00000000000..56a53f19013 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/greater_than_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperator as GreaterThanOperator + +__all__ = ["GreaterThanOperator"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/greater_than_operator_left.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/greater_than_operator_left.py new file mode 100644 index 00000000000..0958d95ca84 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/greater_than_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorLeft as GreaterThanOperatorLeft + +__all__ = ["GreaterThanOperatorLeft"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/greater_than_operator_right.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/greater_than_operator_right.py new file mode 100644 index 00000000000..20234cb9d0e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/greater_than_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorRight as GreaterThanOperatorRight + +__all__ = ["GreaterThanOperatorRight"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/leaf_node.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/leaf_node.py new file mode 100644 index 00000000000..6b5f448e5d4 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/leaf_node.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel + + +class LeafNode(UniversalBaseModel): + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/node.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/node.py new file mode 100644 index 00000000000..f8d6f92d33c --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/node.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .branch_node_all import Node as Node + +__all__ = ["Node"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/nodes_wrapper.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/nodes_wrapper.py new file mode 100644 index 00000000000..503d197b551 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/nodes_wrapper.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel, update_forward_refs + + +class NodesWrapper(UniversalBaseModel): + nodes: typing.List[typing.List["Node"]] + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .branch_node import BranchNode # noqa: E402, F401, I001 +from .node import Node # noqa: E402, F401, I001 + +update_forward_refs(NodesWrapper) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/object_field_value.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/object_field_value.py new file mode 100644 index 00000000000..1822a5b29ca --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/object_field_value.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel, update_forward_refs +from .field_name import FieldName + + +class ObjectFieldValue(UniversalBaseModel): + """ + This type allows us to test a circular reference with a union type (see FieldValue). + """ + + name: FieldName + value: "FieldValue" + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .field_value import FieldValue # noqa: E402, F401, I001 + +update_forward_refs(ObjectFieldValue) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/object_value.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/object_value.py new file mode 100644 index 00000000000..108b5ff73ea --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/object_value.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel + + +class ObjectValue(UniversalBaseModel): + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/or_operator.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/or_operator.py new file mode 100644 index 00000000000..04bc907e4c8 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/or_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperator as OrOperator + +__all__ = ["OrOperator"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/or_operator_child.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/or_operator_child.py new file mode 100644 index 00000000000..49d1ffed627 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/or_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperatorChild as OrOperatorChild + +__all__ = ["OrOperatorChild"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/primitive_value.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/primitive_value.py new file mode 100644 index 00000000000..b3bfe3732ea --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/ast/types/primitive_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PrimitiveValue = typing.Union[typing.Literal["STRING", "NUMBER"], typing.Any] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/client.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/client.py new file mode 100644 index 00000000000..90b75b16594 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/client.py @@ -0,0 +1,114 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import httpx +from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper + + +class SeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : str + The base url to use for requests from the client. + + headers : typing.Optional[typing.Dict[str, str]] + Additional headers to send with every request. + + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.Client] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from seed import SeedApi + + client = SeedApi( + base_url="https://yourhost.com/path/to/api", + ) + """ + + def __init__( + self, + *, + base_url: str, + headers: typing.Optional[typing.Dict[str, str]] = None, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.Client] = None, + ): + _defaulted_timeout = ( + timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read + ) + self._client_wrapper = SyncClientWrapper( + base_url=base_url, + headers=headers, + httpx_client=httpx_client + if httpx_client is not None + else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) + if follow_redirects is not None + else httpx.Client(timeout=_defaulted_timeout), + timeout=_defaulted_timeout, + ) + + +class AsyncSeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : str + The base url to use for requests from the client. + + headers : typing.Optional[typing.Dict[str, str]] + Additional headers to send with every request. + + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.AsyncClient] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from seed import AsyncSeedApi + + client = AsyncSeedApi( + base_url="https://yourhost.com/path/to/api", + ) + """ + + def __init__( + self, + *, + base_url: str, + headers: typing.Optional[typing.Dict[str, str]] = None, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.AsyncClient] = None, + ): + _defaulted_timeout = ( + timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read + ) + self._client_wrapper = AsyncClientWrapper( + base_url=base_url, + headers=headers, + httpx_client=httpx_client + if httpx_client is not None + else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) + if follow_redirects is not None + else httpx.AsyncClient(timeout=_defaulted_timeout), + timeout=_defaulted_timeout, + ) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/__init__.py new file mode 100644 index 00000000000..9a33e233875 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/__init__.py @@ -0,0 +1,105 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .api_error import ApiError + from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper + from .datetime_utils import serialize_datetime + from .file import File, convert_file_dict_to_httpx_tuples, with_content_type + from .http_client import AsyncHttpClient, HttpClient + from .http_response import AsyncHttpResponse, HttpResponse + from .jsonable_encoder import jsonable_encoder + from .pydantic_utilities import ( + IS_PYDANTIC_V2, + UniversalBaseModel, + UniversalRootModel, + parse_obj_as, + universal_field_validator, + universal_root_validator, + update_forward_refs, + ) + from .query_encoder import encode_query + from .remove_none_from_dict import remove_none_from_dict + from .request_options import RequestOptions + from .serialization import FieldMetadata, convert_and_respect_annotation_metadata +_dynamic_imports: typing.Dict[str, str] = { + "ApiError": ".api_error", + "AsyncClientWrapper": ".client_wrapper", + "AsyncHttpClient": ".http_client", + "AsyncHttpResponse": ".http_response", + "BaseClientWrapper": ".client_wrapper", + "FieldMetadata": ".serialization", + "File": ".file", + "HttpClient": ".http_client", + "HttpResponse": ".http_response", + "IS_PYDANTIC_V2": ".pydantic_utilities", + "RequestOptions": ".request_options", + "SyncClientWrapper": ".client_wrapper", + "UniversalBaseModel": ".pydantic_utilities", + "UniversalRootModel": ".pydantic_utilities", + "convert_and_respect_annotation_metadata": ".serialization", + "convert_file_dict_to_httpx_tuples": ".file", + "encode_query": ".query_encoder", + "jsonable_encoder": ".jsonable_encoder", + "parse_obj_as": ".pydantic_utilities", + "remove_none_from_dict": ".remove_none_from_dict", + "serialize_datetime": ".datetime_utils", + "universal_field_validator": ".pydantic_utilities", + "universal_root_validator": ".pydantic_utilities", + "update_forward_refs": ".pydantic_utilities", + "with_content_type": ".file", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "ApiError", + "AsyncClientWrapper", + "AsyncHttpClient", + "AsyncHttpResponse", + "BaseClientWrapper", + "FieldMetadata", + "File", + "HttpClient", + "HttpResponse", + "IS_PYDANTIC_V2", + "RequestOptions", + "SyncClientWrapper", + "UniversalBaseModel", + "UniversalRootModel", + "convert_and_respect_annotation_metadata", + "convert_file_dict_to_httpx_tuples", + "encode_query", + "jsonable_encoder", + "parse_obj_as", + "remove_none_from_dict", + "serialize_datetime", + "universal_field_validator", + "universal_root_validator", + "update_forward_refs", + "with_content_type", +] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/api_error.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/api_error.py new file mode 100644 index 00000000000..6f850a60cba --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/api_error.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, Optional + + +class ApiError(Exception): + headers: Optional[Dict[str, str]] + status_code: Optional[int] + body: Any + + def __init__( + self, + *, + headers: Optional[Dict[str, str]] = None, + status_code: Optional[int] = None, + body: Any = None, + ) -> None: + self.headers = headers + self.status_code = status_code + self.body = body + + def __str__(self) -> str: + return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}" diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/client_wrapper.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/client_wrapper.py new file mode 100644 index 00000000000..d33fe83b334 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/client_wrapper.py @@ -0,0 +1,74 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import httpx +from .http_client import AsyncHttpClient, HttpClient + + +class BaseClientWrapper: + def __init__( + self, + *, + headers: typing.Optional[typing.Dict[str, str]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + ): + self._headers = headers + self._base_url = base_url + self._timeout = timeout + + def get_headers(self) -> typing.Dict[str, str]: + headers: typing.Dict[str, str] = { + "User-Agent": "fern_circular-references-advanced/0.0.1", + "X-Fern-Language": "Python", + "X-Fern-SDK-Name": "fern_circular-references-advanced", + "X-Fern-SDK-Version": "0.0.1", + **(self.get_custom_headers() or {}), + } + return headers + + def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]: + return self._headers + + def get_base_url(self) -> str: + return self._base_url + + def get_timeout(self) -> typing.Optional[float]: + return self._timeout + + +class SyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + headers: typing.Optional[typing.Dict[str, str]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.Client, + ): + super().__init__(headers=headers, base_url=base_url, timeout=timeout) + self.httpx_client = HttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers, + base_timeout=self.get_timeout, + base_url=self.get_base_url, + ) + + +class AsyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + headers: typing.Optional[typing.Dict[str, str]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.AsyncClient, + ): + super().__init__(headers=headers, base_url=base_url, timeout=timeout) + self.httpx_client = AsyncHttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers, + base_timeout=self.get_timeout, + base_url=self.get_base_url, + ) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/datetime_utils.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/datetime_utils.py new file mode 100644 index 00000000000..7c9864a944c --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/datetime_utils.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt + + +def serialize_datetime(v: dt.datetime) -> str: + """ + Serialize a datetime including timezone info. + + Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. + + UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. + """ + + def _serialize_zoned_datetime(v: dt.datetime) -> str: + if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None): + # UTC is a special case where we use "Z" at the end instead of "+00:00" + return v.isoformat().replace("+00:00", "Z") + else: + # Delegate to the typical +/- offset format + return v.isoformat() + + if v.tzinfo is not None: + return _serialize_zoned_datetime(v) + else: + local_tz = dt.datetime.now().astimezone().tzinfo + localized_dt = v.replace(tzinfo=local_tz) + return _serialize_zoned_datetime(localized_dt) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/file.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/file.py new file mode 100644 index 00000000000..44b0d27c089 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/file.py @@ -0,0 +1,67 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast + +# File typing inspired by the flexibility of types within the httpx library +# https://github.com/encode/httpx/blob/master/httpx/_types.py +FileContent = Union[IO[bytes], bytes, str] +File = Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + Tuple[Optional[str], FileContent], + # (filename, file (or bytes), content_type) + Tuple[Optional[str], FileContent, Optional[str]], + # (filename, file (or bytes), content_type, headers) + Tuple[ + Optional[str], + FileContent, + Optional[str], + Mapping[str, str], + ], +] + + +def convert_file_dict_to_httpx_tuples( + d: Dict[str, Union[File, List[File]]], +) -> List[Tuple[str, File]]: + """ + The format we use is a list of tuples, where the first element is the + name of the file and the second is the file object. Typically HTTPX wants + a dict, but to be able to send lists of files, you have to use the list + approach (which also works for non-lists) + https://github.com/encode/httpx/pull/1032 + """ + + httpx_tuples = [] + for key, file_like in d.items(): + if isinstance(file_like, list): + for file_like_item in file_like: + httpx_tuples.append((key, file_like_item)) + else: + httpx_tuples.append((key, file_like)) + return httpx_tuples + + +def with_content_type(*, file: File, default_content_type: str) -> File: + """ + This function resolves to the file's content type, if provided, and defaults + to the default_content_type value if not. + """ + if isinstance(file, tuple): + if len(file) == 2: + filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore + return (filename, content, default_content_type) + elif len(file) == 3: + filename, content, file_content_type = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore + out_content_type = file_content_type or default_content_type + return (filename, content, out_content_type) + elif len(file) == 4: + filename, content, file_content_type, headers = cast( # type: ignore + Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file + ) + out_content_type = file_content_type or default_content_type + return (filename, content, out_content_type, headers) + else: + raise ValueError(f"Unexpected tuple length: {len(file)}") + return (None, file, default_content_type) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/force_multipart.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/force_multipart.py new file mode 100644 index 00000000000..5440913fd4b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/force_multipart.py @@ -0,0 +1,18 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict + + +class ForceMultipartDict(Dict[str, Any]): + """ + A dictionary subclass that always evaluates to True in boolean contexts. + + This is used to force multipart/form-data encoding in HTTP requests even when + the dictionary is empty, which would normally evaluate to False. + """ + + def __bool__(self) -> bool: + return True + + +FORCE_MULTIPART = ForceMultipartDict() diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_client.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_client.py new file mode 100644 index 00000000000..e4173f990f1 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_client.py @@ -0,0 +1,543 @@ +# This file was auto-generated by Fern from our API Definition. + +import asyncio +import email.utils +import re +import time +import typing +import urllib.parse +from contextlib import asynccontextmanager, contextmanager +from random import random + +import httpx +from .file import File, convert_file_dict_to_httpx_tuples +from .force_multipart import FORCE_MULTIPART +from .jsonable_encoder import jsonable_encoder +from .query_encoder import encode_query +from .remove_none_from_dict import remove_none_from_dict +from .request_options import RequestOptions +from httpx._types import RequestFiles + +INITIAL_RETRY_DELAY_SECONDS = 0.5 +MAX_RETRY_DELAY_SECONDS = 10 +MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30 + + +def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: + """ + This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. + + Inspired by the urllib3 retry implementation. + """ + retry_after_ms = response_headers.get("retry-after-ms") + if retry_after_ms is not None: + try: + return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 + except Exception: + pass + + retry_after = response_headers.get("retry-after") + if retry_after is None: + return None + + # Attempt to parse the header as an int. + if re.match(r"^\s*[0-9]+\s*$", retry_after): + seconds = float(retry_after) + # Fallback to parsing it as a date. + else: + retry_date_tuple = email.utils.parsedate_tz(retry_after) + if retry_date_tuple is None: + return None + if retry_date_tuple[9] is None: # Python 2 + # Assume UTC if no timezone was specified + # On Python2.7, parsedate_tz returns None for a timezone offset + # instead of 0 if no timezone is given, where mktime_tz treats + # a None timezone offset as local time. + retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] + + retry_date = email.utils.mktime_tz(retry_date_tuple) + seconds = retry_date - time.time() + + if seconds < 0: + seconds = 0 + + return seconds + + +def _retry_timeout(response: httpx.Response, retries: int) -> float: + """ + Determine the amount of time to wait before retrying a request. + This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff + with a jitter to determine the number of seconds to wait. + """ + + # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says. + retry_after = _parse_retry_after(response.headers) + if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER: + return retry_after + + # Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS. + retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS) + + # Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries. + timeout = retry_delay * (1 - 0.25 * random()) + return timeout if timeout >= 0 else 0 + + +def _should_retry(response: httpx.Response) -> bool: + retryable_400s = [429, 408, 409] + return response.status_code >= 500 or response.status_code in retryable_400s + + +def remove_omit_from_dict( + original: typing.Dict[str, typing.Optional[typing.Any]], + omit: typing.Optional[typing.Any], +) -> typing.Dict[str, typing.Any]: + if omit is None: + return original + new: typing.Dict[str, typing.Any] = {} + for key, value in original.items(): + if value is not omit: + new[key] = value + return new + + +def maybe_filter_request_body( + data: typing.Optional[typing.Any], + request_options: typing.Optional[RequestOptions], + omit: typing.Optional[typing.Any], +) -> typing.Optional[typing.Any]: + if data is None: + return ( + jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} + if request_options is not None + else None + ) + elif not isinstance(data, typing.Mapping): + data_content = jsonable_encoder(data) + else: + data_content = { + **(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore + **( + jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} + if request_options is not None + else {} + ), + } + return data_content + + +# Abstracted out for testing purposes +def get_request_body( + *, + json: typing.Optional[typing.Any], + data: typing.Optional[typing.Any], + request_options: typing.Optional[RequestOptions], + omit: typing.Optional[typing.Any], +) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]: + json_body = None + data_body = None + if data is not None: + data_body = maybe_filter_request_body(data, request_options, omit) + else: + # If both data and json are None, we send json data in the event extra properties are specified + json_body = maybe_filter_request_body(json, request_options, omit) + + # If you have an empty JSON body, you should just send None + return (json_body if json_body != {} else None), data_body if data_body != {} else None + + +class HttpClient: + def __init__( + self, + *, + httpx_client: httpx.Client, + base_timeout: typing.Callable[[], typing.Optional[float]], + base_headers: typing.Callable[[], typing.Dict[str, str]], + base_url: typing.Optional[typing.Callable[[], str]] = None, + ): + self.base_url = base_url + self.base_timeout = base_timeout + self.base_headers = base_headers + self.httpx_client = httpx_client + + def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: + base_url = maybe_base_url + if self.base_url is not None and base_url is None: + base_url = self.base_url() + + if base_url is None: + raise ValueError("A base_url is required to make this request, please provide one and try again.") + return base_url + + def request( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[ + typing.Union[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], + typing.List[typing.Tuple[str, File]], + ] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 2, + omit: typing.Optional[typing.Any] = None, + force_multipart: typing.Optional[bool] = None, + ) -> httpx.Response: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + request_files: typing.Optional[RequestFiles] = ( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if (files is not None and files is not omit and isinstance(files, dict)) + else None + ) + + if (request_files is None or len(request_files) == 0) and force_multipart: + request_files = FORCE_MULTIPART + + response = self.httpx_client.request( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) or {} + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=request_files, + timeout=timeout, + ) + + max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 + if _should_retry(response=response): + if max_retries > retries: + time.sleep(_retry_timeout(response=response, retries=retries)) + return self.request( + path=path, + method=method, + base_url=base_url, + params=params, + json=json, + content=content, + files=files, + headers=headers, + request_options=request_options, + retries=retries + 1, + omit=omit, + ) + + return response + + @contextmanager + def stream( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[ + typing.Union[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], + typing.List[typing.Tuple[str, File]], + ] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 2, + omit: typing.Optional[typing.Any] = None, + force_multipart: typing.Optional[bool] = None, + ) -> typing.Iterator[httpx.Response]: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + request_files: typing.Optional[RequestFiles] = ( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if (files is not None and files is not omit and isinstance(files, dict)) + else None + ) + + if (request_files is None or len(request_files) == 0) and force_multipart: + request_files = FORCE_MULTIPART + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + with self.httpx_client.stream( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=request_files, + timeout=timeout, + ) as stream: + yield stream + + +class AsyncHttpClient: + def __init__( + self, + *, + httpx_client: httpx.AsyncClient, + base_timeout: typing.Callable[[], typing.Optional[float]], + base_headers: typing.Callable[[], typing.Dict[str, str]], + base_url: typing.Optional[typing.Callable[[], str]] = None, + ): + self.base_url = base_url + self.base_timeout = base_timeout + self.base_headers = base_headers + self.httpx_client = httpx_client + + def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: + base_url = maybe_base_url + if self.base_url is not None and base_url is None: + base_url = self.base_url() + + if base_url is None: + raise ValueError("A base_url is required to make this request, please provide one and try again.") + return base_url + + async def request( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[ + typing.Union[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], + typing.List[typing.Tuple[str, File]], + ] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 2, + omit: typing.Optional[typing.Any] = None, + force_multipart: typing.Optional[bool] = None, + ) -> httpx.Response: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + request_files: typing.Optional[RequestFiles] = ( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if (files is not None and files is not omit and isinstance(files, dict)) + else None + ) + + if (request_files is None or len(request_files) == 0) and force_multipart: + request_files = FORCE_MULTIPART + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + # Add the input to each of these and do None-safety checks + response = await self.httpx_client.request( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) or {} + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=request_files, + timeout=timeout, + ) + + max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 + if _should_retry(response=response): + if max_retries > retries: + await asyncio.sleep(_retry_timeout(response=response, retries=retries)) + return await self.request( + path=path, + method=method, + base_url=base_url, + params=params, + json=json, + content=content, + files=files, + headers=headers, + request_options=request_options, + retries=retries + 1, + omit=omit, + ) + return response + + @asynccontextmanager + async def stream( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[ + typing.Union[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], + typing.List[typing.Tuple[str, File]], + ] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 2, + omit: typing.Optional[typing.Any] = None, + force_multipart: typing.Optional[bool] = None, + ) -> typing.AsyncIterator[httpx.Response]: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + request_files: typing.Optional[RequestFiles] = ( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if (files is not None and files is not omit and isinstance(files, dict)) + else None + ) + + if (request_files is None or len(request_files) == 0) and force_multipart: + request_files = FORCE_MULTIPART + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + async with self.httpx_client.stream( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + }, + omit=omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=request_files, + timeout=timeout, + ) as stream: + yield stream diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_response.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_response.py new file mode 100644 index 00000000000..2479747e8bb --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_response.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Dict, Generic, TypeVar + +import httpx + +# Generic to represent the underlying type of the data wrapped by the HTTP response. +T = TypeVar("T") + + +class BaseHttpResponse: + """Minimalist HTTP response wrapper that exposes response headers.""" + + _response: httpx.Response + + def __init__(self, response: httpx.Response): + self._response = response + + @property + def headers(self) -> Dict[str, str]: + return dict(self._response.headers) + + +class HttpResponse(Generic[T], BaseHttpResponse): + """HTTP response wrapper that exposes response headers and data.""" + + _data: T + + def __init__(self, response: httpx.Response, data: T): + super().__init__(response) + self._data = data + + @property + def data(self) -> T: + return self._data + + def close(self) -> None: + self._response.close() + + +class AsyncHttpResponse(Generic[T], BaseHttpResponse): + """HTTP response wrapper that exposes response headers and data.""" + + _data: T + + def __init__(self, response: httpx.Response, data: T): + super().__init__(response) + self._data = data + + @property + def data(self) -> T: + return self._data + + async def close(self) -> None: + await self._response.aclose() diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/__init__.py new file mode 100644 index 00000000000..730e5a3382e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/__init__.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from ._api import EventSource, aconnect_sse, connect_sse + from ._exceptions import SSEError + from ._models import ServerSentEvent +_dynamic_imports: typing.Dict[str, str] = { + "EventSource": "._api", + "SSEError": "._exceptions", + "ServerSentEvent": "._models", + "aconnect_sse": "._api", + "connect_sse": "._api", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["EventSource", "SSEError", "ServerSentEvent", "aconnect_sse", "connect_sse"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_api.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_api.py new file mode 100644 index 00000000000..f900b3b686d --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_api.py @@ -0,0 +1,112 @@ +# This file was auto-generated by Fern from our API Definition. + +import re +from contextlib import asynccontextmanager, contextmanager +from typing import Any, AsyncGenerator, AsyncIterator, Iterator, cast + +import httpx +from ._decoders import SSEDecoder +from ._exceptions import SSEError +from ._models import ServerSentEvent + + +class EventSource: + def __init__(self, response: httpx.Response) -> None: + self._response = response + + def _check_content_type(self) -> None: + content_type = self._response.headers.get("content-type", "").partition(";")[0] + if "text/event-stream" not in content_type: + raise SSEError( + f"Expected response header Content-Type to contain 'text/event-stream', got {content_type!r}" + ) + + def _get_charset(self) -> str: + """Extract charset from Content-Type header, fallback to UTF-8.""" + content_type = self._response.headers.get("content-type", "") + + # Parse charset parameter using regex + charset_match = re.search(r"charset=([^;\s]+)", content_type, re.IGNORECASE) + if charset_match: + charset = charset_match.group(1).strip("\"'") + # Validate that it's a known encoding + try: + # Test if the charset is valid by trying to encode/decode + "test".encode(charset).decode(charset) + return charset + except (LookupError, UnicodeError): + # If charset is invalid, fall back to UTF-8 + pass + + # Default to UTF-8 if no charset specified or invalid charset + return "utf-8" + + @property + def response(self) -> httpx.Response: + return self._response + + def iter_sse(self) -> Iterator[ServerSentEvent]: + self._check_content_type() + decoder = SSEDecoder() + charset = self._get_charset() + + buffer = "" + for chunk in self._response.iter_bytes(): + # Decode chunk using detected charset + text_chunk = chunk.decode(charset, errors="replace") + buffer += text_chunk + + # Process complete lines + while "\n" in buffer: + line, buffer = buffer.split("\n", 1) + line = line.rstrip("\r") + sse = decoder.decode(line) + # when we reach a "\n\n" => line = '' + # => decoder will attempt to return an SSE Event + if sse is not None: + yield sse + + # Process any remaining data in buffer + if buffer.strip(): + line = buffer.rstrip("\r") + sse = decoder.decode(line) + if sse is not None: + yield sse + + async def aiter_sse(self) -> AsyncGenerator[ServerSentEvent, None]: + self._check_content_type() + decoder = SSEDecoder() + lines = cast(AsyncGenerator[str, None], self._response.aiter_lines()) + try: + async for line in lines: + line = line.rstrip("\n") + sse = decoder.decode(line) + if sse is not None: + yield sse + finally: + await lines.aclose() + + +@contextmanager +def connect_sse(client: httpx.Client, method: str, url: str, **kwargs: Any) -> Iterator[EventSource]: + headers = kwargs.pop("headers", {}) + headers["Accept"] = "text/event-stream" + headers["Cache-Control"] = "no-store" + + with client.stream(method, url, headers=headers, **kwargs) as response: + yield EventSource(response) + + +@asynccontextmanager +async def aconnect_sse( + client: httpx.AsyncClient, + method: str, + url: str, + **kwargs: Any, +) -> AsyncIterator[EventSource]: + headers = kwargs.pop("headers", {}) + headers["Accept"] = "text/event-stream" + headers["Cache-Control"] = "no-store" + + async with client.stream(method, url, headers=headers, **kwargs) as response: + yield EventSource(response) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_decoders.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_decoders.py new file mode 100644 index 00000000000..339b0890138 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_decoders.py @@ -0,0 +1,61 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import List, Optional + +from ._models import ServerSentEvent + + +class SSEDecoder: + def __init__(self) -> None: + self._event = "" + self._data: List[str] = [] + self._last_event_id = "" + self._retry: Optional[int] = None + + def decode(self, line: str) -> Optional[ServerSentEvent]: + # See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501 + + if not line: + if not self._event and not self._data and not self._last_event_id and self._retry is None: + return None + + sse = ServerSentEvent( + event=self._event, + data="\n".join(self._data), + id=self._last_event_id, + retry=self._retry, + ) + + # NOTE: as per the SSE spec, do not reset last_event_id. + self._event = "" + self._data = [] + self._retry = None + + return sse + + if line.startswith(":"): + return None + + fieldname, _, value = line.partition(":") + + if value.startswith(" "): + value = value[1:] + + if fieldname == "event": + self._event = value + elif fieldname == "data": + self._data.append(value) + elif fieldname == "id": + if "\0" in value: + pass + else: + self._last_event_id = value + elif fieldname == "retry": + try: + self._retry = int(value) + except (TypeError, ValueError): + pass + else: + pass # Field is ignored. + + return None diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_exceptions.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_exceptions.py new file mode 100644 index 00000000000..81605a8a65e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_exceptions.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import httpx + + +class SSEError(httpx.TransportError): + pass diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_models.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_models.py new file mode 100644 index 00000000000..1af57f8fd0d --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/http_sse/_models.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import json +from dataclasses import dataclass +from typing import Any, Optional + + +@dataclass(frozen=True) +class ServerSentEvent: + event: str = "message" + data: str = "" + id: str = "" + retry: Optional[int] = None + + def json(self) -> Any: + """Parse the data field as JSON.""" + return json.loads(self.data) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/jsonable_encoder.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/jsonable_encoder.py new file mode 100644 index 00000000000..afee3662d83 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/jsonable_encoder.py @@ -0,0 +1,100 @@ +# This file was auto-generated by Fern from our API Definition. + +""" +jsonable_encoder converts a Python object to a JSON-friendly dict +(e.g. datetimes to strings, Pydantic models to dicts). + +Taken from FastAPI, and made a bit simpler +https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py +""" + +import base64 +import dataclasses +import datetime as dt +from enum import Enum +from pathlib import PurePath +from types import GeneratorType +from typing import Any, Callable, Dict, List, Optional, Set, Union + +import pydantic +from .datetime_utils import serialize_datetime +from .pydantic_utilities import ( + IS_PYDANTIC_V2, + encode_by_type, + to_jsonable_with_fallback, +) + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] + + +def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any: + custom_encoder = custom_encoder or {} + if custom_encoder: + if type(obj) in custom_encoder: + return custom_encoder[type(obj)](obj) + else: + for encoder_type, encoder_instance in custom_encoder.items(): + if isinstance(obj, encoder_type): + return encoder_instance(obj) + if isinstance(obj, pydantic.BaseModel): + if IS_PYDANTIC_V2: + encoder = getattr(obj.model_config, "json_encoders", {}) # type: ignore # Pydantic v2 + else: + encoder = getattr(obj.__config__, "json_encoders", {}) # type: ignore # Pydantic v1 + if custom_encoder: + encoder.update(custom_encoder) + obj_dict = obj.dict(by_alias=True) + if "__root__" in obj_dict: + obj_dict = obj_dict["__root__"] + if "root" in obj_dict: + obj_dict = obj_dict["root"] + return jsonable_encoder(obj_dict, custom_encoder=encoder) + if dataclasses.is_dataclass(obj): + obj_dict = dataclasses.asdict(obj) # type: ignore + return jsonable_encoder(obj_dict, custom_encoder=custom_encoder) + if isinstance(obj, bytes): + return base64.b64encode(obj).decode("utf-8") + if isinstance(obj, Enum): + return obj.value + if isinstance(obj, PurePath): + return str(obj) + if isinstance(obj, (str, int, float, type(None))): + return obj + if isinstance(obj, dt.datetime): + return serialize_datetime(obj) + if isinstance(obj, dt.date): + return str(obj) + if isinstance(obj, dict): + encoded_dict = {} + allowed_keys = set(obj.keys()) + for key, value in obj.items(): + if key in allowed_keys: + encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder) + encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder) + encoded_dict[encoded_key] = encoded_value + return encoded_dict + if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)): + encoded_list = [] + for item in obj: + encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) + return encoded_list + + def fallback_serializer(o: Any) -> Any: + attempt_encode = encode_by_type(o) + if attempt_encode is not None: + return attempt_encode + + try: + data = dict(o) + except Exception as e: + errors: List[Exception] = [] + errors.append(e) + try: + data = vars(o) + except Exception as e: + errors.append(e) + raise ValueError(errors) from e + return jsonable_encoder(data, custom_encoder=custom_encoder) + + return to_jsonable_with_fallback(obj, fallback_serializer) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/pydantic_utilities.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/pydantic_utilities.py new file mode 100644 index 00000000000..8906cdfa421 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/pydantic_utilities.py @@ -0,0 +1,258 @@ +# This file was auto-generated by Fern from our API Definition. + +# nopycln: file +import datetime as dt +from collections import defaultdict +from typing import Any, Callable, ClassVar, Dict, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union, cast + +import pydantic + +IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") + +if IS_PYDANTIC_V2: + from pydantic.v1.datetime_parse import parse_date as parse_date + from pydantic.v1.datetime_parse import parse_datetime as parse_datetime + from pydantic.v1.fields import ModelField as ModelField + from pydantic.v1.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[attr-defined] + from pydantic.v1.typing import get_args as get_args + from pydantic.v1.typing import get_origin as get_origin + from pydantic.v1.typing import is_literal_type as is_literal_type + from pydantic.v1.typing import is_union as is_union +else: + from pydantic.datetime_parse import parse_date as parse_date # type: ignore[no-redef] + from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore[no-redef] + from pydantic.fields import ModelField as ModelField # type: ignore[attr-defined, no-redef] + from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[no-redef] + from pydantic.typing import get_args as get_args # type: ignore[no-redef] + from pydantic.typing import get_origin as get_origin # type: ignore[no-redef] + from pydantic.typing import is_literal_type as is_literal_type # type: ignore[no-redef] + from pydantic.typing import is_union as is_union # type: ignore[no-redef] + +from .datetime_utils import serialize_datetime +from .serialization import convert_and_respect_annotation_metadata +from typing_extensions import TypeAlias + +T = TypeVar("T") +Model = TypeVar("Model", bound=pydantic.BaseModel) + + +def parse_obj_as(type_: Type[T], object_: Any) -> T: + dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") + if IS_PYDANTIC_V2: + adapter = pydantic.TypeAdapter(type_) # type: ignore[attr-defined] + return adapter.validate_python(dealiased_object) + return pydantic.parse_obj_as(type_, dealiased_object) + + +def to_jsonable_with_fallback(obj: Any, fallback_serializer: Callable[[Any], Any]) -> Any: + if IS_PYDANTIC_V2: + from pydantic_core import to_jsonable_python + + return to_jsonable_python(obj, fallback=fallback_serializer) + return fallback_serializer(obj) + + +class UniversalBaseModel(pydantic.BaseModel): + if IS_PYDANTIC_V2: + model_config: ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( # type: ignore[typeddict-unknown-key] + # Allow fields beginning with `model_` to be used in the model + protected_namespaces=(), + ) + + @pydantic.model_serializer(mode="plain", when_used="json") # type: ignore[attr-defined] + def serialize_model(self) -> Any: # type: ignore[name-defined] + serialized = self.dict() # type: ignore[attr-defined] + data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} + return data + + else: + + class Config: + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} + + @classmethod + def model_construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": + dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") + return cls.construct(_fields_set, **dealiased_object) + + @classmethod + def construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": + dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") + if IS_PYDANTIC_V2: + return super().model_construct(_fields_set, **dealiased_object) # type: ignore[misc] + return super().construct(_fields_set, **dealiased_object) + + def json(self, **kwargs: Any) -> str: + kwargs_with_defaults = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + if IS_PYDANTIC_V2: + return super().model_dump_json(**kwargs_with_defaults) # type: ignore[misc] + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: Any) -> Dict[str, Any]: + """ + Override the default dict method to `exclude_unset` by default. This function patches + `exclude_unset` to work include fields within non-None default values. + """ + # Note: the logic here is multiplexed given the levers exposed in Pydantic V1 vs V2 + # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice. + # + # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models + # that we have less control over, and this is less intrusive than custom serializers for now. + if IS_PYDANTIC_V2: + kwargs_with_defaults_exclude_unset = { + **kwargs, + "by_alias": True, + "exclude_unset": True, + "exclude_none": False, + } + kwargs_with_defaults_exclude_none = { + **kwargs, + "by_alias": True, + "exclude_none": True, + "exclude_unset": False, + } + dict_dump = deep_union_pydantic_dicts( + super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore[misc] + super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore[misc] + ) + + else: + _fields_set = self.__fields_set__.copy() + + fields = _get_model_fields(self.__class__) + for name, field in fields.items(): + if name not in _fields_set: + default = _get_field_default(field) + + # If the default values are non-null act like they've been set + # This effectively allows exclude_unset to work like exclude_none where + # the latter passes through intentionally set none values. + if default is not None or ("exclude_unset" in kwargs and not kwargs["exclude_unset"]): + _fields_set.add(name) + + if default is not None: + self.__fields_set__.add(name) + + kwargs_with_defaults_exclude_unset_include_fields = { + "by_alias": True, + "exclude_unset": True, + "include": _fields_set, + **kwargs, + } + + dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) + + return cast( + Dict[str, Any], + convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write"), + ) + + +def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> List[Any]: + converted_list: List[Any] = [] + for i, item in enumerate(source): + destination_value = destination[i] + if isinstance(item, dict): + converted_list.append(deep_union_pydantic_dicts(item, destination_value)) + elif isinstance(item, list): + converted_list.append(_union_list_of_pydantic_dicts(item, destination_value)) + else: + converted_list.append(item) + return converted_list + + +def deep_union_pydantic_dicts(source: Dict[str, Any], destination: Dict[str, Any]) -> Dict[str, Any]: + for key, value in source.items(): + node = destination.setdefault(key, {}) + if isinstance(value, dict): + deep_union_pydantic_dicts(value, node) + # Note: we do not do this same processing for sets given we do not have sets of models + # and given the sets are unordered, the processing of the set and matching objects would + # be non-trivial. + elif isinstance(value, list): + destination[key] = _union_list_of_pydantic_dicts(value, node) + else: + destination[key] = value + + return destination + + +if IS_PYDANTIC_V2: + + class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[misc, name-defined, type-arg] + pass + + UniversalRootModel: TypeAlias = V2RootModel # type: ignore[misc] +else: + UniversalRootModel: TypeAlias = UniversalBaseModel # type: ignore[misc, no-redef] + + +def encode_by_type(o: Any) -> Any: + encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(tuple) + for type_, encoder in encoders_by_type.items(): + encoders_by_class_tuples[encoder] += (type_,) + + if type(o) in encoders_by_type: + return encoders_by_type[type(o)](o) + for encoder, classes_tuple in encoders_by_class_tuples.items(): + if isinstance(o, classes_tuple): + return encoder(o) + + +def update_forward_refs(model: Type["Model"], **localns: Any) -> None: + if IS_PYDANTIC_V2: + model.model_rebuild(raise_errors=False) # type: ignore[attr-defined] + else: + model.update_forward_refs(**localns) + + +# Mirrors Pydantic's internal typing +AnyCallable = Callable[..., Any] + + +def universal_root_validator( + pre: bool = False, +) -> Callable[[AnyCallable], AnyCallable]: + def decorator(func: AnyCallable) -> AnyCallable: + if IS_PYDANTIC_V2: + return cast(AnyCallable, pydantic.model_validator(mode="before" if pre else "after")(func)) # type: ignore[attr-defined] + return cast(AnyCallable, pydantic.root_validator(pre=pre)(func)) # type: ignore[call-overload] + + return decorator + + +def universal_field_validator(field_name: str, pre: bool = False) -> Callable[[AnyCallable], AnyCallable]: + def decorator(func: AnyCallable) -> AnyCallable: + if IS_PYDANTIC_V2: + return cast(AnyCallable, pydantic.field_validator(field_name, mode="before" if pre else "after")(func)) # type: ignore[attr-defined] + return cast(AnyCallable, pydantic.validator(field_name, pre=pre)(func)) + + return decorator + + +PydanticField = Union[ModelField, pydantic.fields.FieldInfo] + + +def _get_model_fields(model: Type["Model"]) -> Mapping[str, PydanticField]: + if IS_PYDANTIC_V2: + return cast(Mapping[str, PydanticField], model.model_fields) # type: ignore[attr-defined] + return cast(Mapping[str, PydanticField], model.__fields__) + + +def _get_field_default(field: PydanticField) -> Any: + try: + value = field.get_default() # type: ignore[union-attr] + except: + value = field.default + if IS_PYDANTIC_V2: + from pydantic_core import PydanticUndefined + + if value == PydanticUndefined: + return None + return value + return value diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/query_encoder.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/query_encoder.py new file mode 100644 index 00000000000..3183001d404 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/query_encoder.py @@ -0,0 +1,58 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, List, Optional, Tuple + +import pydantic + + +# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict +def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: + result = [] + for k, v in dict_flat.items(): + key = f"{key_prefix}[{k}]" if key_prefix is not None else k + if isinstance(v, dict): + result.extend(traverse_query_dict(v, key)) + elif isinstance(v, list): + for arr_v in v: + if isinstance(arr_v, dict): + result.extend(traverse_query_dict(arr_v, key)) + else: + result.append((key, arr_v)) + else: + result.append((key, v)) + return result + + +def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]: + if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict): + if isinstance(query_value, pydantic.BaseModel): + obj_dict = query_value.dict(by_alias=True) + else: + obj_dict = query_value + return traverse_query_dict(obj_dict, query_key) + elif isinstance(query_value, list): + encoded_values: List[Tuple[str, Any]] = [] + for value in query_value: + if isinstance(value, pydantic.BaseModel) or isinstance(value, dict): + if isinstance(value, pydantic.BaseModel): + obj_dict = value.dict(by_alias=True) + elif isinstance(value, dict): + obj_dict = value + + encoded_values.extend(single_query_encoder(query_key, obj_dict)) + else: + encoded_values.append((query_key, value)) + + return encoded_values + + return [(query_key, query_value)] + + +def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: + if query is None: + return None + + encoded_query = [] + for k, v in query.items(): + encoded_query.extend(single_query_encoder(k, v)) + return encoded_query diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/remove_none_from_dict.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/remove_none_from_dict.py new file mode 100644 index 00000000000..c2298143f14 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/remove_none_from_dict.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, Mapping, Optional + + +def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]: + new: Dict[str, Any] = {} + for key, value in original.items(): + if value is not None: + new[key] = value + return new diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/request_options.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/request_options.py new file mode 100644 index 00000000000..1b38804432b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/request_options.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +try: + from typing import NotRequired # type: ignore +except ImportError: + from typing_extensions import NotRequired + + +class RequestOptions(typing.TypedDict, total=False): + """ + Additional options for request-specific configuration when calling APIs via the SDK. + This is used primarily as an optional final parameter for service functions. + + Attributes: + - timeout_in_seconds: int. The number of seconds to await an API call before timing out. + + - max_retries: int. The max number of retries to attempt if the API call fails. + + - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict + + - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict + + - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict + + - chunk_size: int. The size, in bytes, to process each chunk of data being streamed back within the response. This equates to leveraging `chunk_size` within `requests` or `httpx`, and is only leveraged for file downloads. + """ + + timeout_in_seconds: NotRequired[int] + max_retries: NotRequired[int] + additional_headers: NotRequired[typing.Dict[str, typing.Any]] + additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] + additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] + chunk_size: NotRequired[int] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/serialization.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/serialization.py new file mode 100644 index 00000000000..c36e865cc72 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/core/serialization.py @@ -0,0 +1,276 @@ +# This file was auto-generated by Fern from our API Definition. + +import collections +import inspect +import typing + +import pydantic +import typing_extensions + + +class FieldMetadata: + """ + Metadata class used to annotate fields to provide additional information. + + Example: + class MyDict(TypedDict): + field: typing.Annotated[str, FieldMetadata(alias="field_name")] + + Will serialize: `{"field": "value"}` + To: `{"field_name": "value"}` + """ + + alias: str + + def __init__(self, *, alias: str) -> None: + self.alias = alias + + +def convert_and_respect_annotation_metadata( + *, + object_: typing.Any, + annotation: typing.Any, + inner_type: typing.Optional[typing.Any] = None, + direction: typing.Literal["read", "write"], +) -> typing.Any: + """ + Respect the metadata annotations on a field, such as aliasing. This function effectively + manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for + TypedDicts, which cannot support aliasing out of the box, and can be extended for additional + utilities, such as defaults. + + Parameters + ---------- + object_ : typing.Any + + annotation : type + The type we're looking to apply typing annotations from + + inner_type : typing.Optional[type] + + Returns + ------- + typing.Any + """ + + if object_ is None: + return None + if inner_type is None: + inner_type = annotation + + clean_type = _remove_annotations(inner_type) + # Pydantic models + if ( + inspect.isclass(clean_type) + and issubclass(clean_type, pydantic.BaseModel) + and isinstance(object_, typing.Mapping) + ): + return _convert_mapping(object_, clean_type, direction) + # TypedDicts + if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping): + return _convert_mapping(object_, clean_type, direction) + + if ( + typing_extensions.get_origin(clean_type) == typing.Dict + or typing_extensions.get_origin(clean_type) == dict + or clean_type == typing.Dict + ) and isinstance(object_, typing.Dict): + key_type = typing_extensions.get_args(clean_type)[0] + value_type = typing_extensions.get_args(clean_type)[1] + + return { + key: convert_and_respect_annotation_metadata( + object_=value, + annotation=annotation, + inner_type=value_type, + direction=direction, + ) + for key, value in object_.items() + } + + # If you're iterating on a string, do not bother to coerce it to a sequence. + if not isinstance(object_, str): + if ( + typing_extensions.get_origin(clean_type) == typing.Set + or typing_extensions.get_origin(clean_type) == set + or clean_type == typing.Set + ) and isinstance(object_, typing.Set): + inner_type = typing_extensions.get_args(clean_type)[0] + return { + convert_and_respect_annotation_metadata( + object_=item, + annotation=annotation, + inner_type=inner_type, + direction=direction, + ) + for item in object_ + } + elif ( + ( + typing_extensions.get_origin(clean_type) == typing.List + or typing_extensions.get_origin(clean_type) == list + or clean_type == typing.List + ) + and isinstance(object_, typing.List) + ) or ( + ( + typing_extensions.get_origin(clean_type) == typing.Sequence + or typing_extensions.get_origin(clean_type) == collections.abc.Sequence + or clean_type == typing.Sequence + ) + and isinstance(object_, typing.Sequence) + ): + inner_type = typing_extensions.get_args(clean_type)[0] + return [ + convert_and_respect_annotation_metadata( + object_=item, + annotation=annotation, + inner_type=inner_type, + direction=direction, + ) + for item in object_ + ] + + if typing_extensions.get_origin(clean_type) == typing.Union: + # We should be able to ~relatively~ safely try to convert keys against all + # member types in the union, the edge case here is if one member aliases a field + # of the same name to a different name from another member + # Or if another member aliases a field of the same name that another member does not. + for member in typing_extensions.get_args(clean_type): + object_ = convert_and_respect_annotation_metadata( + object_=object_, + annotation=annotation, + inner_type=member, + direction=direction, + ) + return object_ + + annotated_type = _get_annotation(annotation) + if annotated_type is None: + return object_ + + # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.) + # Then we can safely call it on the recursive conversion. + return object_ + + +def _convert_mapping( + object_: typing.Mapping[str, object], + expected_type: typing.Any, + direction: typing.Literal["read", "write"], +) -> typing.Mapping[str, object]: + converted_object: typing.Dict[str, object] = {} + try: + annotations = typing_extensions.get_type_hints(expected_type, include_extras=True) + except NameError: + # The TypedDict contains a circular reference, so + # we use the __annotations__ attribute directly. + annotations = getattr(expected_type, "__annotations__", {}) + aliases_to_field_names = _get_alias_to_field_name(annotations) + for key, value in object_.items(): + if direction == "read" and key in aliases_to_field_names: + dealiased_key = aliases_to_field_names.get(key) + if dealiased_key is not None: + type_ = annotations.get(dealiased_key) + else: + type_ = annotations.get(key) + # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map + # + # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias + # then we can just pass the value through as is + if type_ is None: + converted_object[key] = value + elif direction == "read" and key not in aliases_to_field_names: + converted_object[key] = convert_and_respect_annotation_metadata( + object_=value, annotation=type_, direction=direction + ) + else: + converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = ( + convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction) + ) + return converted_object + + +def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]: + maybe_annotated_type = typing_extensions.get_origin(type_) + if maybe_annotated_type is None: + return None + + if maybe_annotated_type == typing_extensions.NotRequired: + type_ = typing_extensions.get_args(type_)[0] + maybe_annotated_type = typing_extensions.get_origin(type_) + + if maybe_annotated_type == typing_extensions.Annotated: + return type_ + + return None + + +def _remove_annotations(type_: typing.Any) -> typing.Any: + maybe_annotated_type = typing_extensions.get_origin(type_) + if maybe_annotated_type is None: + return type_ + + if maybe_annotated_type == typing_extensions.NotRequired: + return _remove_annotations(typing_extensions.get_args(type_)[0]) + + if maybe_annotated_type == typing_extensions.Annotated: + return _remove_annotations(typing_extensions.get_args(type_)[0]) + + return type_ + + +def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]: + annotations = typing_extensions.get_type_hints(type_, include_extras=True) + return _get_alias_to_field_name(annotations) + + +def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]: + annotations = typing_extensions.get_type_hints(type_, include_extras=True) + return _get_field_to_alias_name(annotations) + + +def _get_alias_to_field_name( + field_to_hint: typing.Dict[str, typing.Any], +) -> typing.Dict[str, str]: + aliases = {} + for field, hint in field_to_hint.items(): + maybe_alias = _get_alias_from_type(hint) + if maybe_alias is not None: + aliases[maybe_alias] = field + return aliases + + +def _get_field_to_alias_name( + field_to_hint: typing.Dict[str, typing.Any], +) -> typing.Dict[str, str]: + aliases = {} + for field, hint in field_to_hint.items(): + maybe_alias = _get_alias_from_type(hint) + if maybe_alias is not None: + aliases[field] = maybe_alias + return aliases + + +def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]: + maybe_annotated_type = _get_annotation(type_) + + if maybe_annotated_type is not None: + # The actual annotations are 1 onward, the first is the annotated type + annotations = typing_extensions.get_args(maybe_annotated_type)[1:] + + for annotation in annotations: + if isinstance(annotation, FieldMetadata) and annotation.alias is not None: + return annotation.alias + return None + + +def _alias_key( + key: str, + type_: typing.Any, + direction: typing.Literal["read", "write"], + aliases_to_field_names: typing.Dict[str, str], +) -> str: + if direction == "read": + return aliases_to_field_names.get(key, key) + return _get_alias_from_type(type_=type_) or key diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/py.typed b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/py.typed new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/types/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/types/__init__.py new file mode 100644 index 00000000000..802b933eb12 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/types/__init__.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .importing_a import ImportingA + from .root_type import RootType +_dynamic_imports: typing.Dict[str, str] = {"ImportingA": ".importing_a", "RootType": ".root_type"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["ImportingA", "RootType"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/types/importing_a.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/types/importing_a.py new file mode 100644 index 00000000000..5818c50eb14 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/types/importing_a.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..a.types.a import A +from ..core.pydantic_utilities import UniversalBaseModel + + +class ImportingA(UniversalBaseModel): + a: typing.Optional[A] = None + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/types/root_type.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/types/root_type.py new file mode 100644 index 00000000000..68ad5918228 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/types/root_type.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +import pydantic +from ..core.pydantic_utilities import UniversalBaseModel + + +class RootType(UniversalBaseModel): + s: str + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/version.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/version.py new file mode 100644 index 00000000000..8bceace9866 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/src/seed/version.py @@ -0,0 +1,3 @@ +from importlib import metadata + +__version__ = metadata.version("fern_circular-references-advanced") diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/custom/test_client.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/custom/test_client.py new file mode 100644 index 00000000000..ab04ce6393e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/custom/test_client.py @@ -0,0 +1,7 @@ +import pytest + + +# Get started with writing tests with pytest at https://docs.pytest.org +@pytest.mark.skip(reason="Unimplemented") +def test_client() -> None: + assert True diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/__init__.py new file mode 100644 index 00000000000..2cf01263529 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/__init__.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +from .circle import CircleParams +from .object_with_defaults import ObjectWithDefaultsParams +from .object_with_optional_field import ObjectWithOptionalFieldParams +from .shape import Shape_CircleParams, Shape_SquareParams, ShapeParams +from .square import SquareParams +from .undiscriminated_shape import UndiscriminatedShapeParams + +__all__ = [ + "CircleParams", + "ObjectWithDefaultsParams", + "ObjectWithOptionalFieldParams", + "ShapeParams", + "Shape_CircleParams", + "Shape_SquareParams", + "SquareParams", + "UndiscriminatedShapeParams", +] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/circle.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/circle.py new file mode 100644 index 00000000000..74ecf38c308 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/circle.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions + +from seed.core.serialization import FieldMetadata + + +class CircleParams(typing_extensions.TypedDict): + radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/color.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/color.py new file mode 100644 index 00000000000..2aa2c4c52f0 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/color.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing + +Color = typing.Union[typing.Literal["red", "blue"], typing.Any] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/object_with_defaults.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/object_with_defaults.py new file mode 100644 index 00000000000..a977b1d2aa1 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/object_with_defaults.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions + + +class ObjectWithDefaultsParams(typing_extensions.TypedDict): + """ + Defines properties with default values and validation rules. + """ + + decimal: typing_extensions.NotRequired[float] + string: typing_extensions.NotRequired[str] + required_string: str diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/object_with_optional_field.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/object_with_optional_field.py new file mode 100644 index 00000000000..6b5608bc05b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/object_with_optional_field.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +import uuid + +import typing_extensions +from .color import Color +from .shape import ShapeParams +from .undiscriminated_shape import UndiscriminatedShapeParams + +from seed.core.serialization import FieldMetadata + + +class ObjectWithOptionalFieldParams(typing_extensions.TypedDict): + literal: typing.Literal["lit_one"] + string: typing_extensions.NotRequired[str] + integer: typing_extensions.NotRequired[int] + long_: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="long")]] + double: typing_extensions.NotRequired[float] + bool_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="bool")]] + datetime: typing_extensions.NotRequired[dt.datetime] + date: typing_extensions.NotRequired[dt.date] + uuid_: typing_extensions.NotRequired[typing_extensions.Annotated[uuid.UUID, FieldMetadata(alias="uuid")]] + base_64: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="base64")]] + list_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Sequence[str], FieldMetadata(alias="list")]] + set_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Set[str], FieldMetadata(alias="set")]] + map_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Dict[int, str], FieldMetadata(alias="map")]] + enum: typing_extensions.NotRequired[Color] + union: typing_extensions.NotRequired[ShapeParams] + second_union: typing_extensions.NotRequired[ShapeParams] + undiscriminated_union: typing_extensions.NotRequired[UndiscriminatedShapeParams] + any: typing.Optional[typing.Any] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/shape.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/shape.py new file mode 100644 index 00000000000..7e70010a251 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/shape.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import typing_extensions + +from seed.core.serialization import FieldMetadata + + +class Base(typing_extensions.TypedDict): + id: str + + +class Shape_CircleParams(Base): + shape_type: typing_extensions.Annotated[typing.Literal["circle"], FieldMetadata(alias="shapeType")] + radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] + + +class Shape_SquareParams(Base): + shape_type: typing_extensions.Annotated[typing.Literal["square"], FieldMetadata(alias="shapeType")] + length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] + + +ShapeParams = typing.Union[Shape_CircleParams, Shape_SquareParams] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/square.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/square.py new file mode 100644 index 00000000000..71c7d25fd4a --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/square.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions + +from seed.core.serialization import FieldMetadata + + +class SquareParams(typing_extensions.TypedDict): + length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/undiscriminated_shape.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/undiscriminated_shape.py new file mode 100644 index 00000000000..99f12b300d1 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/assets/models/undiscriminated_shape.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .circle import CircleParams +from .square import SquareParams + +UndiscriminatedShapeParams = typing.Union[CircleParams, SquareParams] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/test_http_client.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/test_http_client.py new file mode 100644 index 00000000000..a541bae6531 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/test_http_client.py @@ -0,0 +1,61 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed.core.http_client import get_request_body +from seed.core.request_options import RequestOptions + + +def get_request_options() -> RequestOptions: + return {"additional_body_parameters": {"see you": "later"}} + + +def test_get_json_request_body() -> None: + json_body, data_body = get_request_body(json={"hello": "world"}, data=None, request_options=None, omit=None) + assert json_body == {"hello": "world"} + assert data_body is None + + json_body_extras, data_body_extras = get_request_body( + json={"goodbye": "world"}, data=None, request_options=get_request_options(), omit=None + ) + + assert json_body_extras == {"goodbye": "world", "see you": "later"} + assert data_body_extras is None + + +def test_get_files_request_body() -> None: + json_body, data_body = get_request_body(json=None, data={"hello": "world"}, request_options=None, omit=None) + assert data_body == {"hello": "world"} + assert json_body is None + + json_body_extras, data_body_extras = get_request_body( + json=None, data={"goodbye": "world"}, request_options=get_request_options(), omit=None + ) + + assert data_body_extras == {"goodbye": "world", "see you": "later"} + assert json_body_extras is None + + +def test_get_none_request_body() -> None: + json_body, data_body = get_request_body(json=None, data=None, request_options=None, omit=None) + assert data_body is None + assert json_body is None + + json_body_extras, data_body_extras = get_request_body( + json=None, data=None, request_options=get_request_options(), omit=None + ) + + assert json_body_extras == {"see you": "later"} + assert data_body_extras is None + + +def test_get_empty_json_request_body() -> None: + unrelated_request_options: RequestOptions = {"max_retries": 3} + json_body, data_body = get_request_body(json=None, data=None, request_options=unrelated_request_options, omit=None) + assert json_body is None + assert data_body is None + + json_body_extras, data_body_extras = get_request_body( + json={}, data=None, request_options=unrelated_request_options, omit=None + ) + + assert json_body_extras is None + assert data_body_extras is None diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/test_query_encoding.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/test_query_encoding.py new file mode 100644 index 00000000000..ef5fd7094f9 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/test_query_encoding.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed.core.query_encoder import encode_query + + +def test_query_encoding_deep_objects() -> None: + assert encode_query({"hello world": "hello world"}) == [("hello world", "hello world")] + assert encode_query({"hello_world": {"hello": "world"}}) == [("hello_world[hello]", "world")] + assert encode_query({"hello_world": {"hello": {"world": "today"}, "test": "this"}, "hi": "there"}) == [ + ("hello_world[hello][world]", "today"), + ("hello_world[test]", "this"), + ("hi", "there"), + ] + + +def test_query_encoding_deep_object_arrays() -> None: + assert encode_query({"objects": [{"key": "hello", "value": "world"}, {"key": "foo", "value": "bar"}]}) == [ + ("objects[key]", "hello"), + ("objects[value]", "world"), + ("objects[key]", "foo"), + ("objects[value]", "bar"), + ] + assert encode_query( + {"users": [{"name": "string", "tags": ["string"]}, {"name": "string2", "tags": ["string2", "string3"]}]} + ) == [ + ("users[name]", "string"), + ("users[tags]", "string"), + ("users[name]", "string2"), + ("users[tags]", "string2"), + ("users[tags]", "string3"), + ] + + +def test_encode_query_with_none() -> None: + encoded = encode_query(None) + assert encoded is None diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/test_serialization.py b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/test_serialization.py new file mode 100644 index 00000000000..b298db89c4b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v1/tests/utils/test_serialization.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, List + +from .assets.models import ObjectWithOptionalFieldParams, ShapeParams + +from seed.core.serialization import convert_and_respect_annotation_metadata + +UNION_TEST: ShapeParams = {"radius_measurement": 1.0, "shape_type": "circle", "id": "1"} +UNION_TEST_CONVERTED = {"shapeType": "circle", "radiusMeasurement": 1.0, "id": "1"} + + +def test_convert_and_respect_annotation_metadata() -> None: + data: ObjectWithOptionalFieldParams = { + "string": "string", + "long_": 12345, + "bool_": True, + "literal": "lit_one", + "any": "any", + } + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" + ) + assert converted == {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"} + + +def test_convert_and_respect_annotation_metadata_in_list() -> None: + data: List[ObjectWithOptionalFieldParams] = [ + {"string": "string", "long_": 12345, "bool_": True, "literal": "lit_one", "any": "any"}, + {"string": "another string", "long_": 67890, "list_": [], "literal": "lit_one", "any": "any"}, + ] + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=List[ObjectWithOptionalFieldParams], direction="write" + ) + + assert converted == [ + {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"}, + {"string": "another string", "long": 67890, "list": [], "literal": "lit_one", "any": "any"}, + ] + + +def test_convert_and_respect_annotation_metadata_in_nested_object() -> None: + data: ObjectWithOptionalFieldParams = { + "string": "string", + "long_": 12345, + "union": UNION_TEST, + "literal": "lit_one", + "any": "any", + } + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" + ) + + assert converted == { + "string": "string", + "long": 12345, + "union": UNION_TEST_CONVERTED, + "literal": "lit_one", + "any": "any", + } + + +def test_convert_and_respect_annotation_metadata_in_union() -> None: + converted = convert_and_respect_annotation_metadata(object_=UNION_TEST, annotation=ShapeParams, direction="write") + + assert converted == UNION_TEST_CONVERTED + + +def test_convert_and_respect_annotation_metadata_with_empty_object() -> None: + data: Any = {} + converted = convert_and_respect_annotation_metadata(object_=data, annotation=ShapeParams, direction="write") + assert converted == data diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/.github/workflows/ci.yml b/seed/python-sdk/circular-references-advanced/pydantic-v2/.github/workflows/ci.yml new file mode 100644 index 00000000000..bfde52e511c --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/.github/workflows/ci.yml @@ -0,0 +1,61 @@ +name: ci + +on: [push] +jobs: + compile: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Compile + run: poetry run mypy . + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + + - name: Test + run: poetry run pytest -rP . + + publish: + needs: [compile, test] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Publish to pypi + run: | + poetry config repositories.remote + poetry --no-interaction -v publish --build --repository remote --username "$" --password "$" + env: + : ${{ secrets. }} + : ${{ secrets. }} diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/.gitignore b/seed/python-sdk/circular-references-advanced/pydantic-v2/.gitignore new file mode 100644 index 00000000000..d2e4ca808d2 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/.gitignore @@ -0,0 +1,5 @@ +.mypy_cache/ +.ruff_cache/ +__pycache__/ +dist/ +poetry.toml diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/README.md b/seed/python-sdk/circular-references-advanced/pydantic-v2/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/poetry.lock b/seed/python-sdk/circular-references-advanced/pydantic-v2/poetry.lock new file mode 100644 index 00000000000..dcc20abb205 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/poetry.lock @@ -0,0 +1,560 @@ +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. + +[[package]] +name = "annotated-types" +version = "0.7.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, + {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} + +[[package]] +name = "anyio" +version = "4.5.2" +description = "High level compatibility layer for multiple asynchronous event loop implementations" +optional = false +python-versions = ">=3.8" +files = [ + {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, + {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, +] + +[package.dependencies] +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +idna = ">=2.8" +sniffio = ">=1.1" +typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} + +[package.extras] +doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] +trio = ["trio (>=0.26.1)"] + +[[package]] +name = "certifi" +version = "2025.10.5" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.7" +files = [ + {file = "certifi-2025.10.5-py3-none-any.whl", hash = "sha256:0f212c2744a9bb6de0c56639a6f68afe01ecd92d91f14ae897c4fe7bbeeef0de"}, + {file = "certifi-2025.10.5.tar.gz", hash = "sha256:47c09d31ccf2acf0be3f701ea53595ee7e0b8fa08801c6624be771df09ae7b43"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.0" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"}, + {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "h11" +version = "0.16.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.8" +files = [ + {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, + {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, + {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.16" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<1.0)"] + +[[package]] +name = "httpx" +version = "0.28.1" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, + {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "idna" +version = "3.11" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.8" +files = [ + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, +] + +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + +[[package]] +name = "iniconfig" +version = "2.1.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.8" +files = [ + {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"}, + {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, +] + +[[package]] +name = "mypy" +version = "1.13.0" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, + {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, + {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, + {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, + {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, + {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, + {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, + {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, + {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, + {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, + {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, + {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, + {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, + {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, + {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, + {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, + {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, + {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, + {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, + {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, + {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, + {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, +] + +[package.dependencies] +mypy-extensions = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=4.6.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.8" +files = [ + {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, + {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, +] + +[[package]] +name = "packaging" +version = "25.0" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, + {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "pydantic" +version = "2.10.6" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, + {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, +] + +[package.dependencies] +annotated-types = ">=0.6.0" +pydantic-core = "2.27.2" +typing-extensions = ">=4.12.2" + +[package.extras] +email = ["email-validator (>=2.0.0)"] +timezone = ["tzdata"] + +[[package]] +name = "pydantic-core" +version = "2.27.2" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, + {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"}, + {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"}, + {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"}, + {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"}, + {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"}, + {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"}, + {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"}, + {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"}, + {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"}, + {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"}, + {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"}, + {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"}, + {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"}, + {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"}, + {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"}, + {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"}, + {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + +[[package]] +name = "pytest" +version = "7.4.4" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, + {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} + +[package.extras] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "pytest-asyncio" +version = "0.23.8" +description = "Pytest support for asyncio" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, + {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, +] + +[package.dependencies] +pytest = ">=7.0.0,<9" + +[package.extras] +docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] +testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "ruff" +version = "0.11.5" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruff-0.11.5-py3-none-linux_armv6l.whl", hash = "sha256:2561294e108eb648e50f210671cc56aee590fb6167b594144401532138c66c7b"}, + {file = "ruff-0.11.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ac12884b9e005c12d0bd121f56ccf8033e1614f736f766c118ad60780882a077"}, + {file = "ruff-0.11.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4bfd80a6ec559a5eeb96c33f832418bf0fb96752de0539905cf7b0cc1d31d779"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0947c0a1afa75dcb5db4b34b070ec2bccee869d40e6cc8ab25aca11a7d527794"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ad871ff74b5ec9caa66cb725b85d4ef89b53f8170f47c3406e32ef040400b038"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e6cf918390cfe46d240732d4d72fa6e18e528ca1f60e318a10835cf2fa3dc19f"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:56145ee1478582f61c08f21076dc59153310d606ad663acc00ea3ab5b2125f82"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e5f66f8f1e8c9fc594cbd66fbc5f246a8d91f916cb9667e80208663ec3728304"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80b4df4d335a80315ab9afc81ed1cff62be112bd165e162b5eed8ac55bfc8470"}, + {file = "ruff-0.11.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3068befab73620b8a0cc2431bd46b3cd619bc17d6f7695a3e1bb166b652c382a"}, + {file = "ruff-0.11.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f5da2e710a9641828e09aa98b92c9ebbc60518fdf3921241326ca3e8f8e55b8b"}, + {file = "ruff-0.11.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ef39f19cb8ec98cbc762344921e216f3857a06c47412030374fffd413fb8fd3a"}, + {file = "ruff-0.11.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b2a7cedf47244f431fd11aa5a7e2806dda2e0c365873bda7834e8f7d785ae159"}, + {file = "ruff-0.11.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:81be52e7519f3d1a0beadcf8e974715b2dfc808ae8ec729ecfc79bddf8dbb783"}, + {file = "ruff-0.11.5-py3-none-win32.whl", hash = "sha256:e268da7b40f56e3eca571508a7e567e794f9bfcc0f412c4b607931d3af9c4afe"}, + {file = "ruff-0.11.5-py3-none-win_amd64.whl", hash = "sha256:6c6dc38af3cfe2863213ea25b6dc616d679205732dc0fb673356c2d69608f800"}, + {file = "ruff-0.11.5-py3-none-win_arm64.whl", hash = "sha256:67e241b4314f4eacf14a601d586026a962f4002a475aa702c69980a38087aa4e"}, + {file = "ruff-0.11.5.tar.gz", hash = "sha256:cae2e2439cb88853e421901ec040a758960b576126dab520fa08e9de431d1bef"}, +] + +[[package]] +name = "six" +version = "1.17.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +description = "Sniff out which async library your code is running under" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, + {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, +] + +[[package]] +name = "tomli" +version = "2.3.0" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"}, + {file = "tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba"}, + {file = "tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf"}, + {file = "tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441"}, + {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845"}, + {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c"}, + {file = "tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456"}, + {file = "tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be"}, + {file = "tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac"}, + {file = "tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22"}, + {file = "tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f"}, + {file = "tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52"}, + {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8"}, + {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6"}, + {file = "tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876"}, + {file = "tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878"}, + {file = "tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b"}, + {file = "tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae"}, + {file = "tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b"}, + {file = "tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf"}, + {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f"}, + {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05"}, + {file = "tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606"}, + {file = "tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999"}, + {file = "tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e"}, + {file = "tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3"}, + {file = "tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc"}, + {file = "tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0"}, + {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879"}, + {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005"}, + {file = "tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463"}, + {file = "tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8"}, + {file = "tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77"}, + {file = "tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf"}, + {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530"}, + {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b"}, + {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67"}, + {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f"}, + {file = "tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0"}, + {file = "tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba"}, + {file = "tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b"}, + {file = "tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549"}, +] + +[[package]] +name = "types-python-dateutil" +version = "2.9.0.20241206" +description = "Typing stubs for python-dateutil" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"}, + {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"}, +] + +[[package]] +name = "typing-extensions" +version = "4.13.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, + {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, +] + +[metadata] +lock-version = "2.0" +python-versions = "^3.8" +content-hash = "7518fee7b23c577dbcb91fab7281a185529efc31b3d735becf97fb10f96bbdec" diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/pyproject.toml b/seed/python-sdk/circular-references-advanced/pydantic-v2/pyproject.toml new file mode 100644 index 00000000000..4ecc789ace6 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/pyproject.toml @@ -0,0 +1,84 @@ +[project] +name = "fern_circular-references-advanced" + +[tool.poetry] +name = "fern_circular-references-advanced" +version = "0.0.1" +description = "" +readme = "README.md" +authors = [] +keywords = [] + +classifiers = [ + "Intended Audience :: Developers", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: OS Independent", + "Operating System :: POSIX", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed" +] +packages = [ + { include = "seed", from = "src"} +] + +[project.urls] +Repository = 'https://github.com/circular-references-advanced/fern' + +[tool.poetry.dependencies] +python = "^3.8" +httpx = ">=0.21.2" +pydantic = ">= 2.0.0" +pydantic-core = ">=2.18.2" +typing_extensions = ">= 4.0.0" + +[tool.poetry.group.dev.dependencies] +mypy = "==1.13.0" +pytest = "^7.4.0" +pytest-asyncio = "^0.23.5" +python-dateutil = "^2.9.0" +types-python-dateutil = "^2.9.0.20240316" +ruff = "==0.11.5" + +[tool.pytest.ini_options] +testpaths = [ "tests" ] +asyncio_mode = "auto" + +[tool.mypy] +plugins = ["pydantic.mypy"] + +[tool.ruff] +line-length = 120 + +[tool.ruff.lint] +select = [ + "E", # pycodestyle errors + "F", # pyflakes + "I", # isort +] +ignore = [ + "E402", # Module level import not at top of file + "E501", # Line too long + "E711", # Comparison to `None` should be `cond is not None` + "E712", # Avoid equality comparisons to `True`; use `if ...:` checks + "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks + "E722", # Do not use bare `except` + "E731", # Do not assign a `lambda` expression, use a `def` + "F821", # Undefined name + "F841" # Local variable ... is assigned to but never used +] + +[tool.ruff.lint.isort] +section-order = ["future", "standard-library", "third-party", "first-party"] + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/requirements.txt b/seed/python-sdk/circular-references-advanced/pydantic-v2/requirements.txt new file mode 100644 index 00000000000..0e1d565a9d6 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/requirements.txt @@ -0,0 +1,4 @@ +httpx>=0.21.2 +pydantic>= 2.0.0 +pydantic-core>=2.18.2 +typing_extensions>= 4.0.0 diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/snippet-templates.json b/seed/python-sdk/circular-references-advanced/pydantic-v2/snippet-templates.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/snippet.json b/seed/python-sdk/circular-references-advanced/pydantic-v2/snippet.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/__init__.py new file mode 100644 index 00000000000..f165f36681b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/__init__.py @@ -0,0 +1,244 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ImportingA, RootType + from . import a, ast + from .a import A + from .ast import ( + Acai, + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, + Animal, + Berry, + BranchNode, + Cat, + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, + FieldName, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, + Fig, + Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, + LeafNode, + Node, + NodesWrapper, + ObjectFieldValue, + ObjectValue, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, + PrimitiveValue, + ) + from .client import AsyncSeedApi, SeedApi + from .version import __version__ +_dynamic_imports: typing.Dict[str, str] = { + "A": ".a", + "Acai": ".ast", + "AndOperator": ".ast", + "AndOperatorChild": ".ast", + "AndOperatorChild_AndOperator": ".ast", + "AndOperatorChild_BooleanLiteral": ".ast", + "AndOperatorChild_EqOperator": ".ast", + "AndOperatorChild_GtOperator": ".ast", + "AndOperatorChild_OrOperator": ".ast", + "Animal": ".ast", + "AsyncSeedApi": ".client", + "Berry": ".ast", + "BranchNode": ".ast", + "Cat": ".ast", + "ContainerValue": ".ast", + "ContainerValue_List": ".ast", + "ContainerValue_Optional": ".ast", + "Dog": ".ast", + "EqualsOperator": ".ast", + "EqualsOperatorLeft": ".ast", + "EqualsOperatorLeft_AndOperator": ".ast", + "EqualsOperatorLeft_EqOperator": ".ast", + "EqualsOperatorLeft_GtOperator": ".ast", + "EqualsOperatorLeft_OrOperator": ".ast", + "EqualsOperatorLeft_StringLiteral": ".ast", + "EqualsOperatorRight": ".ast", + "EqualsOperatorRight_AndOperator": ".ast", + "EqualsOperatorRight_EqOperator": ".ast", + "EqualsOperatorRight_GtOperator": ".ast", + "EqualsOperatorRight_OrOperator": ".ast", + "EqualsOperatorRight_StringLiteral": ".ast", + "FieldName": ".ast", + "FieldValue": ".ast", + "FieldValue_ContainerValue": ".ast", + "FieldValue_ObjectValue": ".ast", + "FieldValue_PrimitiveValue": ".ast", + "Fig": ".ast", + "Fruit": ".ast", + "GreaterThanOperator": ".ast", + "GreaterThanOperatorLeft": ".ast", + "GreaterThanOperatorLeft_AndOperator": ".ast", + "GreaterThanOperatorLeft_EqOperator": ".ast", + "GreaterThanOperatorLeft_GtOperator": ".ast", + "GreaterThanOperatorLeft_NumberLiteral": ".ast", + "GreaterThanOperatorLeft_OrOperator": ".ast", + "GreaterThanOperatorRight": ".ast", + "GreaterThanOperatorRight_AndOperator": ".ast", + "GreaterThanOperatorRight_EqOperator": ".ast", + "GreaterThanOperatorRight_GtOperator": ".ast", + "GreaterThanOperatorRight_NumberLiteral": ".ast", + "GreaterThanOperatorRight_OrOperator": ".ast", + "ImportingA": ".types", + "LeafNode": ".ast", + "Node": ".ast", + "NodesWrapper": ".ast", + "ObjectFieldValue": ".ast", + "ObjectValue": ".ast", + "OrOperator": ".ast", + "OrOperatorChild": ".ast", + "OrOperatorChild_AndOperator": ".ast", + "OrOperatorChild_BooleanLiteral": ".ast", + "OrOperatorChild_EqOperator": ".ast", + "OrOperatorChild_GtOperator": ".ast", + "OrOperatorChild_OrOperator": ".ast", + "PrimitiveValue": ".ast", + "RootType": ".types", + "SeedApi": ".client", + "__version__": ".version", + "a": ".a", + "ast": ".ast", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "A", + "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", + "Animal", + "AsyncSeedApi", + "Berry", + "BranchNode", + "Cat", + "ContainerValue", + "ContainerValue_List", + "ContainerValue_Optional", + "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", + "FieldName", + "FieldValue", + "FieldValue_ContainerValue", + "FieldValue_ObjectValue", + "FieldValue_PrimitiveValue", + "Fig", + "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", + "ImportingA", + "LeafNode", + "Node", + "NodesWrapper", + "ObjectFieldValue", + "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", + "PrimitiveValue", + "RootType", + "SeedApi", + "__version__", + "a", + "ast", +] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/a/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/a/__init__.py new file mode 100644 index 00000000000..64bf1ac038f --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/a/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import A +_dynamic_imports: typing.Dict[str, str] = {"A": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["A"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/a/types/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/a/types/__init__.py new file mode 100644 index 00000000000..d8d24db3188 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/a/types/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .a import A +_dynamic_imports: typing.Dict[str, str] = {"A": ".a"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["A"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/a/types/a.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/a/types/a.py new file mode 100644 index 00000000000..9230b096b5c --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/a/types/a.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...types.root_type import RootType + + +class A(RootType): + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/__init__.py new file mode 100644 index 00000000000..b658bb6b991 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/__init__.py @@ -0,0 +1,223 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + Acai, + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, + Animal, + Berry, + BranchNode, + Cat, + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + Dog, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, + FieldName, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, + Fig, + Fruit, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, + LeafNode, + Node, + NodesWrapper, + ObjectFieldValue, + ObjectValue, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, + PrimitiveValue, + ) +_dynamic_imports: typing.Dict[str, str] = { + "Acai": ".types", + "AndOperator": ".types", + "AndOperatorChild": ".types", + "AndOperatorChild_AndOperator": ".types", + "AndOperatorChild_BooleanLiteral": ".types", + "AndOperatorChild_EqOperator": ".types", + "AndOperatorChild_GtOperator": ".types", + "AndOperatorChild_OrOperator": ".types", + "Animal": ".types", + "Berry": ".types", + "BranchNode": ".types", + "Cat": ".types", + "ContainerValue": ".types", + "ContainerValue_List": ".types", + "ContainerValue_Optional": ".types", + "Dog": ".types", + "EqualsOperator": ".types", + "EqualsOperatorLeft": ".types", + "EqualsOperatorLeft_AndOperator": ".types", + "EqualsOperatorLeft_EqOperator": ".types", + "EqualsOperatorLeft_GtOperator": ".types", + "EqualsOperatorLeft_OrOperator": ".types", + "EqualsOperatorLeft_StringLiteral": ".types", + "EqualsOperatorRight": ".types", + "EqualsOperatorRight_AndOperator": ".types", + "EqualsOperatorRight_EqOperator": ".types", + "EqualsOperatorRight_GtOperator": ".types", + "EqualsOperatorRight_OrOperator": ".types", + "EqualsOperatorRight_StringLiteral": ".types", + "FieldName": ".types", + "FieldValue": ".types", + "FieldValue_ContainerValue": ".types", + "FieldValue_ObjectValue": ".types", + "FieldValue_PrimitiveValue": ".types", + "Fig": ".types", + "Fruit": ".types", + "GreaterThanOperator": ".types", + "GreaterThanOperatorLeft": ".types", + "GreaterThanOperatorLeft_AndOperator": ".types", + "GreaterThanOperatorLeft_EqOperator": ".types", + "GreaterThanOperatorLeft_GtOperator": ".types", + "GreaterThanOperatorLeft_NumberLiteral": ".types", + "GreaterThanOperatorLeft_OrOperator": ".types", + "GreaterThanOperatorRight": ".types", + "GreaterThanOperatorRight_AndOperator": ".types", + "GreaterThanOperatorRight_EqOperator": ".types", + "GreaterThanOperatorRight_GtOperator": ".types", + "GreaterThanOperatorRight_NumberLiteral": ".types", + "GreaterThanOperatorRight_OrOperator": ".types", + "LeafNode": ".types", + "Node": ".types", + "NodesWrapper": ".types", + "ObjectFieldValue": ".types", + "ObjectValue": ".types", + "OrOperator": ".types", + "OrOperatorChild": ".types", + "OrOperatorChild_AndOperator": ".types", + "OrOperatorChild_BooleanLiteral": ".types", + "OrOperatorChild_EqOperator": ".types", + "OrOperatorChild_GtOperator": ".types", + "OrOperatorChild_OrOperator": ".types", + "PrimitiveValue": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", + "Animal", + "Berry", + "BranchNode", + "Cat", + "ContainerValue", + "ContainerValue_List", + "ContainerValue_Optional", + "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", + "FieldName", + "FieldValue", + "FieldValue_ContainerValue", + "FieldValue_ObjectValue", + "FieldValue_PrimitiveValue", + "Fig", + "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", + "LeafNode", + "Node", + "NodesWrapper", + "ObjectFieldValue", + "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", + "PrimitiveValue", +] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/__init__.py new file mode 100644 index 00000000000..cd2955fc318 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/__init__.py @@ -0,0 +1,218 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .acai_all import Acai, Animal, Berry, Cat, Dog, Fig, Fruit + from .and_operator_all import ( + AndOperator, + AndOperatorChild, + AndOperatorChild_AndOperator, + AndOperatorChild_BooleanLiteral, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_OrOperator, + EqualsOperator, + EqualsOperatorLeft, + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_StringLiteral, + EqualsOperatorRight, + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_StringLiteral, + GreaterThanOperator, + GreaterThanOperatorLeft, + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorRight, + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, + GreaterThanOperatorRight_OrOperator, + OrOperator, + OrOperatorChild, + OrOperatorChild_AndOperator, + OrOperatorChild_BooleanLiteral, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_OrOperator, + ) + from .branch_node_all import BranchNode, Node + from .container_value_all import ( + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, + ) + from .field_name import FieldName + from .leaf_node import LeafNode + from .nodes_wrapper import NodesWrapper + from .object_field_value import ObjectFieldValue + from .object_value import ObjectValue + from .primitive_value import PrimitiveValue +_dynamic_imports: typing.Dict[str, str] = { + "Acai": ".acai_all", + "AndOperator": ".and_operator_all", + "AndOperatorChild": ".and_operator_all", + "AndOperatorChild_AndOperator": ".and_operator_all", + "AndOperatorChild_BooleanLiteral": ".and_operator_all", + "AndOperatorChild_EqOperator": ".and_operator_all", + "AndOperatorChild_GtOperator": ".and_operator_all", + "AndOperatorChild_OrOperator": ".and_operator_all", + "Animal": ".acai_all", + "Berry": ".acai_all", + "BranchNode": ".branch_node_all", + "Cat": ".acai_all", + "ContainerValue": ".container_value_all", + "ContainerValue_List": ".container_value_all", + "ContainerValue_Optional": ".container_value_all", + "Dog": ".acai_all", + "EqualsOperator": ".and_operator_all", + "EqualsOperatorLeft": ".and_operator_all", + "EqualsOperatorLeft_AndOperator": ".and_operator_all", + "EqualsOperatorLeft_EqOperator": ".and_operator_all", + "EqualsOperatorLeft_GtOperator": ".and_operator_all", + "EqualsOperatorLeft_OrOperator": ".and_operator_all", + "EqualsOperatorLeft_StringLiteral": ".and_operator_all", + "EqualsOperatorRight": ".and_operator_all", + "EqualsOperatorRight_AndOperator": ".and_operator_all", + "EqualsOperatorRight_EqOperator": ".and_operator_all", + "EqualsOperatorRight_GtOperator": ".and_operator_all", + "EqualsOperatorRight_OrOperator": ".and_operator_all", + "EqualsOperatorRight_StringLiteral": ".and_operator_all", + "FieldName": ".field_name", + "FieldValue": ".container_value_all", + "FieldValue_ContainerValue": ".container_value_all", + "FieldValue_ObjectValue": ".container_value_all", + "FieldValue_PrimitiveValue": ".container_value_all", + "Fig": ".acai_all", + "Fruit": ".acai_all", + "GreaterThanOperator": ".and_operator_all", + "GreaterThanOperatorLeft": ".and_operator_all", + "GreaterThanOperatorLeft_AndOperator": ".and_operator_all", + "GreaterThanOperatorLeft_EqOperator": ".and_operator_all", + "GreaterThanOperatorLeft_GtOperator": ".and_operator_all", + "GreaterThanOperatorLeft_NumberLiteral": ".and_operator_all", + "GreaterThanOperatorLeft_OrOperator": ".and_operator_all", + "GreaterThanOperatorRight": ".and_operator_all", + "GreaterThanOperatorRight_AndOperator": ".and_operator_all", + "GreaterThanOperatorRight_EqOperator": ".and_operator_all", + "GreaterThanOperatorRight_GtOperator": ".and_operator_all", + "GreaterThanOperatorRight_NumberLiteral": ".and_operator_all", + "GreaterThanOperatorRight_OrOperator": ".and_operator_all", + "LeafNode": ".leaf_node", + "Node": ".branch_node_all", + "NodesWrapper": ".nodes_wrapper", + "ObjectFieldValue": ".object_field_value", + "ObjectValue": ".object_value", + "OrOperator": ".and_operator_all", + "OrOperatorChild": ".and_operator_all", + "OrOperatorChild_AndOperator": ".and_operator_all", + "OrOperatorChild_BooleanLiteral": ".and_operator_all", + "OrOperatorChild_EqOperator": ".and_operator_all", + "OrOperatorChild_GtOperator": ".and_operator_all", + "OrOperatorChild_OrOperator": ".and_operator_all", + "PrimitiveValue": ".primitive_value", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "Acai", + "AndOperator", + "AndOperatorChild", + "AndOperatorChild_AndOperator", + "AndOperatorChild_BooleanLiteral", + "AndOperatorChild_EqOperator", + "AndOperatorChild_GtOperator", + "AndOperatorChild_OrOperator", + "Animal", + "Berry", + "BranchNode", + "Cat", + "ContainerValue", + "ContainerValue_List", + "ContainerValue_Optional", + "Dog", + "EqualsOperator", + "EqualsOperatorLeft", + "EqualsOperatorLeft_AndOperator", + "EqualsOperatorLeft_EqOperator", + "EqualsOperatorLeft_GtOperator", + "EqualsOperatorLeft_OrOperator", + "EqualsOperatorLeft_StringLiteral", + "EqualsOperatorRight", + "EqualsOperatorRight_AndOperator", + "EqualsOperatorRight_EqOperator", + "EqualsOperatorRight_GtOperator", + "EqualsOperatorRight_OrOperator", + "EqualsOperatorRight_StringLiteral", + "FieldName", + "FieldValue", + "FieldValue_ContainerValue", + "FieldValue_ObjectValue", + "FieldValue_PrimitiveValue", + "Fig", + "Fruit", + "GreaterThanOperator", + "GreaterThanOperatorLeft", + "GreaterThanOperatorLeft_AndOperator", + "GreaterThanOperatorLeft_EqOperator", + "GreaterThanOperatorLeft_GtOperator", + "GreaterThanOperatorLeft_NumberLiteral", + "GreaterThanOperatorLeft_OrOperator", + "GreaterThanOperatorRight", + "GreaterThanOperatorRight_AndOperator", + "GreaterThanOperatorRight_EqOperator", + "GreaterThanOperatorRight_GtOperator", + "GreaterThanOperatorRight_NumberLiteral", + "GreaterThanOperatorRight_OrOperator", + "LeafNode", + "Node", + "NodesWrapper", + "ObjectFieldValue", + "ObjectValue", + "OrOperator", + "OrOperatorChild", + "OrOperatorChild_AndOperator", + "OrOperatorChild_BooleanLiteral", + "OrOperatorChild_EqOperator", + "OrOperatorChild_GtOperator", + "OrOperatorChild_OrOperator", + "PrimitiveValue", +] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/acai.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/acai.py new file mode 100644 index 00000000000..06dc06d5aa6 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/acai.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Acai as Acai + +__all__ = ["Acai"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/acai_all.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/acai_all.py new file mode 100644 index 00000000000..0c969f29475 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/acai_all.py @@ -0,0 +1,58 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel + +if typing.TYPE_CHECKING: + from .acai import Acai as ast_types_acai_Acai + from .cat import Cat as ast_types_cat_Cat + from .dog import Dog as ast_types_dog_Dog + from .fig import Fig as ast_types_fig_Fig + + +class Acai(ast_types_berry_Berry): + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +Animal = typing.Union["ast_types_cat_Cat", "ast_types_dog_Dog"] + + +class Berry(UniversalBaseModel): + animal: "ast_types_animal_Animal" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class Cat(UniversalBaseModel): + fruit: "ast_types_fruit_Fruit" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class Dog(UniversalBaseModel): + fruit: "ast_types_fruit_Fruit" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +from .fig import Fig as ast_types_fig_Fig # noqa: E402, F401, I001 +from .fruit import Fruit as ast_types_fruit_Fruit # noqa: E402, F401, I001 + + +class Fig(UniversalBaseModel): + animal: "ast_types_animal_Animal" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +from .berry import Berry as ast_types_berry_Berry # noqa: E402, F401, I001 +from .acai import Acai as ast_types_acai_Acai # noqa: E402, F401, I001 +from .cat import Cat as ast_types_cat_Cat # noqa: E402, F401, I001 +from .dog import Dog as ast_types_dog_Dog # noqa: E402, F401, I001 +from .animal import Animal as ast_types_animal_Animal # noqa: E402, F401, I001 + +Fruit = typing.Union["ast_types_acai_Acai", "ast_types_fig_Fig"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/and_operator.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/and_operator.py new file mode 100644 index 00000000000..f3c921a6c39 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/and_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperator as AndOperator + +__all__ = ["AndOperator"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/and_operator_all.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/and_operator_all.py new file mode 100644 index 00000000000..83a8a64a9b6 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/and_operator_all.py @@ -0,0 +1,330 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel + + +class AndOperator(UniversalBaseModel): + """ + Deep circular reference pattern mimicking elevenlabs AST operators + """ + + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class AndOperatorChild_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class AndOperatorChild_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class AndOperatorChild_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class AndOperatorChild_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class AndOperatorChild_BooleanLiteral(UniversalBaseModel): + value: bool + type: typing.Literal["boolean_literal"] = "boolean_literal" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + + +AndOperatorChild = typing.Union[ + AndOperatorChild_AndOperator, + AndOperatorChild_OrOperator, + AndOperatorChild_EqOperator, + AndOperatorChild_GtOperator, + AndOperatorChild_BooleanLiteral, +] + + +class EqualsOperator(UniversalBaseModel): + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class EqualsOperatorLeft_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class EqualsOperatorLeft_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class EqualsOperatorLeft_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class EqualsOperatorLeft_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class EqualsOperatorLeft_StringLiteral(UniversalBaseModel): + value: str + type: typing.Literal["string_literal"] = "string_literal" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + + +EqualsOperatorLeft = typing.Union[ + EqualsOperatorLeft_AndOperator, + EqualsOperatorLeft_OrOperator, + EqualsOperatorLeft_EqOperator, + EqualsOperatorLeft_GtOperator, + EqualsOperatorLeft_StringLiteral, +] + + +class EqualsOperatorRight_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class EqualsOperatorRight_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class EqualsOperatorRight_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class EqualsOperatorRight_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class EqualsOperatorRight_StringLiteral(UniversalBaseModel): + value: str + type: typing.Literal["string_literal"] = "string_literal" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + + +EqualsOperatorRight = typing.Union[ + EqualsOperatorRight_AndOperator, + EqualsOperatorRight_OrOperator, + EqualsOperatorRight_EqOperator, + EqualsOperatorRight_GtOperator, + EqualsOperatorRight_StringLiteral, +] + + +class GreaterThanOperator(UniversalBaseModel): + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class GreaterThanOperatorLeft_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class GreaterThanOperatorLeft_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class GreaterThanOperatorLeft_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class GreaterThanOperatorLeft_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class GreaterThanOperatorLeft_NumberLiteral(UniversalBaseModel): + value: float + type: typing.Literal["number_literal"] = "number_literal" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + + +GreaterThanOperatorLeft = typing.Union[ + GreaterThanOperatorLeft_AndOperator, + GreaterThanOperatorLeft_OrOperator, + GreaterThanOperatorLeft_EqOperator, + GreaterThanOperatorLeft_GtOperator, + GreaterThanOperatorLeft_NumberLiteral, +] + + +class GreaterThanOperatorRight_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class GreaterThanOperatorRight_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class GreaterThanOperatorRight_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class GreaterThanOperatorRight_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class GreaterThanOperatorRight_NumberLiteral(UniversalBaseModel): + value: float + type: typing.Literal["number_literal"] = "number_literal" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + + +GreaterThanOperatorRight = typing.Union[ + GreaterThanOperatorRight_AndOperator, + GreaterThanOperatorRight_OrOperator, + GreaterThanOperatorRight_EqOperator, + GreaterThanOperatorRight_GtOperator, + GreaterThanOperatorRight_NumberLiteral, +] + + +class OrOperator(UniversalBaseModel): + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class OrOperatorChild_AndOperator(UniversalBaseModel): + type: typing.Literal["and_operator"] = "and_operator" + children: typing.List["ast_types_and_operator_child_AndOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class OrOperatorChild_OrOperator(UniversalBaseModel): + type: typing.Literal["or_operator"] = "or_operator" + children: typing.List["ast_types_or_operator_child_OrOperatorChild"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class OrOperatorChild_EqOperator(UniversalBaseModel): + type: typing.Literal["eq_operator"] = "eq_operator" + left: "ast_types_equals_operator_left_EqualsOperatorLeft" + right: "ast_types_equals_operator_right_EqualsOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class OrOperatorChild_GtOperator(UniversalBaseModel): + type: typing.Literal["gt_operator"] = "gt_operator" + left: "ast_types_greater_than_operator_left_GreaterThanOperatorLeft" + right: "ast_types_greater_than_operator_right_GreaterThanOperatorRight" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +from .equals_operator import EqualsOperator as ast_types_equals_operator_EqualsOperator # noqa: E402, F401, I001 +from .greater_than_operator import GreaterThanOperator as ast_types_greater_than_operator_GreaterThanOperator # noqa: E402, F401, I001 +from .or_operator import OrOperator as ast_types_or_operator_OrOperator # noqa: E402, F401, I001 +from .and_operator import AndOperator as ast_types_and_operator_AndOperator # noqa: E402, F401, I001 + + +class OrOperatorChild_BooleanLiteral(UniversalBaseModel): + value: bool + type: typing.Literal["boolean_literal"] = "boolean_literal" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + + +OrOperatorChild = typing.Union[ + OrOperatorChild_AndOperator, + OrOperatorChild_OrOperator, + OrOperatorChild_EqOperator, + OrOperatorChild_GtOperator, + OrOperatorChild_BooleanLiteral, +] +from .and_operator_child import AndOperatorChild as ast_types_and_operator_child_AndOperatorChild # noqa: E402, F401, I001 +from .or_operator_child import OrOperatorChild as ast_types_or_operator_child_OrOperatorChild # noqa: E402, F401, I001 +from .equals_operator_left import EqualsOperatorLeft as ast_types_equals_operator_left_EqualsOperatorLeft # noqa: E402, F401, I001 +from .equals_operator_right import EqualsOperatorRight as ast_types_equals_operator_right_EqualsOperatorRight # noqa: E402, F401, I001 +from .greater_than_operator_left import ( + GreaterThanOperatorLeft as ast_types_greater_than_operator_left_GreaterThanOperatorLeft, +) # noqa: E402, F401, I001 +from .greater_than_operator_right import ( + GreaterThanOperatorRight as ast_types_greater_than_operator_right_GreaterThanOperatorRight, +) # noqa: E402, F401, I001 diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/and_operator_child.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/and_operator_child.py new file mode 100644 index 00000000000..0c043b87dbb --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/and_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import AndOperatorChild as AndOperatorChild + +__all__ = ["AndOperatorChild"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/animal.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/animal.py new file mode 100644 index 00000000000..bc07c7d3b20 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/animal.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Animal as Animal + +__all__ = ["Animal"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/berry.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/berry.py new file mode 100644 index 00000000000..1131a180b1a --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/berry.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Berry as Berry + +__all__ = ["Berry"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/branch_node.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/branch_node.py new file mode 100644 index 00000000000..e53f75d7362 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/branch_node.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .branch_node_all import BranchNode as BranchNode + +__all__ = ["BranchNode"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/branch_node_all.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/branch_node_all.py new file mode 100644 index 00000000000..6913428a0b5 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/branch_node_all.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel +from .leaf_node import LeafNode + +if typing.TYPE_CHECKING: + from .branch_node import BranchNode as ast_types_branch_node_BranchNode + + +class BranchNode(UniversalBaseModel): + children: typing.List["ast_types_node_Node"] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +from .branch_node import BranchNode as ast_types_branch_node_BranchNode # noqa: E402, F401, I001 +from .node import Node as ast_types_node_Node # noqa: E402, F401, I001 + +Node = typing.Union["ast_types_branch_node_BranchNode", LeafNode] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/cat.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/cat.py new file mode 100644 index 00000000000..3d1211c6497 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/cat.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Cat as Cat + +__all__ = ["Cat"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/container_value.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/container_value.py new file mode 100644 index 00000000000..d3b9fbcdba7 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/container_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .container_value_all import ContainerValue as ContainerValue + +__all__ = ["ContainerValue"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/container_value_all.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/container_value_all.py new file mode 100644 index 00000000000..f76f09d1088 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/container_value_all.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel, update_forward_refs +from .primitive_value import PrimitiveValue + + +class ContainerValue_List(UniversalBaseModel): + value: typing.List["ast_types_field_value_FieldValue"] + type: typing.Literal["list"] = "list" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + + +class ContainerValue_Optional(UniversalBaseModel): + value: typing.Optional["ast_types_field_value_FieldValue"] = None + type: typing.Literal["optional"] = "optional" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + + +ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] +from .field_value import FieldValue as ast_types_field_value_FieldValue # noqa: E402, F401, I001 + + +class FieldValue_PrimitiveValue(UniversalBaseModel): + value: PrimitiveValue + type: typing.Literal["primitive_value"] = "primitive_value" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + + +class FieldValue_ObjectValue(UniversalBaseModel): + type: typing.Literal["object_value"] = "object_value" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class FieldValue_ContainerValue(UniversalBaseModel): + value: "ast_types_container_value_ContainerValue" + type: typing.Literal["container_value"] = "container_value" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + + +FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] +from .container_value import ContainerValue as ast_types_container_value_ContainerValue # noqa: E402, F401, I001 + +update_forward_refs(ContainerValue_List) +update_forward_refs(ContainerValue_Optional) +update_forward_refs(FieldValue_ContainerValue) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/dog.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/dog.py new file mode 100644 index 00000000000..bc696fce765 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/dog.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Dog as Dog + +__all__ = ["Dog"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/equals_operator.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/equals_operator.py new file mode 100644 index 00000000000..3a95724f67a --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/equals_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperator as EqualsOperator + +__all__ = ["EqualsOperator"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/equals_operator_left.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/equals_operator_left.py new file mode 100644 index 00000000000..53901b8504e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/equals_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorLeft as EqualsOperatorLeft + +__all__ = ["EqualsOperatorLeft"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/equals_operator_right.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/equals_operator_right.py new file mode 100644 index 00000000000..4348ffe8d3f --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/equals_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import EqualsOperatorRight as EqualsOperatorRight + +__all__ = ["EqualsOperatorRight"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/field_name.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/field_name.py new file mode 100644 index 00000000000..1f861620af8 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/field_name.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +FieldName = str diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/field_value.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/field_value.py new file mode 100644 index 00000000000..88d4a5e9c2d --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/field_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .container_value_all import FieldValue as FieldValue + +__all__ = ["FieldValue"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/fig.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/fig.py new file mode 100644 index 00000000000..cf5006340ba --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/fig.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Fig as Fig + +__all__ = ["Fig"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/fruit.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/fruit.py new file mode 100644 index 00000000000..6f9ff11e1b4 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/fruit.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .acai_all import Fruit as Fruit + +__all__ = ["Fruit"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/greater_than_operator.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/greater_than_operator.py new file mode 100644 index 00000000000..56a53f19013 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/greater_than_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperator as GreaterThanOperator + +__all__ = ["GreaterThanOperator"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/greater_than_operator_left.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/greater_than_operator_left.py new file mode 100644 index 00000000000..0958d95ca84 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/greater_than_operator_left.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorLeft as GreaterThanOperatorLeft + +__all__ = ["GreaterThanOperatorLeft"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/greater_than_operator_right.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/greater_than_operator_right.py new file mode 100644 index 00000000000..20234cb9d0e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/greater_than_operator_right.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import GreaterThanOperatorRight as GreaterThanOperatorRight + +__all__ = ["GreaterThanOperatorRight"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/leaf_node.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/leaf_node.py new file mode 100644 index 00000000000..c3d3886ed86 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/leaf_node.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel + + +class LeafNode(UniversalBaseModel): + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/node.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/node.py new file mode 100644 index 00000000000..f8d6f92d33c --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/node.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .branch_node_all import Node as Node + +__all__ = ["Node"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/nodes_wrapper.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/nodes_wrapper.py new file mode 100644 index 00000000000..2f4f2f0963a --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/nodes_wrapper.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel, update_forward_refs + + +class NodesWrapper(UniversalBaseModel): + nodes: typing.List[typing.List["Node"]] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +from .branch_node import BranchNode # noqa: E402, F401, I001 +from .node import Node # noqa: E402, F401, I001 + +update_forward_refs(NodesWrapper) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/object_field_value.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/object_field_value.py new file mode 100644 index 00000000000..95b62b56b11 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/object_field_value.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel, update_forward_refs +from .field_name import FieldName + + +class ObjectFieldValue(UniversalBaseModel): + """ + This type allows us to test a circular reference with a union type (see FieldValue). + """ + + name: FieldName + value: "FieldValue" + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +from .field_value import FieldValue # noqa: E402, F401, I001 + +update_forward_refs(ObjectFieldValue) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/object_value.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/object_value.py new file mode 100644 index 00000000000..ec7941fc433 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/object_value.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import UniversalBaseModel + + +class ObjectValue(UniversalBaseModel): + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/or_operator.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/or_operator.py new file mode 100644 index 00000000000..04bc907e4c8 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/or_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperator as OrOperator + +__all__ = ["OrOperator"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/or_operator_child.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/or_operator_child.py new file mode 100644 index 00000000000..49d1ffed627 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/or_operator_child.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .and_operator_all import OrOperatorChild as OrOperatorChild + +__all__ = ["OrOperatorChild"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/primitive_value.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/primitive_value.py new file mode 100644 index 00000000000..b3bfe3732ea --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/ast/types/primitive_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PrimitiveValue = typing.Union[typing.Literal["STRING", "NUMBER"], typing.Any] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/client.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/client.py new file mode 100644 index 00000000000..90b75b16594 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/client.py @@ -0,0 +1,114 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import httpx +from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper + + +class SeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : str + The base url to use for requests from the client. + + headers : typing.Optional[typing.Dict[str, str]] + Additional headers to send with every request. + + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.Client] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from seed import SeedApi + + client = SeedApi( + base_url="https://yourhost.com/path/to/api", + ) + """ + + def __init__( + self, + *, + base_url: str, + headers: typing.Optional[typing.Dict[str, str]] = None, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.Client] = None, + ): + _defaulted_timeout = ( + timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read + ) + self._client_wrapper = SyncClientWrapper( + base_url=base_url, + headers=headers, + httpx_client=httpx_client + if httpx_client is not None + else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) + if follow_redirects is not None + else httpx.Client(timeout=_defaulted_timeout), + timeout=_defaulted_timeout, + ) + + +class AsyncSeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : str + The base url to use for requests from the client. + + headers : typing.Optional[typing.Dict[str, str]] + Additional headers to send with every request. + + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.AsyncClient] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from seed import AsyncSeedApi + + client = AsyncSeedApi( + base_url="https://yourhost.com/path/to/api", + ) + """ + + def __init__( + self, + *, + base_url: str, + headers: typing.Optional[typing.Dict[str, str]] = None, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.AsyncClient] = None, + ): + _defaulted_timeout = ( + timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read + ) + self._client_wrapper = AsyncClientWrapper( + base_url=base_url, + headers=headers, + httpx_client=httpx_client + if httpx_client is not None + else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) + if follow_redirects is not None + else httpx.AsyncClient(timeout=_defaulted_timeout), + timeout=_defaulted_timeout, + ) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/__init__.py new file mode 100644 index 00000000000..9a33e233875 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/__init__.py @@ -0,0 +1,105 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .api_error import ApiError + from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper + from .datetime_utils import serialize_datetime + from .file import File, convert_file_dict_to_httpx_tuples, with_content_type + from .http_client import AsyncHttpClient, HttpClient + from .http_response import AsyncHttpResponse, HttpResponse + from .jsonable_encoder import jsonable_encoder + from .pydantic_utilities import ( + IS_PYDANTIC_V2, + UniversalBaseModel, + UniversalRootModel, + parse_obj_as, + universal_field_validator, + universal_root_validator, + update_forward_refs, + ) + from .query_encoder import encode_query + from .remove_none_from_dict import remove_none_from_dict + from .request_options import RequestOptions + from .serialization import FieldMetadata, convert_and_respect_annotation_metadata +_dynamic_imports: typing.Dict[str, str] = { + "ApiError": ".api_error", + "AsyncClientWrapper": ".client_wrapper", + "AsyncHttpClient": ".http_client", + "AsyncHttpResponse": ".http_response", + "BaseClientWrapper": ".client_wrapper", + "FieldMetadata": ".serialization", + "File": ".file", + "HttpClient": ".http_client", + "HttpResponse": ".http_response", + "IS_PYDANTIC_V2": ".pydantic_utilities", + "RequestOptions": ".request_options", + "SyncClientWrapper": ".client_wrapper", + "UniversalBaseModel": ".pydantic_utilities", + "UniversalRootModel": ".pydantic_utilities", + "convert_and_respect_annotation_metadata": ".serialization", + "convert_file_dict_to_httpx_tuples": ".file", + "encode_query": ".query_encoder", + "jsonable_encoder": ".jsonable_encoder", + "parse_obj_as": ".pydantic_utilities", + "remove_none_from_dict": ".remove_none_from_dict", + "serialize_datetime": ".datetime_utils", + "universal_field_validator": ".pydantic_utilities", + "universal_root_validator": ".pydantic_utilities", + "update_forward_refs": ".pydantic_utilities", + "with_content_type": ".file", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "ApiError", + "AsyncClientWrapper", + "AsyncHttpClient", + "AsyncHttpResponse", + "BaseClientWrapper", + "FieldMetadata", + "File", + "HttpClient", + "HttpResponse", + "IS_PYDANTIC_V2", + "RequestOptions", + "SyncClientWrapper", + "UniversalBaseModel", + "UniversalRootModel", + "convert_and_respect_annotation_metadata", + "convert_file_dict_to_httpx_tuples", + "encode_query", + "jsonable_encoder", + "parse_obj_as", + "remove_none_from_dict", + "serialize_datetime", + "universal_field_validator", + "universal_root_validator", + "update_forward_refs", + "with_content_type", +] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/api_error.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/api_error.py new file mode 100644 index 00000000000..6f850a60cba --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/api_error.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, Optional + + +class ApiError(Exception): + headers: Optional[Dict[str, str]] + status_code: Optional[int] + body: Any + + def __init__( + self, + *, + headers: Optional[Dict[str, str]] = None, + status_code: Optional[int] = None, + body: Any = None, + ) -> None: + self.headers = headers + self.status_code = status_code + self.body = body + + def __str__(self) -> str: + return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}" diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/client_wrapper.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/client_wrapper.py new file mode 100644 index 00000000000..d33fe83b334 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/client_wrapper.py @@ -0,0 +1,74 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import httpx +from .http_client import AsyncHttpClient, HttpClient + + +class BaseClientWrapper: + def __init__( + self, + *, + headers: typing.Optional[typing.Dict[str, str]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + ): + self._headers = headers + self._base_url = base_url + self._timeout = timeout + + def get_headers(self) -> typing.Dict[str, str]: + headers: typing.Dict[str, str] = { + "User-Agent": "fern_circular-references-advanced/0.0.1", + "X-Fern-Language": "Python", + "X-Fern-SDK-Name": "fern_circular-references-advanced", + "X-Fern-SDK-Version": "0.0.1", + **(self.get_custom_headers() or {}), + } + return headers + + def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]: + return self._headers + + def get_base_url(self) -> str: + return self._base_url + + def get_timeout(self) -> typing.Optional[float]: + return self._timeout + + +class SyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + headers: typing.Optional[typing.Dict[str, str]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.Client, + ): + super().__init__(headers=headers, base_url=base_url, timeout=timeout) + self.httpx_client = HttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers, + base_timeout=self.get_timeout, + base_url=self.get_base_url, + ) + + +class AsyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + headers: typing.Optional[typing.Dict[str, str]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.AsyncClient, + ): + super().__init__(headers=headers, base_url=base_url, timeout=timeout) + self.httpx_client = AsyncHttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers, + base_timeout=self.get_timeout, + base_url=self.get_base_url, + ) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/datetime_utils.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/datetime_utils.py new file mode 100644 index 00000000000..7c9864a944c --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/datetime_utils.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt + + +def serialize_datetime(v: dt.datetime) -> str: + """ + Serialize a datetime including timezone info. + + Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. + + UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. + """ + + def _serialize_zoned_datetime(v: dt.datetime) -> str: + if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None): + # UTC is a special case where we use "Z" at the end instead of "+00:00" + return v.isoformat().replace("+00:00", "Z") + else: + # Delegate to the typical +/- offset format + return v.isoformat() + + if v.tzinfo is not None: + return _serialize_zoned_datetime(v) + else: + local_tz = dt.datetime.now().astimezone().tzinfo + localized_dt = v.replace(tzinfo=local_tz) + return _serialize_zoned_datetime(localized_dt) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/file.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/file.py new file mode 100644 index 00000000000..44b0d27c089 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/file.py @@ -0,0 +1,67 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast + +# File typing inspired by the flexibility of types within the httpx library +# https://github.com/encode/httpx/blob/master/httpx/_types.py +FileContent = Union[IO[bytes], bytes, str] +File = Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + Tuple[Optional[str], FileContent], + # (filename, file (or bytes), content_type) + Tuple[Optional[str], FileContent, Optional[str]], + # (filename, file (or bytes), content_type, headers) + Tuple[ + Optional[str], + FileContent, + Optional[str], + Mapping[str, str], + ], +] + + +def convert_file_dict_to_httpx_tuples( + d: Dict[str, Union[File, List[File]]], +) -> List[Tuple[str, File]]: + """ + The format we use is a list of tuples, where the first element is the + name of the file and the second is the file object. Typically HTTPX wants + a dict, but to be able to send lists of files, you have to use the list + approach (which also works for non-lists) + https://github.com/encode/httpx/pull/1032 + """ + + httpx_tuples = [] + for key, file_like in d.items(): + if isinstance(file_like, list): + for file_like_item in file_like: + httpx_tuples.append((key, file_like_item)) + else: + httpx_tuples.append((key, file_like)) + return httpx_tuples + + +def with_content_type(*, file: File, default_content_type: str) -> File: + """ + This function resolves to the file's content type, if provided, and defaults + to the default_content_type value if not. + """ + if isinstance(file, tuple): + if len(file) == 2: + filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore + return (filename, content, default_content_type) + elif len(file) == 3: + filename, content, file_content_type = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore + out_content_type = file_content_type or default_content_type + return (filename, content, out_content_type) + elif len(file) == 4: + filename, content, file_content_type, headers = cast( # type: ignore + Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file + ) + out_content_type = file_content_type or default_content_type + return (filename, content, out_content_type, headers) + else: + raise ValueError(f"Unexpected tuple length: {len(file)}") + return (None, file, default_content_type) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/force_multipart.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/force_multipart.py new file mode 100644 index 00000000000..5440913fd4b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/force_multipart.py @@ -0,0 +1,18 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict + + +class ForceMultipartDict(Dict[str, Any]): + """ + A dictionary subclass that always evaluates to True in boolean contexts. + + This is used to force multipart/form-data encoding in HTTP requests even when + the dictionary is empty, which would normally evaluate to False. + """ + + def __bool__(self) -> bool: + return True + + +FORCE_MULTIPART = ForceMultipartDict() diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_client.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_client.py new file mode 100644 index 00000000000..e4173f990f1 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_client.py @@ -0,0 +1,543 @@ +# This file was auto-generated by Fern from our API Definition. + +import asyncio +import email.utils +import re +import time +import typing +import urllib.parse +from contextlib import asynccontextmanager, contextmanager +from random import random + +import httpx +from .file import File, convert_file_dict_to_httpx_tuples +from .force_multipart import FORCE_MULTIPART +from .jsonable_encoder import jsonable_encoder +from .query_encoder import encode_query +from .remove_none_from_dict import remove_none_from_dict +from .request_options import RequestOptions +from httpx._types import RequestFiles + +INITIAL_RETRY_DELAY_SECONDS = 0.5 +MAX_RETRY_DELAY_SECONDS = 10 +MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30 + + +def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: + """ + This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. + + Inspired by the urllib3 retry implementation. + """ + retry_after_ms = response_headers.get("retry-after-ms") + if retry_after_ms is not None: + try: + return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 + except Exception: + pass + + retry_after = response_headers.get("retry-after") + if retry_after is None: + return None + + # Attempt to parse the header as an int. + if re.match(r"^\s*[0-9]+\s*$", retry_after): + seconds = float(retry_after) + # Fallback to parsing it as a date. + else: + retry_date_tuple = email.utils.parsedate_tz(retry_after) + if retry_date_tuple is None: + return None + if retry_date_tuple[9] is None: # Python 2 + # Assume UTC if no timezone was specified + # On Python2.7, parsedate_tz returns None for a timezone offset + # instead of 0 if no timezone is given, where mktime_tz treats + # a None timezone offset as local time. + retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] + + retry_date = email.utils.mktime_tz(retry_date_tuple) + seconds = retry_date - time.time() + + if seconds < 0: + seconds = 0 + + return seconds + + +def _retry_timeout(response: httpx.Response, retries: int) -> float: + """ + Determine the amount of time to wait before retrying a request. + This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff + with a jitter to determine the number of seconds to wait. + """ + + # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says. + retry_after = _parse_retry_after(response.headers) + if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER: + return retry_after + + # Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS. + retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS) + + # Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries. + timeout = retry_delay * (1 - 0.25 * random()) + return timeout if timeout >= 0 else 0 + + +def _should_retry(response: httpx.Response) -> bool: + retryable_400s = [429, 408, 409] + return response.status_code >= 500 or response.status_code in retryable_400s + + +def remove_omit_from_dict( + original: typing.Dict[str, typing.Optional[typing.Any]], + omit: typing.Optional[typing.Any], +) -> typing.Dict[str, typing.Any]: + if omit is None: + return original + new: typing.Dict[str, typing.Any] = {} + for key, value in original.items(): + if value is not omit: + new[key] = value + return new + + +def maybe_filter_request_body( + data: typing.Optional[typing.Any], + request_options: typing.Optional[RequestOptions], + omit: typing.Optional[typing.Any], +) -> typing.Optional[typing.Any]: + if data is None: + return ( + jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} + if request_options is not None + else None + ) + elif not isinstance(data, typing.Mapping): + data_content = jsonable_encoder(data) + else: + data_content = { + **(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore + **( + jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} + if request_options is not None + else {} + ), + } + return data_content + + +# Abstracted out for testing purposes +def get_request_body( + *, + json: typing.Optional[typing.Any], + data: typing.Optional[typing.Any], + request_options: typing.Optional[RequestOptions], + omit: typing.Optional[typing.Any], +) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]: + json_body = None + data_body = None + if data is not None: + data_body = maybe_filter_request_body(data, request_options, omit) + else: + # If both data and json are None, we send json data in the event extra properties are specified + json_body = maybe_filter_request_body(json, request_options, omit) + + # If you have an empty JSON body, you should just send None + return (json_body if json_body != {} else None), data_body if data_body != {} else None + + +class HttpClient: + def __init__( + self, + *, + httpx_client: httpx.Client, + base_timeout: typing.Callable[[], typing.Optional[float]], + base_headers: typing.Callable[[], typing.Dict[str, str]], + base_url: typing.Optional[typing.Callable[[], str]] = None, + ): + self.base_url = base_url + self.base_timeout = base_timeout + self.base_headers = base_headers + self.httpx_client = httpx_client + + def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: + base_url = maybe_base_url + if self.base_url is not None and base_url is None: + base_url = self.base_url() + + if base_url is None: + raise ValueError("A base_url is required to make this request, please provide one and try again.") + return base_url + + def request( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[ + typing.Union[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], + typing.List[typing.Tuple[str, File]], + ] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 2, + omit: typing.Optional[typing.Any] = None, + force_multipart: typing.Optional[bool] = None, + ) -> httpx.Response: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + request_files: typing.Optional[RequestFiles] = ( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if (files is not None and files is not omit and isinstance(files, dict)) + else None + ) + + if (request_files is None or len(request_files) == 0) and force_multipart: + request_files = FORCE_MULTIPART + + response = self.httpx_client.request( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) or {} + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=request_files, + timeout=timeout, + ) + + max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 + if _should_retry(response=response): + if max_retries > retries: + time.sleep(_retry_timeout(response=response, retries=retries)) + return self.request( + path=path, + method=method, + base_url=base_url, + params=params, + json=json, + content=content, + files=files, + headers=headers, + request_options=request_options, + retries=retries + 1, + omit=omit, + ) + + return response + + @contextmanager + def stream( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[ + typing.Union[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], + typing.List[typing.Tuple[str, File]], + ] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 2, + omit: typing.Optional[typing.Any] = None, + force_multipart: typing.Optional[bool] = None, + ) -> typing.Iterator[httpx.Response]: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + request_files: typing.Optional[RequestFiles] = ( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if (files is not None and files is not omit and isinstance(files, dict)) + else None + ) + + if (request_files is None or len(request_files) == 0) and force_multipart: + request_files = FORCE_MULTIPART + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + with self.httpx_client.stream( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=request_files, + timeout=timeout, + ) as stream: + yield stream + + +class AsyncHttpClient: + def __init__( + self, + *, + httpx_client: httpx.AsyncClient, + base_timeout: typing.Callable[[], typing.Optional[float]], + base_headers: typing.Callable[[], typing.Dict[str, str]], + base_url: typing.Optional[typing.Callable[[], str]] = None, + ): + self.base_url = base_url + self.base_timeout = base_timeout + self.base_headers = base_headers + self.httpx_client = httpx_client + + def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: + base_url = maybe_base_url + if self.base_url is not None and base_url is None: + base_url = self.base_url() + + if base_url is None: + raise ValueError("A base_url is required to make this request, please provide one and try again.") + return base_url + + async def request( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[ + typing.Union[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], + typing.List[typing.Tuple[str, File]], + ] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 2, + omit: typing.Optional[typing.Any] = None, + force_multipart: typing.Optional[bool] = None, + ) -> httpx.Response: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + request_files: typing.Optional[RequestFiles] = ( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if (files is not None and files is not omit and isinstance(files, dict)) + else None + ) + + if (request_files is None or len(request_files) == 0) and force_multipart: + request_files = FORCE_MULTIPART + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + # Add the input to each of these and do None-safety checks + response = await self.httpx_client.request( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) or {} + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=request_files, + timeout=timeout, + ) + + max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 + if _should_retry(response=response): + if max_retries > retries: + await asyncio.sleep(_retry_timeout(response=response, retries=retries)) + return await self.request( + path=path, + method=method, + base_url=base_url, + params=params, + json=json, + content=content, + files=files, + headers=headers, + request_options=request_options, + retries=retries + 1, + omit=omit, + ) + return response + + @asynccontextmanager + async def stream( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[ + typing.Union[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], + typing.List[typing.Tuple[str, File]], + ] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 2, + omit: typing.Optional[typing.Any] = None, + force_multipart: typing.Optional[bool] = None, + ) -> typing.AsyncIterator[httpx.Response]: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + request_files: typing.Optional[RequestFiles] = ( + convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) + if (files is not None and files is not omit and isinstance(files, dict)) + else None + ) + + if (request_files is None or len(request_files) == 0) and force_multipart: + request_files = FORCE_MULTIPART + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + async with self.httpx_client.stream( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + }, + omit=omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=request_files, + timeout=timeout, + ) as stream: + yield stream diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_response.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_response.py new file mode 100644 index 00000000000..2479747e8bb --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_response.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Dict, Generic, TypeVar + +import httpx + +# Generic to represent the underlying type of the data wrapped by the HTTP response. +T = TypeVar("T") + + +class BaseHttpResponse: + """Minimalist HTTP response wrapper that exposes response headers.""" + + _response: httpx.Response + + def __init__(self, response: httpx.Response): + self._response = response + + @property + def headers(self) -> Dict[str, str]: + return dict(self._response.headers) + + +class HttpResponse(Generic[T], BaseHttpResponse): + """HTTP response wrapper that exposes response headers and data.""" + + _data: T + + def __init__(self, response: httpx.Response, data: T): + super().__init__(response) + self._data = data + + @property + def data(self) -> T: + return self._data + + def close(self) -> None: + self._response.close() + + +class AsyncHttpResponse(Generic[T], BaseHttpResponse): + """HTTP response wrapper that exposes response headers and data.""" + + _data: T + + def __init__(self, response: httpx.Response, data: T): + super().__init__(response) + self._data = data + + @property + def data(self) -> T: + return self._data + + async def close(self) -> None: + await self._response.aclose() diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/__init__.py new file mode 100644 index 00000000000..730e5a3382e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/__init__.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from ._api import EventSource, aconnect_sse, connect_sse + from ._exceptions import SSEError + from ._models import ServerSentEvent +_dynamic_imports: typing.Dict[str, str] = { + "EventSource": "._api", + "SSEError": "._exceptions", + "ServerSentEvent": "._models", + "aconnect_sse": "._api", + "connect_sse": "._api", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["EventSource", "SSEError", "ServerSentEvent", "aconnect_sse", "connect_sse"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_api.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_api.py new file mode 100644 index 00000000000..f900b3b686d --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_api.py @@ -0,0 +1,112 @@ +# This file was auto-generated by Fern from our API Definition. + +import re +from contextlib import asynccontextmanager, contextmanager +from typing import Any, AsyncGenerator, AsyncIterator, Iterator, cast + +import httpx +from ._decoders import SSEDecoder +from ._exceptions import SSEError +from ._models import ServerSentEvent + + +class EventSource: + def __init__(self, response: httpx.Response) -> None: + self._response = response + + def _check_content_type(self) -> None: + content_type = self._response.headers.get("content-type", "").partition(";")[0] + if "text/event-stream" not in content_type: + raise SSEError( + f"Expected response header Content-Type to contain 'text/event-stream', got {content_type!r}" + ) + + def _get_charset(self) -> str: + """Extract charset from Content-Type header, fallback to UTF-8.""" + content_type = self._response.headers.get("content-type", "") + + # Parse charset parameter using regex + charset_match = re.search(r"charset=([^;\s]+)", content_type, re.IGNORECASE) + if charset_match: + charset = charset_match.group(1).strip("\"'") + # Validate that it's a known encoding + try: + # Test if the charset is valid by trying to encode/decode + "test".encode(charset).decode(charset) + return charset + except (LookupError, UnicodeError): + # If charset is invalid, fall back to UTF-8 + pass + + # Default to UTF-8 if no charset specified or invalid charset + return "utf-8" + + @property + def response(self) -> httpx.Response: + return self._response + + def iter_sse(self) -> Iterator[ServerSentEvent]: + self._check_content_type() + decoder = SSEDecoder() + charset = self._get_charset() + + buffer = "" + for chunk in self._response.iter_bytes(): + # Decode chunk using detected charset + text_chunk = chunk.decode(charset, errors="replace") + buffer += text_chunk + + # Process complete lines + while "\n" in buffer: + line, buffer = buffer.split("\n", 1) + line = line.rstrip("\r") + sse = decoder.decode(line) + # when we reach a "\n\n" => line = '' + # => decoder will attempt to return an SSE Event + if sse is not None: + yield sse + + # Process any remaining data in buffer + if buffer.strip(): + line = buffer.rstrip("\r") + sse = decoder.decode(line) + if sse is not None: + yield sse + + async def aiter_sse(self) -> AsyncGenerator[ServerSentEvent, None]: + self._check_content_type() + decoder = SSEDecoder() + lines = cast(AsyncGenerator[str, None], self._response.aiter_lines()) + try: + async for line in lines: + line = line.rstrip("\n") + sse = decoder.decode(line) + if sse is not None: + yield sse + finally: + await lines.aclose() + + +@contextmanager +def connect_sse(client: httpx.Client, method: str, url: str, **kwargs: Any) -> Iterator[EventSource]: + headers = kwargs.pop("headers", {}) + headers["Accept"] = "text/event-stream" + headers["Cache-Control"] = "no-store" + + with client.stream(method, url, headers=headers, **kwargs) as response: + yield EventSource(response) + + +@asynccontextmanager +async def aconnect_sse( + client: httpx.AsyncClient, + method: str, + url: str, + **kwargs: Any, +) -> AsyncIterator[EventSource]: + headers = kwargs.pop("headers", {}) + headers["Accept"] = "text/event-stream" + headers["Cache-Control"] = "no-store" + + async with client.stream(method, url, headers=headers, **kwargs) as response: + yield EventSource(response) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_decoders.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_decoders.py new file mode 100644 index 00000000000..339b0890138 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_decoders.py @@ -0,0 +1,61 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import List, Optional + +from ._models import ServerSentEvent + + +class SSEDecoder: + def __init__(self) -> None: + self._event = "" + self._data: List[str] = [] + self._last_event_id = "" + self._retry: Optional[int] = None + + def decode(self, line: str) -> Optional[ServerSentEvent]: + # See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501 + + if not line: + if not self._event and not self._data and not self._last_event_id and self._retry is None: + return None + + sse = ServerSentEvent( + event=self._event, + data="\n".join(self._data), + id=self._last_event_id, + retry=self._retry, + ) + + # NOTE: as per the SSE spec, do not reset last_event_id. + self._event = "" + self._data = [] + self._retry = None + + return sse + + if line.startswith(":"): + return None + + fieldname, _, value = line.partition(":") + + if value.startswith(" "): + value = value[1:] + + if fieldname == "event": + self._event = value + elif fieldname == "data": + self._data.append(value) + elif fieldname == "id": + if "\0" in value: + pass + else: + self._last_event_id = value + elif fieldname == "retry": + try: + self._retry = int(value) + except (TypeError, ValueError): + pass + else: + pass # Field is ignored. + + return None diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_exceptions.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_exceptions.py new file mode 100644 index 00000000000..81605a8a65e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_exceptions.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import httpx + + +class SSEError(httpx.TransportError): + pass diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_models.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_models.py new file mode 100644 index 00000000000..1af57f8fd0d --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/http_sse/_models.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import json +from dataclasses import dataclass +from typing import Any, Optional + + +@dataclass(frozen=True) +class ServerSentEvent: + event: str = "message" + data: str = "" + id: str = "" + retry: Optional[int] = None + + def json(self) -> Any: + """Parse the data field as JSON.""" + return json.loads(self.data) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/jsonable_encoder.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/jsonable_encoder.py new file mode 100644 index 00000000000..afee3662d83 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/jsonable_encoder.py @@ -0,0 +1,100 @@ +# This file was auto-generated by Fern from our API Definition. + +""" +jsonable_encoder converts a Python object to a JSON-friendly dict +(e.g. datetimes to strings, Pydantic models to dicts). + +Taken from FastAPI, and made a bit simpler +https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py +""" + +import base64 +import dataclasses +import datetime as dt +from enum import Enum +from pathlib import PurePath +from types import GeneratorType +from typing import Any, Callable, Dict, List, Optional, Set, Union + +import pydantic +from .datetime_utils import serialize_datetime +from .pydantic_utilities import ( + IS_PYDANTIC_V2, + encode_by_type, + to_jsonable_with_fallback, +) + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] + + +def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any: + custom_encoder = custom_encoder or {} + if custom_encoder: + if type(obj) in custom_encoder: + return custom_encoder[type(obj)](obj) + else: + for encoder_type, encoder_instance in custom_encoder.items(): + if isinstance(obj, encoder_type): + return encoder_instance(obj) + if isinstance(obj, pydantic.BaseModel): + if IS_PYDANTIC_V2: + encoder = getattr(obj.model_config, "json_encoders", {}) # type: ignore # Pydantic v2 + else: + encoder = getattr(obj.__config__, "json_encoders", {}) # type: ignore # Pydantic v1 + if custom_encoder: + encoder.update(custom_encoder) + obj_dict = obj.dict(by_alias=True) + if "__root__" in obj_dict: + obj_dict = obj_dict["__root__"] + if "root" in obj_dict: + obj_dict = obj_dict["root"] + return jsonable_encoder(obj_dict, custom_encoder=encoder) + if dataclasses.is_dataclass(obj): + obj_dict = dataclasses.asdict(obj) # type: ignore + return jsonable_encoder(obj_dict, custom_encoder=custom_encoder) + if isinstance(obj, bytes): + return base64.b64encode(obj).decode("utf-8") + if isinstance(obj, Enum): + return obj.value + if isinstance(obj, PurePath): + return str(obj) + if isinstance(obj, (str, int, float, type(None))): + return obj + if isinstance(obj, dt.datetime): + return serialize_datetime(obj) + if isinstance(obj, dt.date): + return str(obj) + if isinstance(obj, dict): + encoded_dict = {} + allowed_keys = set(obj.keys()) + for key, value in obj.items(): + if key in allowed_keys: + encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder) + encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder) + encoded_dict[encoded_key] = encoded_value + return encoded_dict + if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)): + encoded_list = [] + for item in obj: + encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) + return encoded_list + + def fallback_serializer(o: Any) -> Any: + attempt_encode = encode_by_type(o) + if attempt_encode is not None: + return attempt_encode + + try: + data = dict(o) + except Exception as e: + errors: List[Exception] = [] + errors.append(e) + try: + data = vars(o) + except Exception as e: + errors.append(e) + raise ValueError(errors) from e + return jsonable_encoder(data, custom_encoder=custom_encoder) + + return to_jsonable_with_fallback(obj, fallback_serializer) diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/pydantic_utilities.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/pydantic_utilities.py new file mode 100644 index 00000000000..8906cdfa421 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/pydantic_utilities.py @@ -0,0 +1,258 @@ +# This file was auto-generated by Fern from our API Definition. + +# nopycln: file +import datetime as dt +from collections import defaultdict +from typing import Any, Callable, ClassVar, Dict, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union, cast + +import pydantic + +IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") + +if IS_PYDANTIC_V2: + from pydantic.v1.datetime_parse import parse_date as parse_date + from pydantic.v1.datetime_parse import parse_datetime as parse_datetime + from pydantic.v1.fields import ModelField as ModelField + from pydantic.v1.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[attr-defined] + from pydantic.v1.typing import get_args as get_args + from pydantic.v1.typing import get_origin as get_origin + from pydantic.v1.typing import is_literal_type as is_literal_type + from pydantic.v1.typing import is_union as is_union +else: + from pydantic.datetime_parse import parse_date as parse_date # type: ignore[no-redef] + from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore[no-redef] + from pydantic.fields import ModelField as ModelField # type: ignore[attr-defined, no-redef] + from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[no-redef] + from pydantic.typing import get_args as get_args # type: ignore[no-redef] + from pydantic.typing import get_origin as get_origin # type: ignore[no-redef] + from pydantic.typing import is_literal_type as is_literal_type # type: ignore[no-redef] + from pydantic.typing import is_union as is_union # type: ignore[no-redef] + +from .datetime_utils import serialize_datetime +from .serialization import convert_and_respect_annotation_metadata +from typing_extensions import TypeAlias + +T = TypeVar("T") +Model = TypeVar("Model", bound=pydantic.BaseModel) + + +def parse_obj_as(type_: Type[T], object_: Any) -> T: + dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") + if IS_PYDANTIC_V2: + adapter = pydantic.TypeAdapter(type_) # type: ignore[attr-defined] + return adapter.validate_python(dealiased_object) + return pydantic.parse_obj_as(type_, dealiased_object) + + +def to_jsonable_with_fallback(obj: Any, fallback_serializer: Callable[[Any], Any]) -> Any: + if IS_PYDANTIC_V2: + from pydantic_core import to_jsonable_python + + return to_jsonable_python(obj, fallback=fallback_serializer) + return fallback_serializer(obj) + + +class UniversalBaseModel(pydantic.BaseModel): + if IS_PYDANTIC_V2: + model_config: ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( # type: ignore[typeddict-unknown-key] + # Allow fields beginning with `model_` to be used in the model + protected_namespaces=(), + ) + + @pydantic.model_serializer(mode="plain", when_used="json") # type: ignore[attr-defined] + def serialize_model(self) -> Any: # type: ignore[name-defined] + serialized = self.dict() # type: ignore[attr-defined] + data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} + return data + + else: + + class Config: + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} + + @classmethod + def model_construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": + dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") + return cls.construct(_fields_set, **dealiased_object) + + @classmethod + def construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": + dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") + if IS_PYDANTIC_V2: + return super().model_construct(_fields_set, **dealiased_object) # type: ignore[misc] + return super().construct(_fields_set, **dealiased_object) + + def json(self, **kwargs: Any) -> str: + kwargs_with_defaults = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + if IS_PYDANTIC_V2: + return super().model_dump_json(**kwargs_with_defaults) # type: ignore[misc] + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: Any) -> Dict[str, Any]: + """ + Override the default dict method to `exclude_unset` by default. This function patches + `exclude_unset` to work include fields within non-None default values. + """ + # Note: the logic here is multiplexed given the levers exposed in Pydantic V1 vs V2 + # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice. + # + # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models + # that we have less control over, and this is less intrusive than custom serializers for now. + if IS_PYDANTIC_V2: + kwargs_with_defaults_exclude_unset = { + **kwargs, + "by_alias": True, + "exclude_unset": True, + "exclude_none": False, + } + kwargs_with_defaults_exclude_none = { + **kwargs, + "by_alias": True, + "exclude_none": True, + "exclude_unset": False, + } + dict_dump = deep_union_pydantic_dicts( + super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore[misc] + super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore[misc] + ) + + else: + _fields_set = self.__fields_set__.copy() + + fields = _get_model_fields(self.__class__) + for name, field in fields.items(): + if name not in _fields_set: + default = _get_field_default(field) + + # If the default values are non-null act like they've been set + # This effectively allows exclude_unset to work like exclude_none where + # the latter passes through intentionally set none values. + if default is not None or ("exclude_unset" in kwargs and not kwargs["exclude_unset"]): + _fields_set.add(name) + + if default is not None: + self.__fields_set__.add(name) + + kwargs_with_defaults_exclude_unset_include_fields = { + "by_alias": True, + "exclude_unset": True, + "include": _fields_set, + **kwargs, + } + + dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) + + return cast( + Dict[str, Any], + convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write"), + ) + + +def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> List[Any]: + converted_list: List[Any] = [] + for i, item in enumerate(source): + destination_value = destination[i] + if isinstance(item, dict): + converted_list.append(deep_union_pydantic_dicts(item, destination_value)) + elif isinstance(item, list): + converted_list.append(_union_list_of_pydantic_dicts(item, destination_value)) + else: + converted_list.append(item) + return converted_list + + +def deep_union_pydantic_dicts(source: Dict[str, Any], destination: Dict[str, Any]) -> Dict[str, Any]: + for key, value in source.items(): + node = destination.setdefault(key, {}) + if isinstance(value, dict): + deep_union_pydantic_dicts(value, node) + # Note: we do not do this same processing for sets given we do not have sets of models + # and given the sets are unordered, the processing of the set and matching objects would + # be non-trivial. + elif isinstance(value, list): + destination[key] = _union_list_of_pydantic_dicts(value, node) + else: + destination[key] = value + + return destination + + +if IS_PYDANTIC_V2: + + class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[misc, name-defined, type-arg] + pass + + UniversalRootModel: TypeAlias = V2RootModel # type: ignore[misc] +else: + UniversalRootModel: TypeAlias = UniversalBaseModel # type: ignore[misc, no-redef] + + +def encode_by_type(o: Any) -> Any: + encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(tuple) + for type_, encoder in encoders_by_type.items(): + encoders_by_class_tuples[encoder] += (type_,) + + if type(o) in encoders_by_type: + return encoders_by_type[type(o)](o) + for encoder, classes_tuple in encoders_by_class_tuples.items(): + if isinstance(o, classes_tuple): + return encoder(o) + + +def update_forward_refs(model: Type["Model"], **localns: Any) -> None: + if IS_PYDANTIC_V2: + model.model_rebuild(raise_errors=False) # type: ignore[attr-defined] + else: + model.update_forward_refs(**localns) + + +# Mirrors Pydantic's internal typing +AnyCallable = Callable[..., Any] + + +def universal_root_validator( + pre: bool = False, +) -> Callable[[AnyCallable], AnyCallable]: + def decorator(func: AnyCallable) -> AnyCallable: + if IS_PYDANTIC_V2: + return cast(AnyCallable, pydantic.model_validator(mode="before" if pre else "after")(func)) # type: ignore[attr-defined] + return cast(AnyCallable, pydantic.root_validator(pre=pre)(func)) # type: ignore[call-overload] + + return decorator + + +def universal_field_validator(field_name: str, pre: bool = False) -> Callable[[AnyCallable], AnyCallable]: + def decorator(func: AnyCallable) -> AnyCallable: + if IS_PYDANTIC_V2: + return cast(AnyCallable, pydantic.field_validator(field_name, mode="before" if pre else "after")(func)) # type: ignore[attr-defined] + return cast(AnyCallable, pydantic.validator(field_name, pre=pre)(func)) + + return decorator + + +PydanticField = Union[ModelField, pydantic.fields.FieldInfo] + + +def _get_model_fields(model: Type["Model"]) -> Mapping[str, PydanticField]: + if IS_PYDANTIC_V2: + return cast(Mapping[str, PydanticField], model.model_fields) # type: ignore[attr-defined] + return cast(Mapping[str, PydanticField], model.__fields__) + + +def _get_field_default(field: PydanticField) -> Any: + try: + value = field.get_default() # type: ignore[union-attr] + except: + value = field.default + if IS_PYDANTIC_V2: + from pydantic_core import PydanticUndefined + + if value == PydanticUndefined: + return None + return value + return value diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/query_encoder.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/query_encoder.py new file mode 100644 index 00000000000..3183001d404 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/query_encoder.py @@ -0,0 +1,58 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, List, Optional, Tuple + +import pydantic + + +# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict +def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: + result = [] + for k, v in dict_flat.items(): + key = f"{key_prefix}[{k}]" if key_prefix is not None else k + if isinstance(v, dict): + result.extend(traverse_query_dict(v, key)) + elif isinstance(v, list): + for arr_v in v: + if isinstance(arr_v, dict): + result.extend(traverse_query_dict(arr_v, key)) + else: + result.append((key, arr_v)) + else: + result.append((key, v)) + return result + + +def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]: + if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict): + if isinstance(query_value, pydantic.BaseModel): + obj_dict = query_value.dict(by_alias=True) + else: + obj_dict = query_value + return traverse_query_dict(obj_dict, query_key) + elif isinstance(query_value, list): + encoded_values: List[Tuple[str, Any]] = [] + for value in query_value: + if isinstance(value, pydantic.BaseModel) or isinstance(value, dict): + if isinstance(value, pydantic.BaseModel): + obj_dict = value.dict(by_alias=True) + elif isinstance(value, dict): + obj_dict = value + + encoded_values.extend(single_query_encoder(query_key, obj_dict)) + else: + encoded_values.append((query_key, value)) + + return encoded_values + + return [(query_key, query_value)] + + +def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: + if query is None: + return None + + encoded_query = [] + for k, v in query.items(): + encoded_query.extend(single_query_encoder(k, v)) + return encoded_query diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/remove_none_from_dict.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/remove_none_from_dict.py new file mode 100644 index 00000000000..c2298143f14 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/remove_none_from_dict.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, Mapping, Optional + + +def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]: + new: Dict[str, Any] = {} + for key, value in original.items(): + if value is not None: + new[key] = value + return new diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/request_options.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/request_options.py new file mode 100644 index 00000000000..1b38804432b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/request_options.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +try: + from typing import NotRequired # type: ignore +except ImportError: + from typing_extensions import NotRequired + + +class RequestOptions(typing.TypedDict, total=False): + """ + Additional options for request-specific configuration when calling APIs via the SDK. + This is used primarily as an optional final parameter for service functions. + + Attributes: + - timeout_in_seconds: int. The number of seconds to await an API call before timing out. + + - max_retries: int. The max number of retries to attempt if the API call fails. + + - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict + + - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict + + - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict + + - chunk_size: int. The size, in bytes, to process each chunk of data being streamed back within the response. This equates to leveraging `chunk_size` within `requests` or `httpx`, and is only leveraged for file downloads. + """ + + timeout_in_seconds: NotRequired[int] + max_retries: NotRequired[int] + additional_headers: NotRequired[typing.Dict[str, typing.Any]] + additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] + additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] + chunk_size: NotRequired[int] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/serialization.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/serialization.py new file mode 100644 index 00000000000..c36e865cc72 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/core/serialization.py @@ -0,0 +1,276 @@ +# This file was auto-generated by Fern from our API Definition. + +import collections +import inspect +import typing + +import pydantic +import typing_extensions + + +class FieldMetadata: + """ + Metadata class used to annotate fields to provide additional information. + + Example: + class MyDict(TypedDict): + field: typing.Annotated[str, FieldMetadata(alias="field_name")] + + Will serialize: `{"field": "value"}` + To: `{"field_name": "value"}` + """ + + alias: str + + def __init__(self, *, alias: str) -> None: + self.alias = alias + + +def convert_and_respect_annotation_metadata( + *, + object_: typing.Any, + annotation: typing.Any, + inner_type: typing.Optional[typing.Any] = None, + direction: typing.Literal["read", "write"], +) -> typing.Any: + """ + Respect the metadata annotations on a field, such as aliasing. This function effectively + manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for + TypedDicts, which cannot support aliasing out of the box, and can be extended for additional + utilities, such as defaults. + + Parameters + ---------- + object_ : typing.Any + + annotation : type + The type we're looking to apply typing annotations from + + inner_type : typing.Optional[type] + + Returns + ------- + typing.Any + """ + + if object_ is None: + return None + if inner_type is None: + inner_type = annotation + + clean_type = _remove_annotations(inner_type) + # Pydantic models + if ( + inspect.isclass(clean_type) + and issubclass(clean_type, pydantic.BaseModel) + and isinstance(object_, typing.Mapping) + ): + return _convert_mapping(object_, clean_type, direction) + # TypedDicts + if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping): + return _convert_mapping(object_, clean_type, direction) + + if ( + typing_extensions.get_origin(clean_type) == typing.Dict + or typing_extensions.get_origin(clean_type) == dict + or clean_type == typing.Dict + ) and isinstance(object_, typing.Dict): + key_type = typing_extensions.get_args(clean_type)[0] + value_type = typing_extensions.get_args(clean_type)[1] + + return { + key: convert_and_respect_annotation_metadata( + object_=value, + annotation=annotation, + inner_type=value_type, + direction=direction, + ) + for key, value in object_.items() + } + + # If you're iterating on a string, do not bother to coerce it to a sequence. + if not isinstance(object_, str): + if ( + typing_extensions.get_origin(clean_type) == typing.Set + or typing_extensions.get_origin(clean_type) == set + or clean_type == typing.Set + ) and isinstance(object_, typing.Set): + inner_type = typing_extensions.get_args(clean_type)[0] + return { + convert_and_respect_annotation_metadata( + object_=item, + annotation=annotation, + inner_type=inner_type, + direction=direction, + ) + for item in object_ + } + elif ( + ( + typing_extensions.get_origin(clean_type) == typing.List + or typing_extensions.get_origin(clean_type) == list + or clean_type == typing.List + ) + and isinstance(object_, typing.List) + ) or ( + ( + typing_extensions.get_origin(clean_type) == typing.Sequence + or typing_extensions.get_origin(clean_type) == collections.abc.Sequence + or clean_type == typing.Sequence + ) + and isinstance(object_, typing.Sequence) + ): + inner_type = typing_extensions.get_args(clean_type)[0] + return [ + convert_and_respect_annotation_metadata( + object_=item, + annotation=annotation, + inner_type=inner_type, + direction=direction, + ) + for item in object_ + ] + + if typing_extensions.get_origin(clean_type) == typing.Union: + # We should be able to ~relatively~ safely try to convert keys against all + # member types in the union, the edge case here is if one member aliases a field + # of the same name to a different name from another member + # Or if another member aliases a field of the same name that another member does not. + for member in typing_extensions.get_args(clean_type): + object_ = convert_and_respect_annotation_metadata( + object_=object_, + annotation=annotation, + inner_type=member, + direction=direction, + ) + return object_ + + annotated_type = _get_annotation(annotation) + if annotated_type is None: + return object_ + + # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.) + # Then we can safely call it on the recursive conversion. + return object_ + + +def _convert_mapping( + object_: typing.Mapping[str, object], + expected_type: typing.Any, + direction: typing.Literal["read", "write"], +) -> typing.Mapping[str, object]: + converted_object: typing.Dict[str, object] = {} + try: + annotations = typing_extensions.get_type_hints(expected_type, include_extras=True) + except NameError: + # The TypedDict contains a circular reference, so + # we use the __annotations__ attribute directly. + annotations = getattr(expected_type, "__annotations__", {}) + aliases_to_field_names = _get_alias_to_field_name(annotations) + for key, value in object_.items(): + if direction == "read" and key in aliases_to_field_names: + dealiased_key = aliases_to_field_names.get(key) + if dealiased_key is not None: + type_ = annotations.get(dealiased_key) + else: + type_ = annotations.get(key) + # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map + # + # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias + # then we can just pass the value through as is + if type_ is None: + converted_object[key] = value + elif direction == "read" and key not in aliases_to_field_names: + converted_object[key] = convert_and_respect_annotation_metadata( + object_=value, annotation=type_, direction=direction + ) + else: + converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = ( + convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction) + ) + return converted_object + + +def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]: + maybe_annotated_type = typing_extensions.get_origin(type_) + if maybe_annotated_type is None: + return None + + if maybe_annotated_type == typing_extensions.NotRequired: + type_ = typing_extensions.get_args(type_)[0] + maybe_annotated_type = typing_extensions.get_origin(type_) + + if maybe_annotated_type == typing_extensions.Annotated: + return type_ + + return None + + +def _remove_annotations(type_: typing.Any) -> typing.Any: + maybe_annotated_type = typing_extensions.get_origin(type_) + if maybe_annotated_type is None: + return type_ + + if maybe_annotated_type == typing_extensions.NotRequired: + return _remove_annotations(typing_extensions.get_args(type_)[0]) + + if maybe_annotated_type == typing_extensions.Annotated: + return _remove_annotations(typing_extensions.get_args(type_)[0]) + + return type_ + + +def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]: + annotations = typing_extensions.get_type_hints(type_, include_extras=True) + return _get_alias_to_field_name(annotations) + + +def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]: + annotations = typing_extensions.get_type_hints(type_, include_extras=True) + return _get_field_to_alias_name(annotations) + + +def _get_alias_to_field_name( + field_to_hint: typing.Dict[str, typing.Any], +) -> typing.Dict[str, str]: + aliases = {} + for field, hint in field_to_hint.items(): + maybe_alias = _get_alias_from_type(hint) + if maybe_alias is not None: + aliases[maybe_alias] = field + return aliases + + +def _get_field_to_alias_name( + field_to_hint: typing.Dict[str, typing.Any], +) -> typing.Dict[str, str]: + aliases = {} + for field, hint in field_to_hint.items(): + maybe_alias = _get_alias_from_type(hint) + if maybe_alias is not None: + aliases[field] = maybe_alias + return aliases + + +def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]: + maybe_annotated_type = _get_annotation(type_) + + if maybe_annotated_type is not None: + # The actual annotations are 1 onward, the first is the annotated type + annotations = typing_extensions.get_args(maybe_annotated_type)[1:] + + for annotation in annotations: + if isinstance(annotation, FieldMetadata) and annotation.alias is not None: + return annotation.alias + return None + + +def _alias_key( + key: str, + type_: typing.Any, + direction: typing.Literal["read", "write"], + aliases_to_field_names: typing.Dict[str, str], +) -> str: + if direction == "read": + return aliases_to_field_names.get(key, key) + return _get_alias_from_type(type_=type_) or key diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/py.typed b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/py.typed new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/types/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/types/__init__.py new file mode 100644 index 00000000000..802b933eb12 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/types/__init__.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .importing_a import ImportingA + from .root_type import RootType +_dynamic_imports: typing.Dict[str, str] = {"ImportingA": ".importing_a", "RootType": ".root_type"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["ImportingA", "RootType"] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/types/importing_a.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/types/importing_a.py new file mode 100644 index 00000000000..fe7f2f6ad79 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/types/importing_a.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..a.types.a import A +from ..core.pydantic_utilities import UniversalBaseModel + + +class ImportingA(UniversalBaseModel): + a: typing.Optional[A] = None + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/types/root_type.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/types/root_type.py new file mode 100644 index 00000000000..314d4c27b1f --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/types/root_type.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import UniversalBaseModel + + +class RootType(UniversalBaseModel): + s: str + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/version.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/version.py new file mode 100644 index 00000000000..8bceace9866 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/src/seed/version.py @@ -0,0 +1,3 @@ +from importlib import metadata + +__version__ = metadata.version("fern_circular-references-advanced") diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/custom/test_client.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/custom/test_client.py new file mode 100644 index 00000000000..ab04ce6393e --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/custom/test_client.py @@ -0,0 +1,7 @@ +import pytest + + +# Get started with writing tests with pytest at https://docs.pytest.org +@pytest.mark.skip(reason="Unimplemented") +def test_client() -> None: + assert True diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/__init__.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/__init__.py new file mode 100644 index 00000000000..2cf01263529 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/__init__.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +from .circle import CircleParams +from .object_with_defaults import ObjectWithDefaultsParams +from .object_with_optional_field import ObjectWithOptionalFieldParams +from .shape import Shape_CircleParams, Shape_SquareParams, ShapeParams +from .square import SquareParams +from .undiscriminated_shape import UndiscriminatedShapeParams + +__all__ = [ + "CircleParams", + "ObjectWithDefaultsParams", + "ObjectWithOptionalFieldParams", + "ShapeParams", + "Shape_CircleParams", + "Shape_SquareParams", + "SquareParams", + "UndiscriminatedShapeParams", +] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/circle.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/circle.py new file mode 100644 index 00000000000..74ecf38c308 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/circle.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions + +from seed.core.serialization import FieldMetadata + + +class CircleParams(typing_extensions.TypedDict): + radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/color.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/color.py new file mode 100644 index 00000000000..2aa2c4c52f0 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/color.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing + +Color = typing.Union[typing.Literal["red", "blue"], typing.Any] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/object_with_defaults.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/object_with_defaults.py new file mode 100644 index 00000000000..a977b1d2aa1 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/object_with_defaults.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions + + +class ObjectWithDefaultsParams(typing_extensions.TypedDict): + """ + Defines properties with default values and validation rules. + """ + + decimal: typing_extensions.NotRequired[float] + string: typing_extensions.NotRequired[str] + required_string: str diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/object_with_optional_field.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/object_with_optional_field.py new file mode 100644 index 00000000000..6b5608bc05b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/object_with_optional_field.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +import uuid + +import typing_extensions +from .color import Color +from .shape import ShapeParams +from .undiscriminated_shape import UndiscriminatedShapeParams + +from seed.core.serialization import FieldMetadata + + +class ObjectWithOptionalFieldParams(typing_extensions.TypedDict): + literal: typing.Literal["lit_one"] + string: typing_extensions.NotRequired[str] + integer: typing_extensions.NotRequired[int] + long_: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="long")]] + double: typing_extensions.NotRequired[float] + bool_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="bool")]] + datetime: typing_extensions.NotRequired[dt.datetime] + date: typing_extensions.NotRequired[dt.date] + uuid_: typing_extensions.NotRequired[typing_extensions.Annotated[uuid.UUID, FieldMetadata(alias="uuid")]] + base_64: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="base64")]] + list_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Sequence[str], FieldMetadata(alias="list")]] + set_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Set[str], FieldMetadata(alias="set")]] + map_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Dict[int, str], FieldMetadata(alias="map")]] + enum: typing_extensions.NotRequired[Color] + union: typing_extensions.NotRequired[ShapeParams] + second_union: typing_extensions.NotRequired[ShapeParams] + undiscriminated_union: typing_extensions.NotRequired[UndiscriminatedShapeParams] + any: typing.Optional[typing.Any] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/shape.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/shape.py new file mode 100644 index 00000000000..7e70010a251 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/shape.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import typing_extensions + +from seed.core.serialization import FieldMetadata + + +class Base(typing_extensions.TypedDict): + id: str + + +class Shape_CircleParams(Base): + shape_type: typing_extensions.Annotated[typing.Literal["circle"], FieldMetadata(alias="shapeType")] + radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] + + +class Shape_SquareParams(Base): + shape_type: typing_extensions.Annotated[typing.Literal["square"], FieldMetadata(alias="shapeType")] + length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] + + +ShapeParams = typing.Union[Shape_CircleParams, Shape_SquareParams] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/square.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/square.py new file mode 100644 index 00000000000..71c7d25fd4a --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/square.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions + +from seed.core.serialization import FieldMetadata + + +class SquareParams(typing_extensions.TypedDict): + length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/undiscriminated_shape.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/undiscriminated_shape.py new file mode 100644 index 00000000000..99f12b300d1 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/assets/models/undiscriminated_shape.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .circle import CircleParams +from .square import SquareParams + +UndiscriminatedShapeParams = typing.Union[CircleParams, SquareParams] diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/test_http_client.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/test_http_client.py new file mode 100644 index 00000000000..a541bae6531 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/test_http_client.py @@ -0,0 +1,61 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed.core.http_client import get_request_body +from seed.core.request_options import RequestOptions + + +def get_request_options() -> RequestOptions: + return {"additional_body_parameters": {"see you": "later"}} + + +def test_get_json_request_body() -> None: + json_body, data_body = get_request_body(json={"hello": "world"}, data=None, request_options=None, omit=None) + assert json_body == {"hello": "world"} + assert data_body is None + + json_body_extras, data_body_extras = get_request_body( + json={"goodbye": "world"}, data=None, request_options=get_request_options(), omit=None + ) + + assert json_body_extras == {"goodbye": "world", "see you": "later"} + assert data_body_extras is None + + +def test_get_files_request_body() -> None: + json_body, data_body = get_request_body(json=None, data={"hello": "world"}, request_options=None, omit=None) + assert data_body == {"hello": "world"} + assert json_body is None + + json_body_extras, data_body_extras = get_request_body( + json=None, data={"goodbye": "world"}, request_options=get_request_options(), omit=None + ) + + assert data_body_extras == {"goodbye": "world", "see you": "later"} + assert json_body_extras is None + + +def test_get_none_request_body() -> None: + json_body, data_body = get_request_body(json=None, data=None, request_options=None, omit=None) + assert data_body is None + assert json_body is None + + json_body_extras, data_body_extras = get_request_body( + json=None, data=None, request_options=get_request_options(), omit=None + ) + + assert json_body_extras == {"see you": "later"} + assert data_body_extras is None + + +def test_get_empty_json_request_body() -> None: + unrelated_request_options: RequestOptions = {"max_retries": 3} + json_body, data_body = get_request_body(json=None, data=None, request_options=unrelated_request_options, omit=None) + assert json_body is None + assert data_body is None + + json_body_extras, data_body_extras = get_request_body( + json={}, data=None, request_options=unrelated_request_options, omit=None + ) + + assert json_body_extras is None + assert data_body_extras is None diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/test_query_encoding.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/test_query_encoding.py new file mode 100644 index 00000000000..ef5fd7094f9 --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/test_query_encoding.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed.core.query_encoder import encode_query + + +def test_query_encoding_deep_objects() -> None: + assert encode_query({"hello world": "hello world"}) == [("hello world", "hello world")] + assert encode_query({"hello_world": {"hello": "world"}}) == [("hello_world[hello]", "world")] + assert encode_query({"hello_world": {"hello": {"world": "today"}, "test": "this"}, "hi": "there"}) == [ + ("hello_world[hello][world]", "today"), + ("hello_world[test]", "this"), + ("hi", "there"), + ] + + +def test_query_encoding_deep_object_arrays() -> None: + assert encode_query({"objects": [{"key": "hello", "value": "world"}, {"key": "foo", "value": "bar"}]}) == [ + ("objects[key]", "hello"), + ("objects[value]", "world"), + ("objects[key]", "foo"), + ("objects[value]", "bar"), + ] + assert encode_query( + {"users": [{"name": "string", "tags": ["string"]}, {"name": "string2", "tags": ["string2", "string3"]}]} + ) == [ + ("users[name]", "string"), + ("users[tags]", "string"), + ("users[name]", "string2"), + ("users[tags]", "string2"), + ("users[tags]", "string3"), + ] + + +def test_encode_query_with_none() -> None: + encoded = encode_query(None) + assert encoded is None diff --git a/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/test_serialization.py b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/test_serialization.py new file mode 100644 index 00000000000..b298db89c4b --- /dev/null +++ b/seed/python-sdk/circular-references-advanced/pydantic-v2/tests/utils/test_serialization.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, List + +from .assets.models import ObjectWithOptionalFieldParams, ShapeParams + +from seed.core.serialization import convert_and_respect_annotation_metadata + +UNION_TEST: ShapeParams = {"radius_measurement": 1.0, "shape_type": "circle", "id": "1"} +UNION_TEST_CONVERTED = {"shapeType": "circle", "radiusMeasurement": 1.0, "id": "1"} + + +def test_convert_and_respect_annotation_metadata() -> None: + data: ObjectWithOptionalFieldParams = { + "string": "string", + "long_": 12345, + "bool_": True, + "literal": "lit_one", + "any": "any", + } + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" + ) + assert converted == {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"} + + +def test_convert_and_respect_annotation_metadata_in_list() -> None: + data: List[ObjectWithOptionalFieldParams] = [ + {"string": "string", "long_": 12345, "bool_": True, "literal": "lit_one", "any": "any"}, + {"string": "another string", "long_": 67890, "list_": [], "literal": "lit_one", "any": "any"}, + ] + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=List[ObjectWithOptionalFieldParams], direction="write" + ) + + assert converted == [ + {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"}, + {"string": "another string", "long": 67890, "list": [], "literal": "lit_one", "any": "any"}, + ] + + +def test_convert_and_respect_annotation_metadata_in_nested_object() -> None: + data: ObjectWithOptionalFieldParams = { + "string": "string", + "long_": 12345, + "union": UNION_TEST, + "literal": "lit_one", + "any": "any", + } + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" + ) + + assert converted == { + "string": "string", + "long": 12345, + "union": UNION_TEST_CONVERTED, + "literal": "lit_one", + "any": "any", + } + + +def test_convert_and_respect_annotation_metadata_in_union() -> None: + converted = convert_and_respect_annotation_metadata(object_=UNION_TEST, annotation=ShapeParams, direction="write") + + assert converted == UNION_TEST_CONVERTED + + +def test_convert_and_respect_annotation_metadata_with_empty_object() -> None: + data: Any = {} + converted = convert_and_respect_annotation_metadata(object_=data, annotation=ShapeParams, direction="write") + assert converted == data diff --git a/seed/python-sdk/circular-references/no-custom-config/poetry.lock b/seed/python-sdk/circular-references/no-custom-config/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/circular-references/no-custom-config/poetry.lock +++ b/seed/python-sdk/circular-references/no-custom-config/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/__init__.py b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/__init__.py index 1410d867869..3010b3abd86 100644 --- a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/__init__.py +++ b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/__init__.py @@ -6,28 +6,33 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .container_value import ContainerValue, ContainerValue_List, ContainerValue_Optional - from .field_value import FieldValue, FieldValue_ContainerValue, FieldValue_ObjectValue, FieldValue_PrimitiveValue + from .container_value_all import ( + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, + ) from .json_like import JsonLike from .object_value import ObjectValue from .primitive_value import PrimitiveValue - from .t import T - from .tor_u import TorU - from .u import U + from .t_all import T, TorU, U _dynamic_imports: typing.Dict[str, str] = { - "ContainerValue": ".container_value", - "ContainerValue_List": ".container_value", - "ContainerValue_Optional": ".container_value", - "FieldValue": ".field_value", - "FieldValue_ContainerValue": ".field_value", - "FieldValue_ObjectValue": ".field_value", - "FieldValue_PrimitiveValue": ".field_value", + "ContainerValue": ".container_value_all", + "ContainerValue_List": ".container_value_all", + "ContainerValue_Optional": ".container_value_all", + "FieldValue": ".container_value_all", + "FieldValue_ContainerValue": ".container_value_all", + "FieldValue_ObjectValue": ".container_value_all", + "FieldValue_PrimitiveValue": ".container_value_all", "JsonLike": ".json_like", "ObjectValue": ".object_value", "PrimitiveValue": ".primitive_value", - "T": ".t", - "TorU": ".tor_u", - "U": ".u", + "T": ".t_all", + "TorU": ".t_all", + "U": ".t_all", } diff --git a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/container_value.py b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/container_value.py index 3512c8df435..d3b9fbcdba7 100644 --- a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/container_value.py +++ b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/container_value.py @@ -1,41 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class ContainerValue_List(UniversalBaseModel): - value: typing.List["FieldValue"] - type: typing.Literal["list"] = "list" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -class ContainerValue_Optional(UniversalBaseModel): - value: typing.Optional["FieldValue"] = None - type: typing.Literal["optional"] = "optional" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] -from .field_value import FieldValue # noqa: E402, F401, I001 - -update_forward_refs(ContainerValue_List) -update_forward_refs(ContainerValue_Optional) +__all__ = ["ContainerValue"] diff --git a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/container_value_all.py b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/container_value_all.py new file mode 100644 index 00000000000..0d4bc73d8f4 --- /dev/null +++ b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/container_value_all.py @@ -0,0 +1,86 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs +from .primitive_value import PrimitiveValue + + +class ContainerValue_List(UniversalBaseModel): + value: typing.List["ast_types_field_value_FieldValue"] + type: typing.Literal["list"] = "list" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +class ContainerValue_Optional(UniversalBaseModel): + value: typing.Optional["ast_types_field_value_FieldValue"] = None + type: typing.Literal["optional"] = "optional" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] +from .field_value import FieldValue as ast_types_field_value_FieldValue # noqa: E402, F401, I001 + + +class FieldValue_PrimitiveValue(UniversalBaseModel): + value: PrimitiveValue + type: typing.Literal["primitive_value"] = "primitive_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +class FieldValue_ObjectValue(UniversalBaseModel): + type: typing.Literal["object_value"] = "object_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FieldValue_ContainerValue(UniversalBaseModel): + value: "ast_types_container_value_ContainerValue" + type: typing.Literal["container_value"] = "container_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] +from .container_value import ContainerValue as ast_types_container_value_ContainerValue # noqa: E402, F401, I001 + +update_forward_refs(ContainerValue_List) +update_forward_refs(ContainerValue_Optional) +update_forward_refs(FieldValue_ContainerValue) diff --git a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/field_value.py b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/field_value.py index 2aa54df1b0e..88d4a5e9c2d 100644 --- a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/field_value.py +++ b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/field_value.py @@ -1,54 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .primitive_value import PrimitiveValue - - -class FieldValue_PrimitiveValue(UniversalBaseModel): - value: PrimitiveValue - type: typing.Literal["primitive_value"] = "primitive_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -class FieldValue_ObjectValue(UniversalBaseModel): - type: typing.Literal["object_value"] = "object_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class FieldValue_ContainerValue(UniversalBaseModel): - value: "ContainerValue" - type: typing.Literal["container_value"] = "container_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] -from .container_value import ContainerValue # noqa: E402, F401, I001 - -update_forward_refs(FieldValue_ContainerValue) +__all__ = ["FieldValue"] diff --git a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/t.py b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/t.py index c614431643e..7890c29fb10 100644 --- a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/t.py +++ b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/t.py @@ -1,27 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import T as T -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class T(UniversalBaseModel): - child: "TorU" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .u import U # noqa: E402, F401, I001 -from .tor_u import TorU # noqa: E402, F401, I001 - -update_forward_refs(T) +__all__ = ["T"] diff --git a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/t_all.py b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/t_all.py new file mode 100644 index 00000000000..b150b40451a --- /dev/null +++ b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/t_all.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .t import T as ast_types_t_T + from .u import U as ast_types_u_U + + +class T(UniversalBaseModel): + child: "ast_types_tor_u_TorU" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .u import U as ast_types_u_U # noqa: E402, F401, I001 +from .tor_u import TorU as ast_types_tor_u_TorU # noqa: E402, F401, I001 + +TorU = typing.Union["ast_types_t_T", "ast_types_u_U"] + + +class U(UniversalBaseModel): + child: "ast_types_t_T" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .t import T as ast_types_t_T # noqa: E402, F401, I001 diff --git a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/tor_u.py b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/tor_u.py index 5409b5f1551..fd9fb53be9a 100644 --- a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/tor_u.py +++ b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/tor_u.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import TorU as TorU -import typing - -if typing.TYPE_CHECKING: - from .t import T - from .u import U -TorU = typing.Union["T", "U"] +__all__ = ["TorU"] diff --git a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/u.py b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/u.py index 05d42f652c8..85016723b61 100644 --- a/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/u.py +++ b/seed/python-sdk/circular-references/no-custom-config/src/seed/ast/types/u.py @@ -1,26 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import U as U -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class U(UniversalBaseModel): - child: "T" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .t import T # noqa: E402, F401, I001 - -update_forward_refs(U) +__all__ = ["U"] diff --git a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/poetry.lock b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/poetry.lock +++ b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/__init__.py b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/__init__.py index 1410d867869..3010b3abd86 100644 --- a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/__init__.py +++ b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/__init__.py @@ -6,28 +6,33 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .container_value import ContainerValue, ContainerValue_List, ContainerValue_Optional - from .field_value import FieldValue, FieldValue_ContainerValue, FieldValue_ObjectValue, FieldValue_PrimitiveValue + from .container_value_all import ( + ContainerValue, + ContainerValue_List, + ContainerValue_Optional, + FieldValue, + FieldValue_ContainerValue, + FieldValue_ObjectValue, + FieldValue_PrimitiveValue, + ) from .json_like import JsonLike from .object_value import ObjectValue from .primitive_value import PrimitiveValue - from .t import T - from .tor_u import TorU - from .u import U + from .t_all import T, TorU, U _dynamic_imports: typing.Dict[str, str] = { - "ContainerValue": ".container_value", - "ContainerValue_List": ".container_value", - "ContainerValue_Optional": ".container_value", - "FieldValue": ".field_value", - "FieldValue_ContainerValue": ".field_value", - "FieldValue_ObjectValue": ".field_value", - "FieldValue_PrimitiveValue": ".field_value", + "ContainerValue": ".container_value_all", + "ContainerValue_List": ".container_value_all", + "ContainerValue_Optional": ".container_value_all", + "FieldValue": ".container_value_all", + "FieldValue_ContainerValue": ".container_value_all", + "FieldValue_ObjectValue": ".container_value_all", + "FieldValue_PrimitiveValue": ".container_value_all", "JsonLike": ".json_like", "ObjectValue": ".object_value", "PrimitiveValue": ".primitive_value", - "T": ".t", - "TorU": ".tor_u", - "U": ".u", + "T": ".t_all", + "TorU": ".t_all", + "U": ".t_all", } diff --git a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/container_value.py b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/container_value.py index 3512c8df435..d3b9fbcdba7 100644 --- a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/container_value.py +++ b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/container_value.py @@ -1,41 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import ContainerValue as ContainerValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class ContainerValue_List(UniversalBaseModel): - value: typing.List["FieldValue"] - type: typing.Literal["list"] = "list" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -class ContainerValue_Optional(UniversalBaseModel): - value: typing.Optional["FieldValue"] = None - type: typing.Literal["optional"] = "optional" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] -from .field_value import FieldValue # noqa: E402, F401, I001 - -update_forward_refs(ContainerValue_List) -update_forward_refs(ContainerValue_Optional) +__all__ = ["ContainerValue"] diff --git a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/container_value_all.py b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/container_value_all.py new file mode 100644 index 00000000000..0d4bc73d8f4 --- /dev/null +++ b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/container_value_all.py @@ -0,0 +1,86 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs +from .primitive_value import PrimitiveValue + + +class ContainerValue_List(UniversalBaseModel): + value: typing.List["ast_types_field_value_FieldValue"] + type: typing.Literal["list"] = "list" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +class ContainerValue_Optional(UniversalBaseModel): + value: typing.Optional["ast_types_field_value_FieldValue"] = None + type: typing.Literal["optional"] = "optional" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +ContainerValue = typing.Union[ContainerValue_List, ContainerValue_Optional] +from .field_value import FieldValue as ast_types_field_value_FieldValue # noqa: E402, F401, I001 + + +class FieldValue_PrimitiveValue(UniversalBaseModel): + value: PrimitiveValue + type: typing.Literal["primitive_value"] = "primitive_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +class FieldValue_ObjectValue(UniversalBaseModel): + type: typing.Literal["object_value"] = "object_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class FieldValue_ContainerValue(UniversalBaseModel): + value: "ast_types_container_value_ContainerValue" + type: typing.Literal["container_value"] = "container_value" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + + +FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] +from .container_value import ContainerValue as ast_types_container_value_ContainerValue # noqa: E402, F401, I001 + +update_forward_refs(ContainerValue_List) +update_forward_refs(ContainerValue_Optional) +update_forward_refs(FieldValue_ContainerValue) diff --git a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/field_value.py b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/field_value.py index 2aa54df1b0e..88d4a5e9c2d 100644 --- a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/field_value.py +++ b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/field_value.py @@ -1,54 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .container_value_all import FieldValue as FieldValue -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs -from .primitive_value import PrimitiveValue - - -class FieldValue_PrimitiveValue(UniversalBaseModel): - value: PrimitiveValue - type: typing.Literal["primitive_value"] = "primitive_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -class FieldValue_ObjectValue(UniversalBaseModel): - type: typing.Literal["object_value"] = "object_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class FieldValue_ContainerValue(UniversalBaseModel): - value: "ContainerValue" - type: typing.Literal["container_value"] = "container_value" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - - -FieldValue = typing.Union[FieldValue_PrimitiveValue, FieldValue_ObjectValue, FieldValue_ContainerValue] -from .container_value import ContainerValue # noqa: E402, F401, I001 - -update_forward_refs(FieldValue_ContainerValue) +__all__ = ["FieldValue"] diff --git a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/t.py b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/t.py index c614431643e..7890c29fb10 100644 --- a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/t.py +++ b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/t.py @@ -1,27 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import T as T -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class T(UniversalBaseModel): - child: "TorU" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .u import U # noqa: E402, F401, I001 -from .tor_u import TorU # noqa: E402, F401, I001 - -update_forward_refs(T) +__all__ = ["T"] diff --git a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/t_all.py b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/t_all.py new file mode 100644 index 00000000000..b150b40451a --- /dev/null +++ b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/t_all.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + +if typing.TYPE_CHECKING: + from .t import T as ast_types_t_T + from .u import U as ast_types_u_U + + +class T(UniversalBaseModel): + child: "ast_types_tor_u_TorU" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .u import U as ast_types_u_U # noqa: E402, F401, I001 +from .tor_u import TorU as ast_types_tor_u_TorU # noqa: E402, F401, I001 + +TorU = typing.Union["ast_types_t_T", "ast_types_u_U"] + + +class U(UniversalBaseModel): + child: "ast_types_t_T" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .t import T as ast_types_t_T # noqa: E402, F401, I001 diff --git a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/tor_u.py b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/tor_u.py index 5409b5f1551..fd9fb53be9a 100644 --- a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/tor_u.py +++ b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/tor_u.py @@ -1,10 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import TorU as TorU -import typing - -if typing.TYPE_CHECKING: - from .t import T - from .u import U -TorU = typing.Union["T", "U"] +__all__ = ["TorU"] diff --git a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/u.py b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/u.py index 05d42f652c8..85016723b61 100644 --- a/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/u.py +++ b/seed/python-sdk/circular-references/no-inheritance-for-extended-models/src/seed/ast/types/u.py @@ -1,26 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations +from .t_all import U as U -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs - - -class U(UniversalBaseModel): - child: "T" - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -from .t import T # noqa: E402, F401, I001 - -update_forward_refs(U) +__all__ = ["U"] diff --git a/seed/python-sdk/client-side-params/poetry.lock b/seed/python-sdk/client-side-params/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/client-side-params/poetry.lock +++ b/seed/python-sdk/client-side-params/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/content-type/poetry.lock b/seed/python-sdk/content-type/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/content-type/poetry.lock +++ b/seed/python-sdk/content-type/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/cross-package-type-names/poetry.lock b/seed/python-sdk/cross-package-type-names/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/cross-package-type-names/poetry.lock +++ b/seed/python-sdk/cross-package-type-names/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/custom-auth/poetry.lock b/seed/python-sdk/custom-auth/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/custom-auth/poetry.lock +++ b/seed/python-sdk/custom-auth/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/empty-clients/poetry.lock b/seed/python-sdk/empty-clients/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/empty-clients/poetry.lock +++ b/seed/python-sdk/empty-clients/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/enum/no-custom-config/poetry.lock b/seed/python-sdk/enum/no-custom-config/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/enum/no-custom-config/poetry.lock +++ b/seed/python-sdk/enum/no-custom-config/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/enum/strenum/poetry.lock b/seed/python-sdk/enum/strenum/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/enum/strenum/poetry.lock +++ b/seed/python-sdk/enum/strenum/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/error-property/poetry.lock b/seed/python-sdk/error-property/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/error-property/poetry.lock +++ b/seed/python-sdk/error-property/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/errors/poetry.lock b/seed/python-sdk/errors/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/errors/poetry.lock +++ b/seed/python-sdk/errors/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/examples/client-filename/poetry.lock b/seed/python-sdk/examples/client-filename/poetry.lock index ba1fd73e6f3..fef3795643a 100644 --- a/seed/python-sdk/examples/client-filename/poetry.lock +++ b/seed/python-sdk/examples/client-filename/poetry.lock @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] diff --git a/seed/python-sdk/examples/client-filename/snippet.json b/seed/python-sdk/examples/client-filename/snippet.json index 7aa1f94a344..60489e78e7f 100644 --- a/seed/python-sdk/examples/client-filename/snippet.json +++ b/seed/python-sdk/examples/client-filename/snippet.json @@ -1,5 +1,7 @@ { "types": { + "type_types:Node": "from seed.types import Node, Tree\n\nNode(\n name=\"root\",\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n trees=[\n Tree(\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n )\n ],\n)\n", + "type_types:Tree": "from seed.types import Node, Tree\n\nTree(\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n)\n", "type_commons/types:Tag": "\"tag-wf9as23d\"\n", "type_commons/types:Metadata": "from seed.commons.types import Metadata\n\nMetadata(\n id=\"metadata-js8dg24b\",\n data={\"foo\": \"bar\", \"baz\": \"qux\"},\n json_string='{\"foo\": \"bar\", \"baz\": \"qux\"}',\n)\n", "type_commons/types:EventInfo": "from seed.commons.types import EventInfo_Metadata\n\nEventInfo_Metadata(\n id=\"metadata-alskjfg8\",\n data={\"one\": \"two\"},\n json_string='{\"one\": \"two\"}',\n)\n", @@ -13,8 +15,6 @@ "type_types:Moment": "import datetime\nimport uuid\n\nfrom seed.types import Moment\n\nMoment(\n id=uuid.UUID(\n \"656f12d6-f592-444c-a1d3-a3cfd46d5b39\",\n ),\n date=datetime.date.fromisoformat(\n \"1994-01-01\",\n ),\n datetime=datetime.datetime.fromisoformat(\n \"1994-01-01 01:01:01+00:00\",\n ),\n)\n", "type_types:File": "from seed.types import File\n\nFile(\n name=\"file.txt\",\n contents=\"...\",\n)\n", "type_types:Directory": "from seed.types import Directory, File\n\nDirectory(\n name=\"root\",\n files=[\n File(\n name=\"file.txt\",\n contents=\"...\",\n )\n ],\n directories=[\n Directory(\n name=\"tmp\",\n files=[\n File(\n name=\"another_file.txt\",\n contents=\"...\",\n )\n ],\n )\n ],\n)\n", - "type_types:Node": "from seed.types import Node, Tree\n\nNode(\n name=\"root\",\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n trees=[\n Tree(\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n )\n ],\n)\n", - "type_types:Tree": "from seed.types import Node, Tree\n\nTree(\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n)\n", "type_types:Metadata": "from seed.types import Metadata_Html\n\nMetadata_Html(value=\"
...\")\n", "type_types:Exception": "from seed.types import Exception_Generic\n\nException_Generic(\n exception_type=\"Unavailable\",\n exception_message=\"This component is unavailable!\",\n exception_stacktrace=\"