diff --git a/.idea/misc.xml b/.idea/misc.xml index 8029e25..0fba396 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,7 @@ + + \ No newline at end of file diff --git a/ftc_api/custom_templates/pyproject.toml.jinja b/ftc_api/custom_templates/pyproject.toml.jinja index 87bb1de..d79d531 100644 --- a/ftc_api/custom_templates/pyproject.toml.jinja +++ b/ftc_api/custom_templates/pyproject.toml.jinja @@ -2,7 +2,7 @@ name = "ftc_api" description = "A python client to access the FIRST Tech Challenge API" authors = [ - {name = "Ashwin Naren", email="arihant2math@gmail.com"} + { name = "Ashwin Naren", email = "arihant2math@gmail.com" } ] license = {file = "LICENSE"} readme = "README.md" diff --git a/ftc_api/models/__init__.py b/ftc_api/models/__init__.py index 6e719c2..b4512c0 100644 --- a/ftc_api/models/__init__.py +++ b/ftc_api/models/__init__.py @@ -11,7 +11,13 @@ from .award_assignment_list import AwardAssignmentList from .award_list import AwardList from .barcode_element import BarcodeElement +from .coordinate import Coordinate +from .coordinate_equality_comparer import CoordinateEqualityComparer +from .coordinate_sequence import CoordinateSequence +from .coordinate_sequence_factory import CoordinateSequenceFactory +from .dimension import Dimension from .endgame_parked_status import EndgameParkedStatus +from .envelope import Envelope from .event import Event from .event_list import EventList from .event_ranking_list import EventRankingList @@ -23,6 +29,9 @@ FreightFrenzySingleTeamScoreDetails, ) from .ftc_event_level import FTCEventLevel +from .geometry import Geometry +from .geometry_factory import GeometryFactory +from .geometry_overlay import GeometryOverlay from .get_v20_season_schedule_event_code_tournament_level_hybrid_tournament_level import ( GetV20SeasonScheduleEventCodeTournamentLevelHybridTournamentLevel, ) @@ -40,10 +49,16 @@ from .match_result_list import MatchResultList from .match_result_team import MatchResultTeam from .match_score_list import MatchScoreList +from .nts_geometry_services import NtsGeometryServices +from .ogc_geometry_type import OgcGeometryType +from .ordinates import Ordinates +from .point import Point from .power_play_alliance_score_breakdown import PowerPlayAllianceScoreBreakdown from .power_play_alliance_score_details import PowerPlayAllianceScoreDetails from .power_play_remote_score_breakdown import PowerPlayRemoteScoreBreakdown from .power_play_single_team_score_details import PowerPlaySingleTeamScoreDetails +from .precision_model import PrecisionModel +from .precision_models import PrecisionModels from .scheduled_match import ScheduledMatch from .scheduled_match_list import ScheduledMatchList from .scheduled_match_team import ScheduledMatchTeam @@ -74,7 +89,13 @@ "AwardAssignmentList", "AwardList", "BarcodeElement", + "Coordinate", + "CoordinateEqualityComparer", + "CoordinateSequence", + "CoordinateSequenceFactory", + "Dimension", "EndgameParkedStatus", + "Envelope", "Event", "EventList", "EventRankingList", @@ -84,6 +105,9 @@ "FreightFrenzyRemoteScoreBreakdown", "FreightFrenzySingleTeamScoreDetails", "FTCEventLevel", + "Geometry", + "GeometryFactory", + "GeometryOverlay", "GetV20SeasonScheduleEventCodeTournamentLevelHybridTournamentLevel", "GetV20SeasonScoresEventCodeTournamentLevelTournamentLevel", "HybridSchedule", @@ -97,10 +121,16 @@ "MatchResultList", "MatchResultTeam", "MatchScoreList", + "NtsGeometryServices", + "OgcGeometryType", + "Ordinates", + "Point", "PowerPlayAllianceScoreBreakdown", "PowerPlayAllianceScoreDetails", "PowerPlayRemoteScoreBreakdown", "PowerPlaySingleTeamScoreDetails", + "PrecisionModel", + "PrecisionModels", "ScheduledMatch", "ScheduledMatchList", "ScheduledMatchTeam", diff --git a/ftc_api/models/coordinate.py b/ftc_api/models/coordinate.py new file mode 100644 index 0000000..e42bd08 --- /dev/null +++ b/ftc_api/models/coordinate.py @@ -0,0 +1,77 @@ +from typing import Any, Dict, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Coordinate") + + +@attr.s(auto_attribs=True) +class Coordinate: + """ + Attributes: + x (Union[Unset, float]): + y (Union[Unset, float]): + z (Union[Unset, float]): + m (Union[Unset, float]): + coordinate_value (Union[Unset, Coordinate]): + """ + + x: Union[Unset, float] = UNSET + y: Union[Unset, float] = UNSET + z: Union[Unset, float] = UNSET + m: Union[Unset, float] = UNSET + coordinate_value: Union[Unset, "Coordinate"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + x = self.x + y = self.y + z = self.z + m = self.m + coordinate_value: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.coordinate_value, Unset): + coordinate_value = self.coordinate_value.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if x is not UNSET: + field_dict["x"] = x + if y is not UNSET: + field_dict["y"] = y + if z is not UNSET: + field_dict["z"] = z + if m is not UNSET: + field_dict["m"] = m + if coordinate_value is not UNSET: + field_dict["coordinateValue"] = coordinate_value + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + x = d.pop("x", UNSET) + + y = d.pop("y", UNSET) + + z = d.pop("z", UNSET) + + m = d.pop("m", UNSET) + + _coordinate_value = d.pop("coordinateValue", UNSET) + coordinate_value: Union[Unset, Coordinate] + if isinstance(_coordinate_value, Unset): + coordinate_value = UNSET + else: + coordinate_value = Coordinate.from_dict(_coordinate_value) + + coordinate = cls( + x=x, + y=y, + z=z, + m=m, + coordinate_value=coordinate_value, + ) + + return coordinate diff --git a/ftc_api/models/coordinate_equality_comparer.py b/ftc_api/models/coordinate_equality_comparer.py new file mode 100644 index 0000000..57b1b00 --- /dev/null +++ b/ftc_api/models/coordinate_equality_comparer.py @@ -0,0 +1,23 @@ +from typing import Any, Dict, Type, TypeVar + +import attr + +T = TypeVar("T", bound="CoordinateEqualityComparer") + + +@attr.s(auto_attribs=True) +class CoordinateEqualityComparer: + """ """ + + def to_dict(self) -> Dict[str, Any]: + field_dict: Dict[str, Any] = {} + field_dict.update({}) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + src_dict.copy() + coordinate_equality_comparer = cls() + + return coordinate_equality_comparer diff --git a/ftc_api/models/coordinate_sequence.py b/ftc_api/models/coordinate_sequence.py new file mode 100644 index 0000000..8832d00 --- /dev/null +++ b/ftc_api/models/coordinate_sequence.py @@ -0,0 +1,111 @@ +from typing import Any, Dict, Type, TypeVar, Union + +import attr + +from ..models.ordinates import Ordinates +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CoordinateSequence") + + +@attr.s(auto_attribs=True) +class CoordinateSequence: + """ + Attributes: + dimension (Union[Unset, int]): + measures (Union[Unset, int]): + spatial (Union[Unset, int]): + ordinates (Union[Unset, Ordinates]): + has_z (Union[Unset, bool]): + has_m (Union[Unset, bool]): + z_ordinate_index (Union[Unset, int]): + m_ordinate_index (Union[Unset, int]): + count (Union[Unset, int]): + """ + + dimension: Union[Unset, int] = UNSET + measures: Union[Unset, int] = UNSET + spatial: Union[Unset, int] = UNSET + ordinates: Union[Unset, Ordinates] = UNSET + has_z: Union[Unset, bool] = UNSET + has_m: Union[Unset, bool] = UNSET + z_ordinate_index: Union[Unset, int] = UNSET + m_ordinate_index: Union[Unset, int] = UNSET + count: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + dimension = self.dimension + measures = self.measures + spatial = self.spatial + ordinates: Union[Unset, str] = UNSET + if not isinstance(self.ordinates, Unset): + ordinates = self.ordinates.value + + has_z = self.has_z + has_m = self.has_m + z_ordinate_index = self.z_ordinate_index + m_ordinate_index = self.m_ordinate_index + count = self.count + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if dimension is not UNSET: + field_dict["dimension"] = dimension + if measures is not UNSET: + field_dict["measures"] = measures + if spatial is not UNSET: + field_dict["spatial"] = spatial + if ordinates is not UNSET: + field_dict["ordinates"] = ordinates + if has_z is not UNSET: + field_dict["hasZ"] = has_z + if has_m is not UNSET: + field_dict["hasM"] = has_m + if z_ordinate_index is not UNSET: + field_dict["zOrdinateIndex"] = z_ordinate_index + if m_ordinate_index is not UNSET: + field_dict["mOrdinateIndex"] = m_ordinate_index + if count is not UNSET: + field_dict["count"] = count + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + dimension = d.pop("dimension", UNSET) + + measures = d.pop("measures", UNSET) + + spatial = d.pop("spatial", UNSET) + + _ordinates = d.pop("ordinates", UNSET) + ordinates: Union[Unset, Ordinates] + if isinstance(_ordinates, Unset): + ordinates = UNSET + else: + ordinates = Ordinates(_ordinates) + + has_z = d.pop("hasZ", UNSET) + + has_m = d.pop("hasM", UNSET) + + z_ordinate_index = d.pop("zOrdinateIndex", UNSET) + + m_ordinate_index = d.pop("mOrdinateIndex", UNSET) + + count = d.pop("count", UNSET) + + coordinate_sequence = cls( + dimension=dimension, + measures=measures, + spatial=spatial, + ordinates=ordinates, + has_z=has_z, + has_m=has_m, + z_ordinate_index=z_ordinate_index, + m_ordinate_index=m_ordinate_index, + count=count, + ) + + return coordinate_sequence diff --git a/ftc_api/models/coordinate_sequence_factory.py b/ftc_api/models/coordinate_sequence_factory.py new file mode 100644 index 0000000..f5e3414 --- /dev/null +++ b/ftc_api/models/coordinate_sequence_factory.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +import attr + +from ..models.ordinates import Ordinates +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CoordinateSequenceFactory") + + +@attr.s(auto_attribs=True) +class CoordinateSequenceFactory: + """ + Attributes: + ordinates (Union[Unset, Ordinates]): + """ + + ordinates: Union[Unset, Ordinates] = UNSET + + def to_dict(self) -> Dict[str, Any]: + ordinates: Union[Unset, str] = UNSET + if not isinstance(self.ordinates, Unset): + ordinates = self.ordinates.value + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if ordinates is not UNSET: + field_dict["ordinates"] = ordinates + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _ordinates = d.pop("ordinates", UNSET) + ordinates: Union[Unset, Ordinates] + if isinstance(_ordinates, Unset): + ordinates = UNSET + else: + ordinates = Ordinates(_ordinates) + + coordinate_sequence_factory = cls( + ordinates=ordinates, + ) + + return coordinate_sequence_factory diff --git a/ftc_api/models/dimension.py b/ftc_api/models/dimension.py new file mode 100644 index 0000000..966cb1a --- /dev/null +++ b/ftc_api/models/dimension.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class Dimension(str, Enum): + P = "P" + CURVE = "Curve" + A = "A" + COLLAPSE = "Collapse" + DONTCARE = "Dontcare" + TRUE = "True" + UNKNOWN = "Unknown" + + def __str__(self) -> str: + return str(self.value) diff --git a/ftc_api/models/envelope.py b/ftc_api/models/envelope.py new file mode 100644 index 0000000..291c0fe --- /dev/null +++ b/ftc_api/models/envelope.py @@ -0,0 +1,139 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.coordinate import Coordinate + + +T = TypeVar("T", bound="Envelope") + + +@attr.s(auto_attribs=True) +class Envelope: + """ + Attributes: + is_null (Union[Unset, bool]): + width (Union[Unset, float]): + height (Union[Unset, float]): + diameter (Union[Unset, float]): + min_x (Union[Unset, float]): + max_x (Union[Unset, float]): + min_y (Union[Unset, float]): + max_y (Union[Unset, float]): + area (Union[Unset, float]): + min_extent (Union[Unset, float]): + max_extent (Union[Unset, float]): + centre (Union[Unset, Coordinate]): + """ + + is_null: Union[Unset, bool] = UNSET + width: Union[Unset, float] = UNSET + height: Union[Unset, float] = UNSET + diameter: Union[Unset, float] = UNSET + min_x: Union[Unset, float] = UNSET + max_x: Union[Unset, float] = UNSET + min_y: Union[Unset, float] = UNSET + max_y: Union[Unset, float] = UNSET + area: Union[Unset, float] = UNSET + min_extent: Union[Unset, float] = UNSET + max_extent: Union[Unset, float] = UNSET + centre: Union[Unset, "Coordinate"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + is_null = self.is_null + width = self.width + height = self.height + diameter = self.diameter + min_x = self.min_x + max_x = self.max_x + min_y = self.min_y + max_y = self.max_y + area = self.area + min_extent = self.min_extent + max_extent = self.max_extent + centre: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.centre, Unset): + centre = self.centre.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if is_null is not UNSET: + field_dict["isNull"] = is_null + if width is not UNSET: + field_dict["width"] = width + if height is not UNSET: + field_dict["height"] = height + if diameter is not UNSET: + field_dict["diameter"] = diameter + if min_x is not UNSET: + field_dict["minX"] = min_x + if max_x is not UNSET: + field_dict["maxX"] = max_x + if min_y is not UNSET: + field_dict["minY"] = min_y + if max_y is not UNSET: + field_dict["maxY"] = max_y + if area is not UNSET: + field_dict["area"] = area + if min_extent is not UNSET: + field_dict["minExtent"] = min_extent + if max_extent is not UNSET: + field_dict["maxExtent"] = max_extent + if centre is not UNSET: + field_dict["centre"] = centre + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.coordinate import Coordinate + + d = src_dict.copy() + is_null = d.pop("isNull", UNSET) + + width = d.pop("width", UNSET) + + height = d.pop("height", UNSET) + + diameter = d.pop("diameter", UNSET) + + min_x = d.pop("minX", UNSET) + + max_x = d.pop("maxX", UNSET) + + min_y = d.pop("minY", UNSET) + + max_y = d.pop("maxY", UNSET) + + area = d.pop("area", UNSET) + + min_extent = d.pop("minExtent", UNSET) + + max_extent = d.pop("maxExtent", UNSET) + + _centre = d.pop("centre", UNSET) + centre: Union[Unset, Coordinate] + if isinstance(_centre, Unset): + centre = UNSET + else: + centre = Coordinate.from_dict(_centre) + + envelope = cls( + is_null=is_null, + width=width, + height=height, + diameter=diameter, + min_x=min_x, + max_x=max_x, + min_y=min_y, + max_y=max_y, + area=area, + min_extent=min_extent, + max_extent=max_extent, + centre=centre, + ) + + return envelope diff --git a/ftc_api/models/event.py b/ftc_api/models/event.py index 346f58b..bccb27e 100644 --- a/ftc_api/models/event.py +++ b/ftc_api/models/event.py @@ -1,11 +1,15 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast import attr from dateutil.parser import isoparse from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.point import Point + + T = TypeVar("T", bound="Event") @@ -33,6 +37,7 @@ class Event: country (Union[Unset, None, str]): website (Union[Unset, None, str]): live_stream_url (Union[Unset, None, str]): + coordinates (Union[Unset, Point]): webcasts (Union[Unset, None, List[str]]): timezone (Union[Unset, None, str]): date_start (Union[Unset, datetime.datetime]): @@ -59,6 +64,7 @@ class Event: country: Union[Unset, None, str] = UNSET website: Union[Unset, None, str] = UNSET live_stream_url: Union[Unset, None, str] = UNSET + coordinates: Union[Unset, "Point"] = UNSET webcasts: Union[Unset, None, List[str]] = UNSET timezone: Union[Unset, None, str] = UNSET date_start: Union[Unset, datetime.datetime] = UNSET @@ -85,6 +91,10 @@ def to_dict(self) -> Dict[str, Any]: country = self.country website = self.website live_stream_url = self.live_stream_url + coordinates: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.coordinates, Unset): + coordinates = self.coordinates.to_dict() + webcasts: Union[Unset, None, List[str]] = UNSET if not isinstance(self.webcasts, Unset): if self.webcasts is None: @@ -143,6 +153,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["website"] = website if live_stream_url is not UNSET: field_dict["liveStreamUrl"] = live_stream_url + if coordinates is not UNSET: + field_dict["coordinates"] = coordinates if webcasts is not UNSET: field_dict["webcasts"] = webcasts if timezone is not UNSET: @@ -156,6 +168,8 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.point import Point + d = src_dict.copy() event_id = d.pop("eventId", UNSET) @@ -197,6 +211,13 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: live_stream_url = d.pop("liveStreamUrl", UNSET) + _coordinates = d.pop("coordinates", UNSET) + coordinates: Union[Unset, Point] + if isinstance(_coordinates, Unset): + coordinates = UNSET + else: + coordinates = Point.from_dict(_coordinates) + webcasts = cast(List[str], d.pop("webcasts", UNSET)) timezone = d.pop("timezone", UNSET) @@ -236,6 +257,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: country=country, website=website, live_stream_url=live_stream_url, + coordinates=coordinates, webcasts=webcasts, timezone=timezone, date_start=date_start, diff --git a/ftc_api/models/geometry.py b/ftc_api/models/geometry.py new file mode 100644 index 0000000..55544b3 --- /dev/null +++ b/ftc_api/models/geometry.py @@ -0,0 +1,349 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..models.dimension import Dimension +from ..models.ogc_geometry_type import OgcGeometryType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.coordinate import Coordinate + from ..models.envelope import Envelope + from ..models.geometry_factory import GeometryFactory + from ..models.point import Point + from ..models.precision_model import PrecisionModel + + +T = TypeVar("T", bound="Geometry") + + +@attr.s(auto_attribs=True) +class Geometry: + """ + Attributes: + coordinates (Union[Unset, None, List['Coordinate']]): + num_points (Union[Unset, int]): + is_empty (Union[Unset, bool]): + dimension (Union[Unset, Dimension]): + boundary_dimension (Union[Unset, Dimension]): + coordinate (Union[Unset, Coordinate]): + geometry_type (Union[Unset, None, str]): + ogc_geometry_type (Union[Unset, OgcGeometryType]): + boundary (Union[Unset, Geometry]): + factory (Union[Unset, GeometryFactory]): + user_data (Union[Unset, Any]): + srid (Union[Unset, int]): + precision_model (Union[Unset, PrecisionModel]): + num_geometries (Union[Unset, int]): + is_simple (Union[Unset, bool]): + is_valid (Union[Unset, bool]): + area (Union[Unset, float]): + length (Union[Unset, float]): + centroid (Union[Unset, Point]): + interior_point (Union[Unset, Point]): + point_on_surface (Union[Unset, Point]): + envelope (Union[Unset, Geometry]): + envelope_internal (Union[Unset, Envelope]): + is_rectangle (Union[Unset, bool]): + """ + + coordinates: Union[Unset, None, List["Coordinate"]] = UNSET + num_points: Union[Unset, int] = UNSET + is_empty: Union[Unset, bool] = UNSET + dimension: Union[Unset, Dimension] = UNSET + boundary_dimension: Union[Unset, Dimension] = UNSET + coordinate: Union[Unset, "Coordinate"] = UNSET + geometry_type: Union[Unset, None, str] = UNSET + ogc_geometry_type: Union[Unset, OgcGeometryType] = UNSET + boundary: Union[Unset, "Geometry"] = UNSET + factory: Union[Unset, "GeometryFactory"] = UNSET + user_data: Union[Unset, Any] = UNSET + srid: Union[Unset, int] = UNSET + precision_model: Union[Unset, "PrecisionModel"] = UNSET + num_geometries: Union[Unset, int] = UNSET + is_simple: Union[Unset, bool] = UNSET + is_valid: Union[Unset, bool] = UNSET + area: Union[Unset, float] = UNSET + length: Union[Unset, float] = UNSET + centroid: Union[Unset, "Point"] = UNSET + interior_point: Union[Unset, "Point"] = UNSET + point_on_surface: Union[Unset, "Point"] = UNSET + envelope: Union[Unset, "Geometry"] = UNSET + envelope_internal: Union[Unset, "Envelope"] = UNSET + is_rectangle: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + coordinates: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.coordinates, Unset): + if self.coordinates is None: + coordinates = None + else: + coordinates = [] + for coordinates_item_data in self.coordinates: + coordinates_item = coordinates_item_data.to_dict() + + coordinates.append(coordinates_item) + + num_points = self.num_points + is_empty = self.is_empty + dimension: Union[Unset, str] = UNSET + if not isinstance(self.dimension, Unset): + dimension = self.dimension.value + + boundary_dimension: Union[Unset, str] = UNSET + if not isinstance(self.boundary_dimension, Unset): + boundary_dimension = self.boundary_dimension.value + + coordinate: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.coordinate, Unset): + coordinate = self.coordinate.to_dict() + + geometry_type = self.geometry_type + ogc_geometry_type: Union[Unset, str] = UNSET + if not isinstance(self.ogc_geometry_type, Unset): + ogc_geometry_type = self.ogc_geometry_type.value + + boundary: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.boundary, Unset): + boundary = self.boundary.to_dict() + + factory: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.factory, Unset): + factory = self.factory.to_dict() + + user_data = self.user_data + srid = self.srid + precision_model: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.precision_model, Unset): + precision_model = self.precision_model.to_dict() + + num_geometries = self.num_geometries + is_simple = self.is_simple + is_valid = self.is_valid + area = self.area + length = self.length + centroid: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.centroid, Unset): + centroid = self.centroid.to_dict() + + interior_point: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.interior_point, Unset): + interior_point = self.interior_point.to_dict() + + point_on_surface: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.point_on_surface, Unset): + point_on_surface = self.point_on_surface.to_dict() + + envelope: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.envelope, Unset): + envelope = self.envelope.to_dict() + + envelope_internal: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.envelope_internal, Unset): + envelope_internal = self.envelope_internal.to_dict() + + is_rectangle = self.is_rectangle + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if coordinates is not UNSET: + field_dict["coordinates"] = coordinates + if num_points is not UNSET: + field_dict["numPoints"] = num_points + if is_empty is not UNSET: + field_dict["isEmpty"] = is_empty + if dimension is not UNSET: + field_dict["dimension"] = dimension + if boundary_dimension is not UNSET: + field_dict["boundaryDimension"] = boundary_dimension + if coordinate is not UNSET: + field_dict["coordinate"] = coordinate + if geometry_type is not UNSET: + field_dict["geometryType"] = geometry_type + if ogc_geometry_type is not UNSET: + field_dict["ogcGeometryType"] = ogc_geometry_type + if boundary is not UNSET: + field_dict["boundary"] = boundary + if factory is not UNSET: + field_dict["factory"] = factory + if user_data is not UNSET: + field_dict["userData"] = user_data + if srid is not UNSET: + field_dict["srid"] = srid + if precision_model is not UNSET: + field_dict["precisionModel"] = precision_model + if num_geometries is not UNSET: + field_dict["numGeometries"] = num_geometries + if is_simple is not UNSET: + field_dict["isSimple"] = is_simple + if is_valid is not UNSET: + field_dict["isValid"] = is_valid + if area is not UNSET: + field_dict["area"] = area + if length is not UNSET: + field_dict["length"] = length + if centroid is not UNSET: + field_dict["centroid"] = centroid + if interior_point is not UNSET: + field_dict["interiorPoint"] = interior_point + if point_on_surface is not UNSET: + field_dict["pointOnSurface"] = point_on_surface + if envelope is not UNSET: + field_dict["envelope"] = envelope + if envelope_internal is not UNSET: + field_dict["envelopeInternal"] = envelope_internal + if is_rectangle is not UNSET: + field_dict["isRectangle"] = is_rectangle + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.coordinate import Coordinate + from ..models.envelope import Envelope + from ..models.geometry_factory import GeometryFactory + from ..models.point import Point + from ..models.precision_model import PrecisionModel + + d = src_dict.copy() + coordinates = [] + _coordinates = d.pop("coordinates", UNSET) + for coordinates_item_data in _coordinates or []: + coordinates_item = Coordinate.from_dict(coordinates_item_data) + + coordinates.append(coordinates_item) + + num_points = d.pop("numPoints", UNSET) + + is_empty = d.pop("isEmpty", UNSET) + + _dimension = d.pop("dimension", UNSET) + dimension: Union[Unset, Dimension] + if isinstance(_dimension, Unset): + dimension = UNSET + else: + dimension = Dimension(_dimension) + + _boundary_dimension = d.pop("boundaryDimension", UNSET) + boundary_dimension: Union[Unset, Dimension] + if isinstance(_boundary_dimension, Unset): + boundary_dimension = UNSET + else: + boundary_dimension = Dimension(_boundary_dimension) + + _coordinate = d.pop("coordinate", UNSET) + coordinate: Union[Unset, Coordinate] + if isinstance(_coordinate, Unset): + coordinate = UNSET + else: + coordinate = Coordinate.from_dict(_coordinate) + + geometry_type = d.pop("geometryType", UNSET) + + _ogc_geometry_type = d.pop("ogcGeometryType", UNSET) + ogc_geometry_type: Union[Unset, OgcGeometryType] + if isinstance(_ogc_geometry_type, Unset): + ogc_geometry_type = UNSET + else: + ogc_geometry_type = OgcGeometryType(_ogc_geometry_type) + + _boundary = d.pop("boundary", UNSET) + boundary: Union[Unset, Geometry] + if isinstance(_boundary, Unset): + boundary = UNSET + else: + boundary = Geometry.from_dict(_boundary) + + _factory = d.pop("factory", UNSET) + factory: Union[Unset, GeometryFactory] + if isinstance(_factory, Unset): + factory = UNSET + else: + factory = GeometryFactory.from_dict(_factory) + + user_data = d.pop("userData", UNSET) + + srid = d.pop("srid", UNSET) + + _precision_model = d.pop("precisionModel", UNSET) + precision_model: Union[Unset, PrecisionModel] + if isinstance(_precision_model, Unset): + precision_model = UNSET + else: + precision_model = PrecisionModel.from_dict(_precision_model) + + num_geometries = d.pop("numGeometries", UNSET) + + is_simple = d.pop("isSimple", UNSET) + + is_valid = d.pop("isValid", UNSET) + + area = d.pop("area", UNSET) + + length = d.pop("length", UNSET) + + _centroid = d.pop("centroid", UNSET) + centroid: Union[Unset, Point] + if isinstance(_centroid, Unset): + centroid = UNSET + else: + centroid = Point.from_dict(_centroid) + + _interior_point = d.pop("interiorPoint", UNSET) + interior_point: Union[Unset, Point] + if isinstance(_interior_point, Unset): + interior_point = UNSET + else: + interior_point = Point.from_dict(_interior_point) + + _point_on_surface = d.pop("pointOnSurface", UNSET) + point_on_surface: Union[Unset, Point] + if isinstance(_point_on_surface, Unset): + point_on_surface = UNSET + else: + point_on_surface = Point.from_dict(_point_on_surface) + + _envelope = d.pop("envelope", UNSET) + envelope: Union[Unset, Geometry] + if isinstance(_envelope, Unset): + envelope = UNSET + else: + envelope = Geometry.from_dict(_envelope) + + _envelope_internal = d.pop("envelopeInternal", UNSET) + envelope_internal: Union[Unset, Envelope] + if isinstance(_envelope_internal, Unset): + envelope_internal = UNSET + else: + envelope_internal = Envelope.from_dict(_envelope_internal) + + is_rectangle = d.pop("isRectangle", UNSET) + + geometry = cls( + coordinates=coordinates, + num_points=num_points, + is_empty=is_empty, + dimension=dimension, + boundary_dimension=boundary_dimension, + coordinate=coordinate, + geometry_type=geometry_type, + ogc_geometry_type=ogc_geometry_type, + boundary=boundary, + factory=factory, + user_data=user_data, + srid=srid, + precision_model=precision_model, + num_geometries=num_geometries, + is_simple=is_simple, + is_valid=is_valid, + area=area, + length=length, + centroid=centroid, + interior_point=interior_point, + point_on_surface=point_on_surface, + envelope=envelope, + envelope_internal=envelope_internal, + is_rectangle=is_rectangle, + ) + + return geometry diff --git a/ftc_api/models/geometry_factory.py b/ftc_api/models/geometry_factory.py new file mode 100644 index 0000000..f6d4670 --- /dev/null +++ b/ftc_api/models/geometry_factory.py @@ -0,0 +1,97 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.coordinate_sequence_factory import CoordinateSequenceFactory + from ..models.nts_geometry_services import NtsGeometryServices + from ..models.precision_model import PrecisionModel + + +T = TypeVar("T", bound="GeometryFactory") + + +@attr.s(auto_attribs=True) +class GeometryFactory: + """ + Attributes: + precision_model (Union[Unset, PrecisionModel]): + coordinate_sequence_factory (Union[Unset, CoordinateSequenceFactory]): + srid (Union[Unset, int]): + geometry_services (Union[Unset, NtsGeometryServices]): + """ + + precision_model: Union[Unset, "PrecisionModel"] = UNSET + coordinate_sequence_factory: Union[Unset, "CoordinateSequenceFactory"] = UNSET + srid: Union[Unset, int] = UNSET + geometry_services: Union[Unset, "NtsGeometryServices"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + precision_model: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.precision_model, Unset): + precision_model = self.precision_model.to_dict() + + coordinate_sequence_factory: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.coordinate_sequence_factory, Unset): + coordinate_sequence_factory = self.coordinate_sequence_factory.to_dict() + + srid = self.srid + geometry_services: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.geometry_services, Unset): + geometry_services = self.geometry_services.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if precision_model is not UNSET: + field_dict["precisionModel"] = precision_model + if coordinate_sequence_factory is not UNSET: + field_dict["coordinateSequenceFactory"] = coordinate_sequence_factory + if srid is not UNSET: + field_dict["srid"] = srid + if geometry_services is not UNSET: + field_dict["geometryServices"] = geometry_services + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.coordinate_sequence_factory import CoordinateSequenceFactory + from ..models.nts_geometry_services import NtsGeometryServices + from ..models.precision_model import PrecisionModel + + d = src_dict.copy() + _precision_model = d.pop("precisionModel", UNSET) + precision_model: Union[Unset, PrecisionModel] + if isinstance(_precision_model, Unset): + precision_model = UNSET + else: + precision_model = PrecisionModel.from_dict(_precision_model) + + _coordinate_sequence_factory = d.pop("coordinateSequenceFactory", UNSET) + coordinate_sequence_factory: Union[Unset, CoordinateSequenceFactory] + if isinstance(_coordinate_sequence_factory, Unset): + coordinate_sequence_factory = UNSET + else: + coordinate_sequence_factory = CoordinateSequenceFactory.from_dict( + _coordinate_sequence_factory + ) + + srid = d.pop("srid", UNSET) + + _geometry_services = d.pop("geometryServices", UNSET) + geometry_services: Union[Unset, NtsGeometryServices] + if isinstance(_geometry_services, Unset): + geometry_services = UNSET + else: + geometry_services = NtsGeometryServices.from_dict(_geometry_services) + + geometry_factory = cls( + precision_model=precision_model, + coordinate_sequence_factory=coordinate_sequence_factory, + srid=srid, + geometry_services=geometry_services, + ) + + return geometry_factory diff --git a/ftc_api/models/geometry_overlay.py b/ftc_api/models/geometry_overlay.py new file mode 100644 index 0000000..f073412 --- /dev/null +++ b/ftc_api/models/geometry_overlay.py @@ -0,0 +1,23 @@ +from typing import Any, Dict, Type, TypeVar + +import attr + +T = TypeVar("T", bound="GeometryOverlay") + + +@attr.s(auto_attribs=True) +class GeometryOverlay: + """ """ + + def to_dict(self) -> Dict[str, Any]: + field_dict: Dict[str, Any] = {} + field_dict.update({}) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + src_dict.copy() + geometry_overlay = cls() + + return geometry_overlay diff --git a/ftc_api/models/hybrid_schedule_team.py b/ftc_api/models/hybrid_schedule_team.py index ca4f4d8..9fb9ae6 100644 --- a/ftc_api/models/hybrid_schedule_team.py +++ b/ftc_api/models/hybrid_schedule_team.py @@ -17,6 +17,7 @@ class HybridScheduleTeam: no_show (Union[Unset, bool]): dq (Union[Unset, None, bool]): on_field (Union[Unset, None, bool]): + team_name (Union[Unset, None, str]): """ team_number: Union[Unset, None, int] = UNSET @@ -25,6 +26,7 @@ class HybridScheduleTeam: no_show: Union[Unset, bool] = UNSET dq: Union[Unset, None, bool] = UNSET on_field: Union[Unset, None, bool] = UNSET + team_name: Union[Unset, None, str] = UNSET def to_dict(self) -> Dict[str, Any]: team_number = self.team_number @@ -33,6 +35,7 @@ def to_dict(self) -> Dict[str, Any]: no_show = self.no_show dq = self.dq on_field = self.on_field + team_name = self.team_name field_dict: Dict[str, Any] = {} field_dict.update({}) @@ -48,6 +51,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["dq"] = dq if on_field is not UNSET: field_dict["onField"] = on_field + if team_name is not UNSET: + field_dict["teamName"] = team_name return field_dict @@ -66,6 +71,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: on_field = d.pop("onField", UNSET) + team_name = d.pop("teamName", UNSET) + hybrid_schedule_team = cls( team_number=team_number, station=station, @@ -73,6 +80,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: no_show=no_show, dq=dq, on_field=on_field, + team_name=team_name, ) return hybrid_schedule_team diff --git a/ftc_api/models/nts_geometry_services.py b/ftc_api/models/nts_geometry_services.py new file mode 100644 index 0000000..d425e21 --- /dev/null +++ b/ftc_api/models/nts_geometry_services.py @@ -0,0 +1,125 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +import attr + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.coordinate_equality_comparer import CoordinateEqualityComparer + from ..models.coordinate_sequence_factory import CoordinateSequenceFactory + from ..models.geometry_overlay import GeometryOverlay + from ..models.precision_model import PrecisionModel + + +T = TypeVar("T", bound="NtsGeometryServices") + + +@attr.s(auto_attribs=True) +class NtsGeometryServices: + """ + Attributes: + geometry_overlay (Union[Unset, GeometryOverlay]): + coordinate_equality_comparer (Union[Unset, CoordinateEqualityComparer]): + default_srid (Union[Unset, int]): + default_coordinate_sequence_factory (Union[Unset, CoordinateSequenceFactory]): + default_precision_model (Union[Unset, PrecisionModel]): + """ + + geometry_overlay: Union[Unset, "GeometryOverlay"] = UNSET + coordinate_equality_comparer: Union[Unset, "CoordinateEqualityComparer"] = UNSET + default_srid: Union[Unset, int] = UNSET + default_coordinate_sequence_factory: Union[ + Unset, "CoordinateSequenceFactory" + ] = UNSET + default_precision_model: Union[Unset, "PrecisionModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + geometry_overlay: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.geometry_overlay, Unset): + geometry_overlay = self.geometry_overlay.to_dict() + + coordinate_equality_comparer: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.coordinate_equality_comparer, Unset): + coordinate_equality_comparer = self.coordinate_equality_comparer.to_dict() + + default_srid = self.default_srid + default_coordinate_sequence_factory: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.default_coordinate_sequence_factory, Unset): + default_coordinate_sequence_factory = ( + self.default_coordinate_sequence_factory.to_dict() + ) + + default_precision_model: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.default_precision_model, Unset): + default_precision_model = self.default_precision_model.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if geometry_overlay is not UNSET: + field_dict["geometryOverlay"] = geometry_overlay + if coordinate_equality_comparer is not UNSET: + field_dict["coordinateEqualityComparer"] = coordinate_equality_comparer + if default_srid is not UNSET: + field_dict["defaultSRID"] = default_srid + if default_coordinate_sequence_factory is not UNSET: + field_dict[ + "defaultCoordinateSequenceFactory" + ] = default_coordinate_sequence_factory + if default_precision_model is not UNSET: + field_dict["defaultPrecisionModel"] = default_precision_model + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.coordinate_equality_comparer import CoordinateEqualityComparer + from ..models.coordinate_sequence_factory import CoordinateSequenceFactory + from ..models.geometry_overlay import GeometryOverlay + from ..models.precision_model import PrecisionModel + + d = src_dict.copy() + _geometry_overlay = d.pop("geometryOverlay", UNSET) + geometry_overlay: Union[Unset, GeometryOverlay] + if isinstance(_geometry_overlay, Unset): + geometry_overlay = UNSET + else: + geometry_overlay = GeometryOverlay.from_dict(_geometry_overlay) + + _coordinate_equality_comparer = d.pop("coordinateEqualityComparer", UNSET) + coordinate_equality_comparer: Union[Unset, CoordinateEqualityComparer] + if isinstance(_coordinate_equality_comparer, Unset): + coordinate_equality_comparer = UNSET + else: + coordinate_equality_comparer = CoordinateEqualityComparer.from_dict( + _coordinate_equality_comparer + ) + + default_srid = d.pop("defaultSRID", UNSET) + + _default_coordinate_sequence_factory = d.pop( + "defaultCoordinateSequenceFactory", UNSET + ) + default_coordinate_sequence_factory: Union[Unset, CoordinateSequenceFactory] + if isinstance(_default_coordinate_sequence_factory, Unset): + default_coordinate_sequence_factory = UNSET + else: + default_coordinate_sequence_factory = CoordinateSequenceFactory.from_dict( + _default_coordinate_sequence_factory + ) + + _default_precision_model = d.pop("defaultPrecisionModel", UNSET) + default_precision_model: Union[Unset, PrecisionModel] + if isinstance(_default_precision_model, Unset): + default_precision_model = UNSET + else: + default_precision_model = PrecisionModel.from_dict(_default_precision_model) + + nts_geometry_services = cls( + geometry_overlay=geometry_overlay, + coordinate_equality_comparer=coordinate_equality_comparer, + default_srid=default_srid, + default_coordinate_sequence_factory=default_coordinate_sequence_factory, + default_precision_model=default_precision_model, + ) + + return nts_geometry_services diff --git a/ftc_api/models/ogc_geometry_type.py b/ftc_api/models/ogc_geometry_type.py new file mode 100644 index 0000000..fc056f9 --- /dev/null +++ b/ftc_api/models/ogc_geometry_type.py @@ -0,0 +1,23 @@ +from enum import Enum + + +class OgcGeometryType(str, Enum): + POINT = "Point" + LINESTRING = "LineString" + POLYGON = "Polygon" + MULTIPOINT = "MultiPoint" + MULTILINESTRING = "MultiLineString" + MULTIPOLYGON = "MultiPolygon" + GEOMETRYCOLLECTION = "GeometryCollection" + CIRCULARSTRING = "CircularString" + COMPOUNDCURVE = "CompoundCurve" + CURVEPOLYGON = "CurvePolygon" + MULTICURVE = "MultiCurve" + MULTISURFACE = "MultiSurface" + CURVE = "Curve" + SURFACE = "Surface" + POLYHEDRALSURFACE = "PolyhedralSurface" + TIN = "TIN" + + def __str__(self) -> str: + return str(self.value) diff --git a/ftc_api/models/ordinates.py b/ftc_api/models/ordinates.py new file mode 100644 index 0000000..a3c7fa9 --- /dev/null +++ b/ftc_api/models/ordinates.py @@ -0,0 +1,47 @@ +from enum import Enum + + +class Ordinates(str, Enum): + NONE = "None" + X = "X" + Y = "Y" + XY = "XY" + SPATIAL3 = "Spatial3" + XYZ = "XYZ" + SPATIAL4 = "Spatial4" + SPATIAL5 = "Spatial5" + SPATIAL6 = "Spatial6" + SPATIAL7 = "Spatial7" + SPATIAL8 = "Spatial8" + SPATIAL9 = "Spatial9" + SPATIAL10 = "Spatial10" + SPATIAL11 = "Spatial11" + SPATIAL12 = "Spatial12" + SPATIAL13 = "Spatial13" + SPATIAL14 = "Spatial14" + SPATIAL15 = "Spatial15" + SPATIAL16 = "Spatial16" + ALLSPATIALORDINATES = "AllSpatialOrdinates" + MEASURE1 = "Measure1" + XYM = "XYM" + XYZM = "XYZM" + MEASURE2 = "Measure2" + MEASURE3 = "Measure3" + MEASURE4 = "Measure4" + MEASURE5 = "Measure5" + MEASURE6 = "Measure6" + MEASURE7 = "Measure7" + MEASURE8 = "Measure8" + MEASURE9 = "Measure9" + MEASURE10 = "Measure10" + MEASURE11 = "Measure11" + MEASURE12 = "Measure12" + MEASURE13 = "Measure13" + MEASURE14 = "Measure14" + MEASURE15 = "Measure15" + MEASURE16 = "Measure16" + ALLMEASUREORDINATES = "AllMeasureOrdinates" + ALLORDINATES = "AllOrdinates" + + def __str__(self) -> str: + return str(self.value) diff --git a/ftc_api/models/point.py b/ftc_api/models/point.py new file mode 100644 index 0000000..48e8e19 --- /dev/null +++ b/ftc_api/models/point.py @@ -0,0 +1,399 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..models.dimension import Dimension +from ..models.ogc_geometry_type import OgcGeometryType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.coordinate import Coordinate + from ..models.coordinate_sequence import CoordinateSequence + from ..models.envelope import Envelope + from ..models.geometry import Geometry + from ..models.geometry_factory import GeometryFactory + from ..models.precision_model import PrecisionModel + + +T = TypeVar("T", bound="Point") + + +@attr.s(auto_attribs=True) +class Point: + """ + Attributes: + factory (Union[Unset, GeometryFactory]): + user_data (Union[Unset, Any]): + srid (Union[Unset, int]): + precision_model (Union[Unset, PrecisionModel]): + num_geometries (Union[Unset, int]): + is_simple (Union[Unset, bool]): + is_valid (Union[Unset, bool]): + area (Union[Unset, float]): + length (Union[Unset, float]): + centroid (Union[Unset, Point]): + interior_point (Union[Unset, Point]): + point_on_surface (Union[Unset, Point]): + envelope (Union[Unset, Geometry]): + envelope_internal (Union[Unset, Envelope]): + is_rectangle (Union[Unset, bool]): + coordinate_sequence (Union[Unset, CoordinateSequence]): + coordinates (Union[Unset, None, List['Coordinate']]): + num_points (Union[Unset, int]): + is_empty (Union[Unset, bool]): + dimension (Union[Unset, Dimension]): + boundary_dimension (Union[Unset, Dimension]): + x (Union[Unset, float]): + y (Union[Unset, float]): + coordinate (Union[Unset, Coordinate]): + geometry_type (Union[Unset, None, str]): + ogc_geometry_type (Union[Unset, OgcGeometryType]): + boundary (Union[Unset, Geometry]): + z (Union[Unset, float]): + m (Union[Unset, float]): + """ + + factory: Union[Unset, "GeometryFactory"] = UNSET + user_data: Union[Unset, Any] = UNSET + srid: Union[Unset, int] = UNSET + precision_model: Union[Unset, "PrecisionModel"] = UNSET + num_geometries: Union[Unset, int] = UNSET + is_simple: Union[Unset, bool] = UNSET + is_valid: Union[Unset, bool] = UNSET + area: Union[Unset, float] = UNSET + length: Union[Unset, float] = UNSET + centroid: Union[Unset, "Point"] = UNSET + interior_point: Union[Unset, "Point"] = UNSET + point_on_surface: Union[Unset, "Point"] = UNSET + envelope: Union[Unset, "Geometry"] = UNSET + envelope_internal: Union[Unset, "Envelope"] = UNSET + is_rectangle: Union[Unset, bool] = UNSET + coordinate_sequence: Union[Unset, "CoordinateSequence"] = UNSET + coordinates: Union[Unset, None, List["Coordinate"]] = UNSET + num_points: Union[Unset, int] = UNSET + is_empty: Union[Unset, bool] = UNSET + dimension: Union[Unset, Dimension] = UNSET + boundary_dimension: Union[Unset, Dimension] = UNSET + x: Union[Unset, float] = UNSET + y: Union[Unset, float] = UNSET + coordinate: Union[Unset, "Coordinate"] = UNSET + geometry_type: Union[Unset, None, str] = UNSET + ogc_geometry_type: Union[Unset, OgcGeometryType] = UNSET + boundary: Union[Unset, "Geometry"] = UNSET + z: Union[Unset, float] = UNSET + m: Union[Unset, float] = UNSET + + def to_dict(self) -> Dict[str, Any]: + factory: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.factory, Unset): + factory = self.factory.to_dict() + + user_data = self.user_data + srid = self.srid + precision_model: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.precision_model, Unset): + precision_model = self.precision_model.to_dict() + + num_geometries = self.num_geometries + is_simple = self.is_simple + is_valid = self.is_valid + area = self.area + length = self.length + centroid: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.centroid, Unset): + centroid = self.centroid.to_dict() + + interior_point: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.interior_point, Unset): + interior_point = self.interior_point.to_dict() + + point_on_surface: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.point_on_surface, Unset): + point_on_surface = self.point_on_surface.to_dict() + + envelope: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.envelope, Unset): + envelope = self.envelope.to_dict() + + envelope_internal: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.envelope_internal, Unset): + envelope_internal = self.envelope_internal.to_dict() + + is_rectangle = self.is_rectangle + coordinate_sequence: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.coordinate_sequence, Unset): + coordinate_sequence = self.coordinate_sequence.to_dict() + + coordinates: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.coordinates, Unset): + if self.coordinates is None: + coordinates = None + else: + coordinates = [] + for coordinates_item_data in self.coordinates: + coordinates_item = coordinates_item_data.to_dict() + + coordinates.append(coordinates_item) + + num_points = self.num_points + is_empty = self.is_empty + dimension: Union[Unset, str] = UNSET + if not isinstance(self.dimension, Unset): + dimension = self.dimension.value + + boundary_dimension: Union[Unset, str] = UNSET + if not isinstance(self.boundary_dimension, Unset): + boundary_dimension = self.boundary_dimension.value + + x = self.x + y = self.y + coordinate: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.coordinate, Unset): + coordinate = self.coordinate.to_dict() + + geometry_type = self.geometry_type + ogc_geometry_type: Union[Unset, str] = UNSET + if not isinstance(self.ogc_geometry_type, Unset): + ogc_geometry_type = self.ogc_geometry_type.value + + boundary: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.boundary, Unset): + boundary = self.boundary.to_dict() + + z = self.z + m = self.m + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if factory is not UNSET: + field_dict["factory"] = factory + if user_data is not UNSET: + field_dict["userData"] = user_data + if srid is not UNSET: + field_dict["srid"] = srid + if precision_model is not UNSET: + field_dict["precisionModel"] = precision_model + if num_geometries is not UNSET: + field_dict["numGeometries"] = num_geometries + if is_simple is not UNSET: + field_dict["isSimple"] = is_simple + if is_valid is not UNSET: + field_dict["isValid"] = is_valid + if area is not UNSET: + field_dict["area"] = area + if length is not UNSET: + field_dict["length"] = length + if centroid is not UNSET: + field_dict["centroid"] = centroid + if interior_point is not UNSET: + field_dict["interiorPoint"] = interior_point + if point_on_surface is not UNSET: + field_dict["pointOnSurface"] = point_on_surface + if envelope is not UNSET: + field_dict["envelope"] = envelope + if envelope_internal is not UNSET: + field_dict["envelopeInternal"] = envelope_internal + if is_rectangle is not UNSET: + field_dict["isRectangle"] = is_rectangle + if coordinate_sequence is not UNSET: + field_dict["coordinateSequence"] = coordinate_sequence + if coordinates is not UNSET: + field_dict["coordinates"] = coordinates + if num_points is not UNSET: + field_dict["numPoints"] = num_points + if is_empty is not UNSET: + field_dict["isEmpty"] = is_empty + if dimension is not UNSET: + field_dict["dimension"] = dimension + if boundary_dimension is not UNSET: + field_dict["boundaryDimension"] = boundary_dimension + if x is not UNSET: + field_dict["x"] = x + if y is not UNSET: + field_dict["y"] = y + if coordinate is not UNSET: + field_dict["coordinate"] = coordinate + if geometry_type is not UNSET: + field_dict["geometryType"] = geometry_type + if ogc_geometry_type is not UNSET: + field_dict["ogcGeometryType"] = ogc_geometry_type + if boundary is not UNSET: + field_dict["boundary"] = boundary + if z is not UNSET: + field_dict["z"] = z + if m is not UNSET: + field_dict["m"] = m + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.coordinate import Coordinate + from ..models.coordinate_sequence import CoordinateSequence + from ..models.envelope import Envelope + from ..models.geometry import Geometry + from ..models.geometry_factory import GeometryFactory + from ..models.precision_model import PrecisionModel + + d = src_dict.copy() + _factory = d.pop("factory", UNSET) + factory: Union[Unset, GeometryFactory] + if isinstance(_factory, Unset): + factory = UNSET + else: + factory = GeometryFactory.from_dict(_factory) + + user_data = d.pop("userData", UNSET) + + srid = d.pop("srid", UNSET) + + _precision_model = d.pop("precisionModel", UNSET) + precision_model: Union[Unset, PrecisionModel] + if isinstance(_precision_model, Unset): + precision_model = UNSET + else: + precision_model = PrecisionModel.from_dict(_precision_model) + + num_geometries = d.pop("numGeometries", UNSET) + + is_simple = d.pop("isSimple", UNSET) + + is_valid = d.pop("isValid", UNSET) + + area = d.pop("area", UNSET) + + length = d.pop("length", UNSET) + + _centroid = d.pop("centroid", UNSET) + centroid: Union[Unset, Point] + if isinstance(_centroid, Unset): + centroid = UNSET + else: + centroid = Point.from_dict(_centroid) + + _interior_point = d.pop("interiorPoint", UNSET) + interior_point: Union[Unset, Point] + if isinstance(_interior_point, Unset): + interior_point = UNSET + else: + interior_point = Point.from_dict(_interior_point) + + _point_on_surface = d.pop("pointOnSurface", UNSET) + point_on_surface: Union[Unset, Point] + if isinstance(_point_on_surface, Unset): + point_on_surface = UNSET + else: + point_on_surface = Point.from_dict(_point_on_surface) + + _envelope = d.pop("envelope", UNSET) + envelope: Union[Unset, Geometry] + if isinstance(_envelope, Unset): + envelope = UNSET + else: + envelope = Geometry.from_dict(_envelope) + + _envelope_internal = d.pop("envelopeInternal", UNSET) + envelope_internal: Union[Unset, Envelope] + if isinstance(_envelope_internal, Unset): + envelope_internal = UNSET + else: + envelope_internal = Envelope.from_dict(_envelope_internal) + + is_rectangle = d.pop("isRectangle", UNSET) + + _coordinate_sequence = d.pop("coordinateSequence", UNSET) + coordinate_sequence: Union[Unset, CoordinateSequence] + if isinstance(_coordinate_sequence, Unset): + coordinate_sequence = UNSET + else: + coordinate_sequence = CoordinateSequence.from_dict(_coordinate_sequence) + + coordinates = [] + _coordinates = d.pop("coordinates", UNSET) + for coordinates_item_data in _coordinates or []: + coordinates_item = Coordinate.from_dict(coordinates_item_data) + + coordinates.append(coordinates_item) + + num_points = d.pop("numPoints", UNSET) + + is_empty = d.pop("isEmpty", UNSET) + + _dimension = d.pop("dimension", UNSET) + dimension: Union[Unset, Dimension] + if isinstance(_dimension, Unset): + dimension = UNSET + else: + dimension = Dimension(_dimension) + + _boundary_dimension = d.pop("boundaryDimension", UNSET) + boundary_dimension: Union[Unset, Dimension] + if isinstance(_boundary_dimension, Unset): + boundary_dimension = UNSET + else: + boundary_dimension = Dimension(_boundary_dimension) + + x = d.pop("x", UNSET) + + y = d.pop("y", UNSET) + + _coordinate = d.pop("coordinate", UNSET) + coordinate: Union[Unset, Coordinate] + if isinstance(_coordinate, Unset): + coordinate = UNSET + else: + coordinate = Coordinate.from_dict(_coordinate) + + geometry_type = d.pop("geometryType", UNSET) + + _ogc_geometry_type = d.pop("ogcGeometryType", UNSET) + ogc_geometry_type: Union[Unset, OgcGeometryType] + if isinstance(_ogc_geometry_type, Unset): + ogc_geometry_type = UNSET + else: + ogc_geometry_type = OgcGeometryType(_ogc_geometry_type) + + _boundary = d.pop("boundary", UNSET) + boundary: Union[Unset, Geometry] + if isinstance(_boundary, Unset): + boundary = UNSET + else: + boundary = Geometry.from_dict(_boundary) + + z = d.pop("z", UNSET) + + m = d.pop("m", UNSET) + + point = cls( + factory=factory, + user_data=user_data, + srid=srid, + precision_model=precision_model, + num_geometries=num_geometries, + is_simple=is_simple, + is_valid=is_valid, + area=area, + length=length, + centroid=centroid, + interior_point=interior_point, + point_on_surface=point_on_surface, + envelope=envelope, + envelope_internal=envelope_internal, + is_rectangle=is_rectangle, + coordinate_sequence=coordinate_sequence, + coordinates=coordinates, + num_points=num_points, + is_empty=is_empty, + dimension=dimension, + boundary_dimension=boundary_dimension, + x=x, + y=y, + coordinate=coordinate, + geometry_type=geometry_type, + ogc_geometry_type=ogc_geometry_type, + boundary=boundary, + z=z, + m=m, + ) + + return point diff --git a/ftc_api/models/power_play_remote_score_breakdown.py b/ftc_api/models/power_play_remote_score_breakdown.py index 1f0dc7a..4cefba8 100644 --- a/ftc_api/models/power_play_remote_score_breakdown.py +++ b/ftc_api/models/power_play_remote_score_breakdown.py @@ -10,7 +10,6 @@ class PowerPlayRemoteScoreBreakdown: """ """ def to_dict(self) -> Dict[str, Any]: - field_dict: Dict[str, Any] = {} field_dict.update({}) diff --git a/ftc_api/models/precision_model.py b/ftc_api/models/precision_model.py new file mode 100644 index 0000000..26e6b1f --- /dev/null +++ b/ftc_api/models/precision_model.py @@ -0,0 +1,70 @@ +from typing import Any, Dict, Type, TypeVar, Union + +import attr + +from ..models.precision_models import PrecisionModels +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PrecisionModel") + + +@attr.s(auto_attribs=True) +class PrecisionModel: + """ + Attributes: + is_floating (Union[Unset, bool]): + maximum_significant_digits (Union[Unset, int]): + scale (Union[Unset, float]): + precision_model_type (Union[Unset, PrecisionModels]): + """ + + is_floating: Union[Unset, bool] = UNSET + maximum_significant_digits: Union[Unset, int] = UNSET + scale: Union[Unset, float] = UNSET + precision_model_type: Union[Unset, PrecisionModels] = UNSET + + def to_dict(self) -> Dict[str, Any]: + is_floating = self.is_floating + maximum_significant_digits = self.maximum_significant_digits + scale = self.scale + precision_model_type: Union[Unset, str] = UNSET + if not isinstance(self.precision_model_type, Unset): + precision_model_type = self.precision_model_type.value + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if is_floating is not UNSET: + field_dict["isFloating"] = is_floating + if maximum_significant_digits is not UNSET: + field_dict["maximumSignificantDigits"] = maximum_significant_digits + if scale is not UNSET: + field_dict["scale"] = scale + if precision_model_type is not UNSET: + field_dict["precisionModelType"] = precision_model_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + is_floating = d.pop("isFloating", UNSET) + + maximum_significant_digits = d.pop("maximumSignificantDigits", UNSET) + + scale = d.pop("scale", UNSET) + + _precision_model_type = d.pop("precisionModelType", UNSET) + precision_model_type: Union[Unset, PrecisionModels] + if isinstance(_precision_model_type, Unset): + precision_model_type = UNSET + else: + precision_model_type = PrecisionModels(_precision_model_type) + + precision_model = cls( + is_floating=is_floating, + maximum_significant_digits=maximum_significant_digits, + scale=scale, + precision_model_type=precision_model_type, + ) + + return precision_model diff --git a/ftc_api/models/precision_models.py b/ftc_api/models/precision_models.py new file mode 100644 index 0000000..3b11313 --- /dev/null +++ b/ftc_api/models/precision_models.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class PrecisionModels(str, Enum): + FLOATING = "Floating" + FLOATINGSINGLE = "FloatingSingle" + FIXED = "Fixed" + + def __str__(self) -> str: + return str(self.value) diff --git a/ftc_api/models/scheduled_match_team.py b/ftc_api/models/scheduled_match_team.py index 2222b99..26b8ba3 100644 --- a/ftc_api/models/scheduled_match_team.py +++ b/ftc_api/models/scheduled_match_team.py @@ -13,18 +13,24 @@ class ScheduledMatchTeam: Attributes: team_number (Union[Unset, None, int]): station (Union[Unset, None, str]): + team (Union[Unset, None, str]): + team_name (Union[Unset, None, str]): surrogate (Union[Unset, bool]): no_show (Union[Unset, bool]): """ team_number: Union[Unset, None, int] = UNSET station: Union[Unset, None, str] = UNSET + team: Union[Unset, None, str] = UNSET + team_name: Union[Unset, None, str] = UNSET surrogate: Union[Unset, bool] = UNSET no_show: Union[Unset, bool] = UNSET def to_dict(self) -> Dict[str, Any]: team_number = self.team_number station = self.station + team = self.team + team_name = self.team_name surrogate = self.surrogate no_show = self.no_show @@ -34,6 +40,10 @@ def to_dict(self) -> Dict[str, Any]: field_dict["teamNumber"] = team_number if station is not UNSET: field_dict["station"] = station + if team is not UNSET: + field_dict["team"] = team + if team_name is not UNSET: + field_dict["teamName"] = team_name if surrogate is not UNSET: field_dict["surrogate"] = surrogate if no_show is not UNSET: @@ -48,6 +58,10 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: station = d.pop("station", UNSET) + team = d.pop("team", UNSET) + + team_name = d.pop("teamName", UNSET) + surrogate = d.pop("surrogate", UNSET) no_show = d.pop("noShow", UNSET) @@ -55,6 +69,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: scheduled_match_team = cls( team_number=team_number, station=station, + team=team, + team_name=team_name, surrogate=surrogate, no_show=no_show, ) diff --git a/ftc_api/models/team_ranking.py b/ftc_api/models/team_ranking.py index 3723614..125dc2f 100644 --- a/ftc_api/models/team_ranking.py +++ b/ftc_api/models/team_ranking.py @@ -13,6 +13,7 @@ class TeamRanking: Attributes: rank (Union[Unset, int]): team_number (Union[Unset, int]): + team_name (Union[Unset, None, str]): sort_order_1 (Union[Unset, float]): sort_order_2 (Union[Unset, float]): sort_order_3 (Union[Unset, float]): @@ -30,6 +31,7 @@ class TeamRanking: rank: Union[Unset, int] = UNSET team_number: Union[Unset, int] = UNSET + team_name: Union[Unset, None, str] = UNSET sort_order_1: Union[Unset, float] = UNSET sort_order_2: Union[Unset, float] = UNSET sort_order_3: Union[Unset, float] = UNSET @@ -47,6 +49,7 @@ class TeamRanking: def to_dict(self) -> Dict[str, Any]: rank = self.rank team_number = self.team_number + team_name = self.team_name sort_order_1 = self.sort_order_1 sort_order_2 = self.sort_order_2 sort_order_3 = self.sort_order_3 @@ -67,6 +70,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["rank"] = rank if team_number is not UNSET: field_dict["teamNumber"] = team_number + if team_name is not UNSET: + field_dict["teamName"] = team_name if sort_order_1 is not UNSET: field_dict["sortOrder1"] = sort_order_1 if sort_order_2 is not UNSET: @@ -103,6 +108,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: team_number = d.pop("teamNumber", UNSET) + team_name = d.pop("teamName", UNSET) + sort_order_1 = d.pop("sortOrder1", UNSET) sort_order_2 = d.pop("sortOrder2", UNSET) @@ -132,6 +139,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: team_ranking = cls( rank=rank, team_number=team_number, + team_name=team_name, sort_order_1=sort_order_1, sort_order_2=sort_order_2, sort_order_3=sort_order_3, diff --git a/pyproject.toml b/pyproject.toml index 260c247..4b32086 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,11 +2,11 @@ name = "ftc_api" description = "A python client to access the FIRST Tech Challenge API" authors = [ - {name = "Ashwin Naren", email="arihant2math@gmail.com"} + { name = "Ashwin Naren", email = "arihant2math@gmail.com" } ] -license = {file = "LICENSE"} +license = { file = "LICENSE" } readme = "README.md" -version = "0.2.0" +version = "0.3.0" dependencies = [ "httpx[http2]", "python-dateutil", "attrs" ] @@ -27,3 +27,9 @@ build-backend = "setuptools.build_meta" [tool.setuptools] packages = ["ftc_api", "ftc_api.api", "ftc_api.models"] + +[project.urls] +"Homepage" = "https://arihant2math.github.io/ftc-api/" +"Repository" = "https://github.com/arihant2math/ftc-api.git" +"Documentation" = "https://arihant2math.github.io/ftc-api/" +"Bug Tracker" = "https://github.com/arihant2math/ftc-api/issues"