From 266cda7bd6ecd3d27e71db434593c74e0b81f9df Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Tue, 17 Apr 2018 23:01:32 -0400 Subject: [PATCH] Review fixes - Properly move remaining int to int64 - Rename Values to Data on missed List structs --- account.go | 6 +++--- dispute.go | 4 ++-- exchangerate.go | 2 +- exchangerate/client.go | 4 ++-- params.go | 2 +- sourcetransaction.go | 2 +- sourcetransaction/client.go | 4 ++-- topup.go | 2 +- topup/client.go | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/account.go b/account.go index 12cba40641..8c3a729083 100644 --- a/account.go +++ b/account.go @@ -400,9 +400,9 @@ type AccountAddress struct { // DOB is a structure for an account owner's date of birth. type DOB struct { - Day int `json:"day"` - Month int `json:"month"` - Year int `json:"year"` + Day int64 `json:"day"` + Month int64 `json:"month"` + Year int64 `json:"year"` } // Gender is the gender of an account owner. International regulations require diff --git a/dispute.go b/dispute.go index c69ea272d9..d3dc1083b0 100644 --- a/dispute.go +++ b/dispute.go @@ -94,7 +94,7 @@ type EvidenceDetails struct { DueBy int64 `json:"due_by"` HasEvidence bool `json:"has_evidence"` PastDue bool `json:"past_due"` - SubmissionCount int `json:"submission_count"` + SubmissionCount int64 `json:"submission_count"` } // DisputeEvidence is the structure that contains various details about @@ -137,7 +137,7 @@ type File struct { ID string `json:"id"` MIMEType string `json:"mime_type"` Purpose string `json:"purpose"` - Size int `json:"size"` + Size int64 `json:"size"` URL string `json:"url"` } diff --git a/exchangerate.go b/exchangerate.go index 7d22cdb819..d78ee714aa 100644 --- a/exchangerate.go +++ b/exchangerate.go @@ -10,7 +10,7 @@ type ExchangeRate struct { // ExchangeRateList is a list of exchange rates as retrieved from a list endpoint. type ExchangeRateList struct { ListMeta - Values []*ExchangeRate `json:"data"` + Data []*ExchangeRate `json:"data"` } // ExchangeRateListParams are the parameters allowed during ExchangeRate listing. diff --git a/exchangerate/client.go b/exchangerate/client.go index e210d9e3c4..a9e02743d6 100644 --- a/exchangerate/client.go +++ b/exchangerate/client.go @@ -45,8 +45,8 @@ func (c Client) List(params *stripe.ExchangeRateListParams) *Iter { list := &stripe.ExchangeRateList{} err := c.B.Call("GET", "/exchange_rates", c.Key, b, p, list) - ret := make([]interface{}, len(list.Values)) - for i, v := range list.Values { + ret := make([]interface{}, len(list.Data)) + for i, v := range list.Data { ret[i] = v } diff --git a/params.go b/params.go index dbf3cc574a..bc74f61b16 100644 --- a/params.go +++ b/params.go @@ -78,7 +78,7 @@ type ListParams struct { EndingBefore string `form:"ending_before"` Expand []string `form:"expand"` Filters Filters `form:"*"` - Limit int `form:"limit"` + Limit int64 `form:"limit"` // Single specifies whether this is a single page iterator. By default, // listing through an iterator will automatically grab additional pages as diff --git a/sourcetransaction.go b/sourcetransaction.go index 204931a2fa..1d0b4f2616 100644 --- a/sourcetransaction.go +++ b/sourcetransaction.go @@ -11,7 +11,7 @@ type SourceTransactionListParams struct { // SourceTransactionList is a list object for SourceTransactions. type SourceTransactionList struct { ListMeta - Values []*SourceTransaction `json:"data"` + Data []*SourceTransaction `json:"data"` } // SourceTransaction is the resource representing a Stripe source transaction. diff --git a/sourcetransaction/client.go b/sourcetransaction/client.go index 2f161d3f6c..0faa418336 100644 --- a/sourcetransaction/client.go +++ b/sourcetransaction/client.go @@ -40,8 +40,8 @@ func (c Client) List(params *stripe.SourceTransactionListParams) *Iter { err = errors.New("Invalid source transaction params: Source needs to be set") } - ret := make([]interface{}, len(list.Values)) - for i, v := range list.Values { + ret := make([]interface{}, len(list.Data)) + for i, v := range list.Data { ret[i] = v } diff --git a/topup.go b/topup.go index 912fecf37c..2ac8092dc7 100644 --- a/topup.go +++ b/topup.go @@ -30,7 +30,7 @@ type TopupListParams struct { // TopupList is a list of top-ups as retrieved from a list endpoint. type TopupList struct { ListMeta - Values []*Topup `json:"data"` + Data []*Topup `json:"data"` } // Topup is the resource representing a Stripe top-up. diff --git a/topup/client.go b/topup/client.go index 46cda3e1cd..10b46e1e96 100644 --- a/topup/client.go +++ b/topup/client.go @@ -93,8 +93,8 @@ func (c Client) List(params *stripe.TopupListParams) *Iter { list := &stripe.TopupList{} err := c.B.Call("GET", "/topups", c.Key, b, p, list) - ret := make([]interface{}, len(list.Values)) - for i, v := range list.Values { + ret := make([]interface{}, len(list.Data)) + for i, v := range list.Data { ret[i] = v }