// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Google Wallet API Client for Deno * ================================= * * API for issuers to save and manage Google Wallet Objects. * * Docs: https://developers.google.com/pay/passes * Source: https://googleapis.deno.dev/v1/walletobjects:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * API for issuers to save and manage Google Wallet Objects. */ export class Walletobjects { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://walletobjects.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Adds a message to the event ticket class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async eventticketclassAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketClass/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeEventTicketClassAddMessageResponse(data); } /** * Returns the event ticket class with the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async eventticketclassGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketClass/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeEventTicketClass(data); } /** * Inserts an event ticket class with the given ID and properties. * */ async eventticketclassInsert(req: EventTicketClass): Promise { req = serializeEventTicketClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketClass`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeEventTicketClass(data); } /** * Returns a list of all event ticket classes for a given issuer ID. * */ async eventticketclassList(opts: EventticketclassListOptions = {}): Promise { opts = serializeEventticketclassListOptions(opts); const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketClass`); if (opts.issuerId !== undefined) { url.searchParams.append("issuerId", String(opts.issuerId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeEventTicketClassListResponse(data); } /** * Updates the event ticket class referenced by the given class ID. This * method supports patch semantics. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async eventticketclassPatch(resourceId: string, req: EventTicketClass): Promise { req = serializeEventTicketClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeEventTicketClass(data); } /** * Updates the event ticket class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async eventticketclassUpdate(resourceId: string, req: EventTicketClass): Promise { req = serializeEventTicketClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeEventTicketClass(data); } /** * Adds a message to the event ticket object referenced by the given object * ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async eventticketobjectAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketObject/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeEventTicketObjectAddMessageResponse(data); } /** * Returns the event ticket object with the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async eventticketobjectGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketObject/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeEventTicketObject(data); } /** * Inserts an event ticket object with the given ID and properties. * */ async eventticketobjectInsert(req: EventTicketObject): Promise { req = serializeEventTicketObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketObject`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeEventTicketObject(data); } /** * Returns a list of all event ticket objects for a given issuer ID. * */ async eventticketobjectList(opts: EventticketobjectListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketObject`); if (opts.classId !== undefined) { url.searchParams.append("classId", String(opts.classId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeEventTicketObjectListResponse(data); } /** * Modifies linked offer objects for the event ticket object with the given * ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async eventticketobjectModifylinkedofferobjects(resourceId: string, req: ModifyLinkedOfferObjectsRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketObject/${ resourceId }/modifyLinkedOfferObjects`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeEventTicketObject(data); } /** * Updates the event ticket object referenced by the given object ID. This * method supports patch semantics. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async eventticketobjectPatch(resourceId: string, req: EventTicketObject): Promise { req = serializeEventTicketObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeEventTicketObject(data); } /** * Updates the event ticket object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async eventticketobjectUpdate(resourceId: string, req: EventTicketObject): Promise { req = serializeEventTicketObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/eventTicketObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeEventTicketObject(data); } /** * Adds a message to the flight class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async flightclassAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/flightClass/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeFlightClassAddMessageResponse(data); } /** * Returns the flight class with the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async flightclassGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/flightClass/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFlightClass(data); } /** * Inserts an flight class with the given ID and properties. * */ async flightclassInsert(req: FlightClass): Promise { req = serializeFlightClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/flightClass`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeFlightClass(data); } /** * Returns a list of all flight classes for a given issuer ID. * */ async flightclassList(opts: FlightclassListOptions = {}): Promise { opts = serializeFlightclassListOptions(opts); const url = new URL(`${this.#baseUrl}walletobjects/v1/flightClass`); if (opts.issuerId !== undefined) { url.searchParams.append("issuerId", String(opts.issuerId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFlightClassListResponse(data); } /** * Updates the flight class referenced by the given class ID. This method * supports patch semantics. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async flightclassPatch(resourceId: string, req: FlightClass): Promise { req = serializeFlightClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/flightClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeFlightClass(data); } /** * Updates the flight class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async flightclassUpdate(resourceId: string, req: FlightClass): Promise { req = serializeFlightClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/flightClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeFlightClass(data); } /** * Adds a message to the flight object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async flightobjectAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/flightObject/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeFlightObjectAddMessageResponse(data); } /** * Returns the flight object with the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async flightobjectGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/flightObject/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFlightObject(data); } /** * Inserts an flight object with the given ID and properties. * */ async flightobjectInsert(req: FlightObject): Promise { req = serializeFlightObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/flightObject`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeFlightObject(data); } /** * Returns a list of all flight objects for a given issuer ID. * */ async flightobjectList(opts: FlightobjectListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/flightObject`); if (opts.classId !== undefined) { url.searchParams.append("classId", String(opts.classId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFlightObjectListResponse(data); } /** * Updates the flight object referenced by the given object ID. This method * supports patch semantics. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async flightobjectPatch(resourceId: string, req: FlightObject): Promise { req = serializeFlightObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/flightObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeFlightObject(data); } /** * Updates the flight object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async flightobjectUpdate(resourceId: string, req: FlightObject): Promise { req = serializeFlightObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/flightObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeFlightObject(data); } /** * Adds a message to the generic class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async genericclassAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/genericClass/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGenericClassAddMessageResponse(data); } /** * Returns the generic class with the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value needs to follow the format `issuerID.identifier` where `issuerID` is issued by Google and `identifier` is chosen by you. The unique identifier can only include alphanumeric characters, `.`, `_`, or `-`. */ async genericclassGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/genericClass/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGenericClass(data); } /** * Inserts a generic class with the given ID and properties. * */ async genericclassInsert(req: GenericClass): Promise { req = serializeGenericClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/genericClass`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGenericClass(data); } /** * Returns a list of all generic classes for a given issuer ID. * */ async genericclassList(opts: GenericclassListOptions = {}): Promise { opts = serializeGenericclassListOptions(opts); const url = new URL(`${this.#baseUrl}walletobjects/v1/genericClass`); if (opts.issuerId !== undefined) { url.searchParams.append("issuerId", String(opts.issuerId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGenericClassListResponse(data); } /** * Updates the generic class referenced by the given class ID. This method * supports patch semantics. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value needs to follow the format `issuerID.identifier` where `issuerID` is issued by Google and `identifier` is chosen by you. The unique identifier can only include alphanumeric characters, `.`, `_`, or `-`. */ async genericclassPatch(resourceId: string, req: GenericClass): Promise { req = serializeGenericClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/genericClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeGenericClass(data); } /** * Updates the Generic class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value needs to follow the format `issuerID.identifier` where `issuerID` is issued by Google and `identifier` is chosen by you. The unique identifier can only include alphanumeric characters, `.`, `_`, or `-`. */ async genericclassUpdate(resourceId: string, req: GenericClass): Promise { req = serializeGenericClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/genericClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeGenericClass(data); } /** * Adds a message to the generic object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async genericobjectAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/genericObject/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGenericObjectAddMessageResponse(data); } /** * Returns the generic object with the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value needs to follow the format `issuerID.identifier` where `issuerID` is issued by Google and `identifier` is chosen by you. The unique identifier can only include alphanumeric characters, `.`, `_`, or `-`. */ async genericobjectGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/genericObject/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGenericObject(data); } /** * Inserts a generic object with the given ID and properties. * */ async genericobjectInsert(req: GenericObject): Promise { req = serializeGenericObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/genericObject`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGenericObject(data); } /** * Returns a list of all generic objects for a given issuer ID. * */ async genericobjectList(opts: GenericobjectListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/genericObject`); if (opts.classId !== undefined) { url.searchParams.append("classId", String(opts.classId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGenericObjectListResponse(data); } /** * Updates the generic object referenced by the given object ID. This method * supports patch semantics. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value needs to follow the format `issuerID.identifier` where `issuerID` is issued by Google and `identifier` is chosen by you. The unique identifier can only include alphanumeric characters, `.`, `_`, or `-`. */ async genericobjectPatch(resourceId: string, req: GenericObject): Promise { req = serializeGenericObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/genericObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeGenericObject(data); } /** * Updates the generic object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value needs to follow the format `issuerID.identifier` where `issuerID` is issued by Google and `identifier` is chosen by you. The unique identifier can only include alphanumeric characters, `.`, `_`, or `-`. */ async genericobjectUpdate(resourceId: string, req: GenericObject): Promise { req = serializeGenericObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/genericObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeGenericObject(data); } /** * Adds a message to the gift card class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async giftcardclassAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardClass/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGiftCardClassAddMessageResponse(data); } /** * Returns the gift card class with the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async giftcardclassGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardClass/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGiftCardClass(data); } /** * Inserts an gift card class with the given ID and properties. * */ async giftcardclassInsert(req: GiftCardClass): Promise { req = serializeGiftCardClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardClass`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGiftCardClass(data); } /** * Returns a list of all gift card classes for a given issuer ID. * */ async giftcardclassList(opts: GiftcardclassListOptions = {}): Promise { opts = serializeGiftcardclassListOptions(opts); const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardClass`); if (opts.issuerId !== undefined) { url.searchParams.append("issuerId", String(opts.issuerId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGiftCardClassListResponse(data); } /** * Updates the gift card class referenced by the given class ID. This method * supports patch semantics. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async giftcardclassPatch(resourceId: string, req: GiftCardClass): Promise { req = serializeGiftCardClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeGiftCardClass(data); } /** * Updates the gift card class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async giftcardclassUpdate(resourceId: string, req: GiftCardClass): Promise { req = serializeGiftCardClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeGiftCardClass(data); } /** * Adds a message to the gift card object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async giftcardobjectAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardObject/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGiftCardObjectAddMessageResponse(data); } /** * Returns the gift card object with the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async giftcardobjectGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardObject/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGiftCardObject(data); } /** * Inserts an gift card object with the given ID and properties. * */ async giftcardobjectInsert(req: GiftCardObject): Promise { req = serializeGiftCardObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardObject`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeGiftCardObject(data); } /** * Returns a list of all gift card objects for a given issuer ID. * */ async giftcardobjectList(opts: GiftcardobjectListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardObject`); if (opts.classId !== undefined) { url.searchParams.append("classId", String(opts.classId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGiftCardObjectListResponse(data); } /** * Updates the gift card object referenced by the given object ID. This * method supports patch semantics. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async giftcardobjectPatch(resourceId: string, req: GiftCardObject): Promise { req = serializeGiftCardObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeGiftCardObject(data); } /** * Updates the gift card object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async giftcardobjectUpdate(resourceId: string, req: GiftCardObject): Promise { req = serializeGiftCardObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/giftCardObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeGiftCardObject(data); } /** * Returns the issuer with the given issuer ID. * * @param resourceId The unique identifier for an issuer. */ async issuerGet(resourceId: bigint): Promise { resourceId = String(resourceId); const url = new URL(`${this.#baseUrl}walletobjects/v1/issuer/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeIssuer(data); } /** * Inserts an issuer with the given ID and properties. * */ async issuerInsert(req: Issuer): Promise { req = serializeIssuer(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/issuer`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeIssuer(data); } /** * Returns a list of all issuers shared to the caller. * */ async issuerList(): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/issuer`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeIssuerListResponse(data); } /** * Updates the issuer referenced by the given issuer ID. This method supports * patch semantics. * * @param resourceId The unique identifier for an issuer. */ async issuerPatch(resourceId: bigint, req: Issuer): Promise { resourceId = String(resourceId); req = serializeIssuer(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/issuer/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeIssuer(data); } /** * Updates the issuer referenced by the given issuer ID. * * @param resourceId The unique identifier for an issuer. */ async issuerUpdate(resourceId: bigint, req: Issuer): Promise { resourceId = String(resourceId); req = serializeIssuer(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/issuer/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeIssuer(data); } /** * Inserts the resources in the JWT. * */ async jwtInsert(req: JwtResource): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/jwt`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeJwtInsertResponse(data); } /** * Adds a message to the loyalty class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async loyaltyclassAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyClass/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeLoyaltyClassAddMessageResponse(data); } /** * Returns the loyalty class with the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async loyaltyclassGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyClass/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeLoyaltyClass(data); } /** * Inserts an loyalty class with the given ID and properties. * */ async loyaltyclassInsert(req: LoyaltyClass): Promise { req = serializeLoyaltyClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyClass`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeLoyaltyClass(data); } /** * Returns a list of all loyalty classes for a given issuer ID. * */ async loyaltyclassList(opts: LoyaltyclassListOptions = {}): Promise { opts = serializeLoyaltyclassListOptions(opts); const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyClass`); if (opts.issuerId !== undefined) { url.searchParams.append("issuerId", String(opts.issuerId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeLoyaltyClassListResponse(data); } /** * Updates the loyalty class referenced by the given class ID. This method * supports patch semantics. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async loyaltyclassPatch(resourceId: string, req: LoyaltyClass): Promise { req = serializeLoyaltyClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeLoyaltyClass(data); } /** * Updates the loyalty class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async loyaltyclassUpdate(resourceId: string, req: LoyaltyClass): Promise { req = serializeLoyaltyClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeLoyaltyClass(data); } /** * Adds a message to the loyalty object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async loyaltyobjectAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyObject/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeLoyaltyObjectAddMessageResponse(data); } /** * Returns the loyalty object with the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async loyaltyobjectGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyObject/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeLoyaltyObject(data); } /** * Inserts an loyalty object with the given ID and properties. * */ async loyaltyobjectInsert(req: LoyaltyObject): Promise { req = serializeLoyaltyObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyObject`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeLoyaltyObject(data); } /** * Returns a list of all loyalty objects for a given issuer ID. * */ async loyaltyobjectList(opts: LoyaltyobjectListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyObject`); if (opts.classId !== undefined) { url.searchParams.append("classId", String(opts.classId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeLoyaltyObjectListResponse(data); } /** * Modifies linked offer objects for the loyalty object with the given ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async loyaltyobjectModifylinkedofferobjects(resourceId: string, req: ModifyLinkedOfferObjectsRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyObject/${ resourceId }/modifyLinkedOfferObjects`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeLoyaltyObject(data); } /** * Updates the loyalty object referenced by the given object ID. This method * supports patch semantics. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async loyaltyobjectPatch(resourceId: string, req: LoyaltyObject): Promise { req = serializeLoyaltyObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeLoyaltyObject(data); } /** * Updates the loyalty object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async loyaltyobjectUpdate(resourceId: string, req: LoyaltyObject): Promise { req = serializeLoyaltyObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/loyaltyObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeLoyaltyObject(data); } /** * Downloads rotating barcode values for the transit object referenced by the * given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async mediaDownload(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/transitObject/${ resourceId }/downloadRotatingBarcodeValues`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeMedia(data); } /** * Uploads rotating barcode values for the transit object referenced by the * given object ID. Note the max upload size is specified in * google3/production/config/cdd/apps-upload/customers/payments-consumer-passes/config.gcl * and enforced by Scotty. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async mediaUpload(resourceId: string, req: TransitObjectUploadRotatingBarcodeValuesRequest): Promise { req = serializeTransitObjectUploadRotatingBarcodeValuesRequest(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/transitObject/${ resourceId }/uploadRotatingBarcodeValues`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TransitObjectUploadRotatingBarcodeValuesResponse; } /** * Adds a message to the offer class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async offerclassAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/offerClass/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOfferClassAddMessageResponse(data); } /** * Returns the offer class with the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async offerclassGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/offerClass/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOfferClass(data); } /** * Inserts an offer class with the given ID and properties. * */ async offerclassInsert(req: OfferClass): Promise { req = serializeOfferClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/offerClass`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOfferClass(data); } /** * Returns a list of all offer classes for a given issuer ID. * */ async offerclassList(opts: OfferclassListOptions = {}): Promise { opts = serializeOfferclassListOptions(opts); const url = new URL(`${this.#baseUrl}walletobjects/v1/offerClass`); if (opts.issuerId !== undefined) { url.searchParams.append("issuerId", String(opts.issuerId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOfferClassListResponse(data); } /** * Updates the offer class referenced by the given class ID. This method * supports patch semantics. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async offerclassPatch(resourceId: string, req: OfferClass): Promise { req = serializeOfferClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/offerClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOfferClass(data); } /** * Updates the offer class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async offerclassUpdate(resourceId: string, req: OfferClass): Promise { req = serializeOfferClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/offerClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOfferClass(data); } /** * Adds a message to the offer object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async offerobjectAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/offerObject/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOfferObjectAddMessageResponse(data); } /** * Returns the offer object with the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async offerobjectGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/offerObject/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOfferObject(data); } /** * Inserts an offer object with the given ID and properties. * */ async offerobjectInsert(req: OfferObject): Promise { req = serializeOfferObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/offerObject`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeOfferObject(data); } /** * Returns a list of all offer objects for a given issuer ID. * */ async offerobjectList(opts: OfferobjectListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/offerObject`); if (opts.classId !== undefined) { url.searchParams.append("classId", String(opts.classId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeOfferObjectListResponse(data); } /** * Updates the offer object referenced by the given object ID. This method * supports patch semantics. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async offerobjectPatch(resourceId: string, req: OfferObject): Promise { req = serializeOfferObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/offerObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeOfferObject(data); } /** * Updates the offer object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async offerobjectUpdate(resourceId: string, req: OfferObject): Promise { req = serializeOfferObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/offerObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeOfferObject(data); } /** * Returns the permissions for the given issuer id. * * @param resourceId The unique identifier for an issuer. This ID must be unique across all issuers. */ async permissionsGet(resourceId: bigint): Promise { resourceId = String(resourceId); const url = new URL(`${this.#baseUrl}walletobjects/v1/permissions/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePermissions(data); } /** * Updates the permissions for the given issuer. * * @param resourceId The unique identifier for an issuer. This ID must be unique across all issuers. */ async permissionsUpdate(resourceId: bigint, req: Permissions): Promise { resourceId = String(resourceId); req = serializePermissions(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/permissions/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializePermissions(data); } /** * Inserts the smart tap. * */ async smarttapInsert(req: SmartTap): Promise { req = serializeSmartTap(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/smartTap`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSmartTap(data); } /** * Adds a message to the transit class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async transitclassAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/transitClass/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeTransitClassAddMessageResponse(data); } /** * Returns the transit class with the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async transitclassGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/transitClass/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTransitClass(data); } /** * Inserts a transit class with the given ID and properties. * */ async transitclassInsert(req: TransitClass): Promise { req = serializeTransitClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/transitClass`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeTransitClass(data); } /** * Returns a list of all transit classes for a given issuer ID. * */ async transitclassList(opts: TransitclassListOptions = {}): Promise { opts = serializeTransitclassListOptions(opts); const url = new URL(`${this.#baseUrl}walletobjects/v1/transitClass`); if (opts.issuerId !== undefined) { url.searchParams.append("issuerId", String(opts.issuerId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTransitClassListResponse(data); } /** * Updates the transit class referenced by the given class ID. This method * supports patch semantics. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async transitclassPatch(resourceId: string, req: TransitClass): Promise { req = serializeTransitClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/transitClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeTransitClass(data); } /** * Updates the transit class referenced by the given class ID. * * @param resourceId The unique identifier for a class. This ID must be unique across all classes from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async transitclassUpdate(resourceId: string, req: TransitClass): Promise { req = serializeTransitClass(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/transitClass/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeTransitClass(data); } /** * Adds a message to the transit object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async transitobjectAddmessage(resourceId: string, req: AddMessageRequest): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/transitObject/${ resourceId }/addMessage`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeTransitObjectAddMessageResponse(data); } /** * Returns the transit object with the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async transitobjectGet(resourceId: string): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/transitObject/${ resourceId }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTransitObject(data); } /** * Inserts an transit object with the given ID and properties. * */ async transitobjectInsert(req: TransitObject): Promise { req = serializeTransitObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/transitObject`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeTransitObject(data); } /** * Returns a list of all transit objects for a given issuer ID. * */ async transitobjectList(opts: TransitobjectListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}walletobjects/v1/transitObject`); if (opts.classId !== undefined) { url.searchParams.append("classId", String(opts.classId)); } if (opts.maxResults !== undefined) { url.searchParams.append("maxResults", String(opts.maxResults)); } if (opts.token !== undefined) { url.searchParams.append("token", String(opts.token)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeTransitObjectListResponse(data); } /** * Updates the transit object referenced by the given object ID. This method * supports patch semantics. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async transitobjectPatch(resourceId: string, req: TransitObject): Promise { req = serializeTransitObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/transitObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeTransitObject(data); } /** * Updates the transit object referenced by the given object ID. * * @param resourceId The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Your unique identifier should only include alphanumeric characters, '.', '_', or '-'. */ async transitobjectUpdate(resourceId: string, req: TransitObject): Promise { req = serializeTransitObject(req); const url = new URL(`${this.#baseUrl}walletobjects/v1/transitObject/${ resourceId }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return deserializeTransitObject(data); } } /** * ActivationOptions for the class */ export interface ActivationOptions { /** * HTTPS URL that supports REST semantics. Would be used for requesting * activation from partners for given valuable, triggered by the users. */ activationUrl?: string; /** * Flag to allow users to make activation call from different device. This * allows client to render the activation button enabled even if the * activationStatus is ACTIVATED but the requested device is different than * the current device. */ allowReactivation?: boolean; } /** * The activation status of the object. This field includes activation status * if valuable supports activation. */ export interface ActivationStatus { state?: | "UNKNOWN_STATE" | "NOT_ACTIVATED" | "not_activated" | "ACTIVATED" | "activated"; } /** * Resource used when the AddMessage endpoints are called. */ export interface AddMessageRequest { message?: Message; } export interface AirportInfo { /** * Three character IATA airport code. This is a required field for `origin` * and `destination`. Eg: "SFO" */ airportIataCode?: string; /** * Optional field that overrides the airport city name defined by IATA. By * default, Google takes the `airportIataCode` provided and maps it to the * official airport city name defined by IATA. Official IATA airport city * names can be found at IATA airport city names website. For example, for the * airport IATA code "LTN", IATA website tells us that the corresponding * airport city is "London". If this field is not populated, Google would * display "London". However, populating this field with a custom name (eg: * "London Luton") would override it. */ airportNameOverride?: LocalizedString; /** * A name of the gate. Eg: "B59" or "59" */ gate?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#airportInfo"`. */ kind?: string; /** * Terminal name. Eg: "INTL" or "I" */ terminal?: string; } export interface AppLinkData { /** * Optional information about the partner app link. */ androidAppLinkInfo?: AppLinkDataAppLinkInfo; /** * Optional display text for the app link button. Character limit is 30. */ displayText?: LocalizedString; /** * Deprecated. Links to open iOS apps are not supported. */ iosAppLinkInfo?: AppLinkDataAppLinkInfo; /** * Optional information about the partner web link. */ webAppLinkInfo?: AppLinkDataAppLinkInfo; } export interface AppLinkDataAppLinkInfo { /** * Deprecated. Image isn't supported in the app link module. */ appLogoImage?: Image; /** * Target to follow when opening the app link on clients. It will be used by * partners to open their app or webpage. */ appTarget?: AppLinkDataAppLinkInfoAppTarget; /** * Deprecated. Description isn't supported in the app link module. */ description?: LocalizedString; /** * Deprecated. Title isn't supported in the app link module. */ title?: LocalizedString; } export interface AppLinkDataAppLinkInfoAppTarget { /** * Package name for AppTarget. For example: com.google.android.gm */ packageName?: string; /** * URI for AppTarget. The description on the URI must be set. Prefer setting * package field instead, if this target is defined for your application. */ targetUri?: Uri; } export interface AuthenticationKey { /** * Available only to Smart Tap enabled partners. Contact support for * additional guidance. */ id?: number; /** * Available only to Smart Tap enabled partners. Contact support for * additional guidance. */ publicKeyPem?: string; } export interface Barcode { /** * An optional text that will override the default text that shows under the * barcode. This field is intended for a human readable equivalent of the * barcode value, used when the barcode cannot be scanned. */ alternateText?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#barcode"`. */ kind?: string; /** * The render encoding for the barcode. When specified, barcode is rendered * in the given encoding. Otherwise best known encoding is chosen by Google. */ renderEncoding?: | "RENDER_ENCODING_UNSPECIFIED" | "UTF_8"; /** * Optional text that will be shown when the barcode is hidden behind a click * action. This happens in cases where a pass has Smart Tap enabled. If not * specified, a default is chosen by Google. */ showCodeText?: LocalizedString; /** * The type of barcode. */ type?: | "BARCODE_TYPE_UNSPECIFIED" | "AZTEC" | "aztec" | "CODE_39" | "code39" | "CODE_128" | "code128" | "CODABAR" | "codabar" | "DATA_MATRIX" | "dataMatrix" | "EAN_8" | "ean8" | "EAN_13" | "ean13" | "EAN13" | "ITF_14" | "itf14" | "PDF_417" | "pdf417" | "PDF417" | "QR_CODE" | "qrCode" | "qrcode" | "UPC_A" | "upcA" | "TEXT_ONLY" | "textOnly"; /** * The value encoded in the barcode. */ value?: string; } export interface BarcodeSectionDetail { /** * A reference to an existing text-based or image field to display. */ fieldSelector?: FieldSelector; } /** * Information to read/write to blobstore2. */ export interface Blobstore2Info { /** * The blob generation id. */ blobGeneration?: bigint; /** * The blob id, e.g., /blobstore/prod/playground/scotty */ blobId?: string; /** * Read handle passed from Bigstore -> Scotty for a GCS download. This is a * signed, serialized blobstore2.ReadHandle proto which must never be set * outside of Bigstore, and is not applicable to non-GCS media downloads. */ downloadReadHandle?: Uint8Array; /** * The blob read token. Needed to read blobs that have not been replicated. * Might not be available until the final call. */ readToken?: string; /** * Metadata passed from Blobstore -> Scotty for a new GCS upload. This is a * signed, serialized blobstore2.BlobMetadataContainer proto which must never * be consumed outside of Bigstore, and is not applicable to non-GCS media * uploads. */ uploadMetadataContainer?: Uint8Array; } function serializeBlobstore2Info(data: any): Blobstore2Info { return { ...data, blobGeneration: data["blobGeneration"] !== undefined ? String(data["blobGeneration"]) : undefined, downloadReadHandle: data["downloadReadHandle"] !== undefined ? encodeBase64(data["downloadReadHandle"]) : undefined, uploadMetadataContainer: data["uploadMetadataContainer"] !== undefined ? encodeBase64(data["uploadMetadataContainer"]) : undefined, }; } function deserializeBlobstore2Info(data: any): Blobstore2Info { return { ...data, blobGeneration: data["blobGeneration"] !== undefined ? BigInt(data["blobGeneration"]) : undefined, downloadReadHandle: data["downloadReadHandle"] !== undefined ? decodeBase64(data["downloadReadHandle"] as string) : undefined, uploadMetadataContainer: data["uploadMetadataContainer"] !== undefined ? decodeBase64(data["uploadMetadataContainer"] as string) : undefined, }; } export interface BoardingAndSeatingInfo { /** * Set this field only if this flight boards through more than one door or * bridge and you want to explicitly print the door location on the boarding * pass. Most airlines route their passengers to the right door or bridge by * refering to doors/bridges by the `seatClass`. In those cases `boardingDoor` * should not be set. */ boardingDoor?: | "BOARDING_DOOR_UNSPECIFIED" | "FRONT" | "front" | "BACK" | "back"; /** * The value of boarding group (or zone) this passenger shall board with. eg: * "B" The label for this value will be determined by the `boardingPolicy` * field in the `flightClass` referenced by this object. */ boardingGroup?: string; /** * The value of boarding position. eg: "76" */ boardingPosition?: string; /** * A small image shown above the boarding barcode. Airlines can use it to * communicate any special boarding privileges. In the event the security * program logo is also set, this image might be rendered alongside the logo * for that security program. */ boardingPrivilegeImage?: Image; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#boardingAndSeatingInfo"`. */ kind?: string; /** * The passenger's seat assignment. To be used when there is no specific * identifier to use in `seatNumber`. eg: "assigned at gate" */ seatAssignment?: LocalizedString; /** * The value of the seat class. eg: "Economy" or "Economy Plus" */ seatClass?: string; /** * The value of passenger seat. If there is no specific identifier, use * `seatAssignment` instead. eg: "25A" */ seatNumber?: string; /** * The sequence number on the boarding pass. This usually matches the * sequence in which the passengers checked in. Airline might use the number * for manual boarding and bag tags. eg: "49" */ sequenceNumber?: string; } export interface BoardingAndSeatingPolicy { /** * Indicates the policy the airline uses for boarding. If unset, Google will * default to `zoneBased`. */ boardingPolicy?: | "BOARDING_POLICY_UNSPECIFIED" | "ZONE_BASED" | "zoneBased" | "GROUP_BASED" | "groupBased" | "BOARDING_POLICY_OTHER" | "boardingPolicyOther"; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#boardingAndSeatingPolicy"`. */ kind?: string; /** * Seating policy which dictates how we display the seat class. If unset, * Google will default to `cabinBased`. */ seatClassPolicy?: | "SEAT_CLASS_POLICY_UNSPECIFIED" | "CABIN_BASED" | "cabinBased" | "CLASS_BASED" | "classBased" | "TIER_BASED" | "tierBased" | "SEAT_CLASS_POLICY_OTHER" | "seatClassPolicyOther"; } export interface CallbackOptions { /** * URL for the merchant endpoint that would be called to request updates. The * URL should be hosted on HTTPS and robots.txt should allow the URL path to * be accessible by UserAgent:Googlebot. Deprecated. */ updateRequestUrl?: string; /** * The HTTPS url configured by the merchant. The URL should be hosted on * HTTPS and robots.txt should allow the URL path to be accessible by * UserAgent:Googlebot. */ url?: string; } export interface CardBarcodeSectionDetails { /** * Optional information to display below the barcode. */ firstBottomDetail?: BarcodeSectionDetail; /** * Optional information to display above the barcode. If `secondTopDetail` is * defined, this will be displayed to the start side of this detail section. */ firstTopDetail?: BarcodeSectionDetail; /** * Optional second piece of information to display above the barcode. If * `firstTopDetail` is defined, this will be displayed to the end side of this * detail section. */ secondTopDetail?: BarcodeSectionDetail; } export interface CardRowOneItem { /** * The item to be displayed in the row. This item will be automatically * centered. */ item?: TemplateItem; } export interface CardRowTemplateInfo { /** * Template for a row containing one item. Exactly one of "one_item", * "two_items", "three_items" must be set. */ oneItem?: CardRowOneItem; /** * Template for a row containing three items. Exactly one of "one_item", * "two_items", "three_items" must be set. */ threeItems?: CardRowThreeItems; /** * Template for a row containing two items. Exactly one of "one_item", * "two_items", "three_items" must be set. */ twoItems?: CardRowTwoItems; } export interface CardRowThreeItems { /** * The item to be displayed at the end of the row. This item will be aligned * to the right. */ endItem?: TemplateItem; /** * The item to be displayed in the middle of the row. This item will be * centered between the start and end items. */ middleItem?: TemplateItem; /** * The item to be displayed at the start of the row. This item will be * aligned to the left. */ startItem?: TemplateItem; } export interface CardRowTwoItems { /** * The item to be displayed at the end of the row. This item will be aligned * to the right. */ endItem?: TemplateItem; /** * The item to be displayed at the start of the row. This item will be * aligned to the left. */ startItem?: TemplateItem; } export interface CardTemplateOverride { /** * Template information for rows in the card view. At most three rows are * allowed to be specified. */ cardRowTemplateInfos?: CardRowTemplateInfo[]; } export interface ClassTemplateInfo { /** * Specifies extra information to be displayed above and below the barcode. */ cardBarcodeSectionDetails?: CardBarcodeSectionDetails; /** * Override for the card view. */ cardTemplateOverride?: CardTemplateOverride; /** * Override for the details view (beneath the card view). */ detailsTemplateOverride?: DetailsTemplateOverride; /** * Override for the passes list view. */ listTemplateOverride?: ListTemplateOverride; } /** * A sequence of media data references representing composite data. Introduced * to support Bigstore composite objects. For details, visit * http://go/bigstore-composites. */ export interface CompositeMedia { /** * Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should * be the byte representation of a blobstore.BlobRef. Since Blobstore is * deprecating v1, use blobstore2_info instead. For now, any v2 blob will also * be represented in this field as v1 BlobRef. */ blobRef?: Uint8Array; /** * Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to * a v2 blob. */ blobstore2Info?: Blobstore2Info; /** * A binary data reference for a media download. Serves as a * technology-agnostic binary reference in some Google infrastructure. This * value is a serialized storage_cosmo.BinaryReference proto. Storing it as * bytes is a hack to get around the fact that the cosmo proto (as well as * others it includes) doesn't support JavaScript. This prevents us from * including the actual type of this field. */ cosmoBinaryReference?: Uint8Array; /** * crc32.c hash for the payload. */ crc32cHash?: number; /** * Media data, set if reference_type is INLINE */ inline?: Uint8Array; /** * Size of the data, in bytes */ length?: bigint; /** * MD5 hash for the payload. */ md5Hash?: Uint8Array; /** * Reference to a TI Blob, set if reference_type is BIGSTORE_REF. */ objectId?: ObjectId; /** * Path to the data, set if reference_type is PATH */ path?: string; /** * Describes what the field reference contains. */ referenceType?: | "PATH" | "BLOB_REF" | "INLINE" | "BIGSTORE_REF" | "COSMO_BINARY_REFERENCE"; /** * SHA-1 hash for the payload. */ sha1Hash?: Uint8Array; } function serializeCompositeMedia(data: any): CompositeMedia { return { ...data, blobRef: data["blobRef"] !== undefined ? encodeBase64(data["blobRef"]) : undefined, blobstore2Info: data["blobstore2Info"] !== undefined ? serializeBlobstore2Info(data["blobstore2Info"]) : undefined, cosmoBinaryReference: data["cosmoBinaryReference"] !== undefined ? encodeBase64(data["cosmoBinaryReference"]) : undefined, inline: data["inline"] !== undefined ? encodeBase64(data["inline"]) : undefined, length: data["length"] !== undefined ? String(data["length"]) : undefined, md5Hash: data["md5Hash"] !== undefined ? encodeBase64(data["md5Hash"]) : undefined, objectId: data["objectId"] !== undefined ? serializeObjectId(data["objectId"]) : undefined, sha1Hash: data["sha1Hash"] !== undefined ? encodeBase64(data["sha1Hash"]) : undefined, }; } function deserializeCompositeMedia(data: any): CompositeMedia { return { ...data, blobRef: data["blobRef"] !== undefined ? decodeBase64(data["blobRef"] as string) : undefined, blobstore2Info: data["blobstore2Info"] !== undefined ? deserializeBlobstore2Info(data["blobstore2Info"]) : undefined, cosmoBinaryReference: data["cosmoBinaryReference"] !== undefined ? decodeBase64(data["cosmoBinaryReference"] as string) : undefined, inline: data["inline"] !== undefined ? decodeBase64(data["inline"] as string) : undefined, length: data["length"] !== undefined ? BigInt(data["length"]) : undefined, md5Hash: data["md5Hash"] !== undefined ? decodeBase64(data["md5Hash"] as string) : undefined, objectId: data["objectId"] !== undefined ? deserializeObjectId(data["objectId"]) : undefined, sha1Hash: data["sha1Hash"] !== undefined ? decodeBase64(data["sha1Hash"] as string) : undefined, }; } /** * Detailed Content-Type information from Scotty. The Content-Type of the media * will typically be filled in by the header or Scotty's best_guess, but this * extended information provides the backend with more information so that it * can make a better decision if needed. This is only used on media upload * requests from Scotty. */ export interface ContentTypeInfo { /** * Scotty's best guess of what the content type of the file is. */ bestGuess?: string; /** * The content type of the file derived by looking at specific bytes (i.e. * "magic bytes") of the actual file. */ fromBytes?: string; /** * The content type of the file derived from the file extension of the * original file name used by the client. */ fromFileName?: string; /** * The content type of the file as specified in the request headers, * multipart headers, or RUPIO start request. */ fromHeader?: string; /** * The content type of the file derived from the file extension of the URL * path. The URL path is assumed to represent a file name (which is typically * only true for agents that are providing a REST API). */ fromUrlPath?: string; } export interface DateTime { /** * An ISO 8601 extended format date/time. Offset may or may not be required * (refer to the parent field's documentation). Time may be specified up to * nanosecond precision. Offsets may be specified with seconds precision (even * though offset seconds is not part of ISO 8601). For example: * `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the * 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would * be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 * hours before UTC (same instant in time as the above example). If the * date/time is intended for a physical location in New York, this would be * the equivalent of Eastern Daylight Time (EDT). Remember that offset varies * in regions that observe Daylight Saving Time (or Summer Time), depending on * the time of the year. `1985-04-12T19:20:50.52` would be 20 minutes and * 50.52 seconds after the 19th hour of April 12th, 1985 with no offset * information. Providing an offset makes this an absolute instant in time * around the world. The date/time will be adjusted based on the user's time * zone. For example, a time of `2018-06-19T18:30:00-04:00` will be 18:30:00 * for a user in New York and 15:30:00 for a user in Los Angeles. Omitting the * offset makes this a local date/time, representing several instants in time * around the world. The date/time will always be in the user's current time * zone. For example, a time of `2018-06-19T18:30:00` will be 18:30:00 for a * user in New York and also 18:30:00 for a user in Los Angeles. This is * useful when the same local date/time should apply to many physical * locations across several time zones. */ date?: string; } export interface DetailsItemInfo { /** * The item to be displayed in the details list. */ item?: TemplateItem; } export interface DetailsTemplateOverride { /** * Information for the "nth" item displayed in the details list. */ detailsItemInfos?: DetailsItemInfo[]; } /** * Device context associated with the object. */ export interface DeviceContext { /** * If set, redemption information will only be returned to the given device * upon activation of the object. This should not be used as a stable * identifier to trace a user's device. It can change across different passes * for the same device or even across different activations for the same * device. When setting this, callers must also set has_linked_device on the * object being activated. */ deviceToken?: string; } /** * Backend response for a Diff get checksums response. For details on the * Scotty Diff protocol, visit http://go/scotty-diff-protocol. */ export interface DiffChecksumsResponse { /** * Exactly one of these fields must be populated. If checksums_location is * filled, the server will return the corresponding contents to the user. If * object_location is filled, the server will calculate the checksums based on * the content there and return that to the user. For details on the format of * the checksums, see http://go/scotty-diff-protocol. */ checksumsLocation?: CompositeMedia; /** * The chunk size of checksums. Must be a multiple of 256KB. */ chunkSizeBytes?: bigint; /** * If set, calculate the checksums based on the contents and return them to * the caller. */ objectLocation?: CompositeMedia; /** * The total size of the server object. */ objectSizeBytes?: bigint; /** * The object version of the object the checksums are being returned for. */ objectVersion?: string; } function serializeDiffChecksumsResponse(data: any): DiffChecksumsResponse { return { ...data, checksumsLocation: data["checksumsLocation"] !== undefined ? serializeCompositeMedia(data["checksumsLocation"]) : undefined, chunkSizeBytes: data["chunkSizeBytes"] !== undefined ? String(data["chunkSizeBytes"]) : undefined, objectLocation: data["objectLocation"] !== undefined ? serializeCompositeMedia(data["objectLocation"]) : undefined, objectSizeBytes: data["objectSizeBytes"] !== undefined ? String(data["objectSizeBytes"]) : undefined, }; } function deserializeDiffChecksumsResponse(data: any): DiffChecksumsResponse { return { ...data, checksumsLocation: data["checksumsLocation"] !== undefined ? deserializeCompositeMedia(data["checksumsLocation"]) : undefined, chunkSizeBytes: data["chunkSizeBytes"] !== undefined ? BigInt(data["chunkSizeBytes"]) : undefined, objectLocation: data["objectLocation"] !== undefined ? deserializeCompositeMedia(data["objectLocation"]) : undefined, objectSizeBytes: data["objectSizeBytes"] !== undefined ? BigInt(data["objectSizeBytes"]) : undefined, }; } /** * Backend response for a Diff download response. For details on the Scotty * Diff protocol, visit http://go/scotty-diff-protocol. */ export interface DiffDownloadResponse { /** * The original object location. */ objectLocation?: CompositeMedia; } function serializeDiffDownloadResponse(data: any): DiffDownloadResponse { return { ...data, objectLocation: data["objectLocation"] !== undefined ? serializeCompositeMedia(data["objectLocation"]) : undefined, }; } function deserializeDiffDownloadResponse(data: any): DiffDownloadResponse { return { ...data, objectLocation: data["objectLocation"] !== undefined ? deserializeCompositeMedia(data["objectLocation"]) : undefined, }; } /** * A Diff upload request. For details on the Scotty Diff protocol, visit * http://go/scotty-diff-protocol. */ export interface DiffUploadRequest { /** * The location of the checksums for the new object. Agents must clone the * object located here, as the upload server will delete the contents once a * response is received. For details on the format of the checksums, see * http://go/scotty-diff-protocol. */ checksumsInfo?: CompositeMedia; /** * The location of the new object. Agents must clone the object located here, * as the upload server will delete the contents once a response is received. */ objectInfo?: CompositeMedia; /** * The object version of the object that is the base version the incoming * diff script will be applied to. This field will always be filled in. */ objectVersion?: string; } function serializeDiffUploadRequest(data: any): DiffUploadRequest { return { ...data, checksumsInfo: data["checksumsInfo"] !== undefined ? serializeCompositeMedia(data["checksumsInfo"]) : undefined, objectInfo: data["objectInfo"] !== undefined ? serializeCompositeMedia(data["objectInfo"]) : undefined, }; } function deserializeDiffUploadRequest(data: any): DiffUploadRequest { return { ...data, checksumsInfo: data["checksumsInfo"] !== undefined ? deserializeCompositeMedia(data["checksumsInfo"]) : undefined, objectInfo: data["objectInfo"] !== undefined ? deserializeCompositeMedia(data["objectInfo"]) : undefined, }; } /** * Backend response for a Diff upload request. For details on the Scotty Diff * protocol, visit http://go/scotty-diff-protocol. */ export interface DiffUploadResponse { /** * The object version of the object at the server. Must be included in the * end notification response. The version in the end notification response * must correspond to the new version of the object that is now stored at the * server, after the upload. */ objectVersion?: string; /** * The location of the original file for a diff upload request. Must be * filled in if responding to an upload start notification. */ originalObject?: CompositeMedia; } function serializeDiffUploadResponse(data: any): DiffUploadResponse { return { ...data, originalObject: data["originalObject"] !== undefined ? serializeCompositeMedia(data["originalObject"]) : undefined, }; } function deserializeDiffUploadResponse(data: any): DiffUploadResponse { return { ...data, originalObject: data["originalObject"] !== undefined ? deserializeCompositeMedia(data["originalObject"]) : undefined, }; } /** * Backend response for a Diff get version response. For details on the Scotty * Diff protocol, visit http://go/scotty-diff-protocol. */ export interface DiffVersionResponse { /** * The total size of the server object. */ objectSizeBytes?: bigint; /** * The version of the object stored at the server. */ objectVersion?: string; } function serializeDiffVersionResponse(data: any): DiffVersionResponse { return { ...data, objectSizeBytes: data["objectSizeBytes"] !== undefined ? String(data["objectSizeBytes"]) : undefined, }; } function deserializeDiffVersionResponse(data: any): DiffVersionResponse { return { ...data, objectSizeBytes: data["objectSizeBytes"] !== undefined ? BigInt(data["objectSizeBytes"]) : undefined, }; } /** * Information about how a class may be discovered and instantiated from within * the Google Wallet app. This is done by searching for a loyalty or gift card * program and scanning or manually entering. */ export interface DiscoverableProgram { /** * Information about the ability to signin and add a valuable for this * program through a merchant site. Used when MERCHANT_HOSTED_SIGNIN is * enabled. */ merchantSigninInfo?: DiscoverableProgramMerchantSigninInfo; /** * Information about the ability to signup and add a valuable for this * program through a merchant site. Used when MERCHANT_HOSTED_SIGNUP is * enabled. */ merchantSignupInfo?: DiscoverableProgramMerchantSignupInfo; /** * Visibility state of the discoverable program. */ state?: | "STATE_UNSPECIFIED" | "TRUSTED_TESTERS" | "trustedTesters" | "LIVE" | "live" | "DISABLED" | "disabled"; } /** * Information about the merchant hosted signin flow for a program. */ export interface DiscoverableProgramMerchantSigninInfo { /** * The URL to direct the user to for the merchant's signin site. */ signinWebsite?: Uri; } /** * Information about the merchant hosted signup flow for a program. */ export interface DiscoverableProgramMerchantSignupInfo { /** * User data that is sent in a POST request to the signup website URL. This * information is encoded and then shared so that the merchant's website can * prefill fields used to enroll the user for the discoverable program. */ signupSharedDatas?: | "SHARED_DATA_TYPE_UNSPECIFIED" | "FIRST_NAME" | "LAST_NAME" | "STREET_ADDRESS" | "ADDRESS_LINE_1" | "ADDRESS_LINE_2" | "ADDRESS_LINE_3" | "CITY" | "STATE" | "ZIPCODE" | "COUNTRY" | "EMAIL" | "PHONE"[]; /** * The URL to direct the user to for the merchant's signup site. */ signupWebsite?: Uri; } /** * Parameters specific to media downloads. */ export interface DownloadParameters { /** * A boolean to be returned in the response to Scotty. Allows/disallows gzip * encoding of the payload content when the server thinks it's advantageous * (hence, does not guarantee compression) which allows Scotty to GZip the * response to the client. */ allowGzipCompression?: boolean; /** * Determining whether or not Apiary should skip the inclusion of any * Content-Range header on its response to Scotty. */ ignoreRange?: boolean; } export interface EventDateTime { /** * A custom label to use for the doors open value (`doorsOpen`) on the card * detail view. This should only be used if the default "Doors Open" label or * one of the `doorsOpenLabel` options is not sufficient. Both * `doorsOpenLabel` and `customDoorsOpenLabel` may not be set. If neither is * set, the label will default to "Doors Open", localized. If the doors open * field is unset, this label will not be used. */ customDoorsOpenLabel?: LocalizedString; /** * The date/time when the doors open at the venue. This is an ISO 8601 * extended format date/time, with or without an offset. Time may be specified * up to nanosecond precision. Offsets may be specified with seconds precision * (even though offset seconds is not part of ISO 8601). For example: * `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the * 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would * be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 * hours before UTC (same instant in time as the above example). If the event * were in New York, this would be the equivalent of Eastern Daylight Time * (EDT). Remember that offset varies in regions that observe Daylight Saving * Time (or Summer Time), depending on the time of the year. * `1985-04-12T19:20:50.52` would be 20 minutes and 50.52 seconds after the * 19th hour of April 12th, 1985 with no offset information. The portion of * the date/time without the offset is considered the "local date/time". This * should be the local date/time at the venue. For example, if the event * occurs at the 20th hour of June 5th, 2018 at the venue, the local date/time * portion should be `2018-06-05T20:00:00`. If the local date/time at the * venue is 4 hours before UTC, an offset of `-04:00` may be appended. Without * offset information, some rich features may not be available. */ doorsOpen?: string; /** * The label to use for the doors open value (`doorsOpen`) on the card detail * view. Each available option maps to a set of localized strings, so that * translations are shown to the user based on their locale. Both * `doorsOpenLabel` and `customDoorsOpenLabel` may not be set. If neither is * set, the label will default to "Doors Open", localized. If the doors open * field is unset, this label will not be used. */ doorsOpenLabel?: | "DOORS_OPEN_LABEL_UNSPECIFIED" | "DOORS_OPEN" | "doorsOpen" | "GATES_OPEN" | "gatesOpen"; /** * The date/time when the event ends. If the event spans multiple days, it * should be the end date/time on the last day. This is an ISO 8601 extended * format date/time, with or without an offset. Time may be specified up to * nanosecond precision. Offsets may be specified with seconds precision (even * though offset seconds is not part of ISO 8601). For example: * `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the * 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would * be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 * hours before UTC (same instant in time as the above example). If the event * were in New York, this would be the equivalent of Eastern Daylight Time * (EDT). Remember that offset varies in regions that observe Daylight Saving * Time (or Summer Time), depending on the time of the year. * `1985-04-12T19:20:50.52` would be 20 minutes and 50.52 seconds after the * 19th hour of April 12th, 1985 with no offset information. The portion of * the date/time without the offset is considered the "local date/time". This * should be the local date/time at the venue. For example, if the event * occurs at the 20th hour of June 5th, 2018 at the venue, the local date/time * portion should be `2018-06-05T20:00:00`. If the local date/time at the * venue is 4 hours before UTC, an offset of `-04:00` may be appended. Without * offset information, some rich features may not be available. */ end?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#eventDateTime"`. */ kind?: string; /** * The date/time when the event starts. If the event spans multiple days, it * should be the start date/time on the first day. This is an ISO 8601 * extended format date/time, with or without an offset. Time may be specified * up to nanosecond precision. Offsets may be specified with seconds precision * (even though offset seconds is not part of ISO 8601). For example: * `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the * 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would * be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 * hours before UTC (same instant in time as the above example). If the event * were in New York, this would be the equivalent of Eastern Daylight Time * (EDT). Remember that offset varies in regions that observe Daylight Saving * Time (or Summer Time), depending on the time of the year. * `1985-04-12T19:20:50.52` would be 20 minutes and 50.52 seconds after the * 19th hour of April 12th, 1985 with no offset information. The portion of * the date/time without the offset is considered the "local date/time". This * should be the local date/time at the venue. For example, if the event * occurs at the 20th hour of June 5th, 2018 at the venue, the local date/time * portion should be `2018-06-05T20:00:00`. If the local date/time at the * venue is 4 hours before UTC, an offset of `-04:00` may be appended. Without * offset information, some rich features may not be available. */ start?: string; } export interface EventReservationInfo { /** * The confirmation code of the event reservation. This may also take the * form of an "order number", "confirmation number", "reservation number", or * other equivalent. */ confirmationCode?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#eventReservationInfo"`. */ kind?: string; } export interface EventSeat { /** * The gate the ticket holder should enter to get to their seat, such as "A" * or "West". This field is localizable so you may translate words or use * different alphabets for the characters in an identifier. */ gate?: LocalizedString; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#eventSeat"`. */ kind?: string; /** * The row of the seat, such as "1", E", "BB", or "A5". This field is * localizable so you may translate words or use different alphabets for the * characters in an identifier. */ row?: LocalizedString; /** * The seat number, such as "1", "2", "3", or any other seat identifier. This * field is localizable so you may translate words or use different alphabets * for the characters in an identifier. */ seat?: LocalizedString; /** * The section of the seat, such as "121". This field is localizable so you * may translate words or use different alphabets for the characters in an * identifier. */ section?: LocalizedString; } export interface EventTicketClass { /** * Deprecated. Use `multipleDevicesAndHoldersAllowedStatus` instead. */ allowMultipleUsersPerObject?: boolean; /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding object * that will be used instead. */ appLinkData?: AppLinkData; /** * Callback options to be used to call the issuer back for every save/delete * of an object for this class by the end-user. All objects of this class are * eligible for the callback. */ callbackOptions?: CallbackOptions; /** * Template information about how the class should be displayed. If unset, * Google will fallback to a default set of fields to display. */ classTemplateInfo?: ClassTemplateInfo; /** * The label to use for the confirmation code value * (`eventTicketObject.reservationInfo.confirmationCode`) on the card detail * view. Each available option maps to a set of localized strings, so that * translations are shown to the user based on their locale. Both * `confirmationCodeLabel` and `customConfirmationCodeLabel` may not be set. * If neither is set, the label will default to "Confirmation Code", * localized. If the confirmation code field is unset, this label will not be * used. */ confirmationCodeLabel?: | "CONFIRMATION_CODE_LABEL_UNSPECIFIED" | "CONFIRMATION_CODE" | "confirmationCode" | "CONFIRMATION_NUMBER" | "confirmationNumber" | "ORDER_NUMBER" | "orderNumber" | "RESERVATION_NUMBER" | "reservationNumber"; /** * Country code used to display the card's country (when the user is not in * that country), as well as to display localized content when content is not * available in the user's locale. */ countryCode?: string; /** * A custom label to use for the confirmation code value * (`eventTicketObject.reservationInfo.confirmationCode`) on the card detail * view. This should only be used if the default "Confirmation Code" label or * one of the `confirmationCodeLabel` options is not sufficient. Both * `confirmationCodeLabel` and `customConfirmationCodeLabel` may not be set. * If neither is set, the label will default to "Confirmation Code", * localized. If the confirmation code field is unset, this label will not be * used. */ customConfirmationCodeLabel?: LocalizedString; /** * A custom label to use for the gate value * (`eventTicketObject.seatInfo.gate`) on the card detail view. This should * only be used if the default "Gate" label or one of the `gateLabel` options * is not sufficient. Both `gateLabel` and `customGateLabel` may not be set. * If neither is set, the label will default to "Gate", localized. If the gate * field is unset, this label will not be used. */ customGateLabel?: LocalizedString; /** * A custom label to use for the row value (`eventTicketObject.seatInfo.row`) * on the card detail view. This should only be used if the default "Row" * label or one of the `rowLabel` options is not sufficient. Both `rowLabel` * and `customRowLabel` may not be set. If neither is set, the label will * default to "Row", localized. If the row field is unset, this label will not * be used. */ customRowLabel?: LocalizedString; /** * A custom label to use for the seat value * (`eventTicketObject.seatInfo.seat`) on the card detail view. This should * only be used if the default "Seat" label or one of the `seatLabel` options * is not sufficient. Both `seatLabel` and `customSeatLabel` may not be set. * If neither is set, the label will default to "Seat", localized. If the seat * field is unset, this label will not be used. */ customSeatLabel?: LocalizedString; /** * A custom label to use for the section value * (`eventTicketObject.seatInfo.section`) on the card detail view. This should * only be used if the default "Section" label or one of the `sectionLabel` * options is not sufficient. Both `sectionLabel` and `customSectionLabel` may * not be set. If neither is set, the label will default to "Section", * localized. If the section field is unset, this label will not be used. */ customSectionLabel?: LocalizedString; /** * The date & time information of the event. */ dateTime?: EventDateTime; /** * Identifies whether this class supports Smart Tap. The `redemptionIssuers` * and object level `smartTapRedemptionLevel` fields must also be set up * correctly in order for a pass to support Smart Tap. */ enableSmartTap?: boolean; /** * The ID of the event. This ID should be unique for every event in an * account. It is used to group tickets together if the user has saved * multiple tickets for the same event. It can be at most 64 characters. If * provided, the grouping will be stable. Be wary of unintentional collision * to avoid grouping tickets that should not be grouped. If you use only one * class per event, you can simply set this to the `classId` (with or without * the issuer ID portion). If not provided, the platform will attempt to use * other data to group tickets (potentially unstable). */ eventId?: string; /** * Required. The name of the event, such as "LA Dodgers at SF Giants". */ eventName?: LocalizedString; /** * The fine print, terms, or conditions of the ticket. */ finePrint?: LocalizedString; /** * The label to use for the gate value (`eventTicketObject.seatInfo.gate`) on * the card detail view. Each available option maps to a set of localized * strings, so that translations are shown to the user based on their locale. * Both `gateLabel` and `customGateLabel` may not be set. If neither is set, * the label will default to "Gate", localized. If the gate field is unset, * this label will not be used. */ gateLabel?: | "GATE_LABEL_UNSPECIFIED" | "GATE" | "gate" | "DOOR" | "door" | "ENTRANCE" | "entrance"; /** * Optional banner image displayed on the front of the card. If none is * present, nothing will be displayed. The image will display at 100% width. */ heroImage?: Image; /** * The background color for the card. If not set the dominant color of the * hero image is used, and if no hero image is set, the dominant color of the * logo is used. The format is #rrggbb where rrggbb is a hex RGB triplet, such * as `#ffcc00`. You can also use the shorthand version of the RGB triplet * which is #rgb, such as `#fc0`. */ hexBackgroundColor?: string; /** * The URI of your application's home page. Populating the URI in this field * results in the exact same behavior as populating an URI in linksModuleData * (when an object is rendered, a link to the homepage is shown in what would * usually be thought of as the linksModuleData section of the object). */ homepageUri?: Uri; /** * Required. The unique identifier for a class. This ID must be unique across * all classes from an issuer. This value should follow the format issuer ID. * identifier where the former is issued by Google and latter is chosen by * you. Your unique identifier should only include alphanumeric characters, * '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Required. The issuer name. Recommended maximum length is 20 characters to * ensure full string is displayed on smaller screens. */ issuerName?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#eventTicketClass"`. */ kind?: string; /** * Links module data. If links module data is also defined on the object, * both will be displayed. */ linksModuleData?: LinksModuleData; /** * Translated strings for the issuer_name. Recommended maximum length is 20 * characters to ensure full string is displayed on smaller screens. */ localizedIssuerName?: LocalizedString; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * The logo image of the ticket. This image is displayed in the card detail * view of the app. */ logo?: Image; /** * Merchant locations. There is a maximum of ten on the class. Any additional * MerchantLocations added beyond the 10 will be rejected. These locations * will trigger a notification when a user enters within a Google-set radius * of the point. This field replaces the deprecated LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Identifies whether multiple users and devices will save the same object * referencing this class. */ multipleDevicesAndHoldersAllowedStatus?: | "STATUS_UNSPECIFIED" | "MULTIPLE_HOLDERS" | "ONE_USER_ALL_DEVICES" | "ONE_USER_ONE_DEVICE" | "multipleHolders" | "oneUserAllDevices" | "oneUserOneDevice"; /** * Whether or not field updates to this class should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If not specified, no notification will be triggered. * This setting is ephemeral and needs to be set with each PATCH or UPDATE * request, otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Identifies which redemption issuers can redeem the pass over Smart Tap. * Redemption issuers are identified by their issuer ID. Redemption issuers * must have at least one Smart Tap key configured. The `enableSmartTap` and * object level `smartTapRedemptionLevel` fields must also be set up correctly * in order for a pass to support Smart Tap. */ redemptionIssuers?: bigint[]; /** * The review comments set by the platform when a class is marked `approved` * or `rejected`. */ review?: Review; /** * Required. The status of the class. This field can be set to `draft` or * `underReview` using the insert, patch, or update API calls. Once the review * state is changed from `draft` it may not be changed back to `draft`. You * should keep this field to `draft` when the class is under development. A * `draft` class cannot be used to create any object. You should set this * field to `underReview` when you believe the class is ready for use. The * platform will automatically set this field to `approved` and it can be * immediately used to create or migrate objects. When updating an already * `approved` class you should keep setting this field to `underReview`. */ reviewStatus?: | "REVIEW_STATUS_UNSPECIFIED" | "UNDER_REVIEW" | "underReview" | "APPROVED" | "approved" | "REJECTED" | "rejected" | "DRAFT" | "draft"; /** * The label to use for the row value (`eventTicketObject.seatInfo.row`) on * the card detail view. Each available option maps to a set of localized * strings, so that translations are shown to the user based on their locale. * Both `rowLabel` and `customRowLabel` may not be set. If neither is set, the * label will default to "Row", localized. If the row field is unset, this * label will not be used. */ rowLabel?: | "ROW_LABEL_UNSPECIFIED" | "ROW" | "row"; /** * The label to use for the seat value (`eventTicketObject.seatInfo.seat`) on * the card detail view. Each available option maps to a set of localized * strings, so that translations are shown to the user based on their locale. * Both `seatLabel` and `customSeatLabel` may not be set. If neither is set, * the label will default to "Seat", localized. If the seat field is unset, * this label will not be used. */ seatLabel?: | "SEAT_LABEL_UNSPECIFIED" | "SEAT" | "seat"; /** * The label to use for the section value * (`eventTicketObject.seatInfo.section`) on the card detail view. Each * available option maps to a set of localized strings, so that translations * are shown to the user based on their locale. Both `sectionLabel` and * `customSectionLabel` may not be set. If neither is set, the label will * default to "Section", localized. If the section field is unset, this label * will not be used. */ sectionLabel?: | "SECTION_LABEL_UNSPECIFIED" | "SECTION" | "section" | "THEATER" | "theater"; /** * Optional information about the security animation. If this is set a * security animation will be rendered on pass details. */ securityAnimation?: SecurityAnimation; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * Optional value added module data. Maximum of ten on the class. For a pass * only ten will be displayed, prioritizing those from the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Event venue details. */ venue?: EventVenue; /** * Deprecated */ version?: bigint; /** * View Unlock Requirement options for the event ticket. */ viewUnlockRequirement?: | "VIEW_UNLOCK_REQUIREMENT_UNSPECIFIED" | "UNLOCK_NOT_REQUIRED" | "UNLOCK_REQUIRED_TO_VIEW"; /** * The wide logo of the ticket. When provided, this will be used in place of * the logo in the top left of the card view. */ wideLogo?: Image; /** * Deprecated. */ wordMark?: Image; } function serializeEventTicketClass(data: any): EventTicketClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (String(item))) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeEventTicketClass(data: any): EventTicketClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (BigInt(item))) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface EventTicketClassAddMessageResponse { /** * The updated EventTicketClass resource. */ resource?: EventTicketClass; } function serializeEventTicketClassAddMessageResponse(data: any): EventTicketClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeEventTicketClass(data["resource"]) : undefined, }; } function deserializeEventTicketClassAddMessageResponse(data: any): EventTicketClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeEventTicketClass(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#eventticketclassList. */ export interface EventticketclassListOptions { /** * The ID of the issuer authorized to list classes. */ issuerId?: bigint; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` classes are available in a list. For example, if you have * a list of 200 classes and you call list with `maxResults` set to 20, list * will return the first 20 classes and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 classes. */ token?: string; } function serializeEventticketclassListOptions(data: any): EventticketclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? String(data["issuerId"]) : undefined, }; } function deserializeEventticketclassListOptions(data: any): EventticketclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? BigInt(data["issuerId"]) : undefined, }; } export interface EventTicketClassListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: EventTicketClass[]; } function serializeEventTicketClassListResponse(data: any): EventTicketClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeEventTicketClass(item))) : undefined, }; } function deserializeEventTicketClassListResponse(data: any): EventTicketClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeEventTicketClass(item))) : undefined, }; } export interface EventTicketObject { /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding class * only object AppLinkData will be displayed. */ appLinkData?: AppLinkData; /** * The barcode type and value. */ barcode?: Barcode; /** * Required. The class associated with this object. The class must be of the * same type as this object, must already exist, and must be approved. Class * IDs should follow the format issuer ID.identifier where the former is * issued by Google and latter is chosen by you. */ classId?: string; /** * A copy of the inherited fields of the parent class. These fields are * retrieved during a GET. */ classReference?: EventTicketClass; /** * Indicates if notifications should explicitly be suppressed. If this field * is set to true, regardless of the `messages` field, expiration * notifications to the user will be suppressed. By default, this field is set * to false. Currently, this can only be set for offers. */ disableExpirationNotification?: boolean; /** * The face value of the ticket, matching what would be printed on a physical * version of the ticket. */ faceValue?: Money; /** * Information that controls how passes are grouped together. */ groupingInfo?: GroupingInfo; /** * Whether this object is currently linked to a single device. This field is * set by the platform when a user saves the object, linking it to their * device. Intended for use by select partners. Contact support for additional * information. */ hasLinkedDevice?: boolean; /** * Indicates if the object has users. This field is set by the platform. */ hasUsers?: boolean; /** * Optional banner image displayed on the front of the card. If none is * present, hero image of the class, if present, will be displayed. If hero * image of the class is also not present, nothing will be displayed. */ heroImage?: Image; /** * The background color for the card. If not set the dominant color of the * hero image is used, and if no hero image is set, the dominant color of the * logo is used. The format is #rrggbb where rrggbb is a hex RGB triplet, such * as `#ffcc00`. You can also use the shorthand version of the RGB triplet * which is #rgb, such as `#fc0`. */ hexBackgroundColor?: string; /** * Required. The unique identifier for an object. This ID must be unique * across all objects from an issuer. This value should follow the format * issuer ID.identifier where the former is issued by Google and latter is * chosen by you. The unique identifier should only include alphanumeric * characters, '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#eventTicketObject"`. */ kind?: string; /** * linked_object_ids are a list of other objects such as event ticket, * loyalty, offer, generic, giftcard, transit and boarding pass that should be * automatically attached to this event ticket object. If a user had saved * this event ticket, then these linked_object_ids would be automatically * pushed to the user's wallet (unless they turned off the setting to receive * such linked passes). Make sure that objects present in linked_object_ids * are already inserted - if not, calls would fail. Once linked, the linked * objects cannot be unlinked. You cannot link objects belonging to another * issuer. There is a limit to the number of objects that can be linked to a * single object. After the limit is reached, new linked objects in the call * will be ignored silently. Object IDs should follow the format issuer ID. * identifier where the former is issued by Google and the latter is chosen by * you. */ linkedObjectIds?: string[]; /** * A list of offer objects linked to this event ticket. The offer objects * must already exist. Offer object IDs should follow the format issuer ID. * identifier where the former is issued by Google and latter is chosen by * you. */ linkedOfferIds?: string[]; /** * Links module data. If links module data is also defined on the class, both * will be displayed. */ linksModuleData?: LinksModuleData; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * Merchant locations. There is a maximum of ten on the object. Any * additional MerchantLocations added beyond the 10 will be rejected. These * locations will trigger a notification when a user enters within a * Google-set radius of the point. This field replaces the deprecated * LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Whether or not field updates to this object should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If set to DO_NOT_NOTIFY or * NOTIFICATION_SETTINGS_UNSPECIFIED, no notification will be triggered. This * setting is ephemeral and needs to be set with each PATCH or UPDATE request, * otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Pass constraints for the object. Includes limiting NFC and screenshot * behaviors. */ passConstraints?: PassConstraints; /** * Reservation details for this ticket. This is expected to be shared amongst * all tickets that were purchased in the same order. */ reservationInfo?: EventReservationInfo; /** * The rotating barcode type and value. */ rotatingBarcode?: RotatingBarcode; /** * Restrictions on the object that needs to be verified before the user tries * to save the pass. Note that this restrictions will only be applied during * save time. If the restrictions changed after a user saves the pass, the new * restrictions will not be applied to an already saved pass. */ saveRestrictions?: SaveRestrictions; /** * Seating details for this ticket. */ seatInfo?: EventSeat; /** * The value that will be transmitted to a Smart Tap certified terminal over * NFC for this object. The class level fields `enableSmartTap` and * `redemptionIssuers` must also be set up correctly in order for the pass to * support Smart Tap. Only ASCII characters are supported. */ smartTapRedemptionValue?: string; /** * Required. The state of the object. This field is used to determine how an * object is displayed in the app. For example, an `inactive` object is moved * to the "Expired passes" section. */ state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "active" | "COMPLETED" | "completed" | "EXPIRED" | "expired" | "INACTIVE" | "inactive"; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * Name of the ticket holder, if the ticket is assigned to a person. E.g. * "John Doe" or "Jane Doe". */ ticketHolderName?: string; /** * The number of the ticket. This can be a unique identifier across all * tickets in an issuer's system, all tickets for the event (e.g. * XYZ1234512345), or all tickets in the order (1, 2, 3, etc.). */ ticketNumber?: string; /** * The type of the ticket, such as "Adult" or "Child", or "VIP" or * "Standard". */ ticketType?: LocalizedString; /** * The time period this object will be `active` and object can be used. An * object's state will be changed to `expired` when this time period has * passed. */ validTimeInterval?: TimeInterval; /** * Optional value added module data. Maximum of ten on the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; } function serializeEventTicketObject(data: any): EventTicketObject { return { ...data, classReference: data["classReference"] !== undefined ? serializeEventTicketClass(data["classReference"]) : undefined, faceValue: data["faceValue"] !== undefined ? serializeMoney(data["faceValue"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? serializeRotatingBarcode(data["rotatingBarcode"]) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeEventTicketObject(data: any): EventTicketObject { return { ...data, classReference: data["classReference"] !== undefined ? deserializeEventTicketClass(data["classReference"]) : undefined, faceValue: data["faceValue"] !== undefined ? deserializeMoney(data["faceValue"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? deserializeRotatingBarcode(data["rotatingBarcode"]) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface EventTicketObjectAddMessageResponse { /** * The updated EventTicketObject resource. */ resource?: EventTicketObject; } function serializeEventTicketObjectAddMessageResponse(data: any): EventTicketObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeEventTicketObject(data["resource"]) : undefined, }; } function deserializeEventTicketObjectAddMessageResponse(data: any): EventTicketObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeEventTicketObject(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#eventticketobjectList. */ export interface EventticketobjectListOptions { /** * The ID of the class whose objects will be listed. */ classId?: string; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` objects are available in a list. For example, if you have * a list of 200 objects and you call list with `maxResults` set to 20, list * will return the first 20 objects and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 objects. */ token?: string; } export interface EventTicketObjectListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: EventTicketObject[]; } function serializeEventTicketObjectListResponse(data: any): EventTicketObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeEventTicketObject(item))) : undefined, }; } function deserializeEventTicketObjectListResponse(data: any): EventTicketObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeEventTicketObject(item))) : undefined, }; } export interface EventVenue { /** * The address of the venue, such as "24 Willie Mays Plaza\nSan Francisco, CA * 94107". Address lines are separated by line feed (`\n`) characters. This is * required. */ address?: LocalizedString; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#eventVenue"`. */ kind?: string; /** * The name of the venue, such as "AT&T Park". This is required. */ name?: LocalizedString; } /** * Indicates that the issuer would like Google Wallet to send expiry * notifications 2 days prior to the card expiration. */ export interface ExpiryNotification { /** * Indicates if the object needs to have expiry notification enabled. */ enableNotification?: boolean; } /** * Reference definition to use with field overrides. */ export interface FieldReference { /** * Only valid if the `fieldPath` references a date field. Chooses how the * date field will be formatted and displayed in the UI. */ dateFormat?: | "DATE_FORMAT_UNSPECIFIED" | "DATE_TIME" | "dateTime" | "DATE_ONLY" | "dateOnly" | "TIME_ONLY" | "timeOnly" | "DATE_TIME_YEAR" | "dateTimeYear" | "DATE_YEAR" | "dateYear" | "YEAR_MONTH" | "YEAR_MONTH_DAY"; /** * Path to the field being referenced, prefixed with "object" or "class" and * separated with dots. For example, it may be the string * "object.purchaseDetails.purchasePrice". */ fieldPath?: string; } /** * Custom field selector to use with field overrides. */ export interface FieldSelector { /** * If more than one reference is supplied, then the first one that references * a non-empty field will be displayed. */ fields?: FieldReference[]; } export interface FirstRowOption { /** * A reference to the field to be displayed in the first row. */ fieldOption?: FieldSelector; transitOption?: | "TRANSIT_OPTION_UNSPECIFIED" | "ORIGIN_AND_DESTINATION_NAMES" | "originAndDestinationNames" | "ORIGIN_AND_DESTINATION_CODES" | "originAndDestinationCodes" | "ORIGIN_NAME" | "originName"; } export interface FlightCarrier { /** * A logo for the airline alliance, displayed below the QR code that the * passenger scans to board. */ airlineAllianceLogo?: Image; /** * A logo for the airline described by carrierIataCode and * localizedAirlineName. This logo will be rendered at the top of the detailed * card view. */ airlineLogo?: Image; /** * A localized name of the airline specified by carrierIataCode. If unset, * `issuer_name` or `localized_issuer_name` from `FlightClass` will be used * for display purposes. eg: "Swiss Air" for "LX" */ airlineName?: LocalizedString; /** * Two character IATA airline code of the marketing carrier (as opposed to * operating carrier). Exactly one of this or `carrierIcaoCode` needs to be * provided for `carrier` and `operatingCarrier`. eg: "LX" for Swiss Air */ carrierIataCode?: string; /** * Three character ICAO airline code of the marketing carrier (as opposed to * operating carrier). Exactly one of this or `carrierIataCode` needs to be * provided for `carrier` and `operatingCarrier`. eg: "EZY" for Easy Jet */ carrierIcaoCode?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#flightCarrier"`. */ kind?: string; /** * The wide logo of the airline. When provided, this will be used in place of * the airline logo in the top left of the card view. */ wideAirlineLogo?: Image; } export interface FlightClass { /** * Deprecated. Use `multipleDevicesAndHoldersAllowedStatus` instead. */ allowMultipleUsersPerObject?: boolean; /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding object * that will be used instead. */ appLinkData?: AppLinkData; /** * Policies for boarding and seating. These will inform which labels will be * shown to users. */ boardingAndSeatingPolicy?: BoardingAndSeatingPolicy; /** * Callback options to be used to call the issuer back for every save/delete * of an object for this class by the end-user. All objects of this class are * eligible for the callback. */ callbackOptions?: CallbackOptions; /** * Template information about how the class should be displayed. If unset, * Google will fallback to a default set of fields to display. */ classTemplateInfo?: ClassTemplateInfo; /** * Country code used to display the card's country (when the user is not in * that country), as well as to display localized content when content is not * available in the user's locale. */ countryCode?: string; /** * Required. Destination airport. */ destination?: AirportInfo; /** * Identifies whether this class supports Smart Tap. The `redemptionIssuers` * and object level `smartTapRedemptionLevel` fields must also be set up * correctly in order for a pass to support Smart Tap. */ enableSmartTap?: boolean; /** * Required. Information about the flight carrier and number. */ flightHeader?: FlightHeader; /** * Status of this flight. If unset, Google will compute status based on data * from other sources, such as FlightStats, etc. Note: Google-computed status * will not be returned in API responses. */ flightStatus?: | "FLIGHT_STATUS_UNSPECIFIED" | "SCHEDULED" | "scheduled" | "ACTIVE" | "active" | "LANDED" | "landed" | "CANCELLED" | "cancelled" | "REDIRECTED" | "redirected" | "DIVERTED" | "diverted"; /** * Optional banner image displayed on the front of the card. If none is * present, nothing will be displayed. The image will display at 100% width. */ heroImage?: Image; /** * The background color for the card. If not set the dominant color of the * hero image is used, and if no hero image is set, the dominant color of the * logo is used. The format is #rrggbb where rrggbb is a hex RGB triplet, such * as `#ffcc00`. You can also use the shorthand version of the RGB triplet * which is #rgb, such as `#fc0`. */ hexBackgroundColor?: string; /** * The URI of your application's home page. Populating the URI in this field * results in the exact same behavior as populating an URI in linksModuleData * (when an object is rendered, a link to the homepage is shown in what would * usually be thought of as the linksModuleData section of the object). */ homepageUri?: Uri; /** * Required. The unique identifier for a class. This ID must be unique across * all classes from an issuer. This value should follow the format issuer ID. * identifier where the former is issued by Google and latter is chosen by * you. Your unique identifier should only include alphanumeric characters, * '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Required. The issuer name. Recommended maximum length is 20 characters to * ensure full string is displayed on smaller screens. */ issuerName?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#flightClass"`. */ kind?: string; /** * If this field is present, boarding passes served to a user's device will * always be in this language. Represents the BCP 47 language tag. Example * values are "en-US", "en-GB", "de", or "de-AT". */ languageOverride?: string; /** * Links module data. If links module data is also defined on the object, * both will be displayed. */ linksModuleData?: LinksModuleData; /** * The boarding time as it would be printed on the boarding pass. This is an * ISO 8601 extended format date/time without an offset. Time may be specified * up to millisecond precision. eg: `2027-03-05T06:30:00` This should be the * local date/time at the airport (not a UTC time). Google will reject the * request if UTC offset is provided. Time zones will be calculated by Google * based on departure airport. */ localBoardingDateTime?: string; /** * The estimated time the aircraft plans to reach the destination gate (not * the runway) or the actual time it reached the gate. This field should be * set if at least one of the below is true: - It differs from the scheduled * time. Google will use it to calculate the delay. - The aircraft already * arrived at the gate. Google will use it to inform the user that the flight * has arrived at the gate. This is an ISO 8601 extended format date/time * without an offset. Time may be specified up to millisecond precision. eg: * `2027-03-05T06:30:00` This should be the local date/time at the airport * (not a UTC time). Google will reject the request if UTC offset is provided. * Time zones will be calculated by Google based on arrival airport. */ localEstimatedOrActualArrivalDateTime?: string; /** * The estimated time the aircraft plans to pull from the gate or the actual * time the aircraft already pulled from the gate. Note: This is not the * runway time. This field should be set if at least one of the below is true: * - It differs from the scheduled time. Google will use it to calculate the * delay. - The aircraft already pulled from the gate. Google will use it to * inform the user when the flight actually departed. This is an ISO 8601 * extended format date/time without an offset. Time may be specified up to * millisecond precision. eg: `2027-03-05T06:30:00` This should be the local * date/time at the airport (not a UTC time). Google will reject the request * if UTC offset is provided. Time zones will be calculated by Google based on * departure airport. */ localEstimatedOrActualDepartureDateTime?: string; /** * The gate closing time as it would be printed on the boarding pass. Do not * set this field if you do not want to print it in the boarding pass. This is * an ISO 8601 extended format date/time without an offset. Time may be * specified up to millisecond precision. eg: `2027-03-05T06:30:00` This * should be the local date/time at the airport (not a UTC time). Google will * reject the request if UTC offset is provided. Time zones will be calculated * by Google based on departure airport. */ localGateClosingDateTime?: string; /** * Translated strings for the issuer_name. Recommended maximum length is 20 * characters to ensure full string is displayed on smaller screens. */ localizedIssuerName?: LocalizedString; /** * The scheduled time the aircraft plans to reach the destination gate (not * the runway). Note: This field should not change too close to the flight * time. For updates to departure times (delays, etc), please set * `localEstimatedOrActualArrivalDateTime`. This is an ISO 8601 extended * format date/time without an offset. Time may be specified up to millisecond * precision. eg: `2027-03-05T06:30:00` This should be the local date/time at * the airport (not a UTC time). Google will reject the request if UTC offset * is provided. Time zones will be calculated by Google based on arrival * airport. */ localScheduledArrivalDateTime?: string; /** * Required. The scheduled date and time when the aircraft is expected to * depart the gate (not the runway) Note: This field should not change too * close to the departure time. For updates to departure times (delays, etc), * please set `localEstimatedOrActualDepartureDateTime`. This is an ISO 8601 * extended format date/time without an offset. Time may be specified up to * millisecond precision. eg: `2027-03-05T06:30:00` This should be the local * date/time at the airport (not a UTC time). Google will reject the request * if UTC offset is provided. Time zones will be calculated by Google based on * departure airport. */ localScheduledDepartureDateTime?: string; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * Merchant locations. There is a maximum of ten on the class. Any additional * MerchantLocations added beyond the 10 will be rejected by the validator. * These locations will trigger a notification when a user enters within a * Google-set radius of the point. This field replaces the deprecated * LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Identifies whether multiple users and devices will save the same object * referencing this class. */ multipleDevicesAndHoldersAllowedStatus?: | "STATUS_UNSPECIFIED" | "MULTIPLE_HOLDERS" | "ONE_USER_ALL_DEVICES" | "ONE_USER_ONE_DEVICE" | "multipleHolders" | "oneUserAllDevices" | "oneUserOneDevice"; /** * Whether or not field updates to this class should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If not specified, no notification will be triggered. * This setting is ephemeral and needs to be set with each PATCH or UPDATE * request, otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Required. Origin airport. */ origin?: AirportInfo; /** * Identifies which redemption issuers can redeem the pass over Smart Tap. * Redemption issuers are identified by their issuer ID. Redemption issuers * must have at least one Smart Tap key configured. The `enableSmartTap` and * object level `smartTapRedemptionLevel` fields must also be set up correctly * in order for a pass to support Smart Tap. */ redemptionIssuers?: bigint[]; /** * The review comments set by the platform when a class is marked `approved` * or `rejected`. */ review?: Review; /** * Required. The status of the class. This field can be set to `draft` or * `underReview` using the insert, patch, or update API calls. Once the review * state is changed from `draft` it may not be changed back to `draft`. You * should keep this field to `draft` when the class is under development. A * `draft` class cannot be used to create any object. You should set this * field to `underReview` when you believe the class is ready for use. The * platform will automatically set this field to `approved` and it can be * immediately used to create or migrate objects. When updating an already * `approved` class you should keep setting this field to `underReview`. */ reviewStatus?: | "REVIEW_STATUS_UNSPECIFIED" | "UNDER_REVIEW" | "underReview" | "APPROVED" | "approved" | "REJECTED" | "rejected" | "DRAFT" | "draft"; /** * Optional information about the security animation. If this is set a * security animation will be rendered on pass details. */ securityAnimation?: SecurityAnimation; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * Optional value added module data. Maximum of ten on the class. For a pass * only ten will be displayed, prioritizing those from the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; /** * View Unlock Requirement options for the boarding pass. */ viewUnlockRequirement?: | "VIEW_UNLOCK_REQUIREMENT_UNSPECIFIED" | "UNLOCK_NOT_REQUIRED" | "UNLOCK_REQUIRED_TO_VIEW"; /** * Deprecated. */ wordMark?: Image; } function serializeFlightClass(data: any): FlightClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (String(item))) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeFlightClass(data: any): FlightClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (BigInt(item))) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface FlightClassAddMessageResponse { /** * The updated FlightClass resource. */ resource?: FlightClass; } function serializeFlightClassAddMessageResponse(data: any): FlightClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeFlightClass(data["resource"]) : undefined, }; } function deserializeFlightClassAddMessageResponse(data: any): FlightClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeFlightClass(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#flightclassList. */ export interface FlightclassListOptions { /** * The ID of the issuer authorized to list classes. */ issuerId?: bigint; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` classes are available in a list. For example, if you have * a list of 200 classes and you call list with `maxResults` set to 20, list * will return the first 20 classes and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 classes. */ token?: string; } function serializeFlightclassListOptions(data: any): FlightclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? String(data["issuerId"]) : undefined, }; } function deserializeFlightclassListOptions(data: any): FlightclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? BigInt(data["issuerId"]) : undefined, }; } export interface FlightClassListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: FlightClass[]; } function serializeFlightClassListResponse(data: any): FlightClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeFlightClass(item))) : undefined, }; } function deserializeFlightClassListResponse(data: any): FlightClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeFlightClass(item))) : undefined, }; } export interface FlightHeader { /** * Information about airline carrier. This is a required property of * `flightHeader`. */ carrier?: FlightCarrier; /** * The flight number without IATA carrier code. This field should contain * only digits. This is a required property of `flightHeader`. eg: "123" */ flightNumber?: string; /** * Override value to use for flight number. The default value used for * display purposes is carrier + flight_number. If a different value needs to * be shown to passengers, use this field to override the default behavior. * eg: "XX1234 / YY576" */ flightNumberDisplayOverride?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#flightHeader"`. */ kind?: string; /** * Information about operating airline carrier. */ operatingCarrier?: FlightCarrier; /** * The flight number used by the operating carrier without IATA carrier code. * This field should contain only digits. eg: "234" */ operatingFlightNumber?: string; } export interface FlightObject { /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding class * only object AppLinkData will be displayed. */ appLinkData?: AppLinkData; /** * The barcode type and value. */ barcode?: Barcode; /** * Passenger specific information about boarding and seating. */ boardingAndSeatingInfo?: BoardingAndSeatingInfo; /** * Required. The class associated with this object. The class must be of the * same type as this object, must already exist, and must be approved. Class * IDs should follow the format issuer ID.identifier where the former is * issued by Google and latter is chosen by you. */ classId?: string; /** * A copy of the inherited fields of the parent class. These fields are * retrieved during a GET. */ classReference?: FlightClass; /** * Indicates if notifications should explicitly be suppressed. If this field * is set to true, regardless of the `messages` field, expiration * notifications to the user will be suppressed. By default, this field is set * to false. Currently, this can only be set for Flights. */ disableExpirationNotification?: boolean; /** * Information that controls how passes are grouped together. */ groupingInfo?: GroupingInfo; /** * Whether this object is currently linked to a single device. This field is * set by the platform when a user saves the object, linking it to their * device. Intended for use by select partners. Contact support for additional * information. */ hasLinkedDevice?: boolean; /** * Indicates if the object has users. This field is set by the platform. */ hasUsers?: boolean; /** * Optional banner image displayed on the front of the card. If none is * present, hero image of the class, if present, will be displayed. If hero * image of the class is also not present, nothing will be displayed. */ heroImage?: Image; /** * The background color for the card. If not set the dominant color of the * hero image is used, and if no hero image is set, the dominant color of the * logo is used. The format is #rrggbb where rrggbb is a hex RGB triplet, such * as `#ffcc00`. You can also use the shorthand version of the RGB triplet * which is #rgb, such as `#fc0`. */ hexBackgroundColor?: string; /** * Required. The unique identifier for an object. This ID must be unique * across all objects from an issuer. This value should follow the format * issuer ID.identifier where the former is issued by Google and latter is * chosen by you. The unique identifier should only include alphanumeric * characters, '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#flightObject"`. */ kind?: string; /** * linked_object_ids are a list of other objects such as event ticket, * loyalty, offer, generic, giftcard, transit and boarding pass that should be * automatically attached to this flight object. If a user had saved this * boarding pass, then these linked_object_ids would be automatically pushed * to the user's wallet (unless they turned off the setting to receive such * linked passes). Make sure that objects present in linked_object_ids are * already inserted - if not, calls would fail. Once linked, the linked * objects cannot be unlinked. You cannot link objects belonging to another * issuer. There is a limit to the number of objects that can be linked to a * single object. After the limit is reached, new linked objects in the call * will be ignored silently. Object IDs should follow the format issuer ID. * identifier where the former is issued by Google and the latter is chosen by * you. */ linkedObjectIds?: string[]; /** * Links module data. If links module data is also defined on the class, both * will be displayed. */ linksModuleData?: LinksModuleData; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * Merchant locations. There is a maximum of ten on the object. Any * additional MerchantLocations added beyond the 10 will be rejected. These * locations will trigger a notification when a user enters within a * Google-set radius of the point. This field replaces the deprecated * LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Whether or not field updates to this object should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If set to DO_NOT_NOTIFY or * NOTIFICATION_SETTINGS_UNSPECIFIED, no notification will be triggered. This * setting is ephemeral and needs to be set with each PATCH or UPDATE request, * otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Pass constraints for the object. Includes limiting NFC and screenshot * behaviors. */ passConstraints?: PassConstraints; /** * Required. Passenger name as it would appear on the boarding pass. eg: * "Dave M Gahan" or "Gahan/Dave" or "GAHAN/DAVEM" */ passengerName?: string; /** * Required. Information about flight reservation. */ reservationInfo?: ReservationInfo; /** * The rotating barcode type and value. */ rotatingBarcode?: RotatingBarcode; /** * Restrictions on the object that needs to be verified before the user tries * to save the pass. Note that this restrictions will only be applied during * save time. If the restrictions changed after a user saves the pass, the new * restrictions will not be applied to an already saved pass. */ saveRestrictions?: SaveRestrictions; /** * An image for the security program that applies to the passenger. */ securityProgramLogo?: Image; /** * The value that will be transmitted to a Smart Tap certified terminal over * NFC for this object. The class level fields `enableSmartTap` and * `redemptionIssuers` must also be set up correctly in order for the pass to * support Smart Tap. Only ASCII characters are supported. */ smartTapRedemptionValue?: string; /** * Required. The state of the object. This field is used to determine how an * object is displayed in the app. For example, an `inactive` object is moved * to the "Expired passes" section. */ state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "active" | "COMPLETED" | "completed" | "EXPIRED" | "expired" | "INACTIVE" | "inactive"; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * The time period this object will be `active` and object can be used. An * object's state will be changed to `expired` when this time period has * passed. */ validTimeInterval?: TimeInterval; /** * Optional value added module data. Maximum of ten on the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; } function serializeFlightObject(data: any): FlightObject { return { ...data, classReference: data["classReference"] !== undefined ? serializeFlightClass(data["classReference"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? serializeRotatingBarcode(data["rotatingBarcode"]) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeFlightObject(data: any): FlightObject { return { ...data, classReference: data["classReference"] !== undefined ? deserializeFlightClass(data["classReference"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? deserializeRotatingBarcode(data["rotatingBarcode"]) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface FlightObjectAddMessageResponse { /** * The updated FlightObject resource. */ resource?: FlightObject; } function serializeFlightObjectAddMessageResponse(data: any): FlightObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeFlightObject(data["resource"]) : undefined, }; } function deserializeFlightObjectAddMessageResponse(data: any): FlightObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeFlightObject(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#flightobjectList. */ export interface FlightobjectListOptions { /** * The ID of the class whose objects will be listed. */ classId?: string; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` objects are available in a list. For example, if you have * a list of 200 objects and you call list with `maxResults` set to 20, list * will return the first 20 objects and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 objects. */ token?: string; } export interface FlightObjectListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: FlightObject[]; } function serializeFlightObjectListResponse(data: any): FlightObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeFlightObject(item))) : undefined, }; } function deserializeFlightObjectListResponse(data: any): FlightObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeFlightObject(item))) : undefined, }; } export interface FrequentFlyerInfo { /** * Frequent flyer number. Required for each nested object of kind * `walletobjects#frequentFlyerInfo`. */ frequentFlyerNumber?: string; /** * Frequent flyer program name. eg: "Lufthansa Miles & More" */ frequentFlyerProgramName?: LocalizedString; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#frequentFlyerInfo"`. */ kind?: string; } /** * Generic Class */ export interface GenericClass { /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding object * that will be used instead. */ appLinkData?: AppLinkData; /** * Callback options to be used to call the issuer back for every save/delete * of an object for this class by the end-user. All objects of this class are * eligible for the callback. */ callbackOptions?: CallbackOptions; /** * Template information about how the class should be displayed. If unset, * Google will fallback to a default set of fields to display. */ classTemplateInfo?: ClassTemplateInfo; /** * Available only to Smart Tap enabled partners. Contact support for * additional guidance. */ enableSmartTap?: boolean; /** * Required. The unique identifier for the class. This ID must be unique * across all from an issuer. This value needs to follow the format * `issuerID.identifier` where `issuerID` is issued by Google and `identifier` * is chosen by you. The unique identifier can only include alphanumeric * characters, `.`, `_`, or `-`. */ id?: string; /** * Image module data. If `imageModulesData` is also defined on the object, * both will be displayed. Only one of the image from class and one from * object level will be rendered when both set. */ imageModulesData?: ImageModuleData[]; /** * Links module data. If `linksModuleData` is also defined on the object, * both will be displayed. The maximum number of these fields displayed is 10 * from class and 10 from object. */ linksModuleData?: LinksModuleData; /** * Merchant locations. There is a maximum of ten on the class. Any additional * MerchantLocations added beyond the 10 will be rejected. These locations * will trigger a notification when a user enters within a Google-set radius * of the point. This field replaces the deprecated LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Identifies whether multiple users and devices will save the same object * referencing this class. */ multipleDevicesAndHoldersAllowedStatus?: | "STATUS_UNSPECIFIED" | "MULTIPLE_HOLDERS" | "ONE_USER_ALL_DEVICES" | "ONE_USER_ONE_DEVICE" | "multipleHolders" | "oneUserAllDevices" | "oneUserOneDevice"; /** * Identifies which redemption issuers can redeem the pass over Smart Tap. * Redemption issuers are identified by their issuer ID. Redemption issuers * must have at least one Smart Tap key configured. The `enableSmartTap` and * object level `smartTapRedemptionLevel` fields must also be set up correctly * in order for a pass to support Smart Tap. */ redemptionIssuers?: bigint[]; /** * Optional information about the security animation. If this is set a * security animation will be rendered on pass details. */ securityAnimation?: SecurityAnimation; /** * Text module data. If `textModulesData` is also defined on the object, both * will be displayed. The maximum number of these fields displayed is 10 from * class and 10 from object. */ textModulesData?: TextModuleData[]; /** * Optional value added module data. Maximum of ten on the class. For a pass * only ten will be displayed, prioritizing those from the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * View Unlock Requirement options for the generic pass. */ viewUnlockRequirement?: | "VIEW_UNLOCK_REQUIREMENT_UNSPECIFIED" | "UNLOCK_NOT_REQUIRED" | "UNLOCK_REQUIRED_TO_VIEW"; } function serializeGenericClass(data: any): GenericClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (String(item))) : undefined, }; } function deserializeGenericClass(data: any): GenericClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (BigInt(item))) : undefined, }; } /** * Response to adding a new issuer message to the class. This contains the * entire updated GenericClass. */ export interface GenericClassAddMessageResponse { /** * The updated EventTicketClass resource. */ resource?: GenericClass; } function serializeGenericClassAddMessageResponse(data: any): GenericClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeGenericClass(data["resource"]) : undefined, }; } function deserializeGenericClassAddMessageResponse(data: any): GenericClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeGenericClass(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#genericclassList. */ export interface GenericclassListOptions { /** * The ID of the issuer authorized to list classes. */ issuerId?: bigint; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` classes are available in a list. For example, if you have * a list of 200 classes and you call list with `maxResults` set to 20, list * will return the first 20 classes and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 classes. */ token?: string; } function serializeGenericclassListOptions(data: any): GenericclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? String(data["issuerId"]) : undefined, }; } function deserializeGenericclassListOptions(data: any): GenericclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? BigInt(data["issuerId"]) : undefined, }; } /** * List response which contains the list of all generic classes for a given * issuer ID. */ export interface GenericClassListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: GenericClass[]; } function serializeGenericClassListResponse(data: any): GenericClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeGenericClass(item))) : undefined, }; } function deserializeGenericClassListResponse(data: any): GenericClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeGenericClass(item))) : undefined, }; } /** * Generic Object */ export interface GenericObject { /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding class * only object AppLinkData will be displayed. */ appLinkData?: AppLinkData; /** * The barcode type and value. If pass does not have a barcode, we can allow * the issuer to set Barcode.alternate_text and display just that. */ barcode?: Barcode; /** * Required. The header of the pass. This is usually the Business name such * as "XXX Gym", "AAA Insurance". This field is required and appears in the * header row at the very top of the pass. */ cardTitle?: LocalizedString; /** * Required. The class associated with this object. The class must be of the * same type as this object, must already exist, and must be approved. Class * IDs should follow the format `issuerID.identifier` where `issuerID` is * issued by Google and `identifier` is chosen by you. */ classId?: string; /** * Specify which `GenericType` the card belongs to. */ genericType?: | "GENERIC_TYPE_UNSPECIFIED" | "GENERIC_SEASON_PASS" | "GENERIC_UTILITY_BILLS" | "GENERIC_PARKING_PASS" | "GENERIC_VOUCHER" | "GENERIC_GYM_MEMBERSHIP" | "GENERIC_LIBRARY_MEMBERSHIP" | "GENERIC_RESERVATIONS" | "GENERIC_AUTO_INSURANCE" | "GENERIC_HOME_INSURANCE" | "GENERIC_ENTRY_TICKET" | "GENERIC_RECEIPT" | "GENERIC_LOYALTY_CARD" | "GENERIC_OTHER"; /** * Information that controls how passes are grouped together. */ groupingInfo?: GroupingInfo; /** * Indicates if the object has users. This field is set by the platform. */ hasUsers?: boolean; /** * Required. The title of the pass, such as "50% off coupon" or "Library * card" or "Voucher". This field is required and appears in the title row of * the pass detail view. */ header?: LocalizedString; /** * Banner image displayed on the front of the card if present. The image will * be displayed at 100% width. */ heroImage?: Image; /** * The background color for the card. If not set, the dominant color of the * hero image is used, and if no hero image is set, the dominant color of the * logo is used and if logo is not set, a color would be chosen by Google. */ hexBackgroundColor?: string; /** * Required. The unique identifier for an object. This ID must be unique * across all objects from an issuer. This value needs to follow the format * `issuerID.identifier` where `issuerID` is issued by Google and `identifier` * is chosen by you. The unique identifier can only include alphanumeric * characters, `.`, `_`, or `-`. */ id?: string; /** * Image module data. Only one of the image from class and one from object * level will be rendered when both set. */ imageModulesData?: ImageModuleData[]; /** * linked_object_ids are a list of other objects such as event ticket, * loyalty, offer, generic, giftcard, transit and boarding pass that should be * automatically attached to this generic object. If a user had saved this * generic card, then these linked_object_ids would be automatically pushed to * the user's wallet (unless they turned off the setting to receive such * linked passes). Make sure that objects present in linked_object_ids are * already inserted - if not, calls would fail. Once linked, the linked * objects cannot be unlinked. You cannot link objects belonging to another * issuer. There is a limit to the number of objects that can be linked to a * single object. After the limit is reached, new linked objects in the call * will be ignored silently. Object IDs should follow the format issuer ID. * identifier where the former is issued by Google and the latter is chosen by * you. */ linkedObjectIds?: string[]; /** * Links module data. If `linksModuleData` is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * class and 10 from object. */ linksModuleData?: LinksModuleData; /** * The logo image of the pass. This image is displayed in the card detail * view in upper left, and also on the list/thumbnail view. If the logo is not * present, the first letter of `cardTitle` would be shown as logo. */ logo?: Image; /** * Merchant locations. There is a maximum of ten on the object. Any * additional MerchantLocations added beyond the 10 will be rejected. These * locations will trigger a notification when a user enters within a * Google-set radius of the point. This field replaces the deprecated * LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * The notification settings that are enabled for this object. */ notifications?: Notifications; /** * Pass constraints for the object. Includes limiting NFC and screenshot * behaviors. */ passConstraints?: PassConstraints; /** * The rotating barcode settings/details. */ rotatingBarcode?: RotatingBarcode; /** * Restrictions on the object that needs to be verified before the user tries * to save the pass. Note that this restrictions will only be applied during * save time. If the restrictions changed after a user saves the pass, the new * restrictions will not be applied to an already saved pass. */ saveRestrictions?: SaveRestrictions; /** * The value that will be transmitted to a Smart Tap certified terminal over * NFC for this object. The class level fields `enableSmartTap` and * `redemptionIssuers` must also be set up correctly in order for the pass to * support Smart Tap. Only ASCII characters are supported. */ smartTapRedemptionValue?: string; /** * The state of the object. This field is used to determine how an object is * displayed in the app. For example, an `inactive` object is moved to the * "Expired passes" section. If this is not provided, the object would be * considered `ACTIVE`. */ state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "active" | "COMPLETED" | "completed" | "EXPIRED" | "expired" | "INACTIVE" | "inactive"; /** * The title label of the pass, such as location where this pass can be used. * Appears right above the title in the title row in the pass detail view. */ subheader?: LocalizedString; /** * Text module data. If `textModulesData` is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * class and 10 from object. */ textModulesData?: TextModuleData[]; /** * The time period this object will be considered valid or usable. When the * time period is passed, the object will be considered expired, which will * affect the rendering on user's devices. */ validTimeInterval?: TimeInterval; /** * Optional value added module data. Maximum of ten on the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * The wide logo of the pass. When provided, this will be used in place of * the logo in the top left of the card view. */ wideLogo?: Image; } function serializeGenericObject(data: any): GenericObject { return { ...data, rotatingBarcode: data["rotatingBarcode"] !== undefined ? serializeRotatingBarcode(data["rotatingBarcode"]) : undefined, }; } function deserializeGenericObject(data: any): GenericObject { return { ...data, rotatingBarcode: data["rotatingBarcode"] !== undefined ? deserializeRotatingBarcode(data["rotatingBarcode"]) : undefined, }; } /** * Response to adding a new issuer message to the object. This contains the * entire updated GenericObject. */ export interface GenericObjectAddMessageResponse { /** * The updated GenericObject resource. */ resource?: GenericObject; } function serializeGenericObjectAddMessageResponse(data: any): GenericObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeGenericObject(data["resource"]) : undefined, }; } function deserializeGenericObjectAddMessageResponse(data: any): GenericObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeGenericObject(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#genericobjectList. */ export interface GenericobjectListOptions { /** * The ID of the class whose objects will be listed. */ classId?: string; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` objects are available in a list. For example, if you have * a list of 200 objects and you call list with `maxResults` set to 20, list * will return the first 20 objects and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 objects. */ token?: string; } /** * List response which contains the list of all generic objects for a given * issuer ID. */ export interface GenericObjectListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: GenericObject[]; } function serializeGenericObjectListResponse(data: any): GenericObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeGenericObject(item))) : undefined, }; } function deserializeGenericObjectListResponse(data: any): GenericObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeGenericObject(item))) : undefined, }; } export interface GiftCardClass { /** * Determines whether the merchant supports gift card redemption using * barcode. If true, app displays a barcode for the gift card on the Gift card * details screen. If false, a barcode is not displayed. */ allowBarcodeRedemption?: boolean; /** * Deprecated. Use `multipleDevicesAndHoldersAllowedStatus` instead. */ allowMultipleUsersPerObject?: boolean; /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding object * that will be used instead. */ appLinkData?: AppLinkData; /** * Callback options to be used to call the issuer back for every save/delete * of an object for this class by the end-user. All objects of this class are * eligible for the callback. */ callbackOptions?: CallbackOptions; /** * The label to display for the card number, such as "Card Number". */ cardNumberLabel?: string; /** * Template information about how the class should be displayed. If unset, * Google will fallback to a default set of fields to display. */ classTemplateInfo?: ClassTemplateInfo; /** * Country code used to display the card's country (when the user is not in * that country), as well as to display localized content when content is not * available in the user's locale. */ countryCode?: string; /** * Identifies whether this class supports Smart Tap. The `redemptionIssuers` * and object level `smartTapRedemptionLevel` fields must also be set up * correctly in order for a pass to support Smart Tap. */ enableSmartTap?: boolean; /** * The label to display for event number, such as "Target Event #". */ eventNumberLabel?: string; /** * Optional banner image displayed on the front of the card. If none is * present, nothing will be displayed. The image will display at 100% width. */ heroImage?: Image; /** * The background color for the card. If not set the dominant color of the * hero image is used, and if no hero image is set, the dominant color of the * logo is used. The format is #rrggbb where rrggbb is a hex RGB triplet, such * as `#ffcc00`. You can also use the shorthand version of the RGB triplet * which is #rgb, such as `#fc0`. */ hexBackgroundColor?: string; /** * The URI of your application's home page. Populating the URI in this field * results in the exact same behavior as populating an URI in linksModuleData * (when an object is rendered, a link to the homepage is shown in what would * usually be thought of as the linksModuleData section of the object). */ homepageUri?: Uri; /** * Required. The unique identifier for a class. This ID must be unique across * all classes from an issuer. This value should follow the format issuer ID. * identifier where the former is issued by Google and latter is chosen by * you. Your unique identifier should only include alphanumeric characters, * '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Required. The issuer name. Recommended maximum length is 20 characters to * ensure full string is displayed on smaller screens. */ issuerName?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#giftCardClass"`. */ kind?: string; /** * Links module data. If links module data is also defined on the object, * both will be displayed. */ linksModuleData?: LinksModuleData; /** * Translated strings for the card_number_label. */ localizedCardNumberLabel?: LocalizedString; /** * Translated strings for the event_number_label. */ localizedEventNumberLabel?: LocalizedString; /** * Translated strings for the issuer_name. Recommended maximum length is 20 * characters to ensure full string is displayed on smaller screens. */ localizedIssuerName?: LocalizedString; /** * Translated strings for the merchant_name. The app may display an ellipsis * after the first 20 characters to ensure full string is displayed on smaller * screens. */ localizedMerchantName?: LocalizedString; /** * Translated strings for the pin_label. */ localizedPinLabel?: LocalizedString; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * Merchant locations. There is a maximum of ten on the class. Any additional * MerchantLocations added beyond the 10 will be rejected. These locations * will trigger a notification when a user enters within a Google-set radius * of the point. This field replaces the deprecated LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * Merchant name, such as "Adam's Apparel". The app may display an ellipsis * after the first 20 characters to ensure full string is displayed on smaller * screens. */ merchantName?: string; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Identifies whether multiple users and devices will save the same object * referencing this class. */ multipleDevicesAndHoldersAllowedStatus?: | "STATUS_UNSPECIFIED" | "MULTIPLE_HOLDERS" | "ONE_USER_ALL_DEVICES" | "ONE_USER_ONE_DEVICE" | "multipleHolders" | "oneUserAllDevices" | "oneUserOneDevice"; /** * Whether or not field updates to this class should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If not specified, no notification will be triggered. * This setting is ephemeral and needs to be set with each PATCH or UPDATE * request, otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * The label to display for the PIN, such as "4-digit PIN". */ pinLabel?: string; /** * The logo of the gift card program or company. This logo is displayed in * both the details and list views of the app. */ programLogo?: Image; /** * Identifies which redemption issuers can redeem the pass over Smart Tap. * Redemption issuers are identified by their issuer ID. Redemption issuers * must have at least one Smart Tap key configured. The `enableSmartTap` and * object level `smartTapRedemptionLevel` fields must also be set up correctly * in order for a pass to support Smart Tap. */ redemptionIssuers?: bigint[]; /** * The review comments set by the platform when a class is marked `approved` * or `rejected`. */ review?: Review; /** * Required. The status of the class. This field can be set to `draft` or * `underReview` using the insert, patch, or update API calls. Once the review * state is changed from `draft` it may not be changed back to `draft`. You * should keep this field to `draft` when the class is under development. A * `draft` class cannot be used to create any object. You should set this * field to `underReview` when you believe the class is ready for use. The * platform will automatically set this field to `approved` and it can be * immediately used to create or migrate objects. When updating an already * `approved` class you should keep setting this field to `underReview`. */ reviewStatus?: | "REVIEW_STATUS_UNSPECIFIED" | "UNDER_REVIEW" | "underReview" | "APPROVED" | "approved" | "REJECTED" | "rejected" | "DRAFT" | "draft"; /** * Optional information about the security animation. If this is set a * security animation will be rendered on pass details. */ securityAnimation?: SecurityAnimation; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * Optional value added module data. Maximum of ten on the class. For a pass * only ten will be displayed, prioritizing those from the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; /** * View Unlock Requirement options for the gift card. */ viewUnlockRequirement?: | "VIEW_UNLOCK_REQUIREMENT_UNSPECIFIED" | "UNLOCK_NOT_REQUIRED" | "UNLOCK_REQUIRED_TO_VIEW"; /** * The wide logo of the gift card program or company. When provided, this * will be used in place of the program logo in the top left of the card view. */ wideProgramLogo?: Image; /** * Deprecated. */ wordMark?: Image; } function serializeGiftCardClass(data: any): GiftCardClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (String(item))) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeGiftCardClass(data: any): GiftCardClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (BigInt(item))) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface GiftCardClassAddMessageResponse { /** * The updated GiftCardClass resource. */ resource?: GiftCardClass; } function serializeGiftCardClassAddMessageResponse(data: any): GiftCardClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeGiftCardClass(data["resource"]) : undefined, }; } function deserializeGiftCardClassAddMessageResponse(data: any): GiftCardClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeGiftCardClass(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#giftcardclassList. */ export interface GiftcardclassListOptions { /** * The ID of the issuer authorized to list classes. */ issuerId?: bigint; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` classes are available in a list. For example, if you have * a list of 200 classes and you call list with `maxResults` set to 20, list * will return the first 20 classes and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 classes. */ token?: string; } function serializeGiftcardclassListOptions(data: any): GiftcardclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? String(data["issuerId"]) : undefined, }; } function deserializeGiftcardclassListOptions(data: any): GiftcardclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? BigInt(data["issuerId"]) : undefined, }; } export interface GiftCardClassListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: GiftCardClass[]; } function serializeGiftCardClassListResponse(data: any): GiftCardClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeGiftCardClass(item))) : undefined, }; } function deserializeGiftCardClassListResponse(data: any): GiftCardClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeGiftCardClass(item))) : undefined, }; } export interface GiftCardObject { /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding class * only object AppLinkData will be displayed. */ appLinkData?: AppLinkData; /** * The card's monetary balance. */ balance?: Money; /** * The date and time when the balance was last updated. Offset is required. * If balance is updated and this property is not provided, system will * default to the current time. */ balanceUpdateTime?: DateTime; /** * The barcode type and value. */ barcode?: Barcode; /** * Required. The card's number. */ cardNumber?: string; /** * Required. The class associated with this object. The class must be of the * same type as this object, must already exist, and must be approved. Class * IDs should follow the format issuer ID.identifier where the former is * issued by Google and latter is chosen by you. */ classId?: string; /** * A copy of the inherited fields of the parent class. These fields are * retrieved during a GET. */ classReference?: GiftCardClass; /** * Indicates if notifications should explicitly be suppressed. If this field * is set to true, regardless of the `messages` field, expiration * notifications to the user will be suppressed. By default, this field is set * to false. Currently, this can only be set for offers. */ disableExpirationNotification?: boolean; /** * The card's event number, an optional field used by some gift cards. */ eventNumber?: string; /** * Information that controls how passes are grouped together. */ groupingInfo?: GroupingInfo; /** * Whether this object is currently linked to a single device. This field is * set by the platform when a user saves the object, linking it to their * device. Intended for use by select partners. Contact support for additional * information. */ hasLinkedDevice?: boolean; /** * Indicates if the object has users. This field is set by the platform. */ hasUsers?: boolean; /** * Optional banner image displayed on the front of the card. If none is * present, hero image of the class, if present, will be displayed. If hero * image of the class is also not present, nothing will be displayed. */ heroImage?: Image; /** * Required. The unique identifier for an object. This ID must be unique * across all objects from an issuer. This value should follow the format * issuer ID.identifier where the former is issued by Google and latter is * chosen by you. The unique identifier should only include alphanumeric * characters, '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#giftCardObject"`. */ kind?: string; /** * linked_object_ids are a list of other objects such as event ticket, * loyalty, offer, generic, giftcard, transit and boarding pass that should be * automatically attached to this giftcard object. If a user had saved this * gift card, then these linked_object_ids would be automatically pushed to * the user's wallet (unless they turned off the setting to receive such * linked passes). Make sure that objects present in linked_object_ids are * already inserted - if not, calls would fail. Once linked, the linked * objects cannot be unlinked. You cannot link objects belonging to another * issuer. There is a limit to the number of objects that can be linked to a * single object. After the limit is reached, new linked objects in the call * will be ignored silently. Object IDs should follow the format issuer ID. * identifier where the former is issued by Google and the latter is chosen by * you. */ linkedObjectIds?: string[]; /** * Links module data. If links module data is also defined on the class, both * will be displayed. */ linksModuleData?: LinksModuleData; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * Merchant locations. There is a maximum of ten on the object. Any * additional MerchantLocations added beyond the 10 will be rejected. These * locations will trigger a notification when a user enters within a * Google-set radius of the point. This field replaces the deprecated * LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Whether or not field updates to this object should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If set to DO_NOT_NOTIFY or * NOTIFICATION_SETTINGS_UNSPECIFIED, no notification will be triggered. This * setting is ephemeral and needs to be set with each PATCH or UPDATE request, * otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Pass constraints for the object. Includes limiting NFC and screenshot * behaviors. */ passConstraints?: PassConstraints; /** * The card's PIN. */ pin?: string; /** * The rotating barcode type and value. */ rotatingBarcode?: RotatingBarcode; /** * Restrictions on the object that needs to be verified before the user tries * to save the pass. Note that this restrictions will only be applied during * save time. If the restrictions changed after a user saves the pass, the new * restrictions will not be applied to an already saved pass. */ saveRestrictions?: SaveRestrictions; /** * The value that will be transmitted to a Smart Tap certified terminal over * NFC for this object. The class level fields `enableSmartTap` and * `redemptionIssuers` must also be set up correctly in order for the pass to * support Smart Tap. Only ASCII characters are supported. */ smartTapRedemptionValue?: string; /** * Required. The state of the object. This field is used to determine how an * object is displayed in the app. For example, an `inactive` object is moved * to the "Expired passes" section. */ state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "active" | "COMPLETED" | "completed" | "EXPIRED" | "expired" | "INACTIVE" | "inactive"; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * The time period this object will be `active` and object can be used. An * object's state will be changed to `expired` when this time period has * passed. */ validTimeInterval?: TimeInterval; /** * Optional value added module data. Maximum of ten on the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; } function serializeGiftCardObject(data: any): GiftCardObject { return { ...data, balance: data["balance"] !== undefined ? serializeMoney(data["balance"]) : undefined, classReference: data["classReference"] !== undefined ? serializeGiftCardClass(data["classReference"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? serializeRotatingBarcode(data["rotatingBarcode"]) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeGiftCardObject(data: any): GiftCardObject { return { ...data, balance: data["balance"] !== undefined ? deserializeMoney(data["balance"]) : undefined, classReference: data["classReference"] !== undefined ? deserializeGiftCardClass(data["classReference"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? deserializeRotatingBarcode(data["rotatingBarcode"]) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface GiftCardObjectAddMessageResponse { /** * The updated GiftCardObject resource. */ resource?: GiftCardObject; } function serializeGiftCardObjectAddMessageResponse(data: any): GiftCardObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeGiftCardObject(data["resource"]) : undefined, }; } function deserializeGiftCardObjectAddMessageResponse(data: any): GiftCardObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeGiftCardObject(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#giftcardobjectList. */ export interface GiftcardobjectListOptions { /** * The ID of the class whose objects will be listed. */ classId?: string; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` objects are available in a list. For example, if you have * a list of 200 objects and you call list with `maxResults` set to 20, list * will return the first 20 objects and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 objects. */ token?: string; } export interface GiftCardObjectListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: GiftCardObject[]; } function serializeGiftCardObjectListResponse(data: any): GiftCardObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeGiftCardObject(item))) : undefined, }; } function deserializeGiftCardObjectListResponse(data: any): GiftCardObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeGiftCardObject(item))) : undefined, }; } export interface GroupingInfo { /** * Optional grouping ID for grouping the passes with the same ID visually * together. Grouping with different types of passes is allowed. */ groupingId?: string; /** * Optional index for sorting the passes when they are grouped with other * passes. Passes with lower sort index are shown before passes with higher * sort index. If unspecified, the value is assumed to be INT_MAX. For two * passes with the same sort index, the sorting behavior is undefined. */ sortIndex?: number; } /** * Wrapping type for Google hosted images. Next ID: 7 */ export interface Image { /** * Description of the image used for accessibility. */ contentDescription?: LocalizedString; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#image"`. */ kind?: string; /** * The URI for the image. */ sourceUri?: ImageUri; } export interface ImageModuleData { /** * The ID associated with an image module. This field is here to enable ease * of management of image modules. */ id?: string; /** * A 100% width image. */ mainImage?: Image; } export interface ImageUri { /** * Additional information about the image, which is unused and retained only * for backward compatibility. */ description?: string; /** * Translated strings for the description, which are unused and retained only * for backward compatibility. */ localizedDescription?: LocalizedString; /** * The location of the image. URIs must have a scheme. */ uri?: string; } export interface InfoModuleData { /** * A list of collections of labels and values. These will be displayed one * after the other in a singular column. */ labelValueRows?: LabelValueRow[]; showLastUpdateTime?: boolean; } export interface Issuer { /** * Allows the issuer to provide their callback settings. */ callbackOptions?: CallbackOptions; /** * Issuer contact information. */ contactInfo?: IssuerContactInfo; /** * URL for the issuer's home page. */ homepageUrl?: string; /** * The unique identifier for an issuer account. This is automatically * generated when the issuer is inserted. */ issuerId?: bigint; /** * The account name of the issuer. */ name?: string; /** * Available only to Smart Tap enabled partners. Contact support for * additional guidance. */ smartTapMerchantData?: SmartTapMerchantData; } function serializeIssuer(data: any): Issuer { return { ...data, issuerId: data["issuerId"] !== undefined ? String(data["issuerId"]) : undefined, smartTapMerchantData: data["smartTapMerchantData"] !== undefined ? serializeSmartTapMerchantData(data["smartTapMerchantData"]) : undefined, }; } function deserializeIssuer(data: any): Issuer { return { ...data, issuerId: data["issuerId"] !== undefined ? BigInt(data["issuerId"]) : undefined, smartTapMerchantData: data["smartTapMerchantData"] !== undefined ? deserializeSmartTapMerchantData(data["smartTapMerchantData"]) : undefined, }; } export interface IssuerContactInfo { /** * Email addresses which will receive alerts. */ alertsEmails?: string[]; /** * The primary contact email address. */ email?: string; /** * The primary contact name. */ name?: string; /** * The primary contact phone number. */ phone?: string; } export interface IssuerListResponse { /** * Resources corresponding to the list request. */ resources?: Issuer[]; } function serializeIssuerListResponse(data: any): IssuerListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeIssuer(item))) : undefined, }; } function deserializeIssuerListResponse(data: any): IssuerListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeIssuer(item))) : undefined, }; } export interface IssuerToUserInfo { action?: | "ACTION_UNSPECIFIED" | "S2AP" | "s2ap" | "SIGN_UP" | "signUp"; signUpInfo?: SignUpInfo; /** * Currently not used, consider deprecating. */ url?: string; /** * JSON web token for action S2AP. */ value?: string; } export interface JwtInsertResponse { /** * Data that corresponds to the ids of the provided classes and objects in * the JWT. resources will only include the non-empty arrays (i.e. if the JWT * only includes eventTicketObjects, then that is the only field that will be * present in resources). */ resources?: Resources; /** * A URI that, when opened, will allow the end user to save the object(s) * identified in the JWT to their Google account. */ saveUri?: string; } function serializeJwtInsertResponse(data: any): JwtInsertResponse { return { ...data, resources: data["resources"] !== undefined ? serializeResources(data["resources"]) : undefined, }; } function deserializeJwtInsertResponse(data: any): JwtInsertResponse { return { ...data, resources: data["resources"] !== undefined ? deserializeResources(data["resources"]) : undefined, }; } export interface JwtResource { /** * A string representing a JWT of the format described at * https://developers.google.com/wallet/reference/rest/v1/Jwt */ jwt?: string; } /** * A pair of text strings to be displayed in the details view. Note we no * longer display LabelValue/LabelValueRow as a table, instead a list of items. */ export interface LabelValue { /** * The label for a specific row and column. Recommended maximum is 15 * characters for a two-column layout and 30 characters for a one-column * layout. */ label?: string; /** * Translated strings for the label. Recommended maximum is 15 characters for * a two-column layout and 30 characters for a one-column layout. */ localizedLabel?: LocalizedString; /** * Translated strings for the value. Recommended maximum is 15 characters for * a two-column layout and 30 characters for a one-column layout. */ localizedValue?: LocalizedString; /** * The value for a specific row and column. Recommended maximum is 15 * characters for a two-column layout and 30 characters for a one-column * layout. */ value?: string; } export interface LabelValueRow { /** * A list of labels and values. These will be displayed in a singular column, * one after the other, not in multiple columns, despite the field name. */ columns?: LabelValue[]; } export interface LatLongPoint { /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#latLongPoint"`. */ kind?: string; /** * The latitude specified as any value in the range of -90.0 through +90.0, * both inclusive. Values outside these bounds will be rejected. */ latitude?: number; /** * The longitude specified in the range -180.0 through +180.0, both * inclusive. Values outside these bounds will be rejected. */ longitude?: number; } export interface LinksModuleData { /** * The list of URIs. */ uris?: Uri[]; } export interface ListTemplateOverride { /** * Specifies from a predefined set of options or from a reference to the * field what will be displayed in the first row. To set this override, set * the FirstRowOption.fieldOption to the FieldSelector of your choice. */ firstRowOption?: FirstRowOption; /** * A reference to the field to be displayed in the second row. This option is * only displayed if there are not multiple user objects in a group. If there * is a group, the second row will always display a field shared by all * objects. To set this override, please set secondRowOption to the * FieldSelector of you choice. */ secondRowOption?: FieldSelector; /** * An unused/deprecated field. Setting it will have no effect on what the * user sees. */ thirdRowOption?: FieldSelector; } export interface LocalizedString { /** * Contains the string to be displayed if no appropriate translation is * available. */ defaultValue?: TranslatedString; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#localizedString"`. */ kind?: string; /** * Contains the translations for the string. */ translatedValues?: TranslatedString[]; } export interface LoyaltyClass { /** * The account ID label, such as "Member ID." Recommended maximum length is * 15 characters to ensure full string is displayed on smaller screens. */ accountIdLabel?: string; /** * The account name label, such as "Member Name." Recommended maximum length * is 15 characters to ensure full string is displayed on smaller screens. */ accountNameLabel?: string; /** * Deprecated. Use `multipleDevicesAndHoldersAllowedStatus` instead. */ allowMultipleUsersPerObject?: boolean; /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding object * that will be used instead. */ appLinkData?: AppLinkData; /** * Callback options to be used to call the issuer back for every save/delete * of an object for this class by the end-user. All objects of this class are * eligible for the callback. */ callbackOptions?: CallbackOptions; /** * Template information about how the class should be displayed. If unset, * Google will fallback to a default set of fields to display. */ classTemplateInfo?: ClassTemplateInfo; /** * Country code used to display the card's country (when the user is not in * that country), as well as to display localized content when content is not * available in the user's locale. */ countryCode?: string; /** * Information about how the class may be discovered and instantiated from * within the Google Pay app. */ discoverableProgram?: DiscoverableProgram; /** * Identifies whether this class supports Smart Tap. The `redemptionIssuers` * and one of object level `smartTapRedemptionLevel`, barcode.value`, or * `accountId` fields must also be set up correctly in order for a pass to * support Smart Tap. */ enableSmartTap?: boolean; /** * Optional banner image displayed on the front of the card. If none is * present, nothing will be displayed. The image will display at 100% width. */ heroImage?: Image; /** * The background color for the card. If not set the dominant color of the * hero image is used, and if no hero image is set, the dominant color of the * logo is used. The format is #rrggbb where rrggbb is a hex RGB triplet, such * as `#ffcc00`. You can also use the shorthand version of the RGB triplet * which is #rgb, such as `#fc0`. */ hexBackgroundColor?: string; /** * The URI of your application's home page. Populating the URI in this field * results in the exact same behavior as populating an URI in linksModuleData * (when an object is rendered, a link to the homepage is shown in what would * usually be thought of as the linksModuleData section of the object). */ homepageUri?: Uri; /** * Required. The unique identifier for a class. This ID must be unique across * all classes from an issuer. This value should follow the format issuer ID. * identifier where the former is issued by Google and latter is chosen by * you. Your unique identifier should only include alphanumeric characters, * '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Required. The issuer name. Recommended maximum length is 20 characters to * ensure full string is displayed on smaller screens. */ issuerName?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#loyaltyClass"`. */ kind?: string; /** * Links module data. If links module data is also defined on the object, * both will be displayed. */ linksModuleData?: LinksModuleData; /** * Translated strings for the account_id_label. Recommended maximum length is * 15 characters to ensure full string is displayed on smaller screens. */ localizedAccountIdLabel?: LocalizedString; /** * Translated strings for the account_name_label. Recommended maximum length * is 15 characters to ensure full string is displayed on smaller screens. */ localizedAccountNameLabel?: LocalizedString; /** * Translated strings for the issuer_name. Recommended maximum length is 20 * characters to ensure full string is displayed on smaller screens. */ localizedIssuerName?: LocalizedString; /** * Translated strings for the program_name. The app may display an ellipsis * after the first 20 characters to ensure full string is displayed on smaller * screens. */ localizedProgramName?: LocalizedString; /** * Translated strings for the rewards_tier. Recommended maximum length is 7 * characters to ensure full string is displayed on smaller screens. */ localizedRewardsTier?: LocalizedString; /** * Translated strings for the rewards_tier_label. Recommended maximum length * is 9 characters to ensure full string is displayed on smaller screens. */ localizedRewardsTierLabel?: LocalizedString; /** * Translated strings for the secondary_rewards_tier. */ localizedSecondaryRewardsTier?: LocalizedString; /** * Translated strings for the secondary_rewards_tier_label. */ localizedSecondaryRewardsTierLabel?: LocalizedString; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * Merchant locations. There is a maximum of ten on the class. Any additional * MerchantLocations added beyond the 10 will be rejected. These locations * will trigger a notification when a user enters within a Google-set radius * of the point. This field replaces the deprecated LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Identifies whether multiple users and devices will save the same object * referencing this class. */ multipleDevicesAndHoldersAllowedStatus?: | "STATUS_UNSPECIFIED" | "MULTIPLE_HOLDERS" | "ONE_USER_ALL_DEVICES" | "ONE_USER_ONE_DEVICE" | "multipleHolders" | "oneUserAllDevices" | "oneUserOneDevice"; /** * Whether or not field updates to this class should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If not specified, no notification will be triggered. * This setting is ephemeral and needs to be set with each PATCH or UPDATE * request, otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Required. The logo of the loyalty program or company. This logo is * displayed in both the details and list views of the app. */ programLogo?: Image; /** * Required. The program name, such as "Adam's Apparel". The app may display * an ellipsis after the first 20 characters to ensure full string is * displayed on smaller screens. */ programName?: string; /** * Identifies which redemption issuers can redeem the pass over Smart Tap. * Redemption issuers are identified by their issuer ID. Redemption issuers * must have at least one Smart Tap key configured. The `enableSmartTap` and * one of object level `smartTapRedemptionValue`, barcode.value`, or * `accountId` fields must also be set up correctly in order for a pass to * support Smart Tap. */ redemptionIssuers?: bigint[]; /** * The review comments set by the platform when a class is marked `approved` * or `rejected`. */ review?: Review; /** * Required. The status of the class. This field can be set to `draft` or * `underReview` using the insert, patch, or update API calls. Once the review * state is changed from `draft` it may not be changed back to `draft`. You * should keep this field to `draft` when the class is under development. A * `draft` class cannot be used to create any object. You should set this * field to `underReview` when you believe the class is ready for use. The * platform will automatically set this field to `approved` and it can be * immediately used to create or migrate objects. When updating an already * `approved` class you should keep setting this field to `underReview`. */ reviewStatus?: | "REVIEW_STATUS_UNSPECIFIED" | "UNDER_REVIEW" | "underReview" | "APPROVED" | "approved" | "REJECTED" | "rejected" | "DRAFT" | "draft"; /** * The rewards tier, such as "Gold" or "Platinum." Recommended maximum length * is 7 characters to ensure full string is displayed on smaller screens. */ rewardsTier?: string; /** * The rewards tier label, such as "Rewards Tier." Recommended maximum length * is 9 characters to ensure full string is displayed on smaller screens. */ rewardsTierLabel?: string; /** * The secondary rewards tier, such as "Gold" or "Platinum." */ secondaryRewardsTier?: string; /** * The secondary rewards tier label, such as "Rewards Tier." */ secondaryRewardsTierLabel?: string; /** * Optional information about the security animation. If this is set a * security animation will be rendered on pass details. */ securityAnimation?: SecurityAnimation; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * Optional value added module data. Maximum of ten on the class. For a pass * only ten will be displayed, prioritizing those from the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; /** * View Unlock Requirement options for the loyalty card. */ viewUnlockRequirement?: | "VIEW_UNLOCK_REQUIREMENT_UNSPECIFIED" | "UNLOCK_NOT_REQUIRED" | "UNLOCK_REQUIRED_TO_VIEW"; /** * The wide logo of the loyalty program or company. When provided, this will * be used in place of the program logo in the top left of the card view. */ wideProgramLogo?: Image; /** * Deprecated. */ wordMark?: Image; } function serializeLoyaltyClass(data: any): LoyaltyClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (String(item))) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeLoyaltyClass(data: any): LoyaltyClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (BigInt(item))) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface LoyaltyClassAddMessageResponse { /** * The updated LoyaltyClass resource. */ resource?: LoyaltyClass; } function serializeLoyaltyClassAddMessageResponse(data: any): LoyaltyClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeLoyaltyClass(data["resource"]) : undefined, }; } function deserializeLoyaltyClassAddMessageResponse(data: any): LoyaltyClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeLoyaltyClass(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#loyaltyclassList. */ export interface LoyaltyclassListOptions { /** * The ID of the issuer authorized to list classes. */ issuerId?: bigint; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` classes are available in a list. For example, if you have * a list of 200 classes and you call list with `maxResults` set to 20, list * will return the first 20 classes and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 classes. */ token?: string; } function serializeLoyaltyclassListOptions(data: any): LoyaltyclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? String(data["issuerId"]) : undefined, }; } function deserializeLoyaltyclassListOptions(data: any): LoyaltyclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? BigInt(data["issuerId"]) : undefined, }; } export interface LoyaltyClassListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: LoyaltyClass[]; } function serializeLoyaltyClassListResponse(data: any): LoyaltyClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeLoyaltyClass(item))) : undefined, }; } function deserializeLoyaltyClassListResponse(data: any): LoyaltyClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeLoyaltyClass(item))) : undefined, }; } export interface LoyaltyObject { /** * The loyalty account identifier. Recommended maximum length is 20 * characters. */ accountId?: string; /** * The loyalty account holder name, such as "John Smith." Recommended maximum * length is 20 characters to ensure full string is displayed on smaller * screens. */ accountName?: string; /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding class * only object AppLinkData will be displayed. */ appLinkData?: AppLinkData; /** * The barcode type and value. */ barcode?: Barcode; /** * Required. The class associated with this object. The class must be of the * same type as this object, must already exist, and must be approved. Class * IDs should follow the format issuer ID.identifier where the former is * issued by Google and latter is chosen by you. */ classId?: string; /** * A copy of the inherited fields of the parent class. These fields are * retrieved during a GET. */ classReference?: LoyaltyClass; /** * Indicates if notifications should explicitly be suppressed. If this field * is set to true, regardless of the `messages` field, expiration * notifications to the user will be suppressed. By default, this field is set * to false. Currently, this can only be set for offers. */ disableExpirationNotification?: boolean; /** * Information that controls how passes are grouped together. */ groupingInfo?: GroupingInfo; /** * Whether this object is currently linked to a single device. This field is * set by the platform when a user saves the object, linking it to their * device. Intended for use by select partners. Contact support for additional * information. */ hasLinkedDevice?: boolean; /** * Indicates if the object has users. This field is set by the platform. */ hasUsers?: boolean; /** * Optional banner image displayed on the front of the card. If none is * present, hero image of the class, if present, will be displayed. If hero * image of the class is also not present, nothing will be displayed. */ heroImage?: Image; /** * Required. The unique identifier for an object. This ID must be unique * across all objects from an issuer. This value should follow the format * issuer ID.identifier where the former is issued by Google and latter is * chosen by you. The unique identifier should only include alphanumeric * characters, '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#loyaltyObject"`. */ kind?: string; /** * linked_object_ids are a list of other objects such as event ticket, * loyalty, offer, generic, giftcard, transit and boarding pass that should be * automatically attached to this loyalty object. If a user had saved this * loyalty card, then these linked_object_ids would be automatically pushed to * the user's wallet (unless they turned off the setting to receive such * linked passes). Make sure that objects present in linked_object_ids are * already inserted - if not, calls would fail. Once linked, the linked * objects cannot be unlinked. You cannot link objects belonging to another * issuer. There is a limit to the number of objects that can be linked to a * single object. After the limit is reached, new linked objects in the call * will be ignored silently. Object IDs should follow the format issuer ID. * identifier where the former is issued by Google and the latter is chosen by * you. */ linkedObjectIds?: string[]; /** * A list of offer objects linked to this loyalty card. The offer objects * must already exist. Offer object IDs should follow the format issuer ID. * identifier where the former is issued by Google and latter is chosen by * you. */ linkedOfferIds?: string[]; /** * Links module data. If links module data is also defined on the class, both * will be displayed. */ linksModuleData?: LinksModuleData; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * The loyalty reward points label, balance, and type. */ loyaltyPoints?: LoyaltyPoints; /** * Merchant locations. There is a maximum of ten on the object. Any * additional MerchantLocations added beyond the 10 will be rejected. These * locations will trigger a notification when a user enters within a * Google-set radius of the point. This field replaces the deprecated * LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Whether or not field updates to this object should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If set to DO_NOT_NOTIFY or * NOTIFICATION_SETTINGS_UNSPECIFIED, no notification will be triggered. This * setting is ephemeral and needs to be set with each PATCH or UPDATE request, * otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Pass constraints for the object. Includes limiting NFC and screenshot * behaviors. */ passConstraints?: PassConstraints; /** * The rotating barcode type and value. */ rotatingBarcode?: RotatingBarcode; /** * Restrictions on the object that needs to be verified before the user tries * to save the pass. Note that this restrictions will only be applied during * save time. If the restrictions changed after a user saves the pass, the new * restrictions will not be applied to an already saved pass. */ saveRestrictions?: SaveRestrictions; /** * The secondary loyalty reward points label, balance, and type. Shown in * addition to the primary loyalty points. */ secondaryLoyaltyPoints?: LoyaltyPoints; /** * The value that will be transmitted to a Smart Tap certified terminal over * NFC for this object. The class level fields `enableSmartTap` and * `redemptionIssuers` must also be set up correctly in order for the pass to * support Smart Tap. Only ASCII characters are supported. If this value is * not set but the class level fields `enableSmartTap` and `redemptionIssuers` * are set up correctly, the `barcode.value` or the `accountId` fields are * used as fallback if present. */ smartTapRedemptionValue?: string; /** * Required. The state of the object. This field is used to determine how an * object is displayed in the app. For example, an `inactive` object is moved * to the "Expired passes" section. */ state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "active" | "COMPLETED" | "completed" | "EXPIRED" | "expired" | "INACTIVE" | "inactive"; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * The time period this object will be `active` and object can be used. An * object's state will be changed to `expired` when this time period has * passed. */ validTimeInterval?: TimeInterval; /** * Optional value added module data. Maximum of ten on the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; } function serializeLoyaltyObject(data: any): LoyaltyObject { return { ...data, classReference: data["classReference"] !== undefined ? serializeLoyaltyClass(data["classReference"]) : undefined, loyaltyPoints: data["loyaltyPoints"] !== undefined ? serializeLoyaltyPoints(data["loyaltyPoints"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? serializeRotatingBarcode(data["rotatingBarcode"]) : undefined, secondaryLoyaltyPoints: data["secondaryLoyaltyPoints"] !== undefined ? serializeLoyaltyPoints(data["secondaryLoyaltyPoints"]) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeLoyaltyObject(data: any): LoyaltyObject { return { ...data, classReference: data["classReference"] !== undefined ? deserializeLoyaltyClass(data["classReference"]) : undefined, loyaltyPoints: data["loyaltyPoints"] !== undefined ? deserializeLoyaltyPoints(data["loyaltyPoints"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? deserializeRotatingBarcode(data["rotatingBarcode"]) : undefined, secondaryLoyaltyPoints: data["secondaryLoyaltyPoints"] !== undefined ? deserializeLoyaltyPoints(data["secondaryLoyaltyPoints"]) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface LoyaltyObjectAddMessageResponse { /** * The updated LoyaltyObject resource. */ resource?: LoyaltyObject; } function serializeLoyaltyObjectAddMessageResponse(data: any): LoyaltyObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeLoyaltyObject(data["resource"]) : undefined, }; } function deserializeLoyaltyObjectAddMessageResponse(data: any): LoyaltyObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeLoyaltyObject(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#loyaltyobjectList. */ export interface LoyaltyobjectListOptions { /** * The ID of the class whose objects will be listed. */ classId?: string; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` objects are available in a list. For example, if you have * a list of 200 objects and you call list with `maxResults` set to 20, list * will return the first 20 objects and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 objects. */ token?: string; } export interface LoyaltyObjectListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: LoyaltyObject[]; } function serializeLoyaltyObjectListResponse(data: any): LoyaltyObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeLoyaltyObject(item))) : undefined, }; } function deserializeLoyaltyObjectListResponse(data: any): LoyaltyObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeLoyaltyObject(item))) : undefined, }; } export interface LoyaltyPoints { /** * The account holder's loyalty point balance, such as "500" or "$10.00". * Recommended maximum length is 7 characters. This is a required field of * `loyaltyPoints` and `secondaryLoyaltyPoints`. */ balance?: LoyaltyPointsBalance; /** * The loyalty points label, such as "Points". Recommended maximum length is * 9 characters. */ label?: string; /** * Translated strings for the label. Recommended maximum length is 9 * characters. */ localizedLabel?: LocalizedString; } function serializeLoyaltyPoints(data: any): LoyaltyPoints { return { ...data, balance: data["balance"] !== undefined ? serializeLoyaltyPointsBalance(data["balance"]) : undefined, }; } function deserializeLoyaltyPoints(data: any): LoyaltyPoints { return { ...data, balance: data["balance"] !== undefined ? deserializeLoyaltyPointsBalance(data["balance"]) : undefined, }; } export interface LoyaltyPointsBalance { /** * The double form of a balance. Only one of these subtypes (string, int, * double, money) should be populated. */ double?: number; /** * The integer form of a balance. Only one of these subtypes (string, int, * double, money) should be populated. */ int?: number; /** * The money form of a balance. Only one of these subtypes (string, int, * double, money) should be populated. */ money?: Money; /** * The string form of a balance. Only one of these subtypes (string, int, * double, money) should be populated. */ string?: string; } function serializeLoyaltyPointsBalance(data: any): LoyaltyPointsBalance { return { ...data, money: data["money"] !== undefined ? serializeMoney(data["money"]) : undefined, }; } function deserializeLoyaltyPointsBalance(data: any): LoyaltyPointsBalance { return { ...data, money: data["money"] !== undefined ? deserializeMoney(data["money"]) : undefined, }; } /** * A reference to data stored on the filesystem, on GFS or in blobstore. */ export interface Media { /** * Deprecated, use one of explicit hash type fields instead. Algorithm used * for calculating the hash. As of 2011/01/21, "MD5" is the only possible * value for this field. New values may be added at any time. */ algorithm?: string; /** * Use object_id instead. */ bigstoreObjectRef?: Uint8Array; /** * Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should * be the byte representation of a blobstore.BlobRef. Since Blobstore is * deprecating v1, use blobstore2_info instead. For now, any v2 blob will also * be represented in this field as v1 BlobRef. */ blobRef?: Uint8Array; /** * Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to * a v2 blob. */ blobstore2Info?: Blobstore2Info; /** * A composite media composed of one or more media objects, set if * reference_type is COMPOSITE_MEDIA. The media length field must be set to * the sum of the lengths of all composite media objects. Note: All composite * media must have length specified. */ compositeMedia?: CompositeMedia[]; /** * MIME type of the data */ contentType?: string; /** * Extended content type information provided for Scotty uploads. */ contentTypeInfo?: ContentTypeInfo; /** * A binary data reference for a media download. Serves as a * technology-agnostic binary reference in some Google infrastructure. This * value is a serialized storage_cosmo.BinaryReference proto. Storing it as * bytes is a hack to get around the fact that the cosmo proto (as well as * others it includes) doesn't support JavaScript. This prevents us from * including the actual type of this field. */ cosmoBinaryReference?: Uint8Array; /** * For Scotty Uploads: Scotty-provided hashes for uploads For Scotty * Downloads: (WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM.) A * Hash provided by the agent to be used to verify the data being downloaded. * Currently only supported for inline payloads. Further, only crc32c_hash is * currently supported. */ crc32cHash?: number; /** * Set if reference_type is DIFF_CHECKSUMS_RESPONSE. */ diffChecksumsResponse?: DiffChecksumsResponse; /** * Set if reference_type is DIFF_DOWNLOAD_RESPONSE. */ diffDownloadResponse?: DiffDownloadResponse; /** * Set if reference_type is DIFF_UPLOAD_REQUEST. */ diffUploadRequest?: DiffUploadRequest; /** * Set if reference_type is DIFF_UPLOAD_RESPONSE. */ diffUploadResponse?: DiffUploadResponse; /** * Set if reference_type is DIFF_VERSION_RESPONSE. */ diffVersionResponse?: DiffVersionResponse; /** * Parameters for a media download. */ downloadParameters?: DownloadParameters; /** * Original file name */ filename?: string; /** * Deprecated, use one of explicit hash type fields instead. These two hash * related fields will only be populated on Scotty based media uploads and * will contain the content of the hash group in the NotificationRequest: * http://cs/#google3/blobstore2/api/scotty/service/proto/upload_listener.proto&q=class:Hash * Hex encoded hash value of the uploaded media. */ hash?: string; /** * For Scotty uploads only. If a user sends a hash code and the backend has * requested that Scotty verify the upload against the client hash, Scotty * will perform the check on behalf of the backend and will reject it if the * hashes don't match. This is set to true if Scotty performed this * verification. */ hashVerified?: boolean; /** * Media data, set if reference_type is INLINE */ inline?: Uint8Array; /** * |is_potential_retry| is set false only when Scotty is certain that it has * not sent the request before. When a client resumes an upload, this field * must be set true in agent calls, because Scotty cannot be certain that it * has never sent the request before due to potential failure in the session * state persistence. */ isPotentialRetry?: boolean; /** * Size of the data, in bytes */ length?: bigint; /** * Scotty-provided MD5 hash for an upload. */ md5Hash?: Uint8Array; /** * Media id to forward to the operation GetMedia. Can be set if * reference_type is GET_MEDIA. */ mediaId?: Uint8Array; /** * Reference to a TI Blob, set if reference_type is BIGSTORE_REF. */ objectId?: ObjectId; /** * Path to the data, set if reference_type is PATH */ path?: string; /** * Describes what the field reference contains. */ referenceType?: | "PATH" | "BLOB_REF" | "INLINE" | "GET_MEDIA" | "COMPOSITE_MEDIA" | "BIGSTORE_REF" | "DIFF_VERSION_RESPONSE" | "DIFF_CHECKSUMS_RESPONSE" | "DIFF_DOWNLOAD_RESPONSE" | "DIFF_UPLOAD_REQUEST" | "DIFF_UPLOAD_RESPONSE" | "COSMO_BINARY_REFERENCE" | "ARBITRARY_BYTES"; /** * Scotty-provided SHA1 hash for an upload. */ sha1Hash?: Uint8Array; /** * Scotty-provided SHA256 hash for an upload. */ sha256Hash?: Uint8Array; /** * Time at which the media data was last updated, in milliseconds since UNIX * epoch */ timestamp?: bigint; /** * A unique fingerprint/version id for the media data */ token?: string; } function serializeMedia(data: any): Media { return { ...data, bigstoreObjectRef: data["bigstoreObjectRef"] !== undefined ? encodeBase64(data["bigstoreObjectRef"]) : undefined, blobRef: data["blobRef"] !== undefined ? encodeBase64(data["blobRef"]) : undefined, blobstore2Info: data["blobstore2Info"] !== undefined ? serializeBlobstore2Info(data["blobstore2Info"]) : undefined, compositeMedia: data["compositeMedia"] !== undefined ? data["compositeMedia"].map((item: any) => (serializeCompositeMedia(item))) : undefined, cosmoBinaryReference: data["cosmoBinaryReference"] !== undefined ? encodeBase64(data["cosmoBinaryReference"]) : undefined, diffChecksumsResponse: data["diffChecksumsResponse"] !== undefined ? serializeDiffChecksumsResponse(data["diffChecksumsResponse"]) : undefined, diffDownloadResponse: data["diffDownloadResponse"] !== undefined ? serializeDiffDownloadResponse(data["diffDownloadResponse"]) : undefined, diffUploadRequest: data["diffUploadRequest"] !== undefined ? serializeDiffUploadRequest(data["diffUploadRequest"]) : undefined, diffUploadResponse: data["diffUploadResponse"] !== undefined ? serializeDiffUploadResponse(data["diffUploadResponse"]) : undefined, diffVersionResponse: data["diffVersionResponse"] !== undefined ? serializeDiffVersionResponse(data["diffVersionResponse"]) : undefined, inline: data["inline"] !== undefined ? encodeBase64(data["inline"]) : undefined, length: data["length"] !== undefined ? String(data["length"]) : undefined, md5Hash: data["md5Hash"] !== undefined ? encodeBase64(data["md5Hash"]) : undefined, mediaId: data["mediaId"] !== undefined ? encodeBase64(data["mediaId"]) : undefined, objectId: data["objectId"] !== undefined ? serializeObjectId(data["objectId"]) : undefined, sha1Hash: data["sha1Hash"] !== undefined ? encodeBase64(data["sha1Hash"]) : undefined, sha256Hash: data["sha256Hash"] !== undefined ? encodeBase64(data["sha256Hash"]) : undefined, timestamp: data["timestamp"] !== undefined ? String(data["timestamp"]) : undefined, }; } function deserializeMedia(data: any): Media { return { ...data, bigstoreObjectRef: data["bigstoreObjectRef"] !== undefined ? decodeBase64(data["bigstoreObjectRef"] as string) : undefined, blobRef: data["blobRef"] !== undefined ? decodeBase64(data["blobRef"] as string) : undefined, blobstore2Info: data["blobstore2Info"] !== undefined ? deserializeBlobstore2Info(data["blobstore2Info"]) : undefined, compositeMedia: data["compositeMedia"] !== undefined ? data["compositeMedia"].map((item: any) => (deserializeCompositeMedia(item))) : undefined, cosmoBinaryReference: data["cosmoBinaryReference"] !== undefined ? decodeBase64(data["cosmoBinaryReference"] as string) : undefined, diffChecksumsResponse: data["diffChecksumsResponse"] !== undefined ? deserializeDiffChecksumsResponse(data["diffChecksumsResponse"]) : undefined, diffDownloadResponse: data["diffDownloadResponse"] !== undefined ? deserializeDiffDownloadResponse(data["diffDownloadResponse"]) : undefined, diffUploadRequest: data["diffUploadRequest"] !== undefined ? deserializeDiffUploadRequest(data["diffUploadRequest"]) : undefined, diffUploadResponse: data["diffUploadResponse"] !== undefined ? deserializeDiffUploadResponse(data["diffUploadResponse"]) : undefined, diffVersionResponse: data["diffVersionResponse"] !== undefined ? deserializeDiffVersionResponse(data["diffVersionResponse"]) : undefined, inline: data["inline"] !== undefined ? decodeBase64(data["inline"] as string) : undefined, length: data["length"] !== undefined ? BigInt(data["length"]) : undefined, md5Hash: data["md5Hash"] !== undefined ? decodeBase64(data["md5Hash"] as string) : undefined, mediaId: data["mediaId"] !== undefined ? decodeBase64(data["mediaId"] as string) : undefined, objectId: data["objectId"] !== undefined ? deserializeObjectId(data["objectId"]) : undefined, sha1Hash: data["sha1Hash"] !== undefined ? decodeBase64(data["sha1Hash"] as string) : undefined, sha256Hash: data["sha256Hash"] !== undefined ? decodeBase64(data["sha256Hash"] as string) : undefined, timestamp: data["timestamp"] !== undefined ? BigInt(data["timestamp"]) : undefined, }; } /** * Extra information added to operations that support Scotty media requests. */ export interface MediaRequestInfo { /** * The number of current bytes uploaded or downloaded. */ currentBytes?: bigint; /** * Data to be copied to backend requests. Custom data is returned to Scotty * in the agent_state field, which Scotty will then provide in subsequent * upload notifications. */ customData?: string; /** * Set if the http request info is diff encoded. The value of this field is * the version number of the base revision. This is corresponding to Apiary's * mediaDiffObjectVersion * (//depot/google3/java/com/google/api/server/media/variable/DiffObjectVersionVariable.java). * See go/esf-scotty-diff-upload for more information. */ diffObjectVersion?: string; /** * The existence of the final_status field indicates that this is the last * call to the agent for this request_id. * http://google3/uploader/agent/scotty_agent.proto?l=737&rcl=347601929 */ finalStatus?: number; /** * The type of notification received from Scotty. */ notificationType?: | "START" | "PROGRESS" | "END" | "RESPONSE_SENT" | "ERROR"; /** * The Scotty request ID. */ requestId?: string; /** * The partition of the Scotty server handling this request. type is * uploader_service.RequestReceivedParamsServingInfo * LINT.IfChange(request_received_params_serving_info_annotations) * LINT.ThenChange() */ requestReceivedParamsServingInfo?: Uint8Array; /** * The total size of the file. */ totalBytes?: bigint; /** * Whether the total bytes field contains an estimated data. */ totalBytesIsEstimated?: boolean; } function serializeMediaRequestInfo(data: any): MediaRequestInfo { return { ...data, currentBytes: data["currentBytes"] !== undefined ? String(data["currentBytes"]) : undefined, requestReceivedParamsServingInfo: data["requestReceivedParamsServingInfo"] !== undefined ? encodeBase64(data["requestReceivedParamsServingInfo"]) : undefined, totalBytes: data["totalBytes"] !== undefined ? String(data["totalBytes"]) : undefined, }; } function deserializeMediaRequestInfo(data: any): MediaRequestInfo { return { ...data, currentBytes: data["currentBytes"] !== undefined ? BigInt(data["currentBytes"]) : undefined, requestReceivedParamsServingInfo: data["requestReceivedParamsServingInfo"] !== undefined ? decodeBase64(data["requestReceivedParamsServingInfo"] as string) : undefined, totalBytes: data["totalBytes"] !== undefined ? BigInt(data["totalBytes"]) : undefined, }; } /** * Locations of interest for this class or object. Currently, this location is * used for geofenced notifications. When a user is within a set radius of this * lat/long, and dwells there, Google will trigger a notification. When a user * exits this radius, the notification will be hidden. */ export interface MerchantLocation { /** * The latitude specified as any value in the range of -90.0 through +90.0, * both inclusive. Values outside these bounds will be rejected. */ latitude?: number; /** * The longitude specified in the range -180.0 through +180.0, both * inclusive. Values outside these bounds will be rejected. */ longitude?: number; } /** * A message that will be displayed with a Valuable */ export interface Message { /** * The message body. */ body?: string; /** * The period of time that the message will be displayed to users. You can * define both a `startTime` and `endTime` for each message. A message is * displayed immediately after a Wallet Object is inserted unless a * `startTime` is set. The message will appear in a list of messages * indefinitely if `endTime` is not provided. */ displayInterval?: TimeInterval; /** * The message header. */ header?: string; /** * The ID associated with a message. This field is here to enable ease of * management of messages. Notice ID values could possibly duplicate across * multiple messages in the same class/instance, and care must be taken to * select a reasonable ID for each message. */ id?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#walletObjectMessage"`. */ kind?: string; /** * Translated strings for the message body. */ localizedBody?: LocalizedString; /** * Translated strings for the message header. */ localizedHeader?: LocalizedString; /** * The message type. */ messageType?: | "MESSAGE_TYPE_UNSPECIFIED" | "TEXT" | "text" | "EXPIRATION_NOTIFICATION" | "expirationNotification" | "TEXT_AND_NOTIFY"; } export interface ModifyLinkedOfferObjects { /** * The linked offer object ids to add to the object. */ addLinkedOfferObjectIds?: string[]; /** * The linked offer object ids to remove from the object. */ removeLinkedOfferObjectIds?: string[]; } export interface ModifyLinkedOfferObjectsRequest { /** * The linked offer object ids to add or remove from the object. */ linkedOfferObjectIds?: ModifyLinkedOfferObjects; } /** * Constraints that all must be met for the module to be shown. */ export interface ModuleViewConstraints { /** * The period of time that the module will be displayed to users. Can define * both a `startTime` and `endTime`. The module is displayed immediately after * insertion unless a `startTime` is set. The module is displayed indefinitely * if `endTime` is not set. */ displayInterval?: TimeInterval; } export interface Money { /** * The currency code, such as "USD" or "EUR." */ currencyCode?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#money"`. */ kind?: string; /** * The unit of money amount in micros. For example, $1 USD would be * represented as 1000000 micros. */ micros?: bigint; } function serializeMoney(data: any): Money { return { ...data, micros: data["micros"] !== undefined ? String(data["micros"]) : undefined, }; } function deserializeMoney(data: any): Money { return { ...data, micros: data["micros"] !== undefined ? BigInt(data["micros"]) : undefined, }; } /** * Indicates if the object needs to have notification enabled. We support only * one of ExpiryNotification/UpcomingNotification. `expiryNotification` takes * precedence over `upcomingNotification`. In other words if * `expiryNotification` is set, we ignore the `upcomingNotification` field. */ export interface Notifications { /** * A notification would be triggered at a specific time before the card * expires. */ expiryNotification?: ExpiryNotification; /** * A notification would be triggered at a specific time before the card * becomes usable. */ upcomingNotification?: UpcomingNotification; } /** * This is a copy of the tech.blob.ObjectId proto, which could not be used * directly here due to transitive closure issues with JavaScript support; see * http://b/8801763. */ export interface ObjectId { /** * The name of the bucket to which this object belongs. */ bucketName?: string; /** * Generation of the object. Generations are monotonically increasing across * writes, allowing them to be be compared to determine which generation is * newer. If this is omitted in a request, then you are requesting the live * object. See http://go/bigstore-versions */ generation?: bigint; /** * The name of the object. */ objectName?: string; } function serializeObjectId(data: any): ObjectId { return { ...data, generation: data["generation"] !== undefined ? String(data["generation"]) : undefined, }; } function deserializeObjectId(data: any): ObjectId { return { ...data, generation: data["generation"] !== undefined ? BigInt(data["generation"]) : undefined, }; } export interface OfferClass { /** * Deprecated. Use `multipleDevicesAndHoldersAllowedStatus` instead. */ allowMultipleUsersPerObject?: boolean; /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding object * that will be used instead. */ appLinkData?: AppLinkData; /** * Callback options to be used to call the issuer back for every save/delete * of an object for this class by the end-user. All objects of this class are * eligible for the callback. */ callbackOptions?: CallbackOptions; /** * Template information about how the class should be displayed. If unset, * Google will fallback to a default set of fields to display. */ classTemplateInfo?: ClassTemplateInfo; /** * Country code used to display the card's country (when the user is not in * that country), as well as to display localized content when content is not * available in the user's locale. */ countryCode?: string; /** * The details of the offer. */ details?: string; /** * Identifies whether this class supports Smart Tap. The `redemptionIssuers` * and object level `smartTapRedemptionLevel` fields must also be set up * correctly in order for a pass to support Smart Tap. */ enableSmartTap?: boolean; /** * The fine print or terms of the offer, such as "20% off any t-shirt at * Adam's Apparel." */ finePrint?: string; /** * The help link for the offer, such as `http://myownpersonaldomain.com/help` */ helpUri?: Uri; /** * Optional banner image displayed on the front of the card. If none is * present, nothing will be displayed. The image will display at 100% width. */ heroImage?: Image; /** * The background color for the card. If not set the dominant color of the * hero image is used, and if no hero image is set, the dominant color of the * logo is used. The format is #rrggbb where rrggbb is a hex RGB triplet, such * as `#ffcc00`. You can also use the shorthand version of the RGB triplet * which is #rgb, such as `#fc0`. */ hexBackgroundColor?: string; /** * The URI of your application's home page. Populating the URI in this field * results in the exact same behavior as populating an URI in linksModuleData * (when an object is rendered, a link to the homepage is shown in what would * usually be thought of as the linksModuleData section of the object). */ homepageUri?: Uri; /** * Required. The unique identifier for a class. This ID must be unique across * all classes from an issuer. This value should follow the format issuer ID. * identifier where the former is issued by Google and latter is chosen by * you. Your unique identifier should only include alphanumeric characters, * '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Required. The issuer name. Recommended maximum length is 20 characters to * ensure full string is displayed on smaller screens. */ issuerName?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#offerClass"`. */ kind?: string; /** * Links module data. If links module data is also defined on the object, * both will be displayed. */ linksModuleData?: LinksModuleData; /** * Translated strings for the details. */ localizedDetails?: LocalizedString; /** * Translated strings for the fine_print. */ localizedFinePrint?: LocalizedString; /** * Translated strings for the issuer_name. Recommended maximum length is 20 * characters to ensure full string is displayed on smaller screens. */ localizedIssuerName?: LocalizedString; /** * Translated strings for the provider. Recommended maximum length is 12 * characters to ensure full string is displayed on smaller screens. */ localizedProvider?: LocalizedString; /** * Translated strings for the short title. Recommended maximum length is 20 * characters. */ localizedShortTitle?: LocalizedString; /** * Translated strings for the title. Recommended maximum length is 60 * characters to ensure full string is displayed on smaller screens. */ localizedTitle?: LocalizedString; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * Merchant locations. There is a maximum of ten on the class. Any additional * MerchantLocations added beyond the 10 will be rejected. These locations * will trigger a notification when a user enters within a Google-set radius * of the point. This field replaces the deprecated LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Identifies whether multiple users and devices will save the same object * referencing this class. */ multipleDevicesAndHoldersAllowedStatus?: | "STATUS_UNSPECIFIED" | "MULTIPLE_HOLDERS" | "ONE_USER_ALL_DEVICES" | "ONE_USER_ONE_DEVICE" | "multipleHolders" | "oneUserAllDevices" | "oneUserOneDevice"; /** * Whether or not field updates to this class should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If not specified, no notification will be triggered. * This setting is ephemeral and needs to be set with each PATCH or UPDATE * request, otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Required. The offer provider (either the aggregator name or merchant * name). Recommended maximum length is 12 characters to ensure full string is * displayed on smaller screens. */ provider?: string; /** * Required. The redemption channels applicable to this offer. */ redemptionChannel?: | "REDEMPTION_CHANNEL_UNSPECIFIED" | "INSTORE" | "instore" | "ONLINE" | "online" | "BOTH" | "both" | "TEMPORARY_PRICE_REDUCTION" | "temporaryPriceReduction"; /** * Identifies which redemption issuers can redeem the pass over Smart Tap. * Redemption issuers are identified by their issuer ID. Redemption issuers * must have at least one Smart Tap key configured. The `enableSmartTap` and * object level `smartTapRedemptionLevel` fields must also be set up correctly * in order for a pass to support Smart Tap. */ redemptionIssuers?: bigint[]; /** * The review comments set by the platform when a class is marked `approved` * or `rejected`. */ review?: Review; /** * Required. The status of the class. This field can be set to `draft` or The * status of the class. This field can be set to `draft` or `underReview` * using the insert, patch, or update API calls. Once the review state is * changed from `draft` it may not be changed back to `draft`. You should keep * this field to `draft` when the class is under development. A `draft` class * cannot be used to create any object. You should set this field to * `underReview` when you believe the class is ready for use. The platform * will automatically set this field to `approved` and it can be immediately * used to create or migrate objects. When updating an already `approved` * class you should keep setting this field to `underReview`. */ reviewStatus?: | "REVIEW_STATUS_UNSPECIFIED" | "UNDER_REVIEW" | "underReview" | "APPROVED" | "approved" | "REJECTED" | "rejected" | "DRAFT" | "draft"; /** * Optional information about the security animation. If this is set a * security animation will be rendered on pass details. */ securityAnimation?: SecurityAnimation; /** * A shortened version of the title of the offer, such as "20% off," shown to * users as a quick reference to the offer contents. Recommended maximum * length is 20 characters. */ shortTitle?: string; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * Required. The title of the offer, such as "20% off any t-shirt." * Recommended maximum length is 60 characters to ensure full string is * displayed on smaller screens. */ title?: string; /** * The title image of the offer. This image is displayed in both the details * and list views of the app. */ titleImage?: Image; /** * Optional value added module data. Maximum of ten on the class. For a pass * only ten will be displayed, prioritizing those from the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; /** * View Unlock Requirement options for the offer. */ viewUnlockRequirement?: | "VIEW_UNLOCK_REQUIREMENT_UNSPECIFIED" | "UNLOCK_NOT_REQUIRED" | "UNLOCK_REQUIRED_TO_VIEW"; /** * The wide title image of the offer. When provided, this will be used in * place of the title image in the top left of the card view. */ wideTitleImage?: Image; /** * Deprecated. */ wordMark?: Image; } function serializeOfferClass(data: any): OfferClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (String(item))) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeOfferClass(data: any): OfferClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (BigInt(item))) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface OfferClassAddMessageResponse { /** * The updated OfferClass resource. */ resource?: OfferClass; } function serializeOfferClassAddMessageResponse(data: any): OfferClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeOfferClass(data["resource"]) : undefined, }; } function deserializeOfferClassAddMessageResponse(data: any): OfferClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeOfferClass(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#offerclassList. */ export interface OfferclassListOptions { /** * The ID of the issuer authorized to list classes. */ issuerId?: bigint; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` classes are available in a list. For example, if you have * a list of 200 classes and you call list with `maxResults` set to 20, list * will return the first 20 classes and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 classes. */ token?: string; } function serializeOfferclassListOptions(data: any): OfferclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? String(data["issuerId"]) : undefined, }; } function deserializeOfferclassListOptions(data: any): OfferclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? BigInt(data["issuerId"]) : undefined, }; } export interface OfferClassListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: OfferClass[]; } function serializeOfferClassListResponse(data: any): OfferClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeOfferClass(item))) : undefined, }; } function deserializeOfferClassListResponse(data: any): OfferClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeOfferClass(item))) : undefined, }; } export interface OfferObject { /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding class * only object AppLinkData will be displayed. */ appLinkData?: AppLinkData; /** * The barcode type and value. */ barcode?: Barcode; /** * Required. The class associated with this object. The class must be of the * same type as this object, must already exist, and must be approved. Class * IDs should follow the format issuer ID.identifier where the former is * issued by Google and latter is chosen by you. */ classId?: string; /** * A copy of the inherited fields of the parent class. These fields are * retrieved during a GET. */ classReference?: OfferClass; /** * Indicates if notifications should explicitly be suppressed. If this field * is set to true, regardless of the `messages` field, expiration * notifications to the user will be suppressed. By default, this field is set * to false. Currently, this can only be set for offers. */ disableExpirationNotification?: boolean; /** * Information that controls how passes are grouped together. */ groupingInfo?: GroupingInfo; /** * Whether this object is currently linked to a single device. This field is * set by the platform when a user saves the object, linking it to their * device. Intended for use by select partners. Contact support for additional * information. */ hasLinkedDevice?: boolean; /** * Indicates if the object has users. This field is set by the platform. */ hasUsers?: boolean; /** * Optional banner image displayed on the front of the card. If none is * present, hero image of the class, if present, will be displayed. If hero * image of the class is also not present, nothing will be displayed. */ heroImage?: Image; /** * Required. The unique identifier for an object. This ID must be unique * across all objects from an issuer. This value should follow the format * issuer ID.identifier where the former is issued by Google and latter is * chosen by you. The unique identifier should only include alphanumeric * characters, '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#offerObject"`. */ kind?: string; /** * linked_object_ids are a list of other objects such as event ticket, * loyalty, offer, generic, giftcard, transit and boarding pass that should be * automatically attached to this offer object. If a user had saved this * offer, then these linked_object_ids would be automatically pushed to the * user's wallet (unless they turned off the setting to receive such linked * passes). Make sure that objects present in linked_object_ids are already * inserted - if not, calls would fail. Once linked, the linked objects cannot * be unlinked. You cannot link objects belonging to another issuer. There is * a limit to the number of objects that can be linked to a single object. * After the limit is reached, new linked objects in the call will be ignored * silently. Object IDs should follow the format issuer ID.identifier where * the former is issued by Google and the latter is chosen by you. */ linkedObjectIds?: string[]; /** * Links module data. If links module data is also defined on the class, both * will be displayed. */ linksModuleData?: LinksModuleData; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * Merchant locations. There is a maximum of ten on the object. Any * additional MerchantLocations added beyond the 10 will be rejected. These * locations will trigger a notification when a user enters within a * Google-set radius of the point. This field replaces the deprecated * LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Whether or not field updates to this object should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If set to DO_NOT_NOTIFY or * NOTIFICATION_SETTINGS_UNSPECIFIED, no notification will be triggered. This * setting is ephemeral and needs to be set with each PATCH or UPDATE request, * otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Pass constraints for the object. Includes limiting NFC and screenshot * behaviors. */ passConstraints?: PassConstraints; /** * The rotating barcode type and value. */ rotatingBarcode?: RotatingBarcode; /** * Restrictions on the object that needs to be verified before the user tries * to save the pass. Note that this restrictions will only be applied during * save time. If the restrictions changed after a user saves the pass, the new * restrictions will not be applied to an already saved pass. */ saveRestrictions?: SaveRestrictions; /** * The value that will be transmitted to a Smart Tap certified terminal over * NFC for this object. The class level fields `enableSmartTap` and * `redemptionIssuers` must also be set up correctly in order for the pass to * support Smart Tap. Only ASCII characters are supported. */ smartTapRedemptionValue?: string; /** * Required. The state of the object. This field is used to determine how an * object is displayed in the app. For example, an `inactive` object is moved * to the "Expired passes" section. */ state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "active" | "COMPLETED" | "completed" | "EXPIRED" | "expired" | "INACTIVE" | "inactive"; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * The time period this object will be `active` and object can be used. An * object's state will be changed to `expired` when this time period has * passed. */ validTimeInterval?: TimeInterval; /** * Optional value added module data. Maximum of ten on the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; } function serializeOfferObject(data: any): OfferObject { return { ...data, classReference: data["classReference"] !== undefined ? serializeOfferClass(data["classReference"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? serializeRotatingBarcode(data["rotatingBarcode"]) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeOfferObject(data: any): OfferObject { return { ...data, classReference: data["classReference"] !== undefined ? deserializeOfferClass(data["classReference"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? deserializeRotatingBarcode(data["rotatingBarcode"]) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface OfferObjectAddMessageResponse { /** * The updated OfferObject resource. */ resource?: OfferObject; } function serializeOfferObjectAddMessageResponse(data: any): OfferObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeOfferObject(data["resource"]) : undefined, }; } function deserializeOfferObjectAddMessageResponse(data: any): OfferObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeOfferObject(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#offerobjectList. */ export interface OfferobjectListOptions { /** * The ID of the class whose objects will be listed. */ classId?: string; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` objects are available in a list. For example, if you have * a list of 200 objects and you call list with `maxResults` set to 20, list * will return the first 20 objects and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 objects. */ token?: string; } export interface OfferObjectListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: OfferObject[]; } function serializeOfferObjectListResponse(data: any): OfferObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeOfferObject(item))) : undefined, }; } function deserializeOfferObjectListResponse(data: any): OfferObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeOfferObject(item))) : undefined, }; } export interface Pagination { /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#pagination"`. */ kind?: string; /** * Page token to send to fetch the next page. */ nextPageToken?: string; /** * Number of results returned in this page. */ resultsPerPage?: number; } /** * Container for any constraints that may be placed on passes. */ export interface PassConstraints { /** * The NFC constraints for the pass. */ nfcConstraint?: | "NFC_CONSTRAINT_UNSPECIFIED" | "BLOCK_PAYMENT" | "BLOCK_CLOSED_LOOP_TRANSIT"[]; /** * The screenshot eligibility for the pass. */ screenshotEligibility?: | "SCREENSHOT_ELIGIBILITY_UNSPECIFIED" | "ELIGIBLE" | "INELIGIBLE"; } export interface Permission { /** * The email address of the user, group, or service account to which this * permission refers to. */ emailAddress?: string; /** * The role granted by this permission. */ role?: | "ROLE_UNSPECIFIED" | "OWNER" | "owner" | "READER" | "reader" | "WRITER" | "writer"; } export interface Permissions { /** * ID of the issuer the list of permissions refer to. */ issuerId?: bigint; /** * The complete list of permissions for the issuer account. */ permissions?: Permission[]; } function serializePermissions(data: any): Permissions { return { ...data, issuerId: data["issuerId"] !== undefined ? String(data["issuerId"]) : undefined, }; } function deserializePermissions(data: any): Permissions { return { ...data, issuerId: data["issuerId"] !== undefined ? BigInt(data["issuerId"]) : undefined, }; } export interface PurchaseDetails { /** * ID of the account used to purchase the ticket. */ accountId?: string; /** * The confirmation code for the purchase. This may be the same for multiple * different tickets and is used to group tickets together. */ confirmationCode?: string; /** * The purchase date/time of the ticket. This is an ISO 8601 extended format * date/time, with or without an offset. Time may be specified up to * nanosecond precision. Offsets may be specified with seconds precision (even * though offset seconds is not part of ISO 8601). For example: * `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the * 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would * be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 * hours before UTC (same instant in time as the above example). If the event * were in New York, this would be the equivalent of Eastern Daylight Time * (EDT). Remember that offset varies in regions that observe Daylight Saving * Time (or Summer Time), depending on the time of the year. * `1985-04-12T19:20:50.52` would be 20 minutes and 50.52 seconds after the * 19th hour of April 12th, 1985 with no offset information. Without offset * information, some rich features may not be available. */ purchaseDateTime?: string; /** * Receipt number/identifier for tracking the ticket purchase via the body * that sold the ticket. */ purchaseReceiptNumber?: string; /** * The cost of the ticket. */ ticketCost?: TicketCost; } function serializePurchaseDetails(data: any): PurchaseDetails { return { ...data, ticketCost: data["ticketCost"] !== undefined ? serializeTicketCost(data["ticketCost"]) : undefined, }; } function deserializePurchaseDetails(data: any): PurchaseDetails { return { ...data, ticketCost: data["ticketCost"] !== undefined ? deserializeTicketCost(data["ticketCost"]) : undefined, }; } export interface ReservationInfo { /** * Confirmation code needed to check into this flight. This is the number * that the passenger would enter into a kiosk at the airport to look up the * flight and print a boarding pass. */ confirmationCode?: string; /** * E-ticket number. */ eticketNumber?: string; /** * Frequent flyer membership information. */ frequentFlyerInfo?: FrequentFlyerInfo; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#reservationInfo"`. */ kind?: string; } export interface Resources { /** * A list of event ticket classes. */ eventTicketClasses?: EventTicketClass[]; /** * A list of event ticket objects. */ eventTicketObjects?: EventTicketObject[]; /** * A list of flight classes. */ flightClasses?: FlightClass[]; /** * A list of flight objects. */ flightObjects?: FlightObject[]; /** * A list of generic classes. */ genericClasses?: GenericClass[]; /** * A list of generic objects. */ genericObjects?: GenericObject[]; /** * A list of gift card classes. */ giftCardClasses?: GiftCardClass[]; /** * A list of gift card objects. */ giftCardObjects?: GiftCardObject[]; /** * A list of loyalty classes. */ loyaltyClasses?: LoyaltyClass[]; /** * A list of loyalty objects. */ loyaltyObjects?: LoyaltyObject[]; /** * A list of offer classes. */ offerClasses?: OfferClass[]; /** * A list of offer objects. */ offerObjects?: OfferObject[]; /** * A list of transit classes. */ transitClasses?: TransitClass[]; /** * A list of transit objects. */ transitObjects?: TransitObject[]; } function serializeResources(data: any): Resources { return { ...data, eventTicketClasses: data["eventTicketClasses"] !== undefined ? data["eventTicketClasses"].map((item: any) => (serializeEventTicketClass(item))) : undefined, eventTicketObjects: data["eventTicketObjects"] !== undefined ? data["eventTicketObjects"].map((item: any) => (serializeEventTicketObject(item))) : undefined, flightClasses: data["flightClasses"] !== undefined ? data["flightClasses"].map((item: any) => (serializeFlightClass(item))) : undefined, flightObjects: data["flightObjects"] !== undefined ? data["flightObjects"].map((item: any) => (serializeFlightObject(item))) : undefined, genericClasses: data["genericClasses"] !== undefined ? data["genericClasses"].map((item: any) => (serializeGenericClass(item))) : undefined, genericObjects: data["genericObjects"] !== undefined ? data["genericObjects"].map((item: any) => (serializeGenericObject(item))) : undefined, giftCardClasses: data["giftCardClasses"] !== undefined ? data["giftCardClasses"].map((item: any) => (serializeGiftCardClass(item))) : undefined, giftCardObjects: data["giftCardObjects"] !== undefined ? data["giftCardObjects"].map((item: any) => (serializeGiftCardObject(item))) : undefined, loyaltyClasses: data["loyaltyClasses"] !== undefined ? data["loyaltyClasses"].map((item: any) => (serializeLoyaltyClass(item))) : undefined, loyaltyObjects: data["loyaltyObjects"] !== undefined ? data["loyaltyObjects"].map((item: any) => (serializeLoyaltyObject(item))) : undefined, offerClasses: data["offerClasses"] !== undefined ? data["offerClasses"].map((item: any) => (serializeOfferClass(item))) : undefined, offerObjects: data["offerObjects"] !== undefined ? data["offerObjects"].map((item: any) => (serializeOfferObject(item))) : undefined, transitClasses: data["transitClasses"] !== undefined ? data["transitClasses"].map((item: any) => (serializeTransitClass(item))) : undefined, transitObjects: data["transitObjects"] !== undefined ? data["transitObjects"].map((item: any) => (serializeTransitObject(item))) : undefined, }; } function deserializeResources(data: any): Resources { return { ...data, eventTicketClasses: data["eventTicketClasses"] !== undefined ? data["eventTicketClasses"].map((item: any) => (deserializeEventTicketClass(item))) : undefined, eventTicketObjects: data["eventTicketObjects"] !== undefined ? data["eventTicketObjects"].map((item: any) => (deserializeEventTicketObject(item))) : undefined, flightClasses: data["flightClasses"] !== undefined ? data["flightClasses"].map((item: any) => (deserializeFlightClass(item))) : undefined, flightObjects: data["flightObjects"] !== undefined ? data["flightObjects"].map((item: any) => (deserializeFlightObject(item))) : undefined, genericClasses: data["genericClasses"] !== undefined ? data["genericClasses"].map((item: any) => (deserializeGenericClass(item))) : undefined, genericObjects: data["genericObjects"] !== undefined ? data["genericObjects"].map((item: any) => (deserializeGenericObject(item))) : undefined, giftCardClasses: data["giftCardClasses"] !== undefined ? data["giftCardClasses"].map((item: any) => (deserializeGiftCardClass(item))) : undefined, giftCardObjects: data["giftCardObjects"] !== undefined ? data["giftCardObjects"].map((item: any) => (deserializeGiftCardObject(item))) : undefined, loyaltyClasses: data["loyaltyClasses"] !== undefined ? data["loyaltyClasses"].map((item: any) => (deserializeLoyaltyClass(item))) : undefined, loyaltyObjects: data["loyaltyObjects"] !== undefined ? data["loyaltyObjects"].map((item: any) => (deserializeLoyaltyObject(item))) : undefined, offerClasses: data["offerClasses"] !== undefined ? data["offerClasses"].map((item: any) => (deserializeOfferClass(item))) : undefined, offerObjects: data["offerObjects"] !== undefined ? data["offerObjects"].map((item: any) => (deserializeOfferObject(item))) : undefined, transitClasses: data["transitClasses"] !== undefined ? data["transitClasses"].map((item: any) => (deserializeTransitClass(item))) : undefined, transitObjects: data["transitObjects"] !== undefined ? data["transitObjects"].map((item: any) => (deserializeTransitObject(item))) : undefined, }; } export interface Review { comments?: string; } export interface RotatingBarcode { /** * An optional text that will override the default text that shows under the * barcode. This field is intended for a human readable equivalent of the * barcode value, used when the barcode cannot be scanned. */ alternateText?: string; /** * Input only. NOTE: This feature is only available for the transit vertical. * Optional set of initial rotating barcode values. This allows a small subset * of barcodes to be included with the object. Further rotating barcode values * must be uploaded with the UploadRotatingBarcodeValues endpoint. */ initialRotatingBarcodeValues?: RotatingBarcodeValues; /** * The render encoding for the barcode. When specified, barcode is rendered * in the given encoding. Otherwise best known encoding is chosen by Google. */ renderEncoding?: | "RENDER_ENCODING_UNSPECIFIED" | "UTF_8"; /** * Optional text that will be shown when the barcode is hidden behind a click * action. This happens in cases where a pass has Smart Tap enabled. If not * specified, a default is chosen by Google. */ showCodeText?: LocalizedString; /** * Details used to evaluate the {totp_value_n} substitutions. */ totpDetails?: RotatingBarcodeTotpDetails; /** * The type of this barcode. */ type?: | "BARCODE_TYPE_UNSPECIFIED" | "AZTEC" | "aztec" | "CODE_39" | "code39" | "CODE_128" | "code128" | "CODABAR" | "codabar" | "DATA_MATRIX" | "dataMatrix" | "EAN_8" | "ean8" | "EAN_13" | "ean13" | "EAN13" | "ITF_14" | "itf14" | "PDF_417" | "pdf417" | "PDF417" | "QR_CODE" | "qrCode" | "qrcode" | "UPC_A" | "upcA" | "TEXT_ONLY" | "textOnly"; /** * String encoded barcode value. This string supports the following * substitutions: * {totp_value_n}: Replaced with the TOTP value (see * TotpDetails.parameters). * {totp_timestamp_millis}: Replaced with the * timestamp (millis since epoch) at which the barcode was generated. * * {totp_timestamp_seconds}: Replaced with the timestamp (seconds since epoch) * at which the barcode was generated. */ valuePattern?: string; } function serializeRotatingBarcode(data: any): RotatingBarcode { return { ...data, initialRotatingBarcodeValues: data["initialRotatingBarcodeValues"] !== undefined ? serializeRotatingBarcodeValues(data["initialRotatingBarcodeValues"]) : undefined, totpDetails: data["totpDetails"] !== undefined ? serializeRotatingBarcodeTotpDetails(data["totpDetails"]) : undefined, }; } function deserializeRotatingBarcode(data: any): RotatingBarcode { return { ...data, initialRotatingBarcodeValues: data["initialRotatingBarcodeValues"] !== undefined ? deserializeRotatingBarcodeValues(data["initialRotatingBarcodeValues"]) : undefined, totpDetails: data["totpDetails"] !== undefined ? deserializeRotatingBarcodeTotpDetails(data["totpDetails"]) : undefined, }; } /** * Configuration for the time-based OTP substitutions. See * https://tools.ietf.org/html/rfc6238 */ export interface RotatingBarcodeTotpDetails { /** * The TOTP algorithm used to generate the OTP. */ algorithm?: | "TOTP_ALGORITHM_UNSPECIFIED" | "TOTP_SHA1"; /** * The TOTP parameters for each of the {totp_value_*} substitutions. The * TotpParameters at index n is used for the {totp_value_n} substitution. */ parameters?: RotatingBarcodeTotpDetailsTotpParameters[]; /** * The time interval used for the TOTP value generation, in milliseconds. */ periodMillis?: bigint; } function serializeRotatingBarcodeTotpDetails(data: any): RotatingBarcodeTotpDetails { return { ...data, periodMillis: data["periodMillis"] !== undefined ? String(data["periodMillis"]) : undefined, }; } function deserializeRotatingBarcodeTotpDetails(data: any): RotatingBarcodeTotpDetails { return { ...data, periodMillis: data["periodMillis"] !== undefined ? BigInt(data["periodMillis"]) : undefined, }; } /** * Configuration for the key and value length. See * https://www.rfc-editor.org/rfc/rfc4226#section-5.3 */ export interface RotatingBarcodeTotpDetailsTotpParameters { /** * The secret key used for the TOTP value generation, encoded as a Base16 * string. */ key?: string; /** * The length of the TOTP value in decimal digits. */ valueLength?: number; } /** * A payload containing many barcode values and start date/time. */ export interface RotatingBarcodeValues { /** * Required. The amount of time each barcode is valid for. */ periodMillis?: bigint; /** * Required. The date/time the first barcode is valid from. Barcodes will be * rotated through using period_millis defined on the object's * RotatingBarcodeValueInfo. This is an ISO 8601 extended format date/time, * with an offset. Time may be specified up to nanosecond precision. Offsets * may be specified with seconds precision (even though offset seconds is not * part of ISO 8601). For example: `1985-04-12T23:20:50.52Z` would be 20 * minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC. * `1985-04-12T19:20:50.52-04:00` would be 20 minutes and 50.52 seconds after * the 19th hour of April 12th, 1985, 4 hours before UTC (same instant in time * as the above example). If the event were in New York, this would be the * equivalent of Eastern Daylight Time (EDT). Remember that offset varies in * regions that observe Daylight Saving Time (or Summer Time), depending on * the time of the year. */ startDateTime?: string; /** * Required. The values to encode in the barcode. At least one value is * required. */ values?: string[]; } function serializeRotatingBarcodeValues(data: any): RotatingBarcodeValues { return { ...data, periodMillis: data["periodMillis"] !== undefined ? String(data["periodMillis"]) : undefined, }; } function deserializeRotatingBarcodeValues(data: any): RotatingBarcodeValues { return { ...data, periodMillis: data["periodMillis"] !== undefined ? BigInt(data["periodMillis"]) : undefined, }; } /** * Defines restrictions on the object that will be verified during save. Note: * this is an advanced feature, please contact Google for implementation * support. */ export interface SaveRestrictions { /** * Restrict the save of the referencing object to the given email address * only. This is the hex output of SHA256 sum of the email address, all * lowercase and without any notations like "." or "+", except "@". For * example, for example@example.com, this value will be * 31c5543c1734d25c7206f5fd591525d0295bec6fe84ff82f946a34fe970a1e66 and for * Example@example.com, this value will be * bc34f262c93ad7122763684ccea6f07fb7f5d8a2d11e60ce15a6f43fe70ce632 If email * address of the logged-in user who tries to save this pass does not match * with the defined value here, users won't be allowed to save this pass. They * will instead be prompted with an error to contact the issuer. This * information should be gathered from the user with an explicit consent via * Sign in with Google integration * https://developers.google.com/identity/authentication. Please contact with * support before using Save Restrictions. */ restrictToEmailSha256?: string; } export interface SecurityAnimation { /** * Type of animation. */ animationType?: | "ANIMATION_UNSPECIFIED" | "FOIL_SHIMMER" | "foilShimmer"; } export interface SignUpInfo { /** * ID of the class the user can sign up for. */ classId?: string; } export interface SmartTap { /** * The unique identifier for a smart tap. This value should follow the format * issuer ID.identifier where the former is issued by Google and latter is the * Smart Tap id. The Smart Tap id is a Base64 encoded string which represents * the id which was generated by the Google Pay app. */ id?: string; /** * Communication from merchant to user. */ infos?: IssuerToUserInfo[]; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#smartTap"`. */ kind?: string; /** * Smart Tap merchant ID of who engaged in the Smart Tap interaction. */ merchantId?: bigint; } function serializeSmartTap(data: any): SmartTap { return { ...data, merchantId: data["merchantId"] !== undefined ? String(data["merchantId"]) : undefined, }; } function deserializeSmartTap(data: any): SmartTap { return { ...data, merchantId: data["merchantId"] !== undefined ? BigInt(data["merchantId"]) : undefined, }; } export interface SmartTapMerchantData { /** * Available only to Smart Tap enabled partners. Contact support for * additional guidance. */ authenticationKeys?: AuthenticationKey[]; /** * Available only to Smart Tap enabled partners. Contact support for * additional guidance. */ smartTapMerchantId?: bigint; } function serializeSmartTapMerchantData(data: any): SmartTapMerchantData { return { ...data, smartTapMerchantId: data["smartTapMerchantId"] !== undefined ? String(data["smartTapMerchantId"]) : undefined, }; } function deserializeSmartTapMerchantData(data: any): SmartTapMerchantData { return { ...data, smartTapMerchantId: data["smartTapMerchantId"] !== undefined ? BigInt(data["smartTapMerchantId"]) : undefined, }; } export interface TemplateItem { /** * A reference to a field to display. If both `firstValue` and `secondValue` * are populated, they will both appear as one item with a slash between them. * For example, values A and B would be shown as "A / B". */ firstValue?: FieldSelector; /** * A predefined item to display. Only one of `firstValue` or `predefinedItem` * may be set. */ predefinedItem?: | "PREDEFINED_ITEM_UNSPECIFIED" | "FREQUENT_FLYER_PROGRAM_NAME_AND_NUMBER" | "frequentFlyerProgramNameAndNumber" | "FLIGHT_NUMBER_AND_OPERATING_FLIGHT_NUMBER" | "flightNumberAndOperatingFlightNumber"; /** * A reference to a field to display. This may only be populated if the * `firstValue` field is populated. */ secondValue?: FieldSelector; } /** * Data for Text module. All fields are optional. Header will be displayed if * available, different types of bodies will be concatenated if they are * defined. */ export interface TextModuleData { /** * The body of the Text Module, which is defined as an uninterrupted string. * Recommended maximum length is 500 characters to ensure full string is * displayed on smaller screens. */ body?: string; /** * The header of the Text Module. Recommended maximum length is 35 characters * to ensure full string is displayed on smaller screens. */ header?: string; /** * The ID associated with a text module. This field is here to enable ease of * management of text modules and referencing them in template overrides. The * ID should only include alphanumeric characters, '_', or '-'. It can not * include dots, as dots are used to separate fields within * FieldReference.fieldPaths in template overrides. */ id?: string; /** * Translated strings for the body. Recommended maximum length is 500 * characters to ensure full string is displayed on smaller screens. */ localizedBody?: LocalizedString; /** * Translated strings for the header. Recommended maximum length is 35 * characters to ensure full string is displayed on smaller screens. */ localizedHeader?: LocalizedString; } export interface TicketCost { /** * A message describing any kind of discount that was applied. */ discountMessage?: LocalizedString; /** * The face value of the ticket. */ faceValue?: Money; /** * The actual purchase price of the ticket, after tax and/or discounts. */ purchasePrice?: Money; } function serializeTicketCost(data: any): TicketCost { return { ...data, faceValue: data["faceValue"] !== undefined ? serializeMoney(data["faceValue"]) : undefined, purchasePrice: data["purchasePrice"] !== undefined ? serializeMoney(data["purchasePrice"]) : undefined, }; } function deserializeTicketCost(data: any): TicketCost { return { ...data, faceValue: data["faceValue"] !== undefined ? deserializeMoney(data["faceValue"]) : undefined, purchasePrice: data["purchasePrice"] !== undefined ? deserializeMoney(data["purchasePrice"]) : undefined, }; } export interface TicketLeg { /** * The date/time of arrival. This is an ISO 8601 extended format date/time, * with or without an offset. Time may be specified up to nanosecond * precision. Offsets may be specified with seconds precision (even though * offset seconds is not part of ISO 8601). For example: * `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the * 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would * be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 * hours before UTC (same instant in time as the above example). If the event * were in New York, this would be the equivalent of Eastern Daylight Time * (EDT). Remember that offset varies in regions that observe Daylight Saving * Time (or Summer Time), depending on the time of the year. * `1985-04-12T19:20:50.52` would be 20 minutes and 50.52 seconds after the * 19th hour of April 12th, 1985 with no offset information. The portion of * the date/time without the offset is considered the "local date/time". This * should be the local date/time at the destination station. For example, if * the event occurs at the 20th hour of June 5th, 2018 at the destination * station, the local date/time portion should be `2018-06-05T20:00:00`. If * the local date/time at the destination station is 4 hours before UTC, an * offset of `-04:00` may be appended. Without offset information, some rich * features may not be available. */ arrivalDateTime?: string; /** * The train or ship name/number that the passsenger needs to board. */ carriage?: string; /** * The date/time of departure. This is required if there is no validity time * interval set on the transit object. This is an ISO 8601 extended format * date/time, with or without an offset. Time may be specified up to * nanosecond precision. Offsets may be specified with seconds precision (even * though offset seconds is not part of ISO 8601). For example: * `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the * 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would * be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 * hours before UTC (same instant in time as the above example). If the event * were in New York, this would be the equivalent of Eastern Daylight Time * (EDT). Remember that offset varies in regions that observe Daylight Saving * Time (or Summer Time), depending on the time of the year. * `1985-04-12T19:20:50.52` would be 20 minutes and 50.52 seconds after the * 19th hour of April 12th, 1985 with no offset information. The portion of * the date/time without the offset is considered the "local date/time". This * should be the local date/time at the origin station. For example, if the * departure occurs at the 20th hour of June 5th, 2018 at the origin station, * the local date/time portion should be `2018-06-05T20:00:00`. If the local * date/time at the origin station is 4 hours before UTC, an offset of * `-04:00` may be appended. Without offset information, some rich features * may not be available. */ departureDateTime?: string; /** * The destination name. */ destinationName?: LocalizedString; /** * The destination station code. */ destinationStationCode?: string; /** * Short description/name of the fare for this leg of travel. Eg "Anytime * Single Use". */ fareName?: LocalizedString; /** * The name of the origin station. This is required if `desinationName` is * present or if `originStationCode` is not present. */ originName?: LocalizedString; /** * The origin station code. This is required if `destinationStationCode` is * present or if `originName` is not present. */ originStationCode?: string; /** * The platform or gate where the passenger can board the carriage. */ platform?: string; /** * The reserved seat for the passenger(s). If more than one seat is to be * specified then use the `ticketSeats` field instead. Both `ticketSeat` and * `ticketSeats` may not be set. */ ticketSeat?: TicketSeat; /** * The reserved seat for the passenger(s). If only one seat is to be * specified then use the `ticketSeat` field instead. Both `ticketSeat` and * `ticketSeats` may not be set. */ ticketSeats?: TicketSeat[]; /** * The name of the transit operator that is operating this leg of a trip. */ transitOperatorName?: LocalizedString; /** * Terminus station or destination of the train/bus/etc. */ transitTerminusName?: LocalizedString; /** * The zone of boarding within the platform. */ zone?: string; } export interface TicketRestrictions { /** * Extra restrictions that don't fall under the "route" or "time" categories. */ otherRestrictions?: LocalizedString; /** * Restrictions about routes that may be taken. For example, this may be the * string "Reserved CrossCountry trains only". */ routeRestrictions?: LocalizedString; /** * More details about the above `routeRestrictions`. */ routeRestrictionsDetails?: LocalizedString; /** * Restrictions about times this ticket may be used. */ timeRestrictions?: LocalizedString; } export interface TicketSeat { /** * The identifier of the train car or coach in which the ticketed seat is * located. Eg. "10" */ coach?: string; /** * A custome fare class to be used if no `fareClass` applies. Both * `fareClass` and `customFareClass` may not be set. */ customFareClass?: LocalizedString; /** * The fare class of the ticketed seat. */ fareClass?: | "FARE_CLASS_UNSPECIFIED" | "ECONOMY" | "economy" | "FIRST" | "first" | "BUSINESS" | "business"; /** * The identifier of where the ticketed seat is located. Eg. "42". If there * is no specific identifier, use `seatAssigment` instead. */ seat?: string; /** * The passenger's seat assignment. Eg. "no specific seat". To be used when * there is no specific identifier to use in `seat`. */ seatAssignment?: LocalizedString; } export interface TimeInterval { /** * End time of the interval. Offset is not required. If an offset is provided * and `start` time is set, `start` must also include an offset. */ end?: DateTime; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#timeInterval"`. */ kind?: string; /** * Start time of the interval. Offset is not required. If an offset is * provided and `end` time is set, `end` must also include an offset. */ start?: DateTime; } export interface TransitClass { /** * Activation options for an activatable ticket. */ activationOptions?: ActivationOptions; /** * Deprecated. Use `multipleDevicesAndHoldersAllowedStatus` instead. */ allowMultipleUsersPerObject?: boolean; /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding object * that will be used instead. */ appLinkData?: AppLinkData; /** * Callback options to be used to call the issuer back for every save/delete * of an object for this class by the end-user. All objects of this class are * eligible for the callback. */ callbackOptions?: CallbackOptions; /** * Template information about how the class should be displayed. If unset, * Google will fallback to a default set of fields to display. */ classTemplateInfo?: ClassTemplateInfo; /** * Country code used to display the card's country (when the user is not in * that country), as well as to display localized content when content is not * available in the user's locale. */ countryCode?: string; /** * A custom label to use for the carriage value * (`transitObject.ticketLeg.carriage`). */ customCarriageLabel?: LocalizedString; /** * A custom label to use for the coach value * (`transitObject.ticketLeg.ticketSeat.coach`). */ customCoachLabel?: LocalizedString; /** * A custom label to use for the transit concession category value * (`transitObject.concessionCategory`). */ customConcessionCategoryLabel?: LocalizedString; /** * A custom label to use for the confirmation code value * (`transitObject.purchaseDetails.confirmationCode`). */ customConfirmationCodeLabel?: LocalizedString; /** * A custom label to use for the transit discount message value * (`transitObject.purchaseDetails.ticketCost.discountMessage`). */ customDiscountMessageLabel?: LocalizedString; /** * A custom label to use for the fare class value * (`transitObject.ticketLeg.ticketSeat.fareClass`). */ customFareClassLabel?: LocalizedString; /** * A custom label to use for the transit fare name value * (`transitObject.ticketLeg.fareName`). */ customFareNameLabel?: LocalizedString; /** * A custom label to use for the other restrictions value * (`transitObject.ticketRestrictions.otherRestrictions`). */ customOtherRestrictionsLabel?: LocalizedString; /** * A custom label to use for the boarding platform value * (`transitObject.ticketLeg.platform`). */ customPlatformLabel?: LocalizedString; /** * A custom label to use for the purchase face value * (`transitObject.purchaseDetails.ticketCost.faceValue`). */ customPurchaseFaceValueLabel?: LocalizedString; /** * A custom label to use for the purchase price value * (`transitObject.purchaseDetails.ticketCost.purchasePrice`). */ customPurchasePriceLabel?: LocalizedString; /** * A custom label to use for the purchase receipt number value * (`transitObject.purchaseDetails.purchaseReceiptNumber`). */ customPurchaseReceiptNumberLabel?: LocalizedString; /** * A custom label to use for the route restrictions details value * (`transitObject.ticketRestrictions.routeRestrictionsDetails`). */ customRouteRestrictionsDetailsLabel?: LocalizedString; /** * A custom label to use for the route restrictions value * (`transitObject.ticketRestrictions.routeRestrictions`). */ customRouteRestrictionsLabel?: LocalizedString; /** * A custom label to use for the seat location value * (`transitObject.ticketLeg.ticketSeat.seat`). */ customSeatLabel?: LocalizedString; /** * A custom label to use for the ticket number value * (`transitObject.ticketNumber`). */ customTicketNumberLabel?: LocalizedString; /** * A custom label to use for the time restrictions details value * (`transitObject.ticketRestrictions.timeRestrictions`). */ customTimeRestrictionsLabel?: LocalizedString; /** * A custom label to use for the transit terminus name value * (`transitObject.ticketLeg.transitTerminusName`). */ customTransitTerminusNameLabel?: LocalizedString; /** * A custom label to use for the boarding zone value * (`transitObject.ticketLeg.zone`). */ customZoneLabel?: LocalizedString; /** * Controls the display of the single-leg itinerary for this class. By * default, an itinerary will only display for multi-leg trips. */ enableSingleLegItinerary?: boolean; /** * Identifies whether this class supports Smart Tap. The `redemptionIssuers` * and object level `smartTapRedemptionLevel` fields must also be set up * correctly in order for a pass to support Smart Tap. */ enableSmartTap?: boolean; /** * Optional banner image displayed on the front of the card. If none is * present, nothing will be displayed. The image will display at 100% width. */ heroImage?: Image; /** * The background color for the card. If not set the dominant color of the * hero image is used, and if no hero image is set, the dominant color of the * logo is used. The format is #rrggbb where rrggbb is a hex RGB triplet, such * as `#ffcc00`. You can also use the shorthand version of the RGB triplet * which is #rgb, such as `#fc0`. */ hexBackgroundColor?: string; /** * The URI of your application's home page. Populating the URI in this field * results in the exact same behavior as populating an URI in linksModuleData * (when an object is rendered, a link to the homepage is shown in what would * usually be thought of as the linksModuleData section of the object). */ homepageUri?: Uri; /** * Required. The unique identifier for a class. This ID must be unique across * all classes from an issuer. This value should follow the format issuer ID. * identifier where the former is issued by Google and latter is chosen by * you. Your unique identifier should only include alphanumeric characters, * '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * Required. The issuer name. Recommended maximum length is 20 characters to * ensure full string is displayed on smaller screens. */ issuerName?: string; /** * If this field is present, transit tickets served to a user's device will * always be in this language. Represents the BCP 47 language tag. Example * values are "en-US", "en-GB", "de", or "de-AT". */ languageOverride?: string; /** * Links module data. If links module data is also defined on the object, * both will be displayed. */ linksModuleData?: LinksModuleData; /** * Translated strings for the issuer_name. Recommended maximum length is 20 * characters to ensure full string is displayed on smaller screens. */ localizedIssuerName?: LocalizedString; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * Required. The logo image of the ticket. This image is displayed in the * card detail view of the app. */ logo?: Image; /** * Merchant locations. There is a maximum of ten on the class. Any additional * MerchantLocations added beyond the 10 will be rejected. These locations * will trigger a notification when a user enters within a Google-set radius * of the point. This field replaces the deprecated LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Identifies whether multiple users and devices will save the same object * referencing this class. */ multipleDevicesAndHoldersAllowedStatus?: | "STATUS_UNSPECIFIED" | "MULTIPLE_HOLDERS" | "ONE_USER_ALL_DEVICES" | "ONE_USER_ONE_DEVICE" | "multipleHolders" | "oneUserAllDevices" | "oneUserOneDevice"; /** * Whether or not field updates to this class should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If set to DO_NOT_NOTIFY or * NOTIFICATION_SETTINGS_UNSPECIFIED, no notification will be triggered. This * setting is ephemeral and needs to be set with each PATCH or UPDATE request, * otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Identifies which redemption issuers can redeem the pass over Smart Tap. * Redemption issuers are identified by their issuer ID. Redemption issuers * must have at least one Smart Tap key configured. The `enableSmartTap` and * object level `smartTapRedemptionLevel` fields must also be set up correctly * in order for a pass to support Smart Tap. */ redemptionIssuers?: bigint[]; /** * The review comments set by the platform when a class is marked `approved` * or `rejected`. */ review?: Review; /** * Required. The status of the class. This field can be set to `draft` or * `underReview` using the insert, patch, or update API calls. Once the review * state is changed from `draft` it may not be changed back to `draft`. You * should keep this field to `draft` when the class is under development. A * `draft` class cannot be used to create any object. You should set this * field to `underReview` when you believe the class is ready for use. The * platform will automatically set this field to `approved` and it can be * immediately used to create or migrate objects. When updating an already * `approved` class you should keep setting this field to `underReview`. */ reviewStatus?: | "REVIEW_STATUS_UNSPECIFIED" | "UNDER_REVIEW" | "underReview" | "APPROVED" | "approved" | "REJECTED" | "rejected" | "DRAFT" | "draft"; /** * Optional information about the security animation. If this is set a * security animation will be rendered on pass details. */ securityAnimation?: SecurityAnimation; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * The name of the transit operator. */ transitOperatorName?: LocalizedString; /** * Required. The type of transit this class represents, such as "bus". */ transitType?: | "TRANSIT_TYPE_UNSPECIFIED" | "BUS" | "bus" | "RAIL" | "rail" | "TRAM" | "tram" | "FERRY" | "ferry" | "OTHER" | "other"; /** * Optional value added module data. Maximum of ten on the class. For a pass * only ten will be displayed, prioritizing those from the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; /** * View Unlock Requirement options for the transit ticket. */ viewUnlockRequirement?: | "VIEW_UNLOCK_REQUIREMENT_UNSPECIFIED" | "UNLOCK_NOT_REQUIRED" | "UNLOCK_REQUIRED_TO_VIEW"; /** * Watermark image to display on the user's device. */ watermark?: Image; /** * The wide logo of the ticket. When provided, this will be used in place of * the logo in the top left of the card view. */ wideLogo?: Image; /** * Deprecated. */ wordMark?: Image; } function serializeTransitClass(data: any): TransitClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (String(item))) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeTransitClass(data: any): TransitClass { return { ...data, redemptionIssuers: data["redemptionIssuers"] !== undefined ? data["redemptionIssuers"].map((item: any) => (BigInt(item))) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface TransitClassAddMessageResponse { /** * The updated TransitClass resource. */ resource?: TransitClass; } function serializeTransitClassAddMessageResponse(data: any): TransitClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeTransitClass(data["resource"]) : undefined, }; } function deserializeTransitClassAddMessageResponse(data: any): TransitClassAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeTransitClass(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#transitclassList. */ export interface TransitclassListOptions { /** * The ID of the issuer authorized to list classes. */ issuerId?: bigint; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` classes are available in a list. For example, if you have * a list of 200 classes and you call list with `maxResults` set to 20, list * will return the first 20 classes and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 classes. */ token?: string; } function serializeTransitclassListOptions(data: any): TransitclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? String(data["issuerId"]) : undefined, }; } function deserializeTransitclassListOptions(data: any): TransitclassListOptions { return { ...data, issuerId: data["issuerId"] !== undefined ? BigInt(data["issuerId"]) : undefined, }; } export interface TransitClassListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: TransitClass[]; } function serializeTransitClassListResponse(data: any): TransitClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeTransitClass(item))) : undefined, }; } function deserializeTransitClassListResponse(data: any): TransitClassListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeTransitClass(item))) : undefined, }; } export interface TransitObject { /** * The activation status for the object. Required if the class has * `activationOptions` set. */ activationStatus?: ActivationStatus; /** * Optional app or website link that will be displayed as a button on the * front of the pass. If AppLinkData is provided for the corresponding class * only object AppLinkData will be displayed. */ appLinkData?: AppLinkData; /** * The barcode type and value. */ barcode?: Barcode; /** * Required. The class associated with this object. The class must be of the * same type as this object, must already exist, and must be approved. Class * IDs should follow the format issuer ID.identifier where the former is * issued by Google and latter is chosen by you. */ classId?: string; /** * A copy of the inherited fields of the parent class. These fields are * retrieved during a GET. */ classReference?: TransitClass; /** * The concession category for the ticket. */ concessionCategory?: | "CONCESSION_CATEGORY_UNSPECIFIED" | "ADULT" | "adult" | "CHILD" | "child" | "SENIOR" | "senior"; /** * A custom concession category to use when `concessionCategory` does not * provide the right option. Both `concessionCategory` and * `customConcessionCategory` may not be set. */ customConcessionCategory?: LocalizedString; /** * A custom status to use for the ticket status value when `ticketStatus` * does not provide the right option. Both `ticketStatus` and * `customTicketStatus` may not be set. */ customTicketStatus?: LocalizedString; /** * Device context associated with the object. */ deviceContext?: DeviceContext; /** * Indicates if notifications should explicitly be suppressed. If this field * is set to true, regardless of the `messages` field, expiration * notifications to the user will be suppressed. By default, this field is set * to false. Currently, this can only be set for offers. */ disableExpirationNotification?: boolean; /** * Information that controls how passes are grouped together. */ groupingInfo?: GroupingInfo; /** * Whether this object is currently linked to a single device. This field is * set by the platform when a user saves the object, linking it to their * device. Intended for use by select partners. Contact support for additional * information. */ hasLinkedDevice?: boolean; /** * Indicates if the object has users. This field is set by the platform. */ hasUsers?: boolean; /** * Optional banner image displayed on the front of the card. If none is * present, hero image of the class, if present, will be displayed. If hero * image of the class is also not present, nothing will be displayed. */ heroImage?: Image; /** * The background color for the card. If not set the dominant color of the * hero image is used, and if no hero image is set, the dominant color of the * logo is used. The format is #rrggbb where rrggbb is a hex RGB triplet, such * as `#ffcc00`. You can also use the shorthand version of the RGB triplet * which is #rgb, such as `#fc0`. */ hexBackgroundColor?: string; /** * Required. The unique identifier for an object. This ID must be unique * across all objects from an issuer. This value should follow the format * issuer ID.identifier where the former is issued by Google and latter is * chosen by you. The unique identifier should only include alphanumeric * characters, '.', '_', or '-'. */ id?: string; /** * Image module data. The maximum number of these fields displayed is 1 from * object level and 1 for class object level. */ imageModulesData?: ImageModuleData[]; /** * Deprecated. Use textModulesData instead. */ infoModuleData?: InfoModuleData; /** * linked_object_ids are a list of other objects such as event ticket, * loyalty, offer, generic, giftcard, transit and boarding pass that should be * automatically attached to this transit object. If a user had saved this * transit card, then these linked_object_ids would be automatically pushed to * the user's wallet (unless they turned off the setting to receive such * linked passes). Make sure that objects present in linked_object_ids are * already inserted - if not, calls would fail. Once linked, the linked * objects cannot be unlinked. You cannot link objects belonging to another * issuer. There is a limit to the number of objects that can be linked to a * single object. After the limit is reached, new linked objects in the call * will be ignored silently. Object IDs should follow the format issuer ID. * identifier where the former is issued by Google and the latter is chosen by * you. */ linkedObjectIds?: string[]; /** * Links module data. If links module data is also defined on the class, both * will be displayed. */ linksModuleData?: LinksModuleData; /** * Note: This field is currently not supported to trigger geo notifications. */ locations?: LatLongPoint[]; /** * Merchant locations. There is a maximum of ten on the object. Any * additional MerchantLocations added beyond the 10 will be rejected. These * locations will trigger a notification when a user enters within a * Google-set radius of the point. This field replaces the deprecated * LatLongPoints. */ merchantLocations?: MerchantLocation[]; /** * An array of messages displayed in the app. All users of this object will * receive its associated messages. The maximum number of these fields is 10. */ messages?: Message[]; /** * Whether or not field updates to this object should trigger notifications. * When set to NOTIFY, we will attempt to trigger a field update notification * to users. These notifications will only be sent to users if the field is * part of an allowlist. If set to DO_NOT_NOTIFY or * NOTIFICATION_SETTINGS_UNSPECIFIED, no notification will be triggered. This * setting is ephemeral and needs to be set with each PATCH or UPDATE request, * otherwise a notification will not be triggered. */ notifyPreference?: | "NOTIFICATION_SETTINGS_FOR_UPDATES_UNSPECIFIED" | "NOTIFY_ON_UPDATE"; /** * Pass constraints for the object. Includes limiting NFC and screenshot * behaviors. */ passConstraints?: PassConstraints; /** * The name(s) of the passengers the ticket is assigned to. The above * `passengerType` field is meant to give Google context on this field. */ passengerNames?: string; /** * The number of passengers. */ passengerType?: | "PASSENGER_TYPE_UNSPECIFIED" | "SINGLE_PASSENGER" | "singlePassenger" | "MULTIPLE_PASSENGERS" | "multiplePassengers"; /** * Purchase details for this ticket. */ purchaseDetails?: PurchaseDetails; /** * The rotating barcode type and value. */ rotatingBarcode?: RotatingBarcode; /** * Restrictions on the object that needs to be verified before the user tries * to save the pass. Note that this restrictions will only be applied during * save time. If the restrictions changed after a user saves the pass, the new * restrictions will not be applied to an already saved pass. */ saveRestrictions?: SaveRestrictions; /** * The value that will be transmitted to a Smart Tap certified terminal over * NFC for this object. The class level fields `enableSmartTap` and * `redemptionIssuers` must also be set up correctly in order for the pass to * support Smart Tap. Only ASCII characters are supported. */ smartTapRedemptionValue?: string; /** * Required. The state of the object. This field is used to determine how an * object is displayed in the app. For example, an `inactive` object is moved * to the "Expired passes" section. */ state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "active" | "COMPLETED" | "completed" | "EXPIRED" | "expired" | "INACTIVE" | "inactive"; /** * Text module data. If text module data is also defined on the class, both * will be displayed. The maximum number of these fields displayed is 10 from * the object and 10 from the class. */ textModulesData?: TextModuleData[]; /** * A single ticket leg contains departure and arrival information along with * boarding and seating information. If more than one leg is to be specified * then use the `ticketLegs` field instead. Both `ticketLeg` and `ticketLegs` * may not be set. */ ticketLeg?: TicketLeg; /** * Each ticket may contain one or more legs. Each leg contains departure and * arrival information along with boarding and seating information. If only * one leg is to be specified then use the `ticketLeg` field instead. Both * `ticketLeg` and `ticketLegs` may not be set. */ ticketLegs?: TicketLeg[]; /** * The number of the ticket. This is a unique identifier for the ticket in * the transit operator's system. */ ticketNumber?: string; /** * Information about what kind of restrictions there are on using this * ticket. For example, which days of the week it must be used, or which * routes are allowed to be taken. */ ticketRestrictions?: TicketRestrictions; /** * The status of the ticket. For states which affect display, use the `state` * field instead. */ ticketStatus?: | "TICKET_STATUS_UNSPECIFIED" | "USED" | "used" | "REFUNDED" | "refunded" | "EXCHANGED" | "exchanged"; /** * This id is used to group tickets together if the user has saved multiple * tickets for the same trip. */ tripId?: string; /** * Required. The type of trip this transit object represents. Used to * determine the pass title and/or which symbol to use between the origin and * destination. */ tripType?: | "TRIP_TYPE_UNSPECIFIED" | "ROUND_TRIP" | "roundTrip" | "ONE_WAY" | "oneWay"; /** * The time period this object will be `active` and object can be used. An * object's state will be changed to `expired` when this time period has * passed. */ validTimeInterval?: TimeInterval; /** * Optional value added module data. Maximum of ten on the object. */ valueAddedModuleData?: ValueAddedModuleData[]; /** * Deprecated */ version?: bigint; } function serializeTransitObject(data: any): TransitObject { return { ...data, classReference: data["classReference"] !== undefined ? serializeTransitClass(data["classReference"]) : undefined, purchaseDetails: data["purchaseDetails"] !== undefined ? serializePurchaseDetails(data["purchaseDetails"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? serializeRotatingBarcode(data["rotatingBarcode"]) : undefined, version: data["version"] !== undefined ? String(data["version"]) : undefined, }; } function deserializeTransitObject(data: any): TransitObject { return { ...data, classReference: data["classReference"] !== undefined ? deserializeTransitClass(data["classReference"]) : undefined, purchaseDetails: data["purchaseDetails"] !== undefined ? deserializePurchaseDetails(data["purchaseDetails"]) : undefined, rotatingBarcode: data["rotatingBarcode"] !== undefined ? deserializeRotatingBarcode(data["rotatingBarcode"]) : undefined, version: data["version"] !== undefined ? BigInt(data["version"]) : undefined, }; } export interface TransitObjectAddMessageResponse { /** * The updated TransitObject resource. */ resource?: TransitObject; } function serializeTransitObjectAddMessageResponse(data: any): TransitObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? serializeTransitObject(data["resource"]) : undefined, }; } function deserializeTransitObjectAddMessageResponse(data: any): TransitObjectAddMessageResponse { return { ...data, resource: data["resource"] !== undefined ? deserializeTransitObject(data["resource"]) : undefined, }; } /** * Additional options for Walletobjects#transitobjectList. */ export interface TransitobjectListOptions { /** * The ID of the class whose objects will be listed. */ classId?: string; /** * Identifies the max number of results returned by a list. All results are * returned if `maxResults` isn't defined. */ maxResults?: number; /** * Used to get the next set of results if `maxResults` is specified, but more * than `maxResults` objects are available in a list. For example, if you have * a list of 200 objects and you call list with `maxResults` set to 20, list * will return the first 20 objects and a token. Call list again with * `maxResults` set to 20 and the token to get the next 20 objects. */ token?: string; } export interface TransitObjectListResponse { /** * Pagination of the response. */ pagination?: Pagination; /** * Resources corresponding to the list request. */ resources?: TransitObject[]; } function serializeTransitObjectListResponse(data: any): TransitObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (serializeTransitObject(item))) : undefined, }; } function deserializeTransitObjectListResponse(data: any): TransitObjectListResponse { return { ...data, resources: data["resources"] !== undefined ? data["resources"].map((item: any) => (deserializeTransitObject(item))) : undefined, }; } /** * Request to upload rotating barcode values. */ export interface TransitObjectUploadRotatingBarcodeValuesRequest { /** * A reference to the rotating barcode values payload that was uploaded. */ blob?: Media; /** * Extra information about the uploaded media. */ mediaRequestInfo?: MediaRequestInfo; } function serializeTransitObjectUploadRotatingBarcodeValuesRequest(data: any): TransitObjectUploadRotatingBarcodeValuesRequest { return { ...data, blob: data["blob"] !== undefined ? serializeMedia(data["blob"]) : undefined, mediaRequestInfo: data["mediaRequestInfo"] !== undefined ? serializeMediaRequestInfo(data["mediaRequestInfo"]) : undefined, }; } function deserializeTransitObjectUploadRotatingBarcodeValuesRequest(data: any): TransitObjectUploadRotatingBarcodeValuesRequest { return { ...data, blob: data["blob"] !== undefined ? deserializeMedia(data["blob"]) : undefined, mediaRequestInfo: data["mediaRequestInfo"] !== undefined ? deserializeMediaRequestInfo(data["mediaRequestInfo"]) : undefined, }; } /** * Response for uploading rotating barcode values. */ export interface TransitObjectUploadRotatingBarcodeValuesResponse { } export interface TranslatedString { /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#translatedString"`. */ kind?: string; /** * Represents the BCP 47 language tag. Example values are "en-US", "en-GB", * "de", or "de-AT". */ language?: string; /** * The UTF-8 encoded translated string. */ value?: string; } /** * Indicates that the issuer would like Google Wallet to send an upcoming card * validity notification 1 day before card becomes valid/usable. */ export interface UpcomingNotification { /** * Indicates if the object needs to have upcoming notification enabled. */ enableNotification?: boolean; } export interface Uri { /** * The URI's title appearing in the app as text. Recommended maximum is 20 * characters to ensure full string is displayed on smaller screens. Note that * in some contexts this text is not used, such as when `description` is part * of an image. */ description?: string; /** * The ID associated with a uri. This field is here to enable ease of * management of uris. */ id?: string; /** * Identifies what kind of resource this is. Value: the fixed string * `"walletobjects#uri"`. */ kind?: string; /** * Translated strings for the description. Recommended maximum is 20 * characters to ensure full string is displayed on smaller screens. */ localizedDescription?: LocalizedString; /** * The location of a web page, image, or other resource. URIs in the * `LinksModuleData` module can have different prefixes indicating the type of * URI (a link to a web page, a link to a map, a telephone number, or an email * address). URIs must have a scheme. */ uri?: string; } /** * Data for Value Added module. Required fields are header and uri. */ export interface ValueAddedModuleData { /** * Body to be displayed on the module. Character limit is 50 and longer * strings will be truncated. */ body?: LocalizedString; /** * Header to be displayed on the module. Character limit is 60 and longer * strings will be truncated. */ header?: LocalizedString; /** * Image to be displayed on the module. Recommended image ratio is 1:1. * Images will be resized to fit this ratio. */ image?: Image; /** * The index for sorting the modules. Modules with a lower sort index are * shown before modules with a higher sort index. If unspecified, the sort * index is assumed to be INT_MAX. For two modules with the same index, the * sorting behavior is undefined. */ sortIndex?: number; /** * URI that the module leads to on click. This can be a web link or a deep * link as mentioned in * https://developer.android.com/training/app-links/deep-linking. */ uri?: string; /** * Constraints that all must be met for the module to be shown. */ viewConstraints?: ModuleViewConstraints; } function decodeBase64(b64: string): Uint8Array { const binString = atob(b64); const size = binString.length; const bytes = new Uint8Array(size); for (let i = 0; i < size; i++) { bytes[i] = binString.charCodeAt(i); } return bytes; } const base64abc = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"]; /** * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727 * Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation * @param data */ function encodeBase64(uint8: Uint8Array): string { let result = "", i; const l = uint8.length; for (i = 2; i < l; i += 3) { result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[((uint8[i - 1] & 0x0f) << 2) | (uint8[i] >> 6)]; result += base64abc[uint8[i] & 0x3f]; } if (i === l + 1) { // 1 octet yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[(uint8[i - 2] & 0x03) << 4]; result += "=="; } if (i === l) { // 2 octets yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[(uint8[i - 1] & 0x0f) << 2]; result += "="; } return result; }