update functions;

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2022-02-27 21:48:13 -08:00
parent 2d90bb61be
commit cbf5f4df6d
16 changed files with 544 additions and 481 deletions

View File

@ -87,6 +87,7 @@ def generatePath(
endoint_refs = getEndpointRefs(endpoint, data) endoint_refs = getEndpointRefs(endpoint, data)
parameter_refs = getParameterRefs(endpoint) parameter_refs = getParameterRefs(endpoint)
request_body_refs = getRequestBodyRefs(endpoint) request_body_refs = getRequestBodyRefs(endpoint)
request_body_type = getRequestBodyType(endpoint)
# Add our imports. # Add our imports.
f.write("from typing import Any, Dict, Optional, Union\n") f.write("from typing import Any, Dict, Optional, Union\n")
@ -141,6 +142,11 @@ def generatePath(
": " + ": " +
parameter_type + parameter_type +
",\n") ",\n")
if request_body_type:
f.write(
"\tbody: " +
request_body_type +
",\n")
f.write("\t*,\n") f.write("\t*,\n")
f.write("\tclient: Client,\n") f.write("\tclient: Client,\n")
f.write(") -> Dict[str, Any]:\n") f.write(") -> Dict[str, Any]:\n")
@ -268,6 +274,11 @@ def generatePath(
": " + ": " +
parameter_type + parameter_type +
",\n") ",\n")
if request_body_type:
f.write(
"\tbody: " +
request_body_type +
",\n")
f.write("\t*,\n") f.write("\t*,\n")
f.write("\tclient: Client,\n") f.write("\tclient: Client,\n")
f.write(") -> Response[Union[Any, " + f.write(") -> Response[Union[Any, " +
@ -294,6 +305,9 @@ def generatePath(
"=" + "=" +
camel_to_snake(parameter_name) + camel_to_snake(parameter_name) +
",\n") ",\n")
if request_body_type:
f.write(
"\t\tbody=body,\n")
f.write("\t\tclient=client,\n") f.write("\t\tclient=client,\n")
f.write("\t)\n") f.write("\t)\n")
f.write("\n") f.write("\n")
@ -329,6 +343,11 @@ def generatePath(
": " + ": " +
parameter_type + parameter_type +
",\n") ",\n")
if request_body_type:
f.write(
"\tbody: " +
request_body_type +
",\n")
f.write("\t*,\n") f.write("\t*,\n")
f.write("\tclient: Client,\n") f.write("\tclient: Client,\n")
f.write(") -> Optional[Union[Any, " + f.write(") -> Optional[Union[Any, " +
@ -358,6 +377,9 @@ def generatePath(
"=" + "=" +
camel_to_snake(parameter_name) + camel_to_snake(parameter_name) +
",\n") ",\n")
if request_body_type:
f.write(
"\t\tbody=body,\n")
f.write("\t\tclient=client,\n") f.write("\t\tclient=client,\n")
f.write("\t).parsed\n") f.write("\t).parsed\n")
@ -386,6 +408,11 @@ def generatePath(
": " + ": " +
parameter_type + parameter_type +
",\n") ",\n")
if request_body_type:
f.write(
"\tbody: " +
request_body_type +
",\n")
f.write("\t*,\n") f.write("\t*,\n")
f.write("\tclient: Client,\n") f.write("\tclient: Client,\n")
f.write(") -> Response[Union[Any, " + f.write(") -> Response[Union[Any, " +
@ -412,6 +439,9 @@ def generatePath(
"=" + "=" +
camel_to_snake(parameter_name) + camel_to_snake(parameter_name) +
",\n") ",\n")
if request_body_type:
f.write(
"\t\tbody=body,\n")
f.write("\t\tclient=client,\n") f.write("\t\tclient=client,\n")
f.write("\t)\n") f.write("\t)\n")
f.write("\n") f.write("\n")
@ -445,6 +475,11 @@ def generatePath(
": " + ": " +
parameter_type + parameter_type +
",\n") ",\n")
if request_body_type:
f.write(
"\tbody: " +
request_body_type +
",\n")
f.write("\t*,\n") f.write("\t*,\n")
f.write("\tclient: Client,\n") f.write("\tclient: Client,\n")
f.write(") -> Optional[Union[Any, " + f.write(") -> Optional[Union[Any, " +
@ -475,6 +510,9 @@ def generatePath(
"=" + "=" +
camel_to_snake(parameter_name) + camel_to_snake(parameter_name) +
",\n") ",\n")
if request_body_type:
f.write(
"\t\t\tbody=body,\n")
f.write("\t\t\tclient=client,\n") f.write("\t\t\tclient=client,\n")
f.write("\t\t)\n") f.write("\t\t)\n")
f.write("\t).parsed\n") f.write("\t).parsed\n")
@ -949,6 +987,27 @@ def getRequestBodyRefs(endpoint: dict) -> [str]:
return refs return refs
def getRequestBodyType(endpoint: dict) -> str:
type_name = None
if 'requestBody' in endpoint:
requestBody = endpoint['requestBody']
if 'content' in requestBody:
content = requestBody['content']
for content_type in content:
if content_type == 'application/json':
json = content[content_type]['schema']
if '$ref' in json:
ref = json['$ref'].replace('#/components/schemas/', '')
return ref
elif content_type == 'text/plain':
return 'bytes'
else:
print(" unsupported content type: ", content_type)
raise Exception("unsupported content type")
return type_name
def camel_to_snake(name: str): def camel_to_snake(name: str):
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)

