Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update via SDK Studio #96

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.23"
".": "0.1.0-alpha.24"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/terminal%2Fterminal-aec664b754b331c7446e35e745ff99e8c95dd67562e5588fec96ad269f06bf55.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/terminal%2Fterminal-4a086f87c6798bfcbf445efb078d6c69c00fbf26d4b5e695ca8f5b7030d811ca.yml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/terminaldotshop/[email protected].23'
go get -u 'github.com/terminaldotshop/[email protected].24'
```

<!-- x-release-please-end -->
Expand Down
3 changes: 3 additions & 0 deletions aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ type CartAmount = shared.CartAmount
// This is an alias to an internal type.
type CartItem = shared.CartItem

// This is an alias to an internal type.
type CartShipping = shared.CartShipping

// This is an alias to an internal type.
type Order = shared.Order

Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "0.1.0-alpha.23" // x-release-please-version
const PackageVersion = "0.1.0-alpha.24" // x-release-please-version
45 changes: 37 additions & 8 deletions shared/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Address struct {
Province string `json:"province,required"`
Street1 string `json:"street1,required"`
Zip string `json:"zip,required"`
Phone string `json:"phone"`
Street2 string `json:"street2"`
JSON addressJSON `json:"-"`
}
Expand All @@ -26,6 +27,7 @@ type addressJSON struct {
Province apijson.Field
Street1 apijson.Field
Zip apijson.Field
Phone apijson.Field
Street2 apijson.Field
raw string
ExtraFields map[string]apijson.Field
Expand All @@ -46,6 +48,7 @@ type AddressParam struct {
Province param.Field[string] `json:"province,required"`
Street1 param.Field[string] `json:"street1,required"`
Zip param.Field[string] `json:"zip,required"`
Phone param.Field[string] `json:"phone"`
Street2 param.Field[string] `json:"street2"`
}

Expand Down Expand Up @@ -102,12 +105,13 @@ func (r cardExpirationJSON) RawJSON() string {
}

type Cart struct {
Amount CartAmount `json:"amount,required"`
Items []CartItem `json:"items,required"`
Subtotal int64 `json:"subtotal,required"`
CardID string `json:"cardID"`
ShippingID string `json:"shippingID"`
JSON cartJSON `json:"-"`
Amount CartAmount `json:"amount,required"`
Items []CartItem `json:"items,required"`
Subtotal int64 `json:"subtotal,required"`
CardID string `json:"cardID"`
Shipping CartShipping `json:"shipping"`
ShippingID string `json:"shippingID"`
JSON cartJSON `json:"-"`
}

// cartJSON contains the JSON metadata for the struct [Cart]
Expand All @@ -116,6 +120,7 @@ type cartJSON struct {
Items apijson.Field
Subtotal apijson.Field
CardID apijson.Field
Shipping apijson.Field
ShippingID apijson.Field
raw string
ExtraFields map[string]apijson.Field
Expand All @@ -130,15 +135,15 @@ func (r cartJSON) RawJSON() string {
}

type CartAmount struct {
Shipping int64 `json:"shipping,required"`
Subtotal int64 `json:"subtotal,required"`
Shipping int64 `json:"shipping"`
JSON cartAmountJSON `json:"-"`
}

// cartAmountJSON contains the JSON metadata for the struct [CartAmount]
type cartAmountJSON struct {
Shipping apijson.Field
Subtotal apijson.Field
Shipping apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -177,6 +182,28 @@ func (r cartItemJSON) RawJSON() string {
return r.raw
}

type CartShipping struct {
Service string `json:"service"`
Timeframe string `json:"timeframe"`
JSON cartShippingJSON `json:"-"`
}

// cartShippingJSON contains the JSON metadata for the struct [CartShipping]
type cartShippingJSON struct {
Service apijson.Field
Timeframe apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *CartShipping) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r cartShippingJSON) RawJSON() string {
return r.raw
}

type Order struct {
ID string `json:"id,required"`
Amount OrderAmount `json:"amount,required"`
Expand Down Expand Up @@ -262,6 +289,7 @@ type OrderShipping struct {
Province string `json:"province,required"`
Street1 string `json:"street1,required"`
Zip string `json:"zip,required"`
Phone string `json:"phone"`
Street2 string `json:"street2"`
JSON orderShippingJSON `json:"-"`
}
Expand All @@ -274,6 +302,7 @@ type orderShippingJSON struct {
Province apijson.Field
Street1 apijson.Field
Zip apijson.Field
Phone apijson.Field
Street2 apijson.Field
raw string
ExtraFields map[string]apijson.Field
Expand Down
1 change: 1 addition & 0 deletions usershipping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestUserShippingNewWithOptionalParams(t *testing.T) {
Province: terminal.F("string"),
Country: terminal.F("xx"),
Zip: terminal.F("string"),
Phone: terminal.F("string"),
},
})
if err != nil {
Expand Down