gen: make androidpublisher PurchaseType a pointer field.
Clients need to differentiate between 0 and unset.
Fixes #275.
Change-Id: Ib5b8c080d9546c0fa2b5ca50ab3957b325e1203d
Reviewed-on: https://code-review.googlesource.com/30570
Reviewed-by: Jean de Klerk <deklerk@google.com>
diff --git a/androidpublisher/v1.1/androidpublisher-gen.go b/androidpublisher/v1.1/androidpublisher-gen.go
index 07d0e24..e140ea6 100644
--- a/androidpublisher/v1.1/androidpublisher-gen.go
+++ b/androidpublisher/v1.1/androidpublisher-gen.go
@@ -132,7 +132,7 @@
// billing flow. Possible values are:
// - Test (i.e. purchased from a license testing account)
// - Promo (i.e. purchased using a promo code)
- PurchaseType int64 `json:"purchaseType,omitempty"`
+ PurchaseType *int64 `json:"purchaseType,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
diff --git a/androidpublisher/v2/androidpublisher-gen.go b/androidpublisher/v2/androidpublisher-gen.go
index d4ecf54..208af0d 100644
--- a/androidpublisher/v2/androidpublisher-gen.go
+++ b/androidpublisher/v2/androidpublisher-gen.go
@@ -1509,7 +1509,7 @@
// billing flow. Possible values are:
// - Test (i.e. purchased from a license testing account)
// - Promo (i.e. purchased using a promo code)
- PurchaseType int64 `json:"purchaseType,omitempty"`
+ PurchaseType *int64 `json:"purchaseType,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
diff --git a/androidpublisher/v3/androidpublisher-gen.go b/androidpublisher/v3/androidpublisher-gen.go
index 78a15ec..980c55a 100644
--- a/androidpublisher/v3/androidpublisher-gen.go
+++ b/androidpublisher/v3/androidpublisher-gen.go
@@ -1459,7 +1459,7 @@
// billing flow. Possible values are:
// - Test (i.e. purchased from a license testing account)
// - Promo (i.e. purchased using a promo code)
- PurchaseType int64 `json:"purchaseType,omitempty"`
+ PurchaseType *int64 `json:"purchaseType,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
diff --git a/google-api-go-generator/gen.go b/google-api-go-generator/gen.go
index 8f37db7..201335d 100644
--- a/google-api-go-generator/gen.go
+++ b/google-api-go-generator/gen.go
@@ -803,6 +803,9 @@
// This makes it possible to distinguish between a field being unset vs having
// an empty value.
var pointerFields = []fieldName{
+ {api: "androidpublisher:v1.1", schema: "InappPurchase", field: "PurchaseType"},
+ {api: "androidpublisher:v2", schema: "ProductPurchase", field: "PurchaseType"},
+ {api: "androidpublisher:v3", schema: "ProductPurchase", field: "PurchaseType"},
{api: "androidpublisher:v2", schema: "SubscriptionPurchase", field: "CancelReason"},
{api: "androidpublisher:v2", schema: "SubscriptionPurchase", field: "PaymentState"},
{api: "cloudmonitoring:v2beta2", schema: "Point", field: "BoolValue"},