Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2022-04-06 23:12:58 -07:00
parent 5bcbf4251b
commit 429c341f84
6 changed files with 38 additions and 0 deletions

View File

@ -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 +

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)