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

release: 0.1.0-alpha.43 #167

Merged
merged 3 commits into from
Dec 16, 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.42"
".": "0.1.0-alpha.43"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/terminal%2Fterminal-021e5a9aa9e248a4b6ba60431861583dd6a44ed0f18223360cce035209347883.yml
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/terminal%2Fterminal-9bd3e770ac1c373832d7c1143f25c52015bbaef6ea57c6610eb8f83fc8a5517d.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.43 (2024-12-16)

Full Changelog: [v0.1.0-alpha.42...v0.1.0-alpha.43](https://github.com/terminaldotshop/terminal-sdk-go/compare/v0.1.0-alpha.42...v0.1.0-alpha.43)

### Features

* **api:** manual updates ([#166](https://github.com/terminaldotshop/terminal-sdk-go/issues/166)) ([3d1dc54](https://github.com/terminaldotshop/terminal-sdk-go/commit/3d1dc54ef1b9e574987991449ebc0832c03ae241))

## 0.1.0-alpha.42 (2024-12-16)

Full Changelog: [v0.1.0-alpha.41...v0.1.0-alpha.42](https://github.com/terminaldotshop/terminal-sdk-go/compare/v0.1.0-alpha.41...v0.1.0-alpha.42)
Expand Down
14 changes: 7 additions & 7 deletions 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].42'
go get -u 'github.com/terminaldotshop/[email protected].43'
```

<!-- x-release-please-end -->
Expand Down Expand Up @@ -53,7 +53,7 @@ func main() {
option.WithBearerToken("My Bearer Token"), // defaults to os.LookupEnv("TERMINAL_BEARER_TOKEN")
option.WithEnvironmentSandbox(), // defaults to option.WithEnvironmentProduction()
)
product, err := client.Products.List(context.TODO())
product, err := client.Product.List(context.TODO())
if err != nil {
panic(err.Error())
}
Expand Down Expand Up @@ -146,7 +146,7 @@ client := terminal.NewClient(
option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Products.List(context.TODO(), ...,
client.Product.List(context.TODO(), ...,
// Override the header
option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
// Add an undocumented field to the request body, using sjson syntax
Expand Down Expand Up @@ -175,14 +175,14 @@ When the API returns a non-success status code, we return an error with type
To handle errors, we recommend that you use the `errors.As` pattern:

```go
_, err := client.Products.List(context.TODO())
_, err := client.Product.List(context.TODO())
if err != nil {
var apierr *terminal.Error
if errors.As(err, &apierr) {
println(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request
println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
}
panic(err.Error()) // GET "/products": 400 Bad Request { ... }
panic(err.Error()) // GET "/product": 400 Bad Request { ... }
}
```

Expand All @@ -200,7 +200,7 @@ To set a per-retry timeout, use `option.WithRequestTimeout()`.
// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Products.List(
client.Product.List(
ctx,
// This sets the per-retry timeout
option.WithRequestTimeout(20*time.Second),
Expand Down Expand Up @@ -235,7 +235,7 @@ client := terminal.NewClient(
)

// Override per-request:
client.Products.List(context.TODO(), option.WithMaxRetries(5))
client.Product.List(context.TODO(), option.WithMaxRetries(5))
```

### Making custom/undocumented requests
Expand Down
6 changes: 3 additions & 3 deletions address.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ func NewAddressService(opts ...option.RequestOption) (r *AddressService) {
// Create and add a shipping address to the current user.
func (r *AddressService) New(ctx context.Context, body AddressNewParams, opts ...option.RequestOption) (res *AddressNewResponse, err error) {
opts = append(r.Options[:], opts...)
path := "addresses"
path := "address"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}

// Get the shipping addresses associated with the current user.
func (r *AddressService) List(ctx context.Context, opts ...option.RequestOption) (res *AddressListResponse, err error) {
opts = append(r.Options[:], opts...)
path := "addresses"
path := "address"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return
}
Expand All @@ -56,7 +56,7 @@ func (r *AddressService) Delete(ctx context.Context, id string, opts ...option.R
err = errors.New("missing required id parameter")
return
}
path := fmt.Sprintf("addresses/%s", id)
path := fmt.Sprintf("address/%s", id)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...)
return
}
Expand Down
6 changes: 3 additions & 3 deletions address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestAddressNewWithOptionalParams(t *testing.T) {
option.WithBaseURL(baseURL),
option.WithBearerToken("My Bearer Token"),
)
_, err := client.Addresses.New(context.TODO(), terminal.AddressNewParams{
_, err := client.Address.New(context.TODO(), terminal.AddressNewParams{
City: terminal.F("Anytown"),
Country: terminal.F("US"),
Name: terminal.F("John Doe"),
Expand Down Expand Up @@ -56,7 +56,7 @@ func TestAddressList(t *testing.T) {
option.WithBaseURL(baseURL),
option.WithBearerToken("My Bearer Token"),
)
_, err := client.Addresses.List(context.TODO())
_, err := client.Address.List(context.TODO())
if err != nil {
var apierr *terminal.Error
if errors.As(err, &apierr) {
Expand All @@ -78,7 +78,7 @@ func TestAddressDelete(t *testing.T) {
option.WithBaseURL(baseURL),
option.WithBearerToken("My Bearer Token"),
)
_, err := client.Addresses.Delete(context.TODO(), "shp_XXXXXXXXXXXXXXXXXXXXXXXXX")
_, err := client.Address.Delete(context.TODO(), "shp_XXXXXXXXXXXXXXXXXXXXXXXXX")
if err != nil {
var apierr *terminal.Error
if errors.As(err, &apierr) {
Expand Down
Loading
Loading