From c715f7b52e738f87e28984d256e31d1dbf15dd37 Mon Sep 17 00:00:00 2001 From: sagarkothari Date: Mon, 4 Dec 2023 11:19:36 -0800 Subject: [PATCH] Added batch URLs to the batch code for go, node and python --- go/demo_eventticket.go | 2 ++ go/demo_flight.go | 1 + go/demo_generic.go | 1 + go/demo_giftcard.go | 1 + go/demo_loyalty.go | 1 + go/demo_offer.go | 1 + go/demo_transit.go | 1 + nodejs/demo-eventticket.js | 2 +- nodejs/demo-flight.js | 2 +- nodejs/demo-generic.js | 2 +- nodejs/demo-giftcard.js | 2 +- nodejs/demo-loyalty.js | 2 +- nodejs/demo-offer.js | 2 +- nodejs/demo-transit.js | 2 +- python/demo_eventticket.py | 2 +- python/demo_flight.py | 2 +- python/demo_generic.py | 2 +- python/demo_giftcard.py | 2 +- python/demo_loyalty.py | 2 +- python/demo_offer.py | 2 +- python/demo_transit.py | 2 +- 21 files changed, 22 insertions(+), 14 deletions(-) diff --git a/go/demo_eventticket.go b/go/demo_eventticket.go index 11c33ed..ecc31d5 100644 --- a/go/demo_eventticket.go +++ b/go/demo_eventticket.go @@ -537,6 +537,8 @@ func (d *demoEventticket) batchCreateObjects(issuerId, classSuffix string) { } data += "--batch_createobjectbatch--" + + // batchUrl = 'https://walletobjects.googleapis.com/batch'; res, err := d.httpClient.Post(batchUrl, "multipart/mixed; boundary=batch_createobjectbatch", bytes.NewBuffer([]byte(data))) if err != nil { diff --git a/go/demo_flight.go b/go/demo_flight.go index 0e2f1c0..d1a45e9 100644 --- a/go/demo_flight.go +++ b/go/demo_flight.go @@ -497,6 +497,7 @@ func (d *demoFlight) batchCreateObjects(issuerId, classSuffix string) { } data += "--batch_createobjectbatch--" + // batchUrl = 'https://walletobjects.googleapis.com/batch'; res, err := d.httpClient.Post(batchUrl, "multipart/mixed; boundary=batch_createobjectbatch", bytes.NewBuffer([]byte(data))) if err != nil { diff --git a/go/demo_generic.go b/go/demo_generic.go index 0c12c7d..1e69804 100644 --- a/go/demo_generic.go +++ b/go/demo_generic.go @@ -489,6 +489,7 @@ func (d *demoGeneric) batchCreateObjects(issuerId, classSuffix string) { } data += "--batch_createobjectbatch--" + // batchUrl = 'https://walletobjects.googleapis.com/batch'; res, err := d.httpClient.Post(batchUrl, "multipart/mixed; boundary=batch_createobjectbatch", bytes.NewBuffer([]byte(data))) if err != nil { diff --git a/go/demo_giftcard.go b/go/demo_giftcard.go index 48031b7..914a20b 100644 --- a/go/demo_giftcard.go +++ b/go/demo_giftcard.go @@ -466,6 +466,7 @@ func (d *demoGiftcard) batchCreateObjects(issuerId, classSuffix string) { } data += "--batch_createobjectbatch--" + // batchUrl = 'https://walletobjects.googleapis.com/batch'; res, err := d.httpClient.Post(batchUrl, "multipart/mixed; boundary=batch_createobjectbatch", bytes.NewBuffer([]byte(data))) if err != nil { diff --git a/go/demo_loyalty.go b/go/demo_loyalty.go index 660e5c5..40235ac 100644 --- a/go/demo_loyalty.go +++ b/go/demo_loyalty.go @@ -487,6 +487,7 @@ func (d *demoLoyalty) batchCreateObjects(issuerId, classSuffix string) { } data += "--batch_createobjectbatch--" + // batchUrl = 'https://walletobjects.googleapis.com/batch'; res, err := d.httpClient.Post(batchUrl, "multipart/mixed; boundary=batch_createobjectbatch", bytes.NewBuffer([]byte(data))) if err != nil { diff --git a/go/demo_offer.go b/go/demo_offer.go index 8c3c055..dc4bf05 100644 --- a/go/demo_offer.go +++ b/go/demo_offer.go @@ -469,6 +469,7 @@ func (d *demoOffer) batchCreateObjects(issuerId, classSuffix string) { } data += "--batch_createobjectbatch--" + // batchUrl = 'https://walletobjects.googleapis.com/batch'; res, err := d.httpClient.Post(batchUrl, "multipart/mixed; boundary=batch_createobjectbatch", bytes.NewBuffer([]byte(data))) if err != nil { diff --git a/go/demo_transit.go b/go/demo_transit.go index 49379ab..6c5a83a 100644 --- a/go/demo_transit.go +++ b/go/demo_transit.go @@ -544,6 +544,7 @@ func (d *demoTransit) batchCreateObjects(issuerId, classSuffix string) { } data += "--batch_createobjectbatch--" + // batchUrl = 'https://walletobjects.googleapis.com/batch'; res, err := d.httpClient.Post(batchUrl, "multipart/mixed; boundary=batch_createobjectbatch", bytes.NewBuffer([]byte(data))) if err != nil { diff --git a/nodejs/demo-eventticket.js b/nodejs/demo-eventticket.js index 7e631b6..8227c65 100644 --- a/nodejs/demo-eventticket.js +++ b/nodejs/demo-eventticket.js @@ -990,7 +990,7 @@ class DemoEventTicket { // Invoke the batch API calls let response = await this.httpClient.request({ - url: this.batchUrl, + url: this.batchUrl, // https://walletobjects.googleapis.com/batch method: 'POST', data: data, headers: { diff --git a/nodejs/demo-flight.js b/nodejs/demo-flight.js index b4bf025..d7ce622 100644 --- a/nodejs/demo-flight.js +++ b/nodejs/demo-flight.js @@ -951,7 +951,7 @@ class DemoFlight { // Invoke the batch API calls let response = await this.httpClient.request({ - url: this.batchUrl, + url: this.batchUrl, // https://walletobjects.googleapis.com/batch method: 'POST', data: data, headers: { diff --git a/nodejs/demo-generic.js b/nodejs/demo-generic.js index aaef37c..900d4f8 100644 --- a/nodejs/demo-generic.js +++ b/nodejs/demo-generic.js @@ -859,7 +859,7 @@ class DemoGeneric { // Invoke the batch API calls let response = await this.httpClient.request({ - url: this.batchUrl, + url: this.batchUrl, // https://walletobjects.googleapis.com/batch method: 'POST', data: data, headers: { diff --git a/nodejs/demo-giftcard.js b/nodejs/demo-giftcard.js index efe7473..8858df0 100644 --- a/nodejs/demo-giftcard.js +++ b/nodejs/demo-giftcard.js @@ -920,7 +920,7 @@ class DemoGiftCard { // Invoke the batch API calls let response = await this.httpClient.request({ - url: this.batchUrl, + url: this.batchUrl, // https://walletobjects.googleapis.com/batch method: 'POST', data: data, headers: { diff --git a/nodejs/demo-loyalty.js b/nodejs/demo-loyalty.js index 1bc88ed..e9f5051 100644 --- a/nodejs/demo-loyalty.js +++ b/nodejs/demo-loyalty.js @@ -941,7 +941,7 @@ class DemoLoyalty { // Invoke the batch API calls let response = await this.httpClient.request({ - url: this.batchUrl, + url: this.batchUrl, // https://walletobjects.googleapis.com/batch method: 'POST', data: data, headers: { diff --git a/nodejs/demo-offer.js b/nodejs/demo-offer.js index 1cd46ff..c73c9c8 100644 --- a/nodejs/demo-offer.js +++ b/nodejs/demo-offer.js @@ -923,7 +923,7 @@ class DemoOffer { // Invoke the batch API calls let response = await this.httpClient.request({ - url: this.batchUrl, + url: this.batchUrl, // https://walletobjects.googleapis.com/batch method: 'POST', data: data, headers: { diff --git a/nodejs/demo-transit.js b/nodejs/demo-transit.js index 1408b50..a283ecb 100644 --- a/nodejs/demo-transit.js +++ b/nodejs/demo-transit.js @@ -998,7 +998,7 @@ class DemoTransit { // Invoke the batch API calls let response = await this.httpClient.request({ - url: this.batchUrl, + url: this.batchUrl, // https://walletobjects.googleapis.com/batch method: 'POST', data: data, headers: { diff --git a/python/demo_eventticket.py b/python/demo_eventticket.py index 4f1cfc7..0a0a6c6 100644 --- a/python/demo_eventticket.py +++ b/python/demo_eventticket.py @@ -901,7 +901,7 @@ class DemoEventTicket: # Invoke the batch API calls response = self.http_client.post( - url=self.batch_url, + url=self.batch_url, # https://walletobjects.googleapis.com/batch data=data, headers={ # `boundary` is the delimiter between API calls in the batch request diff --git a/python/demo_flight.py b/python/demo_flight.py index fa2a518..7d50fab 100644 --- a/python/demo_flight.py +++ b/python/demo_flight.py @@ -862,7 +862,7 @@ class DemoFlight: # Invoke the batch API calls response = self.http_client.post( - url=self.batch_url, + url=self.batch_url, # https://walletobjects.googleapis.com/batch data=data, headers={ # `boundary` is the delimiter between API calls in the batch request diff --git a/python/demo_generic.py b/python/demo_generic.py index bc85011..a151e55 100644 --- a/python/demo_generic.py +++ b/python/demo_generic.py @@ -871,7 +871,7 @@ class DemoGeneric: # Invoke the batch API calls response = self.http_client.post( - url=self.batch_url, + url=self.batch_url, # https://walletobjects.googleapis.com/batch data=data, headers={ # `boundary` is the delimiter between API calls in the batch request diff --git a/python/demo_giftcard.py b/python/demo_giftcard.py index 290d4dd..020af1f 100644 --- a/python/demo_giftcard.py +++ b/python/demo_giftcard.py @@ -831,7 +831,7 @@ class DemoGiftCard: # Invoke the batch API calls response = self.http_client.post( - url='https://walletobjects.googleapis.com/batch', + url=self.batch_url, # https://walletobjects.googleapis.com/batch data=data, headers={ # `boundary` is the delimiter between API calls in the batch request diff --git a/python/demo_loyalty.py b/python/demo_loyalty.py index 3b04217..3439b0a 100644 --- a/python/demo_loyalty.py +++ b/python/demo_loyalty.py @@ -854,7 +854,7 @@ class DemoLoyalty: # Invoke the batch API calls response = self.http_client.post( - url='https://walletobjects.googleapis.com/batch', + url=self.batch_url, # https://walletobjects.googleapis.com/batch data=data, headers={ # `boundary` is the delimiter between API calls in the batch request diff --git a/python/demo_offer.py b/python/demo_offer.py index 27253cd..f70dd39 100644 --- a/python/demo_offer.py +++ b/python/demo_offer.py @@ -834,7 +834,7 @@ class DemoOffer: # Invoke the batch API calls response = self.http_client.post( - url='https://walletobjects.googleapis.com/batch', + url=self.batch_url, # https://walletobjects.googleapis.com/batch data=data, headers={ # `boundary` is the delimiter between API calls in the batch request diff --git a/python/demo_transit.py b/python/demo_transit.py index 8ed9c3b..2b4371f 100644 --- a/python/demo_transit.py +++ b/python/demo_transit.py @@ -911,7 +911,7 @@ class DemoTransit: # Invoke the batch API calls response = self.http_client.post( - url='https://walletobjects.googleapis.com/batch', + url=self.batch_url, # https://walletobjects.googleapis.com/batch data=data, headers={ # `boundary` is the delimiter between API calls in the batch request