@ -730,10 +730,23 @@ def generateType(path: str, name: str, schema: dict):
|
||||
property_name +
|
||||
": Union[Unset, bool] = False\n")
|
||||
elif property_type == 'array':
|
||||
f.write(
|
||||
"\t" +
|
||||
property_name +
|
||||
": Union[Unset, array] = []\n")
|
||||
if 'items' in property_schema:
|
||||
if '$ref' in property_schema['items']:
|
||||
property_type = property_schema['items']['$ref']
|
||||
property_type = property_type.replace(
|
||||
'#/components/schemas/', '')
|
||||
f.write(
|
||||
"\t" +
|
||||
property_name +
|
||||
": Union[Unset, List[" +
|
||||
property_type +
|
||||
"]] = UNSET\n")
|
||||
else:
|
||||
print(" array: ", [property_schema])
|
||||
print(" array: ", [property_schema['items']])
|
||||
raise Exception("Unknown array type")
|
||||
else:
|
||||
raise Exception("Unknown array type")
|
||||
else:
|
||||
raise Exception(" unknown type: ", property_type)
|
||||
elif '$ref' in property_schema:
|
||||
@ -821,12 +834,29 @@ def generateType(path: str, name: str, schema: dict):
|
||||
property_name +
|
||||
"\n")
|
||||
elif property_type == 'array':
|
||||
f.write(
|
||||
"\t\t" +
|
||||
property_name +
|
||||
" = self." +
|
||||
property_name +
|
||||
"\n")
|
||||
if 'items' in property_schema:
|
||||
if '$ref' in property_schema['items']:
|
||||
property_type = property_schema['items']['$ref']
|
||||
property_type = property_type.replace(
|
||||
'#/components/schemas/', '')
|
||||
f.write(
|
||||
"\t\t" +
|
||||
property_name +
|
||||
": Union[Unset, List[" +
|
||||
property_type +
|
||||
"]] = UNSET\n")
|
||||
f.write(
|
||||
"\t\tif not isinstance(self." + property_name + ", Unset):\n")
|
||||
f.write(
|
||||
"\t\t\t" +
|
||||
property_name +
|
||||
" = self." +
|
||||
property_name +
|
||||
"\n")
|
||||
else:
|
||||
print(" array: ", [property_schema])
|
||||
print(" array: ", [property_schema['items']])
|
||||
raise Exception("Unknown array type")
|
||||
else:
|
||||
raise Exception(" unknown type: ", property_type)
|
||||
elif '$ref' in property_schema:
|
||||
@ -958,13 +988,22 @@ def generateType(path: str, name: str, schema: dict):
|
||||
"\", UNSET)\n")
|
||||
f.write("\n")
|
||||
elif property_type == 'array':
|
||||
f.write(
|
||||
"\t\t" +
|
||||
property_name +
|
||||
" = d.pop(\"" +
|
||||
property_name +
|
||||
"\", UNSET)\n")
|
||||
f.write("\n")
|
||||
if 'items' in property_schema:
|
||||
if '$ref' in property_schema['items']:
|
||||
property_type = property_schema['items']['$ref']
|
||||
property_type = property_type.replace(
|
||||
'#/components/schemas/', '')
|
||||
f.write(
|
||||
"\t\t" +
|
||||
property_name +
|
||||
" = cast(List["+ property_type + "], d.pop(\"" +
|
||||
property_name +
|
||||
"\", UNSET))\n")
|
||||
f.write("\n")
|
||||
else:
|
||||
print(" array: ", [property_schema])
|
||||
print(" array: ", [property_schema['items']])
|
||||
raise Exception("Unknown array type")
|
||||
else:
|
||||
print(" unknown type: ", property_type)
|
||||
raise Exception(" unknown type: ", property_type)
|
||||
|
@ -10,13 +10,15 @@ T = TypeVar("T", bound="ApiCallWithPriceResultsPage")
|
||||
@attr.s(auto_attribs=True)
|
||||
class ApiCallWithPriceResultsPage:
|
||||
""" """
|
||||
items: Union[Unset, array] = []
|
||||
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]:
|
||||
items = self.items
|
||||
items: Union[Unset, List[ApiCallWithPrice]] = UNSET
|
||||
if not isinstance(self.items, Unset):
|
||||
items = self.items
|
||||
next_page = self.next_page
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
|
@ -10,13 +10,15 @@ T = TypeVar("T", bound="ApiTokenResultsPage")
|
||||
@attr.s(auto_attribs=True)
|
||||
class ApiTokenResultsPage:
|
||||
""" """
|
||||
items: Union[Unset, array] = []
|
||||
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]:
|
||||
items = self.items
|
||||
items: Union[Unset, List[ApiToken]] = UNSET
|
||||
if not isinstance(self.items, Unset):
|
||||
items = self.items
|
||||
next_page = self.next_page
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
|
@ -10,13 +10,15 @@ T = TypeVar("T", bound="ExtendedUserResultsPage")
|
||||
@attr.s(auto_attribs=True)
|
||||
class ExtendedUserResultsPage:
|
||||
""" """
|
||||
items: Union[Unset, array] = []
|
||||
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]:
|
||||
items = self.items
|
||||
items: Union[Unset, List[ExtendedUser]] = UNSET
|
||||
if not isinstance(self.items, Unset):
|
||||
items = self.items
|
||||
next_page = self.next_page
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
|
@ -10,13 +10,15 @@ T = TypeVar("T", bound="FileConversionResultsPage")
|
||||
@attr.s(auto_attribs=True)
|
||||
class FileConversionResultsPage:
|
||||
""" """
|
||||
items: Union[Unset, array] = []
|
||||
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]:
|
||||
items = self.items
|
||||
items: Union[Unset, List[FileConversion]] = UNSET
|
||||
if not isinstance(self.items, Unset):
|
||||
items = self.items
|
||||
next_page = self.next_page
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
|
@ -10,13 +10,15 @@ T = TypeVar("T", bound="UserResultsPage")
|
||||
@attr.s(auto_attribs=True)
|
||||
class UserResultsPage:
|
||||
""" """
|
||||
items: Union[Unset, array] = []
|
||||
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]:
|
||||
items = self.items
|
||||
items: Union[Unset, List[User]] = UNSET
|
||||
if not isinstance(self.items, Unset):
|
||||
items = self.items
|
||||
next_page = self.next_page
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
|
Reference in New Issue
Block a user