Skip to content

Commit

Permalink
more Classes and Objects, Types and Enums added and cleaned-up
Browse files Browse the repository at this point in the history
  • Loading branch information
loechel committed Apr 24, 2024
1 parent f18c7a0 commit b55ee19
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/edutap/wallet_google/modelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ class GoogleWalletObjectModel(GoogleWalletWithIdModel):
"""

classId: str
version: str | None = Field(description="deprecated", exclude=True, default=None)
version: str | None = Field(
description="deprecated", deprecated=True, exclude=True, default=None
)

groupingInfo: GroupingInfo | None = None

Expand All @@ -85,6 +87,7 @@ class GoogleWalletObjectModel(GoogleWalletWithIdModel):
linksModuleData: LinksModuleData | None = None
infoModuleData: InfoModuleData | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default=None,
)
Expand Down
23 changes: 23 additions & 0 deletions src/edutap/wallet_google/models/primitives/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ class BarcodeType(CamelCaseAliasEnum):
TEXT_ONLY = "TEXT_ONLY"


class BoardingPolicy(CamelCaseAliasEnum):
"""
see: https://developers.google.com/wallet/reference/rest/v1/flightclass#boardingpolicy
"""

BOARDING_POLICY_UNSPECIFIED = "BOARDING_POLICY_UNSPECIFIED"
ZONE_BASED = "ZONE_BASED"
GROUP_BASED = "GROUP_BASED"
BOARDING_POLICY_OTHER = "BOARDING_POLICY_OTHER"


class ConcessionCategory(CamelCaseAliasEnum):
"""
see: https://developers.google.com/wallet/reference/rest/v1/transitobject#concessioncategory
Expand Down Expand Up @@ -300,6 +311,18 @@ class ScreenshotEligibility(CamelCaseAliasEnum):
INELIGIBLE = "INELIGIBLE"


class SeatClassPolicy(CamelCaseAliasEnum):
"""
see: https://developers.google.com/wallet/reference/rest/v1/flightclass#seatclasspolicy
"""

SEAT_CLASS_POLICY_UNSPECIFIED = "SEAT_CLASS_POLICY_UNSPECIFIED"
CABIN_BASED = "CABIN_BASED"
CLASS_BASED = "CLASS_BASED"
TIER_BASED = "TIER_BASED"
SEAT_CLASS_POLICY_OTHER = "SEAT_CLASS_POLICY_OTHER"


class SeatLabel(CamelCaseAliasEnum):
"""
see: https://developers.google.com/wallet/tickets/events/rest/v1/eventticketclass#seatlabel
Expand Down
34 changes: 29 additions & 5 deletions src/edutap/wallet_google/models/tickets_and_transit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from .primitives.data import AppLinkData
from .primitives.datetime import TimeInterval
from .primitives.enums import ActivationState
from .primitives.enums import BoardingPolicy
from .primitives.enums import ConcessionCategory
from .primitives.enums import ConfirmationCodeLabel
from .primitives.enums import DoorsOpenLabel
Expand All @@ -21,6 +22,7 @@
from .primitives.enums import PassengerType
from .primitives.enums import ReviewStatus
from .primitives.enums import RowLabel
from .primitives.enums import SeatClassPolicy
from .primitives.enums import SeatLabel
from .primitives.enums import SectionLabel
from .primitives.enums import State
Expand Down Expand Up @@ -124,10 +126,12 @@ class EventTicketClass(
gateLabel: GateLabel | None = None
customGateLabel: LocalizedString | None = None
finePrint: LocalizedString | None = None
version: str | None = Field(description="deprecated", exclude=True, default=None)
issuerName: str | None = None
localizedIssuerName: LocalizedString | None = None
homepageUri: Uri | None = None
version: str | None = Field(
description="deprecated", deprecated=True, exclude=True, default=None
)
# issuerName: str | None = None
# localizedIssuerName: LocalizedString | None = None
# homepageUri: Uri | None = None
locations: list[LatLongPoint] | None = None
reviewStatus: ReviewStatus | None = None
review: Review | None = None
Expand Down Expand Up @@ -378,15 +382,35 @@ class FlightHeader(GoogleWalletModel):

class AirportInfo(GoogleWalletModel):
"""
see:
see: https://developers.google.com/wallet/reference/rest/v1/flightclass#airportinfo
"""

kind: str | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default="walletobjects#airportInfo",
)
airportIataCode: str | None = Field(max_length=3, default=None)
terminal: str | None = None
gate: str | None = None
airportNameOverride: LocalizedString | None = None


class BoardingAndSeatingPolicy(GoogleWalletModel):
"""
see:
"""

kind: str | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default="walletobjects#boardingAndSeatingPolicy",
)
boardingPolicy: BoardingPolicy = BoardingPolicy.BOARDING_POLICY_UNSPECIFIED
seatClassPolicy: SeatClassPolicy = SeatClassPolicy.SEAT_CLASS_POLICY_UNSPECIFIED


@register_model(
"FlightClass",
Expand Down

0 comments on commit b55ee19

Please sign in to comment.