diff --git a/Makefile b/Makefile index 2b0a16b9b..86d316630 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ generate: docker-image ## Generate the api client. --name python-generator \ -v $(CURDIR):/usr/src \ --workdir /usr/src \ - $(DOCKER_IMAGE_NAME) poetry run python generate/generate.py + $(DOCKER_IMAGE_NAME) poetry run python generate/generate.py && poetry run autopep8 --in-place --aggressive --aggressive kittycad/models/*.py && autopep8 --in-place --aggressive --aggressive kittycad/api/*.py .PHONY: shell shell: docker-image ## Pop into a shell in the docker image. diff --git a/kittycad/models/auth_session.py b/kittycad/models/auth_session.py index 063046193..6cfcd299e 100644 --- a/kittycad/models/auth_session.py +++ b/kittycad/models/auth_session.py @@ -8,107 +8,105 @@ from ..types import UNSET, Unset T = TypeVar("T", bound="AuthSession") - @attr.s(auto_attribs=True) class AuthSession: - """ """ - created_at: Union[Unset, datetime.datetime] = UNSET - email: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - image: Union[Unset, str] = UNSET - ip_address: Union[Unset, str] = UNSET - is_valid: Union[Unset, bool] = False - token: Union[Unset, str] = UNSET - user_id: Union[Unset, str] = UNSET + """ """ + created_at: Union[Unset, datetime.datetime] = UNSET + email: Union[Unset, str] = UNSET + id: Union[Unset, str] = UNSET + image: Union[Unset, str] = UNSET + ip_address: Union[Unset, str] = UNSET + is_valid: Union[Unset, bool] = False + token: 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]: - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - email = self.email - id = self.id - image = self.image - ip_address = self.ip_address - is_valid = self.is_valid - token = self.token - user_id = self.user_id + def to_dict(self) -> Dict[str, Any]: + created_at: Union[Unset, str] = UNSET + if not isinstance(self.created_at, Unset): + created_at = self.created_at.isoformat() + email = self.email + id = self.id + image = self.image + ip_address = self.ip_address + is_valid = self.is_valid + token = self.token + user_id = self.user_id - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if created_at is not UNSET: - field_dict['created_at'] = created_at - if email is not UNSET: - field_dict['email'] = email - if id is not UNSET: - field_dict['id'] = id - if image is not UNSET: - field_dict['image'] = image - if ip_address is not UNSET: - field_dict['ip_address'] = ip_address - if is_valid is not UNSET: - field_dict['is_valid'] = is_valid - if token is not UNSET: - field_dict['token'] = token - if user_id is not UNSET: - field_dict['user_id'] = user_id + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if created_at is not UNSET: + field_dict['created_at'] = created_at + if email is not UNSET: + field_dict['email'] = email + if id is not UNSET: + field_dict['id'] = id + if image is not UNSET: + field_dict['image'] = image + if ip_address is not UNSET: + field_dict['ip_address'] = ip_address + if is_valid is not UNSET: + field_dict['is_valid'] = is_valid + if token is not UNSET: + field_dict['token'] = token + if user_id is not UNSET: + field_dict['user_id'] = user_id - return field_dict + return field_dict - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if not isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _created_at = d.pop("created_at", UNSET) + created_at: Union[Unset, datetime.datetime] + if not isinstance(_created_at, Unset): + created_at = UNSET + else: + 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) - - 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 + 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 return auth_session - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/kittycad/models/error_message.py b/kittycad/models/error_message.py index 003f3e6f5..b089e10ea 100644 --- a/kittycad/models/error_message.py +++ b/kittycad/models/error_message.py @@ -6,65 +6,63 @@ from ..types import UNSET, Unset T = TypeVar("T", bound="ErrorMessage") - @attr.s(auto_attribs=True) class ErrorMessage: - """ """ - code: Union[Unset, int] = UNSET - message: Union[Unset, str] = UNSET - status: Union[Unset, str] = UNSET + """ """ + code: Union[Unset, int] = UNSET + message: 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]: - code = self.code - message = self.message - status = self.status + def to_dict(self) -> Dict[str, Any]: + code = self.code + message = self.message + status = self.status - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if code is not UNSET: - field_dict['code'] = code - if message is not UNSET: - field_dict['message'] = message - if status is not UNSET: - field_dict['status'] = status + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if code is not UNSET: + field_dict['code'] = code + if message is not UNSET: + field_dict['message'] = message + if status is not UNSET: + field_dict['status'] = status - return field_dict + return field_dict - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - code = d.pop("code", UNSET) + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + code = d.pop("code", UNSET) - message = d.pop("message", UNSET) + message = d.pop("message", UNSET) - status = d.pop("status", UNSET) - - error_message = cls( - code=code, - message=message, - status=status, - ) - - error_message.additional_properties = d + status = d.pop("status", UNSET) + error_message = cls( + code= code, + message= message, + status= status, + ) + + error_message.additional_properties = d return error_message - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/kittycad/models/file_conversion.py b/kittycad/models/file_conversion.py index d507925b9..5678c5229 100644 --- a/kittycad/models/file_conversion.py +++ b/kittycad/models/file_conversion.py @@ -11,142 +11,140 @@ from ..types import UNSET, Unset T = TypeVar("T", bound="FileConversion") - @attr.s(auto_attribs=True) class FileConversion: - """ """ - completed_at: Union[Unset, datetime.datetime] = UNSET - created_at: Union[Unset, datetime.datetime] = UNSET - id: Union[Unset, str] = UNSET - output: Union[Unset, str] = UNSET - output_format: Union[Unset, ValidOutputFileFormat] = UNSET - src_format: Union[Unset, ValidSourceFileFormat] = UNSET - started_at: Union[Unset, datetime.datetime] = UNSET - status: Union[Unset, FileConversionStatus] = UNSET + """ """ + completed_at: Union[Unset, datetime.datetime] = UNSET + created_at: Union[Unset, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + output: Union[Unset, str] = UNSET + output_format: Union[Unset, ValidOutputFileFormat] = UNSET + src_format: Union[Unset, ValidSourceFileFormat] = UNSET + started_at: Union[Unset, datetime.datetime] = 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]: - completed_at: Union[Unset, str] = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - created_at: Union[Unset, str] = UNSET - if not isinstance(self.created_at, Unset): - created_at = self.created_at.isoformat() - id = self.id - output = self.output - output_format: Union[Unset, str] = UNSET - if not isinstance(self.output_format, Unset): - output_format = self.output_format.value - src_format: Union[Unset, str] = UNSET - if not isinstance(self.src_format, Unset): - src_format = self.src_format.value - started_at: Union[Unset, str] = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - status: Union[Unset, str] = UNSET - if not isinstance(self.status, Unset): - status = self.status.value + def to_dict(self) -> Dict[str, Any]: + completed_at: Union[Unset, str] = UNSET + if not isinstance(self.completed_at, Unset): + completed_at = self.completed_at.isoformat() + created_at: Union[Unset, str] = UNSET + if not isinstance(self.created_at, Unset): + created_at = self.created_at.isoformat() + id = self.id + output = self.output + output_format: Union[Unset, str] = UNSET + if not isinstance(self.output_format, Unset): + output_format = self.output_format.value + src_format: Union[Unset, str] = UNSET + if not isinstance(self.src_format, Unset): + src_format = self.src_format.value + started_at: Union[Unset, str] = UNSET + if not isinstance(self.started_at, Unset): + started_at = self.started_at.isoformat() + status: Union[Unset, str] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if completed_at is not UNSET: - field_dict['completed_at'] = completed_at - if created_at is not UNSET: - field_dict['created_at'] = created_at - if id is not UNSET: - field_dict['id'] = id - if output is not UNSET: - field_dict['output'] = output - if output_format is not UNSET: - field_dict['output_format'] = output_format - if src_format is not UNSET: - field_dict['src_format'] = src_format - if started_at is not UNSET: - field_dict['started_at'] = started_at - if status is not UNSET: - field_dict['status'] = status + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if completed_at is not UNSET: + field_dict['completed_at'] = completed_at + if created_at is not UNSET: + field_dict['created_at'] = created_at + if id is not UNSET: + field_dict['id'] = id + if output is not UNSET: + field_dict['output'] = output + if output_format is not UNSET: + field_dict['output_format'] = output_format + if src_format is not UNSET: + field_dict['src_format'] = src_format + if started_at is not UNSET: + field_dict['started_at'] = started_at + if status is not UNSET: + field_dict['status'] = status - return field_dict + return field_dict - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - _completed_at = d.pop("completed_at", UNSET) - completed_at: Union[Unset, datetime.datetime] - if not isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = isoparse(_completed_at) + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _completed_at = d.pop("completed_at", UNSET) + completed_at: Union[Unset, datetime.datetime] + if not isinstance(_completed_at, Unset): + completed_at = UNSET + else: + completed_at = isoparse(_completed_at) - _created_at = d.pop("created_at", UNSET) - created_at: Union[Unset, datetime.datetime] - if not isinstance(_created_at, Unset): - created_at = UNSET - else: - created_at = isoparse(_created_at) + _created_at = d.pop("created_at", UNSET) + created_at: Union[Unset, datetime.datetime] + if not isinstance(_created_at, Unset): + created_at = UNSET + else: + 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: Union[Unset, ValidOutputFileFormat] - if not isinstance(_output_format, Unset): - output_format = UNSET - else: - output_format = ValidOutputFileFormat(_output_format) + _output_format = d.pop("output_format", UNSET) + output_format: Union[Unset, ValidOutputFileFormat] + if not isinstance(_output_format, Unset): + output_format = UNSET + else: + output_format = ValidOutputFileFormat(_output_format) - _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, ValidSourceFileFormat] - if not isinstance(_src_format, Unset): - src_format = UNSET - else: - src_format = ValidSourceFileFormat(_src_format) + _src_format = d.pop("src_format", UNSET) + src_format: Union[Unset, ValidSourceFileFormat] + if not isinstance(_src_format, Unset): + src_format = UNSET + else: + src_format = ValidSourceFileFormat(_src_format) - _started_at = d.pop("started_at", UNSET) - started_at: Union[Unset, datetime.datetime] - if not isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = isoparse(_started_at) + _started_at = d.pop("started_at", UNSET) + started_at: Union[Unset, datetime.datetime] + if not isinstance(_started_at, Unset): + started_at = UNSET + else: + started_at = isoparse(_started_at) - _status = d.pop("status", UNSET) - status: Union[Unset, FileConversionStatus] - if not isinstance(_status, Unset): - status = UNSET - else: - 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 + _status = d.pop("status", UNSET) + status: Union[Unset, FileConversionStatus] + if not isinstance(_status, Unset): + status = UNSET + else: + 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 return file_conversion - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/kittycad/models/file_conversion_status.py b/kittycad/models/file_conversion_status.py index 1154e996d..dcc026959 100644 --- a/kittycad/models/file_conversion_status.py +++ b/kittycad/models/file_conversion_status.py @@ -1,12 +1,11 @@ from enum import Enum - class FileConversionStatus(str, Enum): - QUEUED = 'Queued' - UPLOADED = 'Uploaded' - IN _PROGRESS = 'In Progress' - COMPLETED = 'Completed' - FAILED = 'Failed' + QUEUED = 'Queued' + UPLOADED = 'Uploaded' + IN _PROGRESS = 'In Progress' + COMPLETED = 'Completed' + FAILED = 'Failed' - def __str__(self) -> str: - return str(self.value) + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/gpu_device.py b/kittycad/models/gpu_device.py index 72827a22a..069a0cf72 100644 --- a/kittycad/models/gpu_device.py +++ b/kittycad/models/gpu_device.py @@ -6,79 +6,77 @@ from ..types import UNSET, Unset T = TypeVar("T", bound="GPUDevice") - @attr.s(auto_attribs=True) class GPUDevice: - """ """ - id: Union[Unset, int] = UNSET - memory_bus_width: Union[Unset, int] = UNSET - memory_clock_rate: Union[Unset, int] = UNSET - name: Union[Unset, str] = UNSET - peak_memory_bandwidth: Union[Unset, int] = UNSET + """ """ + id: Union[Unset, int] = UNSET + memory_bus_width: Union[Unset, int] = UNSET + memory_clock_rate: Union[Unset, int] = UNSET + name: Union[Unset, str] = 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]: - id = self.id - memory_bus_width = self.memory_bus_width - memory_clock_rate = self.memory_clock_rate - name = self.name - peak_memory_bandwidth = self.peak_memory_bandwidth + def to_dict(self) -> Dict[str, Any]: + id = self.id + memory_bus_width = self.memory_bus_width + memory_clock_rate = self.memory_clock_rate + name = self.name + peak_memory_bandwidth = self.peak_memory_bandwidth - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if id is not UNSET: - field_dict['id'] = id - if memory_bus_width is not UNSET: - field_dict['memory_bus_width'] = memory_bus_width - if memory_clock_rate is not UNSET: - field_dict['memory_clock_rate'] = memory_clock_rate - if name is not UNSET: - field_dict['name'] = name - if peak_memory_bandwidth is not UNSET: - field_dict['peak_memory_bandwidth'] = peak_memory_bandwidth + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict['id'] = id + if memory_bus_width is not UNSET: + field_dict['memory_bus_width'] = memory_bus_width + if memory_clock_rate is not UNSET: + field_dict['memory_clock_rate'] = memory_clock_rate + if name is not UNSET: + field_dict['name'] = name + if peak_memory_bandwidth is not UNSET: + field_dict['peak_memory_bandwidth'] = peak_memory_bandwidth - return field_dict + return field_dict - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - id = d.pop("id", UNSET) + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + 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) - - 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 + 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 return gpu_device - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/kittycad/models/instance.py b/kittycad/models/instance.py index aa3d66b10..2b2122934 100644 --- a/kittycad/models/instance.py +++ b/kittycad/models/instance.py @@ -7,128 +7,126 @@ from ..types import UNSET, Unset T = TypeVar("T", bound="Instance") - @attr.s(auto_attribs=True) class Instance: - """ """ - cpu_platform: Union[Unset, str] = UNSET - description: Union[Unset, str] = UNSET - environment: Union[Unset, ServerEnv] = UNSET - git_hash: Union[Unset, str] = UNSET - hostname: Union[Unset, str] = UNSET - id: Union[Unset, str] = UNSET - image: Union[Unset, str] = UNSET - ip_address: Union[Unset, str] = UNSET - machine_type: Union[Unset, str] = UNSET - name: Union[Unset, str] = UNSET - zone: Union[Unset, str] = UNSET + """ """ + cpu_platform: Union[Unset, str] = UNSET + description: Union[Unset, str] = UNSET + environment: Union[Unset, ServerEnv] = UNSET + git_hash: Union[Unset, str] = UNSET + hostname: Union[Unset, str] = UNSET + id: Union[Unset, str] = UNSET + image: Union[Unset, str] = UNSET + ip_address: Union[Unset, str] = UNSET + machine_type: Union[Unset, str] = UNSET + name: 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]: - cpu_platform = self.cpu_platform - description = self.description - environment: Union[Unset, str] = UNSET - if not isinstance(self.environment, Unset): - environment = self.environment.value - git_hash = self.git_hash - hostname = self.hostname - id = self.id - image = self.image - ip_address = self.ip_address - machine_type = self.machine_type - name = self.name - zone = self.zone + def to_dict(self) -> Dict[str, Any]: + cpu_platform = self.cpu_platform + description = self.description + environment: Union[Unset, str] = UNSET + if not isinstance(self.environment, Unset): + environment = self.environment.value + git_hash = self.git_hash + hostname = self.hostname + id = self.id + image = self.image + ip_address = self.ip_address + machine_type = self.machine_type + name = self.name + zone = self.zone - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if cpu_platform is not UNSET: - field_dict['cpu_platform'] = cpu_platform - if description is not UNSET: - field_dict['description'] = description - if environment is not UNSET: - field_dict['environment'] = environment - if git_hash is not UNSET: - field_dict['git_hash'] = git_hash - if hostname is not UNSET: - field_dict['hostname'] = hostname - if id is not UNSET: - field_dict['id'] = id - if image is not UNSET: - field_dict['image'] = image - if ip_address is not UNSET: - field_dict['ip_address'] = ip_address - if machine_type is not UNSET: - field_dict['machine_type'] = machine_type - if name is not UNSET: - field_dict['name'] = name - if zone is not UNSET: - field_dict['zone'] = zone + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if cpu_platform is not UNSET: + field_dict['cpu_platform'] = cpu_platform + if description is not UNSET: + field_dict['description'] = description + if environment is not UNSET: + field_dict['environment'] = environment + if git_hash is not UNSET: + field_dict['git_hash'] = git_hash + if hostname is not UNSET: + field_dict['hostname'] = hostname + if id is not UNSET: + field_dict['id'] = id + if image is not UNSET: + field_dict['image'] = image + if ip_address is not UNSET: + field_dict['ip_address'] = ip_address + if machine_type is not UNSET: + field_dict['machine_type'] = machine_type + if name is not UNSET: + field_dict['name'] = name + if zone is not UNSET: + field_dict['zone'] = zone - return field_dict + return field_dict - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - cpu_platform = d.pop("cpu_platform", UNSET) + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + cpu_platform = d.pop("cpu_platform", UNSET) - description = d.pop("description", UNSET) + description = d.pop("description", UNSET) - _environment = d.pop("environment", UNSET) - environment: Union[Unset, ServerEnv] - if not isinstance(_environment, Unset): - environment = UNSET - else: - environment = ServerEnv(_environment) + _environment = d.pop("environment", UNSET) + environment: Union[Unset, ServerEnv] + if not isinstance(_environment, Unset): + environment = UNSET + else: + 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) - - 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 + 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 return instance - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/kittycad/models/pong_enum.py b/kittycad/models/pong_enum.py index eabdf457c..32940a120 100644 --- a/kittycad/models/pong_enum.py +++ b/kittycad/models/pong_enum.py @@ -1,8 +1,7 @@ from enum import Enum - class PongEnum(str, Enum): - PONG = 'pong' + PONG = 'pong' - def __str__(self) -> str: - return str(self.value) + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/pong_message.py b/kittycad/models/pong_message.py index 36b128ef2..bbd2d9f7a 100644 --- a/kittycad/models/pong_message.py +++ b/kittycad/models/pong_message.py @@ -7,58 +7,56 @@ from ..types import UNSET, Unset T = TypeVar("T", bound="PongMessage") - @attr.s(auto_attribs=True) 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]: - message: Union[Unset, str] = UNSET - if not isinstance(self.message, Unset): - message = self.message.value + def to_dict(self) -> Dict[str, Any]: + message: Union[Unset, str] = UNSET + if not isinstance(self.message, Unset): + message = self.message.value - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if message is not UNSET: - field_dict['message'] = message + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict['message'] = message - return field_dict + return field_dict - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - _message = d.pop("message", UNSET) - message: Union[Unset, PongEnum] - if not isinstance(_message, Unset): - message = UNSET - else: - message = PongEnum(_message) - - pong_message = cls( - message=message, - ) - - pong_message.additional_properties = d + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _message = d.pop("message", UNSET) + message: Union[Unset, PongEnum] + if not isinstance(_message, Unset): + message = UNSET + else: + message = PongEnum(_message) + pong_message = cls( + message= message, + ) + + pong_message.additional_properties = d return pong_message - @property - def additional_keys(self) -> List[str]: - return list(self.additional_properties.keys()) + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] - def __contains__(self, key: str) -> bool: - return key in self.additional_properties + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/kittycad/models/server_env.py b/kittycad/models/server_env.py index 8822a3791..5b37c9852 100644 --- a/kittycad/models/server_env.py +++ b/kittycad/models/server_env.py @@ -1,10 +1,9 @@ from enum import Enum - class ServerEnv(str, Enum): - PRODUCTION = 'production' - DEVELOPMENT = 'development' - PREVIEW = 'preview' + PRODUCTION = 'production' + DEVELOPMENT = 'development' + PREVIEW = 'preview' - def __str__(self) -> str: - return str(self.value) + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/valid_output_file_format.py b/kittycad/models/valid_output_file_format.py index 78194f2e3..8059e58cd 100644 --- a/kittycad/models/valid_output_file_format.py +++ b/kittycad/models/valid_output_file_format.py @@ -1,13 +1,12 @@ from enum import Enum - class ValidOutputFileFormat(str, Enum): - STL = 'stl' - OBJ = 'obj' - DAE = 'dae' - STEP = 'step' - FBX = 'fbx' - FBXB = 'fbxb' + STL = 'stl' + OBJ = 'obj' + DAE = 'dae' + STEP = 'step' + FBX = 'fbx' + FBXB = 'fbxb' - def __str__(self) -> str: - return str(self.value) + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/valid_source_file_format.py b/kittycad/models/valid_source_file_format.py index 0b8f05d22..6f11479e3 100644 --- a/kittycad/models/valid_source_file_format.py +++ b/kittycad/models/valid_source_file_format.py @@ -1,12 +1,11 @@ from enum import Enum - class ValidSourceFileFormat(str, Enum): - STL = 'stl' - OBJ = 'obj' - DAE = 'dae' - STEP = 'step' - FBX = 'fbx' + STL = 'stl' + OBJ = 'obj' + DAE = 'dae' + STEP = 'step' + FBX = 'fbx' - def __str__(self) -> str: - return str(self.value) + def __str__(self) -> str: + return str(self.value) diff --git a/pyproject.toml b/pyproject.toml index 9ed6bc5a7..25d14c50e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ sphinx-automodapi = "^0.13" pytest-cov = "^3.0.0" pytest-asyncio = "^0.16.0" openapi-parser = "^0.2.6" +autopep8 = "^1.6.0" [build-system] requires = ["poetry>=1.0"]