View File

@ -6,7 +6,7 @@ import httpx
from ...client import AuthenticatedClient from ...client import AuthenticatedClient
from ...models.file_conversion import FileConversion from ...models.file_conversion import FileConversion
from ...types import Response from ...types import Response
from ...api.file.file_conversion_by_id import sync as fc_sync, asyncio as fc_asyncio from ...api.file.file_conversion_status import sync as fc_sync, asyncio as fc_asyncio
def sync( def sync(

View File

@ -12,6 +12,7 @@ from ...types import Response
def _get_kwargs( def _get_kwargs(
source_format: ValidSourceFileFormat, source_format: ValidSourceFileFormat,
output_format: ValidOutputFileFormat, output_format: ValidOutputFileFormat,
body: bytes,
*, *,
client: Client, client: Client,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
@ -65,12 +66,14 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConv
def sync_detailed( def sync_detailed(
source_format: ValidSourceFileFormat, source_format: ValidSourceFileFormat,
output_format: ValidOutputFileFormat, output_format: ValidOutputFileFormat,
body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Union[Any, FileConversion, ErrorMessage]]: ) -> Response[Union[Any, FileConversion, ErrorMessage]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
source_format=source_format, source_format=source_format,
output_format=output_format, output_format=output_format,
body=body,
client=client, client=client,
) )
@ -85,6 +88,7 @@ def sync_detailed(
def sync( def sync(
source_format: ValidSourceFileFormat, source_format: ValidSourceFileFormat,
output_format: ValidOutputFileFormat, output_format: ValidOutputFileFormat,
body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[Any, FileConversion, ErrorMessage]]: ) -> Optional[Union[Any, FileConversion, ErrorMessage]]:
@ -93,6 +97,7 @@ def sync(
return sync_detailed( return sync_detailed(
source_format=source_format, source_format=source_format,
output_format=output_format, output_format=output_format,
body=body,
client=client, client=client,
).parsed ).parsed
@ -100,12 +105,14 @@ def sync(
async def asyncio_detailed( async def asyncio_detailed(
source_format: ValidSourceFileFormat, source_format: ValidSourceFileFormat,
output_format: ValidOutputFileFormat, output_format: ValidOutputFileFormat,
body: bytes,
*, *,
client: Client, client: Client,
) -> Response[Union[Any, FileConversion, ErrorMessage]]: ) -> Response[Union[Any, FileConversion, ErrorMessage]]:
kwargs = _get_kwargs( kwargs = _get_kwargs(
source_format=source_format, source_format=source_format,
output_format=output_format, output_format=output_format,
body=body,
client=client, client=client,
) )
@ -118,6 +125,7 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
source_format: ValidSourceFileFormat, source_format: ValidSourceFileFormat,
output_format: ValidOutputFileFormat, output_format: ValidOutputFileFormat,
body: bytes,
*, *,
client: Client, client: Client,
) -> Optional[Union[Any, FileConversion, ErrorMessage]]: ) -> Optional[Union[Any, FileConversion, ErrorMessage]]:
@ -127,6 +135,7 @@ async def asyncio(
await asyncio_detailed( await asyncio_detailed(
source_format=source_format, source_format=source_format,
output_format=output_format, output_format=output_format,
body=body,
client=client, client=client,
) )
).parsed ).parsed

View File

@ -7,7 +7,7 @@ from ...client import AuthenticatedClient
from ...models.file_conversion import FileConversion from ...models.file_conversion import FileConversion
from ...models.valid_file_type import ValidFileType from ...models.valid_file_type import ValidFileType
from ...types import Response from ...types import Response
from ...api.file.file_convert import sync as fc_sync, asyncio as fc_asyncio from ...api.file.post_file_conversion import sync as fc_sync, asyncio as fc_asyncio
def sync( def sync(
source_format: ValidFileType, source_format: ValidFileType,

View File

@ -3,16 +3,16 @@ import pytest
import asyncio import asyncio
from .client import AuthenticatedClientFromEnv from .client import AuthenticatedClientFromEnv
from .models import FileConversion, ValidFileType, AuthSession, InstanceMetadata, Message from .models import FileConversion, ValidOutputFileFormat, ValidSourceFileFormat, AuthSession, InstanceMetadata, Message
from .api.file import file_convert_with_base64_helper from .api.file import post_file_conversion_with_base64_helper
from .api.meta import meta_debug_session, meta_debug_instance, ping from .api.meta import auth_session, instance_metadata, ping
def test_get_session(): def test_get_session():
# Create our client. # Create our client.
client = ClientFromEnv() client = ClientFromEnv()
# Get the session. # Get the session.
session: AuthSession = meta_debug_session.sync(client=client) session: AuthSession = auth_session.sync(client=client)
assert session != None assert session != None
@ -24,7 +24,7 @@ async def test_get_session_async():
client = ClientFromEnv() client = ClientFromEnv()
# Get the session. # Get the session.
session: AuthSession = await meta_debug_session.asyncio(client=client) session: AuthSession = await auth_session.asyncio(client=client)
assert session != None assert session != None
@ -35,7 +35,7 @@ def test_get_instance():
client = ClientFromEnv() client = ClientFromEnv()
# Get the instance. # Get the instance.
instance: InstanceMetadata = meta_debug_instance.sync(client=client) instance: InstanceMetadata = instance_metadata.sync(client=client)
assert instance != None assert instance != None
@ -47,7 +47,7 @@ async def test_get_instance_async():
client = ClientFromEnv() client = ClientFromEnv()
# Get the instance. # Get the instance.
instance: InstanceMetadata = await meta_debug_instance.asyncio(client=client) instance: InstanceMetadata = await instance_metadata.asyncio(client=client)
assert instance != None assert instance != None
@ -86,7 +86,7 @@ def test_file_convert_stl():
file.close() file.close()
# Get the fc. # Get the fc.
fc: FileConversion = file_convert_with_base64_helper.sync(client=client, content=content, source_format=ValidFileType.STL, output_format=ValidFileType.OBJ) fc: FileConversion = post_file_convertsion_with_base64_helper.sync(client=client, content=content, source_format=ValidSourceFileFormat.STL, output_format=ValidOutputFileFormat.OBJ)
assert fc != None assert fc != None
@ -103,7 +103,7 @@ async def test_file_convert_stl_async():
file.close() file.close()
# Get the fc. # Get the fc.
fc: FileConversion = await file_convert_with_base64_helper.asyncio(client=client, content=content, source_format=ValidFileType.STL, output_format=ValidFileType.OBJ) fc: FileConversion = await post_file_convertsion_with_base64_helper.asyncio(client=client, content=content, source_format=ValidSourceFileFormat.STL, output_format=ValidOutputFileFormat.OBJ)
assert fc != None assert fc != None

View File

@ -8,105 +8,105 @@ from ..types import UNSET, Unset
T = TypeVar("T", bound="AuthSession") T = TypeVar("T", bound="AuthSession")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class AuthSession: class AuthSession:
""" """ """ """
created_at: Union[Unset, datetime.datetime] = UNSET created_at: Union[Unset, datetime.datetime] = UNSET
email: Union[Unset, str] = UNSET email: Union[Unset, str] = UNSET
id: Union[Unset, str] = UNSET id: Union[Unset, str] = UNSET
image: Union[Unset, str] = UNSET image: Union[Unset, str] = UNSET
ip_address: Union[Unset, str] = UNSET ip_address: Union[Unset, str] = UNSET
is_valid: Union[Unset, bool] = False is_valid: Union[Unset, bool] = False
token: Union[Unset, str] = UNSET token: Union[Unset, str] = UNSET
user_id: Union[Unset, str] = UNSET user_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
created_at: Union[Unset, str] = UNSET created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset): if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat() created_at = self.created_at.isoformat()
email = self.email email = self.email
id = self.id id = self.id
image = self.image image = self.image
ip_address = self.ip_address ip_address = self.ip_address
is_valid = self.is_valid is_valid = self.is_valid
token = self.token token = self.token
user_id = self.user_id user_id = self.user_id
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if created_at is not UNSET: if created_at is not UNSET:
field_dict['created_at'] = created_at field_dict['created_at'] = created_at
if email is not UNSET: if email is not UNSET:
field_dict['email'] = email field_dict['email'] = email
if id is not UNSET: if id is not UNSET:
field_dict['id'] = id field_dict['id'] = id
if image is not UNSET: if image is not UNSET:
field_dict['image'] = image field_dict['image'] = image
if ip_address is not UNSET: if ip_address is not UNSET:
field_dict['ip_address'] = ip_address field_dict['ip_address'] = ip_address
if is_valid is not UNSET: if is_valid is not UNSET:
field_dict['is_valid'] = is_valid field_dict['is_valid'] = is_valid
if token is not UNSET: if token is not UNSET:
field_dict['token'] = token field_dict['token'] = token
if user_id is not UNSET: if user_id is not UNSET:
field_dict['user_id'] = user_id field_dict['user_id'] = user_id
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
_created_at = d.pop("created_at", UNSET) _created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime] created_at: Union[Unset, datetime.datetime]
if not isinstance(_created_at, Unset): if not isinstance(_created_at, Unset):
created_at = UNSET created_at = UNSET
else: else:
created_at = isoparse(_created_at) created_at = isoparse(_created_at)
email = d.pop("email", UNSET) email = d.pop("email", UNSET)
id = d.pop("id", UNSET) id = d.pop("id", UNSET)
image = d.pop("image", UNSET) image = d.pop("image", UNSET)
ip_address = d.pop("ip_address", UNSET) ip_address = d.pop("ip_address", UNSET)
is_valid = d.pop("is_valid", UNSET) is_valid = d.pop("is_valid", UNSET)
token = d.pop("token", UNSET) token = d.pop("token", UNSET)
user_id = d.pop("user_id", UNSET) user_id = d.pop("user_id", UNSET)
auth_session = cls(
created_at=created_at,
email=email,
id=id,
image=image,
ip_address=ip_address,
is_valid=is_valid,
token=token,
user_id=user_id,
)
auth_session.additional_properties = d auth_session = cls(
return auth_session created_at= created_at,
email= email,
id= id,
image= image,
ip_address= ip_address,
is_valid= is_valid,
token= token,
user_id= user_id,
)
@property auth_session.additional_properties = d
def additional_keys(self) -> List[str]: return auth_session
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any: @property
return self.additional_properties[key] def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __setitem__(self, key: str, value: Any) -> None: def __getitem__(self, key: str) -> Any:
self.additional_properties[key] = value return self.additional_properties[key]
def __delitem__(self, key: str) -> None: def __setitem__(self, key: str, value: Any) -> None:
del self.additional_properties[key] self.additional_properties[key] = value
def __contains__(self, key: str) -> bool: def __delitem__(self, key: str) -> None:
return key in self.additional_properties del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -6,63 +6,63 @@ from ..types import UNSET, Unset
T = TypeVar("T", bound="ErrorMessage") T = TypeVar("T", bound="ErrorMessage")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class ErrorMessage: class ErrorMessage:
""" """ """ """
code: Union[Unset, int] = UNSET code: Union[Unset, int] = UNSET
message: Union[Unset, str] = UNSET message: Union[Unset, str] = UNSET
status: Union[Unset, str] = UNSET status: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
code = self.code code = self.code
message = self.message message = self.message
status = self.status status = self.status
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if code is not UNSET: if code is not UNSET:
field_dict['code'] = code field_dict['code'] = code
if message is not UNSET: if message is not UNSET:
field_dict['message'] = message field_dict['message'] = message
if status is not UNSET: if status is not UNSET:
field_dict['status'] = status field_dict['status'] = status
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
code = d.pop("code", UNSET) code = d.pop("code", UNSET)
message = d.pop("message", UNSET) message = d.pop("message", UNSET)
status = d.pop("status", UNSET) status = d.pop("status", UNSET)
error_message = cls(
code=code,
message=message,
status=status,
)
error_message.additional_properties = d error_message = cls(
return error_message code= code,
message= message,
status= status,
)
@property error_message.additional_properties = d
def additional_keys(self) -> List[str]: return error_message
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any: @property
return self.additional_properties[key] def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __setitem__(self, key: str, value: Any) -> None: def __getitem__(self, key: str) -> Any:
self.additional_properties[key] = value return self.additional_properties[key]
def __delitem__(self, key: str) -> None: def __setitem__(self, key: str, value: Any) -> None:
del self.additional_properties[key] self.additional_properties[key] = value
def __contains__(self, key: str) -> bool: def __delitem__(self, key: str) -> None:
return key in self.additional_properties del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -11,140 +11,140 @@ from ..types import UNSET, Unset
T = TypeVar("T", bound="FileConversion") T = TypeVar("T", bound="FileConversion")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class FileConversion: class FileConversion:
""" """ """ """
completed_at: Union[Unset, datetime.datetime] = UNSET completed_at: Union[Unset, datetime.datetime] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET created_at: Union[Unset, datetime.datetime] = UNSET
id: Union[Unset, str] = UNSET id: Union[Unset, str] = UNSET
output: Union[Unset, str] = UNSET output: Union[Unset, str] = UNSET
output_format: Union[Unset, ValidOutputFileFormat] = UNSET output_format: Union[Unset, ValidOutputFileFormat] = UNSET
src_format: Union[Unset, ValidSourceFileFormat] = UNSET src_format: Union[Unset, ValidSourceFileFormat] = UNSET
started_at: Union[Unset, datetime.datetime] = UNSET started_at: Union[Unset, datetime.datetime] = UNSET
status: Union[Unset, FileConversionStatus] = UNSET status: Union[Unset, FileConversionStatus] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
completed_at: Union[Unset, str] = UNSET completed_at: Union[Unset, str] = UNSET
if not isinstance(self.completed_at, Unset): if not isinstance(self.completed_at, Unset):
completed_at = self.completed_at.isoformat() completed_at = self.completed_at.isoformat()
created_at: Union[Unset, str] = UNSET created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset): if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat() created_at = self.created_at.isoformat()
id = self.id id = self.id
output = self.output output = self.output
output_format: Union[Unset, str] = UNSET output_format: Union[Unset, str] = UNSET
if not isinstance(self.output_format, Unset): if not isinstance(self.output_format, Unset):
output_format = self.output_format.value output_format = self.output_format.value
src_format: Union[Unset, str] = UNSET src_format: Union[Unset, str] = UNSET
if not isinstance(self.src_format, Unset): if not isinstance(self.src_format, Unset):
src_format = self.src_format.value src_format = self.src_format.value
started_at: Union[Unset, str] = UNSET started_at: Union[Unset, str] = UNSET
if not isinstance(self.started_at, Unset): if not isinstance(self.started_at, Unset):
started_at = self.started_at.isoformat() started_at = self.started_at.isoformat()
status: Union[Unset, str] = UNSET status: Union[Unset, str] = UNSET
if not isinstance(self.status, Unset): if not isinstance(self.status, Unset):
status = self.status.value status = self.status.value
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if completed_at is not UNSET: if completed_at is not UNSET:
field_dict['completed_at'] = completed_at field_dict['completed_at'] = completed_at
if created_at is not UNSET: if created_at is not UNSET:
field_dict['created_at'] = created_at field_dict['created_at'] = created_at
if id is not UNSET: if id is not UNSET:
field_dict['id'] = id field_dict['id'] = id
if output is not UNSET: if output is not UNSET:
field_dict['output'] = output field_dict['output'] = output
if output_format is not UNSET: if output_format is not UNSET:
field_dict['output_format'] = output_format field_dict['output_format'] = output_format
if src_format is not UNSET: if src_format is not UNSET:
field_dict['src_format'] = src_format field_dict['src_format'] = src_format
if started_at is not UNSET: if started_at is not UNSET:
field_dict['started_at'] = started_at field_dict['started_at'] = started_at
if status is not UNSET: if status is not UNSET:
field_dict['status'] = status field_dict['status'] = status
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET) _completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime] completed_at: Union[Unset, datetime.datetime]
if not isinstance(_completed_at, Unset): if not isinstance(_completed_at, Unset):
completed_at = UNSET completed_at = UNSET
else: else:
completed_at = isoparse(_completed_at) completed_at = isoparse(_completed_at)
_created_at = d.pop("created_at", UNSET) _created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime] created_at: Union[Unset, datetime.datetime]
if not isinstance(_created_at, Unset): if not isinstance(_created_at, Unset):
created_at = UNSET created_at = UNSET
else: else:
created_at = isoparse(_created_at) created_at = isoparse(_created_at)
id = d.pop("id", UNSET) id = d.pop("id", UNSET)
output = d.pop("output", UNSET) output = d.pop("output", UNSET)
_output_format = d.pop("output_format", UNSET) _output_format = d.pop("output_format", UNSET)
output_format: Union[Unset, ValidOutputFileFormat] output_format: Union[Unset, ValidOutputFileFormat]
if not isinstance(_output_format, Unset): if not isinstance(_output_format, Unset):
output_format = UNSET output_format = UNSET
else: else:
output_format = ValidOutputFileFormat(_output_format) output_format = ValidOutputFileFormat(_output_format)
_src_format = d.pop("src_format", UNSET) _src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, ValidSourceFileFormat] src_format: Union[Unset, ValidSourceFileFormat]
if not isinstance(_src_format, Unset): if not isinstance(_src_format, Unset):
src_format = UNSET src_format = UNSET
else: else:
src_format = ValidSourceFileFormat(_src_format) src_format = ValidSourceFileFormat(_src_format)
_started_at = d.pop("started_at", UNSET) _started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime] started_at: Union[Unset, datetime.datetime]
if not isinstance(_started_at, Unset): if not isinstance(_started_at, Unset):
started_at = UNSET started_at = UNSET
else: else:
started_at = isoparse(_started_at) started_at = isoparse(_started_at)
_status = d.pop("status", UNSET) _status = d.pop("status", UNSET)
status: Union[Unset, FileConversionStatus] status: Union[Unset, FileConversionStatus]
if not isinstance(_status, Unset): if not isinstance(_status, Unset):
status = UNSET status = UNSET
else: else:
status = FileConversionStatus(_status) status = FileConversionStatus(_status)
file_conversion = cls(
completed_at=completed_at,
created_at=created_at,
id=id,
output=output,
output_format=output_format,
src_format=src_format,
started_at=started_at,
status=status,
)
file_conversion.additional_properties = d file_conversion = cls(
return file_conversion completed_at= completed_at,
created_at= created_at,
id= id,
output= output,
output_format= output_format,
src_format= src_format,
started_at= started_at,
status= status,
)
@property file_conversion.additional_properties = d
def additional_keys(self) -> List[str]: return file_conversion
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any: @property
return self.additional_properties[key] def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __setitem__(self, key: str, value: Any) -> None: def __getitem__(self, key: str) -> Any:
self.additional_properties[key] = value return self.additional_properties[key]
def __delitem__(self, key: str) -> None: def __setitem__(self, key: str, value: Any) -> None:
del self.additional_properties[key] self.additional_properties[key] = value
def __contains__(self, key: str) -> bool: def __delitem__(self, key: str) -> None:
return key in self.additional_properties del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -1,12 +1,11 @@
from enum import Enum from enum import Enum
class FileConversionStatus(str, Enum): class FileConversionStatus(str, Enum):
QUEUED = 'Queued' QUEUED = 'Queued'
UPLOADED = 'Uploaded' UPLOADED = 'Uploaded'
IN _PROGRESS = 'In Progress' IN _PROGRESS = 'In Progress'
COMPLETED = 'Completed' COMPLETED = 'Completed'
FAILED = 'Failed' FAILED = 'Failed'
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -6,77 +6,77 @@ from ..types import UNSET, Unset
T = TypeVar("T", bound="GPUDevice") T = TypeVar("T", bound="GPUDevice")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class GPUDevice: class GPUDevice:
""" """ """ """
id: Union[Unset, int] = UNSET id: Union[Unset, int] = UNSET
memory_bus_width: Union[Unset, int] = UNSET memory_bus_width: Union[Unset, int] = UNSET
memory_clock_rate: Union[Unset, int] = UNSET memory_clock_rate: Union[Unset, int] = UNSET
name: Union[Unset, str] = UNSET name: Union[Unset, str] = UNSET
peak_memory_bandwidth: Union[Unset, int] = UNSET peak_memory_bandwidth: Union[Unset, int] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
id = self.id id = self.id
memory_bus_width = self.memory_bus_width memory_bus_width = self.memory_bus_width
memory_clock_rate = self.memory_clock_rate memory_clock_rate = self.memory_clock_rate
name = self.name name = self.name
peak_memory_bandwidth = self.peak_memory_bandwidth peak_memory_bandwidth = self.peak_memory_bandwidth
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if id is not UNSET: if id is not UNSET:
field_dict['id'] = id field_dict['id'] = id
if memory_bus_width is not UNSET: if memory_bus_width is not UNSET:
field_dict['memory_bus_width'] = memory_bus_width field_dict['memory_bus_width'] = memory_bus_width
if memory_clock_rate is not UNSET: if memory_clock_rate is not UNSET:
field_dict['memory_clock_rate'] = memory_clock_rate field_dict['memory_clock_rate'] = memory_clock_rate
if name is not UNSET: if name is not UNSET:
field_dict['name'] = name field_dict['name'] = name
if peak_memory_bandwidth is not UNSET: if peak_memory_bandwidth is not UNSET:
field_dict['peak_memory_bandwidth'] = peak_memory_bandwidth field_dict['peak_memory_bandwidth'] = peak_memory_bandwidth
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
id = d.pop("id", UNSET) id = d.pop("id", UNSET)
memory_bus_width = d.pop("memory_bus_width", UNSET) memory_bus_width = d.pop("memory_bus_width", UNSET)
memory_clock_rate = d.pop("memory_clock_rate", UNSET) memory_clock_rate = d.pop("memory_clock_rate", UNSET)
name = d.pop("name", UNSET) name = d.pop("name", UNSET)
peak_memory_bandwidth = d.pop("peak_memory_bandwidth", UNSET) peak_memory_bandwidth = d.pop("peak_memory_bandwidth", UNSET)
gpu_device = cls(
id=id,
memory_bus_width=memory_bus_width,
memory_clock_rate=memory_clock_rate,
name=name,
peak_memory_bandwidth=peak_memory_bandwidth,
)
gpu_device.additional_properties = d gpu_device = cls(
return gpu_device id= id,
memory_bus_width= memory_bus_width,
memory_clock_rate= memory_clock_rate,
name= name,
peak_memory_bandwidth= peak_memory_bandwidth,
)
@property gpu_device.additional_properties = d
def additional_keys(self) -> List[str]: return gpu_device
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any: @property
return self.additional_properties[key] def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __setitem__(self, key: str, value: Any) -> None: def __getitem__(self, key: str) -> Any:
self.additional_properties[key] = value return self.additional_properties[key]
def __delitem__(self, key: str) -> None: def __setitem__(self, key: str, value: Any) -> None:
del self.additional_properties[key] self.additional_properties[key] = value
def __contains__(self, key: str) -> bool: def __delitem__(self, key: str) -> None:
return key in self.additional_properties del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -7,126 +7,126 @@ from ..types import UNSET, Unset
T = TypeVar("T", bound="Instance") T = TypeVar("T", bound="Instance")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class Instance: class Instance:
""" """ """ """
cpu_platform: Union[Unset, str] = UNSET cpu_platform: Union[Unset, str] = UNSET
description: Union[Unset, str] = UNSET description: Union[Unset, str] = UNSET
environment: Union[Unset, ServerEnv] = UNSET environment: Union[Unset, ServerEnv] = UNSET
git_hash: Union[Unset, str] = UNSET git_hash: Union[Unset, str] = UNSET
hostname: Union[Unset, str] = UNSET hostname: Union[Unset, str] = UNSET
id: Union[Unset, str] = UNSET id: Union[Unset, str] = UNSET
image: Union[Unset, str] = UNSET image: Union[Unset, str] = UNSET
ip_address: Union[Unset, str] = UNSET ip_address: Union[Unset, str] = UNSET
machine_type: Union[Unset, str] = UNSET machine_type: Union[Unset, str] = UNSET
name: Union[Unset, str] = UNSET name: Union[Unset, str] = UNSET
zone: Union[Unset, str] = UNSET zone: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
cpu_platform = self.cpu_platform cpu_platform = self.cpu_platform
description = self.description description = self.description
environment: Union[Unset, str] = UNSET environment: Union[Unset, str] = UNSET
if not isinstance(self.environment, Unset): if not isinstance(self.environment, Unset):
environment = self.environment.value environment = self.environment.value
git_hash = self.git_hash git_hash = self.git_hash
hostname = self.hostname hostname = self.hostname
id = self.id id = self.id
image = self.image image = self.image
ip_address = self.ip_address ip_address = self.ip_address
machine_type = self.machine_type machine_type = self.machine_type
name = self.name name = self.name
zone = self.zone zone = self.zone
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if cpu_platform is not UNSET: if cpu_platform is not UNSET:
field_dict['cpu_platform'] = cpu_platform field_dict['cpu_platform'] = cpu_platform
if description is not UNSET: if description is not UNSET:
field_dict['description'] = description field_dict['description'] = description
if environment is not UNSET: if environment is not UNSET:
field_dict['environment'] = environment field_dict['environment'] = environment
if git_hash is not UNSET: if git_hash is not UNSET:
field_dict['git_hash'] = git_hash field_dict['git_hash'] = git_hash
if hostname is not UNSET: if hostname is not UNSET:
field_dict['hostname'] = hostname field_dict['hostname'] = hostname
if id is not UNSET: if id is not UNSET:
field_dict['id'] = id field_dict['id'] = id
if image is not UNSET: if image is not UNSET:
field_dict['image'] = image field_dict['image'] = image
if ip_address is not UNSET: if ip_address is not UNSET:
field_dict['ip_address'] = ip_address field_dict['ip_address'] = ip_address
if machine_type is not UNSET: if machine_type is not UNSET:
field_dict['machine_type'] = machine_type field_dict['machine_type'] = machine_type
if name is not UNSET: if name is not UNSET:
field_dict['name'] = name field_dict['name'] = name
if zone is not UNSET: if zone is not UNSET:
field_dict['zone'] = zone field_dict['zone'] = zone
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
cpu_platform = d.pop("cpu_platform", UNSET) cpu_platform = d.pop("cpu_platform", UNSET)
description = d.pop("description", UNSET) description = d.pop("description", UNSET)
_environment = d.pop("environment", UNSET) _environment = d.pop("environment", UNSET)
environment: Union[Unset, ServerEnv] environment: Union[Unset, ServerEnv]
if not isinstance(_environment, Unset): if not isinstance(_environment, Unset):
environment = UNSET environment = UNSET
else: else:
environment = ServerEnv(_environment) environment = ServerEnv(_environment)
git_hash = d.pop("git_hash", UNSET) git_hash = d.pop("git_hash", UNSET)
hostname = d.pop("hostname", UNSET) hostname = d.pop("hostname", UNSET)
id = d.pop("id", UNSET) id = d.pop("id", UNSET)
image = d.pop("image", UNSET) image = d.pop("image", UNSET)
ip_address = d.pop("ip_address", UNSET) ip_address = d.pop("ip_address", UNSET)
machine_type = d.pop("machine_type", UNSET) machine_type = d.pop("machine_type", UNSET)
name = d.pop("name", UNSET) name = d.pop("name", UNSET)
zone = d.pop("zone", UNSET) zone = d.pop("zone", UNSET)
instance = cls(
cpu_platform=cpu_platform,
description=description,
environment=environment,
git_hash=git_hash,
hostname=hostname,
id=id,
image=image,
ip_address=ip_address,
machine_type=machine_type,
name=name,
zone=zone,
)
instance.additional_properties = d instance = cls(
return instance cpu_platform= cpu_platform,
description= description,
environment= environment,
git_hash= git_hash,
hostname= hostname,
id= id,
image= image,
ip_address= ip_address,
machine_type= machine_type,
name= name,
zone= zone,
)
@property instance.additional_properties = d
def additional_keys(self) -> List[str]: return instance
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any: @property
return self.additional_properties[key] def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __setitem__(self, key: str, value: Any) -> None: def __getitem__(self, key: str) -> Any:
self.additional_properties[key] = value return self.additional_properties[key]
def __delitem__(self, key: str) -> None: def __setitem__(self, key: str, value: Any) -> None:
del self.additional_properties[key] self.additional_properties[key] = value
def __contains__(self, key: str) -> bool: def __delitem__(self, key: str) -> None:
return key in self.additional_properties del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -1,8 +1,7 @@
from enum import Enum from enum import Enum
class PongEnum(str, Enum): class PongEnum(str, Enum):
PONG = 'pong' PONG = 'pong'
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -7,56 +7,56 @@ from ..types import UNSET, Unset
T = TypeVar("T", bound="PongMessage") T = TypeVar("T", bound="PongMessage")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class PongMessage: class PongMessage:
""" """ """ """
message: Union[Unset, PongEnum] = UNSET message: Union[Unset, PongEnum] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
message: Union[Unset, str] = UNSET message: Union[Unset, str] = UNSET
if not isinstance(self.message, Unset): if not isinstance(self.message, Unset):
message = self.message.value message = self.message.value
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if message is not UNSET: if message is not UNSET:
field_dict['message'] = message field_dict['message'] = message
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
_message = d.pop("message", UNSET) _message = d.pop("message", UNSET)
message: Union[Unset, PongEnum] message: Union[Unset, PongEnum]
if not isinstance(_message, Unset): if not isinstance(_message, Unset):
message = UNSET message = UNSET
else: else:
message = PongEnum(_message) message = PongEnum(_message)
pong_message = cls(
message=message,
)
pong_message.additional_properties = d pong_message = cls(
return pong_message message= message,
)
@property pong_message.additional_properties = d
def additional_keys(self) -> List[str]: return pong_message
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any: @property
return self.additional_properties[key] def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __setitem__(self, key: str, value: Any) -> None: def __getitem__(self, key: str) -> Any:
self.additional_properties[key] = value return self.additional_properties[key]
def __delitem__(self, key: str) -> None: def __setitem__(self, key: str, value: Any) -> None:
del self.additional_properties[key] self.additional_properties[key] = value
def __contains__(self, key: str) -> bool: def __delitem__(self, key: str) -> None:
return key in self.additional_properties del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -1,10 +1,9 @@
from enum import Enum from enum import Enum
class ServerEnv(str, Enum): class ServerEnv(str, Enum):
PRODUCTION = 'production' PRODUCTION = 'production'
DEVELOPMENT = 'development' DEVELOPMENT = 'development'
PREVIEW = 'preview' PREVIEW = 'preview'
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -1,13 +1,12 @@
from enum import Enum from enum import Enum
class ValidOutputFileFormat(str, Enum): class ValidOutputFileFormat(str, Enum):
STL = 'stl' STL = 'stl'
OBJ = 'obj' OBJ = 'obj'
DAE = 'dae' DAE = 'dae'
STEP = 'step' STEP = 'step'
FBX = 'fbx' FBX = 'fbx'
FBXB = 'fbxb' FBXB = 'fbxb'
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -1,12 +1,11 @@
from enum import Enum from enum import Enum
class ValidSourceFileFormat(str, Enum): class ValidSourceFileFormat(str, Enum):
STL = 'stl' STL = 'stl'
OBJ = 'obj' OBJ = 'obj'
DAE = 'dae' DAE = 'dae'
STEP = 'step' STEP = 'step'
FBX = 'fbx' FBX = 'fbx'
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)