| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  | import datetime | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  | from typing import Any, Dict, List, Type, TypeVar, Union | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | import attr | 
					
						
							|  |  |  | from dateutil.parser import isoparse | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-05 15:33:51 -07:00
										 |  |  | from ..models.api_call_status import ApiCallStatus | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  | from ..models.unit_pressure import UnitPressure | 
					
						
							| 
									
										
										
										
											2023-05-23 14:24:13 -07:00
										 |  |  | from ..models.uuid import Uuid | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  | from ..types import UNSET, Unset | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-30 15:59:51 -07:00
										 |  |  | JL = TypeVar("JL", bound="UnitPressureConversion") | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @attr.s(auto_attribs=True) | 
					
						
							| 
									
										
										
										
											2022-07-25 22:46:48 +00:00
										 |  |  | class UnitPressureConversion: | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |     """Result of converting between units."""  # noqa: E501 | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |     completed_at: Union[Unset, datetime.datetime] = UNSET | 
					
						
							|  |  |  |     created_at: Union[Unset, datetime.datetime] = UNSET | 
					
						
							|  |  |  |     error: Union[Unset, str] = UNSET | 
					
						
							|  |  |  |     id: Union[Unset, str] = UNSET | 
					
						
							|  |  |  |     input: Union[Unset, float] = UNSET | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |     input_unit: Union[Unset, UnitPressure] = UNSET | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |     output: Union[Unset, float] = UNSET | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |     output_unit: Union[Unset, UnitPressure] = UNSET | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |     started_at: Union[Unset, datetime.datetime] = UNSET | 
					
						
							| 
									
										
										
										
											2022-07-05 15:33:51 -07:00
										 |  |  |     status: Union[Unset, ApiCallStatus] = UNSET | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |     updated_at: Union[Unset, datetime.datetime] = UNSET | 
					
						
							|  |  |  |     user_id: Union[Unset, str] = UNSET | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     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() | 
					
						
							|  |  |  |         error = self.error | 
					
						
							|  |  |  |         id = self.id | 
					
						
							|  |  |  |         input = self.input | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |         if not isinstance(self.input_unit, Unset): | 
					
						
							|  |  |  |             input_unit = self.input_unit | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         output = self.output | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |         if not isinstance(self.output_unit, Unset): | 
					
						
							|  |  |  |             output_unit = self.output_unit | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         started_at: Union[Unset, str] = UNSET | 
					
						
							|  |  |  |         if not isinstance(self.started_at, Unset): | 
					
						
							|  |  |  |             started_at = self.started_at.isoformat() | 
					
						
							|  |  |  |         if not isinstance(self.status, Unset): | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             status = self.status | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         updated_at: Union[Unset, str] = UNSET | 
					
						
							|  |  |  |         if not isinstance(self.updated_at, Unset): | 
					
						
							|  |  |  |             updated_at = self.updated_at.isoformat() | 
					
						
							|  |  |  |         user_id = self.user_id | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         field_dict: Dict[str, Any] = {} | 
					
						
							|  |  |  |         field_dict.update(self.additional_properties) | 
					
						
							|  |  |  |         field_dict.update({}) | 
					
						
							|  |  |  |         if completed_at is not UNSET: | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             field_dict["completed_at"] = completed_at | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         if created_at is not UNSET: | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             field_dict["created_at"] = created_at | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         if error is not UNSET: | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             field_dict["error"] = error | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         if id is not UNSET: | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             field_dict["id"] = id | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         if input is not UNSET: | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             field_dict["input"] = input | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |         if input_unit is not UNSET: | 
					
						
							|  |  |  |             field_dict["input_unit"] = input_unit | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         if output is not UNSET: | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             field_dict["output"] = output | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |         if output_unit is not UNSET: | 
					
						
							|  |  |  |             field_dict["output_unit"] = output_unit | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         if started_at is not UNSET: | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             field_dict["started_at"] = started_at | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         if status is not UNSET: | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             field_dict["status"] = status | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         if updated_at is not UNSET: | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             field_dict["updated_at"] = updated_at | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         if user_id is not UNSET: | 
					
						
							| 
									
										
										
										
											2023-05-04 00:58:06 -07:00
										 |  |  |             field_dict["user_id"] = user_id | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |         return field_dict | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @classmethod | 
					
						
							| 
									
										
										
										
											2023-08-30 15:59:51 -07:00
										 |  |  |     def from_dict(cls: Type[JL], src_dict: Dict[str, Any]) -> JL: | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         d = src_dict.copy() | 
					
						
							|  |  |  |         _completed_at = d.pop("completed_at", UNSET) | 
					
						
							|  |  |  |         completed_at: Union[Unset, datetime.datetime] | 
					
						
							|  |  |  |         if 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 isinstance(_created_at, Unset): | 
					
						
							|  |  |  |             created_at = UNSET | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             created_at = isoparse(_created_at) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         error = d.pop("error", UNSET) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-23 14:24:13 -07:00
										 |  |  |         _id = d.pop("id", UNSET) | 
					
						
							|  |  |  |         id: Union[Unset, Uuid] | 
					
						
							|  |  |  |         if isinstance(_id, Unset): | 
					
						
							|  |  |  |             id = UNSET | 
					
						
							|  |  |  |         else: | 
					
						
							| 
									
										
										
										
											2023-07-31 12:50:30 -07:00
										 |  |  |             id = _id  # type: ignore[arg-type] | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |         input = d.pop("input", UNSET) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |         _input_unit = d.pop("input_unit", UNSET) | 
					
						
							|  |  |  |         input_unit: Union[Unset, UnitPressure] | 
					
						
							|  |  |  |         if isinstance(_input_unit, Unset): | 
					
						
							|  |  |  |             input_unit = UNSET | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2023-07-07 18:03:18 -07:00
										 |  |  |             input_unit = _input_unit  # type: ignore[arg-type] | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |         output = d.pop("output", UNSET) | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |         _output_unit = d.pop("output_unit", UNSET) | 
					
						
							|  |  |  |         output_unit: Union[Unset, UnitPressure] | 
					
						
							|  |  |  |         if isinstance(_output_unit, Unset): | 
					
						
							|  |  |  |             output_unit = UNSET | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2023-07-07 18:03:18 -07:00
										 |  |  |             output_unit = _output_unit  # type: ignore[arg-type] | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |         _started_at = d.pop("started_at", UNSET) | 
					
						
							|  |  |  |         started_at: Union[Unset, datetime.datetime] | 
					
						
							|  |  |  |         if isinstance(_started_at, Unset): | 
					
						
							|  |  |  |             started_at = UNSET | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             started_at = isoparse(_started_at) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         _status = d.pop("status", UNSET) | 
					
						
							| 
									
										
										
										
											2022-07-05 15:33:51 -07:00
										 |  |  |         status: Union[Unset, ApiCallStatus] | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |         if isinstance(_status, Unset): | 
					
						
							|  |  |  |             status = UNSET | 
					
						
							|  |  |  |         else: | 
					
						
							| 
									
										
										
										
											2023-07-07 18:03:18 -07:00
										 |  |  |             status = _status  # type: ignore[arg-type] | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |         _updated_at = d.pop("updated_at", UNSET) | 
					
						
							|  |  |  |         updated_at: Union[Unset, datetime.datetime] | 
					
						
							|  |  |  |         if isinstance(_updated_at, Unset): | 
					
						
							|  |  |  |             updated_at = UNSET | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             updated_at = isoparse(_updated_at) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         user_id = d.pop("user_id", UNSET) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-25 22:46:48 +00:00
										 |  |  |         unit_pressure_conversion = cls( | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |             completed_at=completed_at, | 
					
						
							|  |  |  |             created_at=created_at, | 
					
						
							|  |  |  |             error=error, | 
					
						
							|  |  |  |             id=id, | 
					
						
							|  |  |  |             input=input, | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |             input_unit=input_unit, | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |             output=output, | 
					
						
							| 
									
										
										
										
											2023-05-26 12:31:24 -07:00
										 |  |  |             output_unit=output_unit, | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  |             started_at=started_at, | 
					
						
							|  |  |  |             status=status, | 
					
						
							|  |  |  |             updated_at=updated_at, | 
					
						
							|  |  |  |             user_id=user_id, | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-25 22:46:48 +00:00
										 |  |  |         unit_pressure_conversion.additional_properties = d | 
					
						
							|  |  |  |         return unit_pressure_conversion | 
					
						
							| 
									
										
										
										
											2022-06-16 12:02:16 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @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 __setitem__(self, key: str, value: Any) -> None: | 
					
						
							|  |  |  |         self.additional_properties[key] = value | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def __delitem__(self, key: str) -> None: | 
					
						
							|  |  |  |         del self.additional_properties[key] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def __contains__(self, key: str) -> bool: | 
					
						
							|  |  |  |         return key in self.additional_properties |