Initial commit
This commit is contained in:
23
garbage_api_client/models/__init__.py
Normal file
23
garbage_api_client/models/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
""" Contains all the data models used in inputs/outputs """
|
||||
|
||||
from .collection_entry import CollectionEntry
|
||||
from .collection_entry_garbage_type import CollectionEntryGarbageType
|
||||
from .entry_find_locations_location_entries_get_garbage_type_type_0 import (
|
||||
EntryFindLocationsLocationEntriesGetGarbageTypeType0,
|
||||
)
|
||||
from .http_validation_error import HTTPValidationError
|
||||
from .location import Location
|
||||
from .search_results_collection_entry import SearchResultsCollectionEntry
|
||||
from .search_results_location import SearchResultsLocation
|
||||
from .validation_error import ValidationError
|
||||
|
||||
__all__ = (
|
||||
"CollectionEntry",
|
||||
"CollectionEntryGarbageType",
|
||||
"EntryFindLocationsLocationEntriesGetGarbageTypeType0",
|
||||
"HTTPValidationError",
|
||||
"Location",
|
||||
"SearchResultsCollectionEntry",
|
||||
"SearchResultsLocation",
|
||||
"ValidationError",
|
||||
)
|
76
garbage_api_client/models/collection_entry.py
Normal file
76
garbage_api_client/models/collection_entry.py
Normal file
@@ -0,0 +1,76 @@
|
||||
from typing import Any, Dict, List, Type, TypeVar, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..models.collection_entry_garbage_type import CollectionEntryGarbageType
|
||||
|
||||
T = TypeVar("T", bound="CollectionEntry")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class CollectionEntry:
|
||||
"""
|
||||
Attributes:
|
||||
locations (List[int]):
|
||||
garbage_type (CollectionEntryGarbageType):
|
||||
date (str):
|
||||
"""
|
||||
|
||||
locations: List[int]
|
||||
garbage_type: CollectionEntryGarbageType
|
||||
date: str
|
||||
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
locations = self.locations
|
||||
|
||||
garbage_type = self.garbage_type.value
|
||||
|
||||
date = self.date
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"locations": locations,
|
||||
"garbage_type": garbage_type,
|
||||
"date": date,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
d = src_dict.copy()
|
||||
locations = cast(List[int], d.pop("locations"))
|
||||
|
||||
garbage_type = CollectionEntryGarbageType(d.pop("garbage_type"))
|
||||
|
||||
date = d.pop("date")
|
||||
|
||||
collection_entry = cls(
|
||||
locations=locations,
|
||||
garbage_type=garbage_type,
|
||||
date=date,
|
||||
)
|
||||
|
||||
collection_entry.additional_properties = d
|
||||
return collection_entry
|
||||
|
||||
@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
|
13
garbage_api_client/models/collection_entry_garbage_type.py
Normal file
13
garbage_api_client/models/collection_entry_garbage_type.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from enum import IntEnum
|
||||
|
||||
|
||||
class CollectionEntryGarbageType(IntEnum):
|
||||
VALUE_0 = 0
|
||||
VALUE_1 = 1
|
||||
VALUE_2 = 2
|
||||
VALUE_3 = 3
|
||||
VALUE_4 = 4
|
||||
VALUE_5 = 5
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
@@ -0,0 +1,13 @@
|
||||
from enum import IntEnum
|
||||
|
||||
|
||||
class EntryFindLocationsLocationEntriesGetGarbageTypeType0(IntEnum):
|
||||
VALUE_0 = 0
|
||||
VALUE_1 = 1
|
||||
VALUE_2 = 2
|
||||
VALUE_3 = 3
|
||||
VALUE_4 = 4
|
||||
VALUE_5 = 5
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
74
garbage_api_client/models/http_validation_error.py
Normal file
74
garbage_api_client/models/http_validation_error.py
Normal file
@@ -0,0 +1,74 @@
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.validation_error import ValidationError
|
||||
|
||||
|
||||
T = TypeVar("T", bound="HTTPValidationError")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class HTTPValidationError:
|
||||
"""
|
||||
Attributes:
|
||||
detail (Union[Unset, List['ValidationError']]):
|
||||
"""
|
||||
|
||||
detail: Union[Unset, List["ValidationError"]] = UNSET
|
||||
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
detail: Union[Unset, List[Dict[str, Any]]] = UNSET
|
||||
if not isinstance(self.detail, Unset):
|
||||
detail = []
|
||||
for detail_item_data in self.detail:
|
||||
detail_item = detail_item_data.to_dict()
|
||||
detail.append(detail_item)
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if detail is not UNSET:
|
||||
field_dict["detail"] = detail
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
from ..models.validation_error import ValidationError
|
||||
|
||||
d = src_dict.copy()
|
||||
detail = []
|
||||
_detail = d.pop("detail", UNSET)
|
||||
for detail_item_data in _detail or []:
|
||||
detail_item = ValidationError.from_dict(detail_item_data)
|
||||
|
||||
detail.append(detail_item)
|
||||
|
||||
http_validation_error = cls(
|
||||
detail=detail,
|
||||
)
|
||||
|
||||
http_validation_error.additional_properties = d
|
||||
return http_validation_error
|
||||
|
||||
@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
|
90
garbage_api_client/models/location.py
Normal file
90
garbage_api_client/models/location.py
Normal file
@@ -0,0 +1,90 @@
|
||||
from typing import Any, Dict, List, Type, TypeVar, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="Location")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class Location:
|
||||
"""
|
||||
Attributes:
|
||||
id (int):
|
||||
name (str):
|
||||
location (List[int]):
|
||||
country (int):
|
||||
timezone (str):
|
||||
"""
|
||||
|
||||
id: int
|
||||
name: str
|
||||
location: List[int]
|
||||
country: int
|
||||
timezone: str
|
||||
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
id = self.id
|
||||
|
||||
name = self.name
|
||||
|
||||
location = self.location
|
||||
|
||||
country = self.country
|
||||
|
||||
timezone = self.timezone
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"id": id,
|
||||
"name": name,
|
||||
"location": location,
|
||||
"country": country,
|
||||
"timezone": timezone,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
d = src_dict.copy()
|
||||
id = d.pop("id")
|
||||
|
||||
name = d.pop("name")
|
||||
|
||||
location = cast(List[int], d.pop("location"))
|
||||
|
||||
country = d.pop("country")
|
||||
|
||||
timezone = d.pop("timezone")
|
||||
|
||||
location = cls(
|
||||
id=id,
|
||||
name=name,
|
||||
location=location,
|
||||
country=country,
|
||||
timezone=timezone,
|
||||
)
|
||||
|
||||
location.additional_properties = d
|
||||
return location
|
||||
|
||||
@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
|
72
garbage_api_client/models/search_results_collection_entry.py
Normal file
72
garbage_api_client/models/search_results_collection_entry.py
Normal file
@@ -0,0 +1,72 @@
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.collection_entry import CollectionEntry
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SearchResultsCollectionEntry")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SearchResultsCollectionEntry:
|
||||
"""
|
||||
Attributes:
|
||||
results (List['CollectionEntry']):
|
||||
"""
|
||||
|
||||
results: List["CollectionEntry"]
|
||||
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
results = []
|
||||
for results_item_data in self.results:
|
||||
results_item = results_item_data.to_dict()
|
||||
results.append(results_item)
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"results": results,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
from ..models.collection_entry import CollectionEntry
|
||||
|
||||
d = src_dict.copy()
|
||||
results = []
|
||||
_results = d.pop("results")
|
||||
for results_item_data in _results:
|
||||
results_item = CollectionEntry.from_dict(results_item_data)
|
||||
|
||||
results.append(results_item)
|
||||
|
||||
search_results_collection_entry = cls(
|
||||
results=results,
|
||||
)
|
||||
|
||||
search_results_collection_entry.additional_properties = d
|
||||
return search_results_collection_entry
|
||||
|
||||
@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
|
72
garbage_api_client/models/search_results_location.py
Normal file
72
garbage_api_client/models/search_results_location.py
Normal file
@@ -0,0 +1,72 @@
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..models.location import Location
|
||||
|
||||
|
||||
T = TypeVar("T", bound="SearchResultsLocation")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class SearchResultsLocation:
|
||||
"""
|
||||
Attributes:
|
||||
results (List['Location']):
|
||||
"""
|
||||
|
||||
results: List["Location"]
|
||||
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
results = []
|
||||
for results_item_data in self.results:
|
||||
results_item = results_item_data.to_dict()
|
||||
results.append(results_item)
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"results": results,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
from ..models.location import Location
|
||||
|
||||
d = src_dict.copy()
|
||||
results = []
|
||||
_results = d.pop("results")
|
||||
for results_item_data in _results:
|
||||
results_item = Location.from_dict(results_item_data)
|
||||
|
||||
results.append(results_item)
|
||||
|
||||
search_results_location = cls(
|
||||
results=results,
|
||||
)
|
||||
|
||||
search_results_location.additional_properties = d
|
||||
return search_results_location
|
||||
|
||||
@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
|
87
garbage_api_client/models/validation_error.py
Normal file
87
garbage_api_client/models/validation_error.py
Normal file
@@ -0,0 +1,87 @@
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
from attrs import define as _attrs_define
|
||||
from attrs import field as _attrs_field
|
||||
|
||||
T = TypeVar("T", bound="ValidationError")
|
||||
|
||||
|
||||
@_attrs_define
|
||||
class ValidationError:
|
||||
"""
|
||||
Attributes:
|
||||
loc (List[Union[int, str]]):
|
||||
msg (str):
|
||||
type (str):
|
||||
"""
|
||||
|
||||
loc: List[Union[int, str]]
|
||||
msg: str
|
||||
type: str
|
||||
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
loc = []
|
||||
for loc_item_data in self.loc:
|
||||
loc_item: Union[int, str]
|
||||
loc_item = loc_item_data
|
||||
loc.append(loc_item)
|
||||
|
||||
msg = self.msg
|
||||
|
||||
type = self.type
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update(
|
||||
{
|
||||
"loc": loc,
|
||||
"msg": msg,
|
||||
"type": type,
|
||||
}
|
||||
)
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
d = src_dict.copy()
|
||||
loc = []
|
||||
_loc = d.pop("loc")
|
||||
for loc_item_data in _loc:
|
||||
|
||||
def _parse_loc_item(data: object) -> Union[int, str]:
|
||||
return cast(Union[int, str], data)
|
||||
|
||||
loc_item = _parse_loc_item(loc_item_data)
|
||||
|
||||
loc.append(loc_item)
|
||||
|
||||
msg = d.pop("msg")
|
||||
|
||||
type = d.pop("type")
|
||||
|
||||
validation_error = cls(
|
||||
loc=loc,
|
||||
msg=msg,
|
||||
type=type,
|
||||
)
|
||||
|
||||
validation_error.additional_properties = d
|
||||
return validation_error
|
||||
|
||||
@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
|
Reference in New Issue
Block a user