From 1599e2ee612d98cef0f7e5979fd0a4ede86228db Mon Sep 17 00:00:00 2001 From: Nick Alteen Date: Wed, 12 Oct 2022 16:48:27 -0400 Subject: [PATCH] minor updates to .NET formatting, corrected links in java README --- dotnet/DemoEventTicket.cs | 129 +++++++++++++++++++---------- dotnet/DemoFlight.cs | 3 +- dotnet/DemoGeneric.cs | 73 ++++++++-------- dotnet/DemoGiftCard.cs | 169 +++++++++++++++++++------------------- dotnet/DemoLoyalty.cs | 145 ++++++++++++++++---------------- dotnet/DemoOffer.cs | 169 +++++++++++++++++++------------------- dotnet/DemoTransit.cs | 169 +++++++++++++++++++------------------- java/README.md | 14 ++-- python/__init__.py | 0 9 files changed, 460 insertions(+), 411 deletions(-) create mode 100644 python/__init__.py diff --git a/dotnet/DemoEventTicket.cs b/dotnet/DemoEventTicket.cs index 5ee0121..fd2db9f 100644 --- a/dotnet/DemoEventTicket.cs +++ b/dotnet/DemoEventTicket.cs @@ -66,7 +66,8 @@ class DemoEventTicket { credentials = (ServiceAccountCredential)GoogleCredential .FromFile(keyFilePath) - .CreateScoped(new[] { + .CreateScoped(new[] + { "https://www.googleapis.com/auth/wallet_object.issuer" }) .UnderlyingCredential; @@ -190,8 +191,10 @@ class DemoEventTicket } } }, - TextModulesData = new List { - new TextModuleData { + TextModulesData = new List + { + new TextModuleData + { Header = "Text module header", Body = "Text module body", Id = "TEXT_MODULE_ID" @@ -199,27 +202,36 @@ class DemoEventTicket }, LinksModuleData = new LinksModuleData { - Uris = new List { - new Google.Apis.Walletobjects.v1.Data.Uri { + Uris = new List + { + new Google.Apis.Walletobjects.v1.Data.Uri + { UriValue = "http://maps.google.com/", Description = "Link module URI description", Id = "LINK_MODULE_URI_ID" }, - new Google.Apis.Walletobjects.v1.Data.Uri { + new Google.Apis.Walletobjects.v1.Data.Uri + { UriValue = "tel:6505555555", Description = "Link module tel description", Id = "LINK_MODULE_TEL_ID" } } }, - ImageModulesData = new List { - new ImageModuleData { - MainImage = new Image { - SourceUri = new ImageUri { + ImageModulesData = new List + { + new ImageModuleData + { + MainImage = new Image + { + SourceUri = new ImageUri + { Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" }, - ContentDescription = new LocalizedString { - DefaultValue = new TranslatedString { + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { Language = "en-US", Value = "Image module description" } @@ -233,8 +245,10 @@ class DemoEventTicket Type = "QR_CODE", Value = "QR code" }, - Locations = new List { - new LatLongPoint { + Locations = new List + { + new LatLongPoint + { Latitude = 37.424015499999996, Longitude = -122.09259560000001 } @@ -384,8 +398,10 @@ class DemoEventTicket } } }, - TextModulesData = new List { - new TextModuleData { + TextModulesData = new List + { + new TextModuleData + { Header = "Text module header", Body = "Text module body", Id = "TEXT_MODULE_ID" @@ -393,27 +409,36 @@ class DemoEventTicket }, LinksModuleData = new LinksModuleData { - Uris = new List { - new Google.Apis.Walletobjects.v1.Data.Uri { + Uris = new List + { + new Google.Apis.Walletobjects.v1.Data.Uri + { UriValue = "http://maps.google.com/", Description = "Link module URI description", Id = "LINK_MODULE_URI_ID" }, - new Google.Apis.Walletobjects.v1.Data.Uri { + new Google.Apis.Walletobjects.v1.Data.Uri + { UriValue = "tel:6505555555", Description = "Link module tel description", Id = "LINK_MODULE_TEL_ID" } } }, - ImageModulesData = new List { - new ImageModuleData { - MainImage = new Image { - SourceUri = new ImageUri { + ImageModulesData = new List + { + new ImageModuleData + { + MainImage = new Image + { + SourceUri = new ImageUri + { Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" }, - ContentDescription = new LocalizedString { - DefaultValue = new TranslatedString { + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { Language = "en-US", Value = "Image module description" } @@ -427,8 +452,10 @@ class DemoEventTicket Type = "QR_CODE", Value = "QR code" }, - Locations = new List { - new LatLongPoint { + Locations = new List + { + new LatLongPoint + { Latitude = 37.424015499999996, Longitude = -122.09259560000001 } @@ -481,7 +508,8 @@ class DemoEventTicket { iss = credentials.Id, aud = "google", - origins = new string[] { + origins = new string[] + { "www.example.com" }, typ = "savetowallet", @@ -489,10 +517,12 @@ class DemoEventTicket { // The listed classes and objects will be created // when the user saves the pass to their wallet - eventTicketClasses = new JObject[] { + eventTicketClasses = new JObject[] + { serializedClass }, - eventTicketObjects = new JObject[] { + eventTicketObjects = new JObject[] + { serializedObject } })), @@ -626,8 +656,10 @@ class DemoEventTicket } } }, - TextModulesData = new List { - new TextModuleData { + TextModulesData = new List + { + new TextModuleData + { Header = "Text module header", Body = "Text module body", Id = "TEXT_MODULE_ID" @@ -635,27 +667,36 @@ class DemoEventTicket }, LinksModuleData = new LinksModuleData { - Uris = new List { - new Google.Apis.Walletobjects.v1.Data.Uri { + Uris = new List + { + new Google.Apis.Walletobjects.v1.Data.Uri + { UriValue = "http://maps.google.com/", Description = "Link module URI description", Id = "LINK_MODULE_URI_ID" }, - new Google.Apis.Walletobjects.v1.Data.Uri { + new Google.Apis.Walletobjects.v1.Data.Uri + { UriValue = "tel:6505555555", Description = "Link module tel description", Id = "LINK_MODULE_TEL_ID" } } }, - ImageModulesData = new List { - new ImageModuleData { - MainImage = new Image { - SourceUri = new ImageUri { + ImageModulesData = new List + { + new ImageModuleData + { + MainImage = new Image + { + SourceUri = new ImageUri + { Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" }, - ContentDescription = new LocalizedString { - DefaultValue = new TranslatedString { + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { Language = "en-US", Value = "Image module description" } @@ -669,8 +710,10 @@ class DemoEventTicket Type = "QR_CODE", Value = "QR code" }, - Locations = new List { - new LatLongPoint { + Locations = new List + { + new LatLongPoint + { Latitude = 37.424015499999996, Longitude = -122.09259560000001 } diff --git a/dotnet/DemoFlight.cs b/dotnet/DemoFlight.cs index cef2ec6..057cf4c 100644 --- a/dotnet/DemoFlight.cs +++ b/dotnet/DemoFlight.cs @@ -66,7 +66,8 @@ class DemoFlight { credentials = (ServiceAccountCredential)GoogleCredential .FromFile(keyFilePath) - .CreateScoped(new[] { + .CreateScoped(new[] + { "https://www.googleapis.com/auth/wallet_object.issuer" }) .UnderlyingCredential; diff --git a/dotnet/DemoGeneric.cs b/dotnet/DemoGeneric.cs index f9a394d..1178075 100644 --- a/dotnet/DemoGeneric.cs +++ b/dotnet/DemoGeneric.cs @@ -65,7 +65,8 @@ class DemoGeneric { credentials = (ServiceAccountCredential)GoogleCredential .FromFile(keyFilePath) - .CreateScoped(new[] { + .CreateScoped(new[] + { "https://www.googleapis.com/auth/wallet_object.issuer" }) .UnderlyingCredential; @@ -179,54 +180,54 @@ class DemoGeneric } }, TextModulesData = new List - { - new TextModuleData { - Header = "Text module header", - Body = "Text module body", - Id = "TEXT_MODULE_ID" - } - }, + new TextModuleData + { + Header = "Text module header", + Body = "Text module body", + Id = "TEXT_MODULE_ID" + } + }, LinksModuleData = new LinksModuleData { Uris = new List - { - new Google.Apis.Walletobjects.v1.Data.Uri { - UriValue = "http://maps.google.com/", - Description = "Link module URI description", - Id = "LINK_MODULE_URI_ID" - }, - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "tel:6505555555", - Description = "Link module tel description", - Id = "LINK_MODULE_TEL_ID" + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "http://maps.google.com/", + Description = "Link module URI description", + Id = "LINK_MODULE_URI_ID" + }, + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "tel:6505555555", + Description = "Link module tel description", + Id = "LINK_MODULE_TEL_ID" + } } - } }, ImageModulesData = new List - { - new ImageModuleData { - MainImage = new Image + new ImageModuleData { - SourceUri = new ImageUri + MainImage = new Image { - Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" - }, - ContentDescription = new LocalizedString - { - DefaultValue = new TranslatedString + SourceUri = new ImageUri { - Language = "en-US", - Value = "Image module description" + Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" + }, + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { + Language = "en-US", + Value = "Image module description" + } } - } - }, - Id = "IMAGE_MODULE_ID" - } - }, + }, + Id = "IMAGE_MODULE_ID" + } + }, Barcode = new Barcode { Type = "QR_CODE", diff --git a/dotnet/DemoGiftCard.cs b/dotnet/DemoGiftCard.cs index a3f215f..89017cc 100644 --- a/dotnet/DemoGiftCard.cs +++ b/dotnet/DemoGiftCard.cs @@ -66,7 +66,8 @@ class DemoGiftCard { credentials = (ServiceAccountCredential)GoogleCredential .FromFile(keyFilePath) - .CreateScoped(new[] { + .CreateScoped(new[] + { "https://www.googleapis.com/auth/wallet_object.issuer" }) .UnderlyingCredential; @@ -183,67 +184,67 @@ class DemoGiftCard } }, TextModulesData = new List - { - new TextModuleData { - Header = "Text module header", - Body = "Text module body", - Id = "TEXT_MODULE_ID" - } - }, + new TextModuleData + { + Header = "Text module header", + Body = "Text module body", + Id = "TEXT_MODULE_ID" + } + }, LinksModuleData = new LinksModuleData { Uris = new List - { - new Google.Apis.Walletobjects.v1.Data.Uri { - UriValue = "http://maps.google.com/", - Description = "Link module URI description", - Id = "LINK_MODULE_URI_ID" - }, - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "tel:6505555555", - Description = "Link module tel description", - Id = "LINK_MODULE_TEL_ID" + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "http://maps.google.com/", + Description = "Link module URI description", + Id = "LINK_MODULE_URI_ID" + }, + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "tel:6505555555", + Description = "Link module tel description", + Id = "LINK_MODULE_TEL_ID" + } } - } }, ImageModulesData = new List - { - new ImageModuleData { - MainImage = new Image + new ImageModuleData { - SourceUri = new ImageUri + MainImage = new Image { - Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" - }, - ContentDescription = new LocalizedString - { - DefaultValue = new TranslatedString + SourceUri = new ImageUri { - Language = "en-US", - Value = "Image module description" + Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" + }, + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { + Language = "en-US", + Value = "Image module description" + } } - } - }, - Id = "IMAGE_MODULE_ID" - } - }, + }, + Id = "IMAGE_MODULE_ID" + } + }, Barcode = new Barcode { Type = "QR_CODE", Value = "QR code" }, Locations = new List - { - new LatLongPoint { - Latitude = 37.424015499999996, - Longitude = -122.09259560000001 - } - }, + new LatLongPoint + { + Latitude = 37.424015499999996, + Longitude = -122.09259560000001 + } + }, CardNumber = "Card number", Pin = "1234", Balance = new Money @@ -355,67 +356,67 @@ class DemoGiftCard } }, TextModulesData = new List + { + new TextModuleData { - new TextModuleData - { - Header = "Text module header", - Body = "Text module body", - Id = "TEXT_MODULE_ID" - } - }, + Header = "Text module header", + Body = "Text module body", + Id = "TEXT_MODULE_ID" + } + }, LinksModuleData = new LinksModuleData { Uris = new List + { + new Google.Apis.Walletobjects.v1.Data.Uri { - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "http://maps.google.com/", - Description = "Link module URI description", - Id = "LINK_MODULE_URI_ID" - }, - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "tel:6505555555", - Description = "Link module tel description", - Id = "LINK_MODULE_TEL_ID" - } + UriValue = "http://maps.google.com/", + Description = "Link module URI description", + Id = "LINK_MODULE_URI_ID" + }, + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "tel:6505555555", + Description = "Link module tel description", + Id = "LINK_MODULE_TEL_ID" } + } }, ImageModulesData = new List + { + new ImageModuleData { - new ImageModuleData + MainImage = new Image { - MainImage = new Image + SourceUri = new ImageUri { - SourceUri = new ImageUri - { - Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" - }, - ContentDescription = new LocalizedString - { - DefaultValue = new TranslatedString - { - Language = "en-US", - Value = "Image module description" - } - } + Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" }, - Id = "IMAGE_MODULE_ID" - } - }, + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { + Language = "en-US", + Value = "Image module description" + } + } + }, + Id = "IMAGE_MODULE_ID" + } + }, Barcode = new Barcode { Type = "QR_CODE", Value = "QR code" }, Locations = new List + { + new LatLongPoint { - new LatLongPoint - { - Latitude = 37.424015499999996, - Longitude = -122.09259560000001 - } - }, + Latitude = 37.424015499999996, + Longitude = -122.09259560000001 + } + }, CardNumber = "Card number", Pin = "1234", Balance = new Money diff --git a/dotnet/DemoLoyalty.cs b/dotnet/DemoLoyalty.cs index cfcc54a..ae0b4bf 100644 --- a/dotnet/DemoLoyalty.cs +++ b/dotnet/DemoLoyalty.cs @@ -66,7 +66,8 @@ class DemoLoyalty { credentials = (ServiceAccountCredential)GoogleCredential .FromFile(keyFilePath) - .CreateScoped(new[] { + .CreateScoped(new[] + { "https://www.googleapis.com/auth/wallet_object.issuer" }) .UnderlyingCredential; @@ -199,67 +200,67 @@ class DemoLoyalty } }, TextModulesData = new List - { - new TextModuleData { - Header = "Text module header", - Body = "Text module body", - Id = "TEXT_MODULE_ID" - } - }, + new TextModuleData + { + Header = "Text module header", + Body = "Text module body", + Id = "TEXT_MODULE_ID" + } + }, LinksModuleData = new LinksModuleData { Uris = new List - { - new Google.Apis.Walletobjects.v1.Data.Uri { - UriValue = "http://maps.google.com/", - Description = "Link module URI description", - Id = "LINK_MODULE_URI_ID" - }, - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "tel:6505555555", - Description = "Link module tel description", - Id = "LINK_MODULE_TEL_ID" + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "http://maps.google.com/", + Description = "Link module URI description", + Id = "LINK_MODULE_URI_ID" + }, + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "tel:6505555555", + Description = "Link module tel description", + Id = "LINK_MODULE_TEL_ID" + } } - } }, ImageModulesData = new List - { - new ImageModuleData { - MainImage = new Image + new ImageModuleData { - SourceUri = new ImageUri + MainImage = new Image { - Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" - }, - ContentDescription = new LocalizedString - { - DefaultValue = new TranslatedString + SourceUri = new ImageUri { - Language = "en-US", - Value = "Image module description" + Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" + }, + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { + Language = "en-US", + Value = "Image module description" + } } - } - }, - Id = "IMAGE_MODULE_ID" - } - }, + }, + Id = "IMAGE_MODULE_ID" + } + }, Barcode = new Barcode { Type = "QR_CODE", Value = "QR code" }, Locations = new List - { - new LatLongPoint { - Latitude = 37.424015499999996, - Longitude = -122.09259560000001 - } - }, + new LatLongPoint + { + Latitude = 37.424015499999996, + Longitude = -122.09259560000001 + } + }, AccountId = "Account id", AccountName = "Account name", LoyaltyPoints = new LoyaltyPoints @@ -386,14 +387,14 @@ class DemoLoyalty } }, TextModulesData = new List + { + new TextModuleData { - new TextModuleData - { - Header = "Text module header", - Body = "Text module body", - Id = "TEXT_MODULE_ID" - } - }, + Header = "Text module header", + Body = "Text module body", + Id = "TEXT_MODULE_ID" + } + }, LinksModuleData = new LinksModuleData { Uris = new List @@ -413,40 +414,40 @@ class DemoLoyalty } }, ImageModulesData = new List + { + new ImageModuleData { - new ImageModuleData + MainImage = new Image { - MainImage = new Image + SourceUri = new ImageUri { - SourceUri = new ImageUri - { - Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" - }, - ContentDescription = new LocalizedString - { - DefaultValue = new TranslatedString - { - Language = "en-US", - Value = "Image module description" - } - } + Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" }, - Id = "IMAGE_MODULE_ID" - } - }, + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { + Language = "en-US", + Value = "Image module description" + } + } + }, + Id = "IMAGE_MODULE_ID" + } + }, Barcode = new Barcode { Type = "QR_CODE", Value = "QR code" }, Locations = new List + { + new LatLongPoint { - new LatLongPoint - { - Latitude = 37.424015499999996, - Longitude = -122.09259560000001 - } - }, + Latitude = 37.424015499999996, + Longitude = -122.09259560000001 + } + }, AccountId = "Account id", AccountName = "Account name", LoyaltyPoints = new LoyaltyPoints diff --git a/dotnet/DemoOffer.cs b/dotnet/DemoOffer.cs index e5fca4d..b9411c3 100644 --- a/dotnet/DemoOffer.cs +++ b/dotnet/DemoOffer.cs @@ -66,7 +66,8 @@ class DemoOffer { credentials = (ServiceAccountCredential)GoogleCredential .FromFile(keyFilePath) - .CreateScoped(new[] { + .CreateScoped(new[] + { "https://www.googleapis.com/auth/wallet_object.issuer" }) .UnderlyingCredential; @@ -186,67 +187,67 @@ class DemoOffer } }, TextModulesData = new List - { - new TextModuleData { - Header = "Text module header", - Body = "Text module body", - Id = "TEXT_MODULE_ID" - } - }, + new TextModuleData + { + Header = "Text module header", + Body = "Text module body", + Id = "TEXT_MODULE_ID" + } + }, LinksModuleData = new LinksModuleData { Uris = new List - { - new Google.Apis.Walletobjects.v1.Data.Uri { - UriValue = "http://maps.google.com/", - Description = "Link module URI description", - Id = "LINK_MODULE_URI_ID" - }, - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "tel:6505555555", - Description = "Link module tel description", - Id = "LINK_MODULE_TEL_ID" + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "http://maps.google.com/", + Description = "Link module URI description", + Id = "LINK_MODULE_URI_ID" + }, + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "tel:6505555555", + Description = "Link module tel description", + Id = "LINK_MODULE_TEL_ID" + } } - } }, ImageModulesData = new List - { - new ImageModuleData { - MainImage = new Image + new ImageModuleData { - SourceUri = new ImageUri + MainImage = new Image { - Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" - }, - ContentDescription = new LocalizedString - { - DefaultValue = new TranslatedString + SourceUri = new ImageUri { - Language = "en-US", - Value = "Image module description" + Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" + }, + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { + Language = "en-US", + Value = "Image module description" + } } - } - }, - Id = "IMAGE_MODULE_ID" - } - }, + }, + Id = "IMAGE_MODULE_ID" + } + }, Barcode = new Barcode { Type = "QR_CODE", Value = "QR code" }, Locations = new List - { - new LatLongPoint { - Latitude = 37.424015499999996, - Longitude = -122.09259560000001 - } - }, + new LatLongPoint + { + Latitude = 37.424015499999996, + Longitude = -122.09259560000001 + } + }, ValidTimeInterval = new TimeInterval { Start = new Google.Apis.Walletobjects.v1.Data.DateTime @@ -361,67 +362,67 @@ class DemoOffer } }, TextModulesData = new List + { + new TextModuleData { - new TextModuleData - { - Header = "Text module header", - Body = "Text module body", - Id = "TEXT_MODULE_ID" - } - }, + Header = "Text module header", + Body = "Text module body", + Id = "TEXT_MODULE_ID" + } + }, LinksModuleData = new LinksModuleData { Uris = new List + { + new Google.Apis.Walletobjects.v1.Data.Uri { - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "http://maps.google.com/", - Description = "Link module URI description", - Id = "LINK_MODULE_URI_ID" - }, - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "tel:6505555555", - Description = "Link module tel description", - Id = "LINK_MODULE_TEL_ID" - } + UriValue = "http://maps.google.com/", + Description = "Link module URI description", + Id = "LINK_MODULE_URI_ID" + }, + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "tel:6505555555", + Description = "Link module tel description", + Id = "LINK_MODULE_TEL_ID" } + } }, ImageModulesData = new List + { + new ImageModuleData { - new ImageModuleData + MainImage = new Image { - MainImage = new Image + SourceUri = new ImageUri { - SourceUri = new ImageUri - { - Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" - }, - ContentDescription = new LocalizedString - { - DefaultValue = new TranslatedString - { - Language = "en-US", - Value = "Image module description" - } - } + Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" }, - Id = "IMAGE_MODULE_ID" - } - }, + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { + Language = "en-US", + Value = "Image module description" + } + } + }, + Id = "IMAGE_MODULE_ID" + } + }, Barcode = new Barcode { Type = "QR_CODE", Value = "QR code" }, Locations = new List + { + new LatLongPoint { - new LatLongPoint - { - Latitude = 37.424015499999996, - Longitude = -122.09259560000001 - } - }, + Latitude = 37.424015499999996, + Longitude = -122.09259560000001 + } + }, ValidTimeInterval = new TimeInterval { Start = new Google.Apis.Walletobjects.v1.Data.DateTime diff --git a/dotnet/DemoTransit.cs b/dotnet/DemoTransit.cs index c4efba1..b1e95c3 100644 --- a/dotnet/DemoTransit.cs +++ b/dotnet/DemoTransit.cs @@ -66,7 +66,8 @@ class DemoTransit { credentials = (ServiceAccountCredential)GoogleCredential .FromFile(keyFilePath) - .CreateScoped(new[] { + .CreateScoped(new[] + { "https://www.googleapis.com/auth/wallet_object.issuer" }) .UnderlyingCredential; @@ -199,67 +200,67 @@ class DemoTransit } }, TextModulesData = new List - { - new TextModuleData { - Header = "Text module header", - Body = "Text module body", - Id = "TEXT_MODULE_ID" - } - }, + new TextModuleData + { + Header = "Text module header", + Body = "Text module body", + Id = "TEXT_MODULE_ID" + } + }, LinksModuleData = new LinksModuleData { Uris = new List - { - new Google.Apis.Walletobjects.v1.Data.Uri { - UriValue = "http://maps.google.com/", - Description = "Link module URI description", - Id = "LINK_MODULE_URI_ID" - }, - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "tel:6505555555", - Description = "Link module tel description", - Id = "LINK_MODULE_TEL_ID" + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "http://maps.google.com/", + Description = "Link module URI description", + Id = "LINK_MODULE_URI_ID" + }, + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "tel:6505555555", + Description = "Link module tel description", + Id = "LINK_MODULE_TEL_ID" + } } - } }, ImageModulesData = new List - { - new ImageModuleData { - MainImage = new Image + new ImageModuleData { - SourceUri = new ImageUri + MainImage = new Image { - Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" - }, - ContentDescription = new LocalizedString - { - DefaultValue = new TranslatedString + SourceUri = new ImageUri { - Language = "en-US", - Value = "Image module description" + Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" + }, + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { + Language = "en-US", + Value = "Image module description" + } } - } - }, - Id = "IMAGE_MODULE_ID" - } - }, + }, + Id = "IMAGE_MODULE_ID" + } + }, Barcode = new Barcode { Type = "QR_CODE", Value = "QR code" }, Locations = new List - { - new LatLongPoint { - Latitude = 37.424015499999996, - Longitude = -122.09259560000001 - } - }, + new LatLongPoint + { + Latitude = 37.424015499999996, + Longitude = -122.09259560000001 + } + }, PassengerType = "SINGLE_PASSENGER", PassengerNames = "Passenger names", TicketLeg = new TicketLeg @@ -409,67 +410,67 @@ class DemoTransit } }, TextModulesData = new List + { + new TextModuleData { - new TextModuleData - { - Header = "Text module header", - Body = "Text module body", - Id = "TEXT_MODULE_ID" - } - }, + Header = "Text module header", + Body = "Text module body", + Id = "TEXT_MODULE_ID" + } + }, LinksModuleData = new LinksModuleData { Uris = new List + { + new Google.Apis.Walletobjects.v1.Data.Uri { - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "http://maps.google.com/", - Description = "Link module URI description", - Id = "LINK_MODULE_URI_ID" - }, - new Google.Apis.Walletobjects.v1.Data.Uri - { - UriValue = "tel:6505555555", - Description = "Link module tel description", - Id = "LINK_MODULE_TEL_ID" - } + UriValue = "http://maps.google.com/", + Description = "Link module URI description", + Id = "LINK_MODULE_URI_ID" + }, + new Google.Apis.Walletobjects.v1.Data.Uri + { + UriValue = "tel:6505555555", + Description = "Link module tel description", + Id = "LINK_MODULE_TEL_ID" } + } }, ImageModulesData = new List + { + new ImageModuleData { - new ImageModuleData + MainImage = new Image { - MainImage = new Image + SourceUri = new ImageUri { - SourceUri = new ImageUri - { - Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" - }, - ContentDescription = new LocalizedString - { - DefaultValue = new TranslatedString - { - Language = "en-US", - Value = "Image module description" - } - } + Uri = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg" }, - Id = "IMAGE_MODULE_ID" - } - }, + ContentDescription = new LocalizedString + { + DefaultValue = new TranslatedString + { + Language = "en-US", + Value = "Image module description" + } + } + }, + Id = "IMAGE_MODULE_ID" + } + }, Barcode = new Barcode { Type = "QR_CODE", Value = "QR code" }, Locations = new List + { + new LatLongPoint { - new LatLongPoint - { - Latitude = 37.424015499999996, - Longitude = -122.09259560000001 - } - }, + Latitude = 37.424015499999996, + Longitude = -122.09259560000001 + } + }, PassengerType = "SINGLE_PASSENGER", PassengerNames = "Passenger names", TicketLeg = new TicketLeg diff --git a/java/README.md b/java/README.md index 329bc81..86b9b45 100644 --- a/java/README.md +++ b/java/README.md @@ -8,13 +8,13 @@ creating a pass class, updating issuer permissions, and more. | Pass type | File | |-----------|------| -| Event tickets | [DemoEventTicket.cs](./DemoEventTicket.cs) | -| Flight boarding passes | [DemoFlight.cs](./DemoFlight.cs) | -| Generic passes | [DemoGeneric.cs](./DemoGeneric.cs) | -| Gift cards | [DemoGiftCard.cs](./DemoGiftCard.cs) | -| Loyalty program membership | [DemoLoyalty.cs](./DemoLoyalty.cs) | -| Offers and promotions | [DemoOffer.cs](./DemoOffer.cs) | -| Transit passes | [DemoTransit.cs](./DemoTransit.cs) | +| Event tickets | [DemoEventTicket.java](./src/main/java/DemoEventTicket.java) | +| Flight boarding passes | [DemoFlight.java](./src/main/java/DemoFlight.java) | +| Generic passes | [DemoGeneric.java](./src/main/java/DemoGeneric.java) | +| Gift cards | [DemoGiftCard.java](./src/main/java/DemoGiftCard.java) | +| Loyalty program membership | [DemoLoyalty.java](./src/main/java/DemoLoyalty.java) | +| Offers and promotions | [DemoOffer.java](./src/main/java/DemoOffer.java) | +| Transit passes | [DemoTransit.java](./src/main/java/DemoTransit.java) | ## Prerequisites diff --git a/python/__init__.py b/python/__init__.py new file mode 100644 index 0000000..e69de29