Skip to content

Commit

Permalink
add kind attribute for retail classes
Browse files Browse the repository at this point in the history
  • Loading branch information
loechel committed May 2, 2024
1 parent 1942abf commit 32f77dd
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 3 deletions.
68 changes: 66 additions & 2 deletions src/edutap/wallet_google/models/retail.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,21 @@
)
class GiftCardClass(
GoogleWalletClassModel,
GoogleWalletWithKindMixin,
GoogleWalletMessageableMixin,
GoogleWalletStyleableClassMixin,
):
"""
see: https://developers.google.com/wallet/retail/gift-cards/rest/v1/giftcardclass
"""

kind: str | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default="walletobjects#giftCardClass",
)

merchantName: str | None = None
programLogo: Image | None = None
wideProgramLogo: Image | None = None
Expand Down Expand Up @@ -83,6 +91,13 @@ class GiftCardObject(
see: https://developers.google.com/wallet/retail/gift-cards/rest/v1/giftcardobject
"""

kind: str | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default="walletobjects#giftCardObject",
)

classReference: GiftCardClass | None = None
cardNumber: str | None = None
pin: str | None = None
Expand Down Expand Up @@ -113,6 +128,13 @@ class LoyaltyClass(
see: https://developers.google.com/wallet/retail/loyalty-cards/rest/v1/loyaltyclass
"""

kind: str | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default="walletobjects#loyaltyClass",
)

issuerName: str | None = None
programName: str | None = None
programLogo: Image | None = None
Expand Down Expand Up @@ -180,6 +202,13 @@ class LoyaltyPointsBalance(
see: https://developers.google.com/wallet/retail/loyalty-cards/rest/v1/loyaltyobject#LoyaltyPointsBalance
"""

kind: str | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default="walletobjects#loyaltyPointsBalance",
)

string: str | None = None
int_: int | None = Field(alias="int", serialization_alias="int", default=None)
double: float | None = None
Expand Down Expand Up @@ -208,6 +237,13 @@ class LoyaltyPoints(
see: https://developers.google.com/wallet/retail/loyalty-cards/rest/v1/loyaltyobject#LoyaltyPoints
"""

kind: str | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default="walletobjects#loyaltyPoints",
)

label: str | None = None
balance: LoyaltyPointsBalance | None = None
localizedLabel: LocalizedString | None = None
Expand All @@ -224,6 +260,13 @@ class LoyaltyObject(
see: https://developers.google.com/wallet/retail/loyalty-cards/rest/v1/loyaltyobject
"""

kind: str | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default="walletobjects#loyaltyObject",
)

classReference: LoyaltyClass | None = None
state: State = State.STATE_UNSPECIFIED
accountName: str | None = None
Expand All @@ -249,11 +292,21 @@ class LoyaltyObject(
@register_model(
"OfferClass", url_part="offerClass", plural="offerClasses", can_disable=False
)
class OfferClass(GoogleWalletClassModel):
class OfferClass(
GoogleWalletClassModel,
GoogleWalletWithKindMixin,
):
"""
see: https://developers.google.com/wallet/retail/offers/rest/v1/offerclass
"""

kind: str | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default="walletobjects#offerClass",
)

title: str | None = None
redemptionChannel: RedemptionChannel = (
RedemptionChannel.REDEMPTION_CHANNEL_UNSPECIFIED
Expand Down Expand Up @@ -291,12 +344,23 @@ class OfferClass(GoogleWalletClassModel):


@register_model("OfferObject", url_part="offerObject")
class OfferObject(GoogleWalletObjectModel):
class OfferObject(
GoogleWalletObjectModel,
GoogleWalletWithKindMixin,
):
"""
see: https://developers.google.com/wallet/retail/offers/rest/v1/offerobject
"""

kind: str | None = Field(
description="deprecated",
deprecated=True,
exclude=True,
default="walletobjects#offerClass",
)

classReference: OfferClass | None = None

version: str | None = None
state: State = State.STATE_UNSPECIFIED
barcode: Barcode
Expand Down
2 changes: 1 addition & 1 deletion src/edutap/wallet_google/models/tickets_and_transit.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class EventTicketClass(
)
# issuerName: str | None = None
# localizedIssuerName: LocalizedString | None = None
# homepageUri: Uri | None = None
homepageUri: Uri | None = None
locations: list[LatLongPoint] | None = None
reviewStatus: ReviewStatus | None = None
review: Review | None = None
Expand Down

0 comments on commit 32f77dd

Please sign in to comment.