Skip to content

Commit

Permalink
Merge upstream and update generated code for v601
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Oct 13, 2023
2 parents 30554b9 + df184f1 commit a9787b8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v600
v601
2 changes: 1 addition & 1 deletion issuing_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ type IssuingTokenNetworkData struct {
WalletProvider *IssuingTokenNetworkDataWalletProvider `json:"wallet_provider"`
}

// An issuing token object is created when an issued card is added to a digital wallet. As a [card issuer](https://stripe.com/docs/issuing), you can view and manage these tokens through Stripe.
// An issuing token object is created when an issued card is added to a digital wallet. As a [card issuer](https://stripe.com/docs/issuing), you can [view and manage these tokens](https://stripe.com/docs/issuing/controls/token-management) through Stripe.
type IssuingToken struct {
APIResource
// Card associated with this token.
Expand Down
21 changes: 0 additions & 21 deletions source.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package stripe

import "encoding/json"

// The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0).
type SourceCodeVerificationStatus string

Expand Down Expand Up @@ -626,22 +624,3 @@ type Source struct {
Usage SourceUsage `json:"usage"`
WeChat *SourceWeChat `json:"wechat"`
}

// UnmarshalJSON handles deserialization of a Source.
// This custom unmarshaling is needed because the resulting
// property may be an id or the full struct if it was expanded.
func (s *Source) UnmarshalJSON(data []byte) error {
if id, ok := ParseID(data); ok {
s.ID = id
return nil
}

type source Source
var v source
if err := json.Unmarshal(data, &v); err != nil {
return err
}

*s = Source(v)
return nil
}
13 changes: 11 additions & 2 deletions stripe.go
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,7 @@ func Int64Slice(v []int64) []*int64 {
return out
}

// NewBackends creates a new set of backends with the given HTTP client. You
// should only need to use this for testing purposes or on App Engine.
// NewBackends creates a new set of backends with the given HTTP client.
func NewBackends(httpClient *http.Client) *Backends {
apiConfig := &BackendConfig{HTTPClient: httpClient}
connectConfig := &BackendConfig{HTTPClient: httpClient}
Expand All @@ -1203,6 +1202,16 @@ func NewBackends(httpClient *http.Client) *Backends {
}
}

// NewBackendsWithConfig creates a new set of backends with the given config for all backends.
// Useful for setting up client with a custom logger and http client.
func NewBackendsWithConfig(config *BackendConfig) *Backends {
return &Backends{
API: GetBackendWithConfig(APIBackend, config),
Connect: GetBackendWithConfig(ConnectBackend, config),
Uploads: GetBackendWithConfig(UploadsBackend, config),
}
}

// ParseID attempts to parse a string scalar from a given JSON value which is
// still encoded as []byte. If the value was a string, it returns the string
// along with true as the second return value. If not, false is returned as the
Expand Down

0 comments on commit a9787b8

Please sign in to comment.