diff --git a/generate/generate.py b/generate/generate.py index 932d65d45..f787e320b 100755 --- a/generate/generate.py +++ b/generate/generate.py @@ -735,6 +735,10 @@ def generateType(path: str, name: str, schema: dict): property_type = property_schema['items']['$ref'] property_type = property_type.replace( '#/components/schemas/', '') + f.write( + "\tfrom ...models import " + + property_type + + "\n") f.write( "\t" + property_name + @@ -839,6 +843,10 @@ def generateType(path: str, name: str, schema: dict): property_type = property_schema['items']['$ref'] property_type = property_type.replace( '#/components/schemas/', '') + f.write( + "\t\tfrom ...models import " + + property_type + + "\n") f.write( "\t\t" + property_name + @@ -993,6 +1001,16 @@ def generateType(path: str, name: str, schema: dict): property_type = property_schema['items']['$ref'] property_type = property_type.replace( '#/components/schemas/', '') + f.write( + "\t\tfrom ...models import " + + property_type + + "\n") + f.write( + "\t\t" + + property_name + + " = cast(List[" + property_type + "], d.pop(\"" + + property_name + + "\", UNSET))\n") f.write( "\t\t" + property_name + diff --git a/kittycad/models/api_call_with_price_results_page.py b/kittycad/models/api_call_with_price_results_page.py index c30723ad3..7eb747cca 100644 --- a/kittycad/models/api_call_with_price_results_page.py +++ b/kittycad/models/api_call_with_price_results_page.py @@ -10,12 +10,14 @@ T = TypeVar("T", bound="ApiCallWithPriceResultsPage") @attr.s(auto_attribs=True) class ApiCallWithPriceResultsPage: """ """ + from ...models import ApiCallWithPrice items: Union[Unset, List[ApiCallWithPrice]] = UNSET next_page: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + from ...models import ApiCallWithPrice items: Union[Unset, List[ApiCallWithPrice]] = UNSET if not isinstance(self.items, Unset): items = self.items @@ -34,6 +36,8 @@ class ApiCallWithPriceResultsPage: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + from ...models import ApiCallWithPrice + items = cast(List[ApiCallWithPrice], d.pop("items", UNSET)) items = cast(List[ApiCallWithPrice], d.pop("items", UNSET)) next_page = d.pop("next_page", UNSET) diff --git a/kittycad/models/api_token_results_page.py b/kittycad/models/api_token_results_page.py index 27a0d1600..8bdd4fae0 100644 --- a/kittycad/models/api_token_results_page.py +++ b/kittycad/models/api_token_results_page.py @@ -10,12 +10,14 @@ T = TypeVar("T", bound="ApiTokenResultsPage") @attr.s(auto_attribs=True) class ApiTokenResultsPage: """ """ + from ...models import ApiToken items: Union[Unset, List[ApiToken]] = UNSET next_page: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + from ...models import ApiToken items: Union[Unset, List[ApiToken]] = UNSET if not isinstance(self.items, Unset): items = self.items @@ -34,6 +36,8 @@ class ApiTokenResultsPage: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + from ...models import ApiToken + items = cast(List[ApiToken], d.pop("items", UNSET)) items = cast(List[ApiToken], d.pop("items", UNSET)) next_page = d.pop("next_page", UNSET) diff --git a/kittycad/models/extended_user_results_page.py b/kittycad/models/extended_user_results_page.py index edbbab5e5..5afeb67c4 100644 --- a/kittycad/models/extended_user_results_page.py +++ b/kittycad/models/extended_user_results_page.py @@ -10,12 +10,14 @@ T = TypeVar("T", bound="ExtendedUserResultsPage") @attr.s(auto_attribs=True) class ExtendedUserResultsPage: """ """ + from ...models import ExtendedUser items: Union[Unset, List[ExtendedUser]] = UNSET next_page: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + from ...models import ExtendedUser items: Union[Unset, List[ExtendedUser]] = UNSET if not isinstance(self.items, Unset): items = self.items @@ -34,6 +36,8 @@ class ExtendedUserResultsPage: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + from ...models import ExtendedUser + items = cast(List[ExtendedUser], d.pop("items", UNSET)) items = cast(List[ExtendedUser], d.pop("items", UNSET)) next_page = d.pop("next_page", UNSET) diff --git a/kittycad/models/file_conversion_results_page.py b/kittycad/models/file_conversion_results_page.py index bd9ce3745..016fd668c 100644 --- a/kittycad/models/file_conversion_results_page.py +++ b/kittycad/models/file_conversion_results_page.py @@ -10,12 +10,14 @@ T = TypeVar("T", bound="FileConversionResultsPage") @attr.s(auto_attribs=True) class FileConversionResultsPage: """ """ + from ...models import FileConversion items: Union[Unset, List[FileConversion]] = UNSET next_page: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + from ...models import FileConversion items: Union[Unset, List[FileConversion]] = UNSET if not isinstance(self.items, Unset): items = self.items @@ -34,6 +36,8 @@ class FileConversionResultsPage: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + from ...models import FileConversion + items = cast(List[FileConversion], d.pop("items", UNSET)) items = cast(List[FileConversion], d.pop("items", UNSET)) next_page = d.pop("next_page", UNSET) diff --git a/kittycad/models/user_results_page.py b/kittycad/models/user_results_page.py index 178a7a8d5..e07589c5a 100644 --- a/kittycad/models/user_results_page.py +++ b/kittycad/models/user_results_page.py @@ -10,12 +10,14 @@ T = TypeVar("T", bound="UserResultsPage") @attr.s(auto_attribs=True) class UserResultsPage: """ """ + from ...models import User items: Union[Unset, List[User]] = UNSET next_page: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + from ...models import User items: Union[Unset, List[User]] = UNSET if not isinstance(self.items, Unset): items = self.items @@ -34,6 +36,8 @@ class UserResultsPage: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + from ...models import User + items = cast(List[User], d.pop("items", UNSET)) items = cast(List[User], d.pop("items", UNSET)) next_page = d.pop("next_page", UNSET)