Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 17, 2024
1 parent 468fbb4 commit 82ea930
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 4
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/terminal%2Fterminal-23e90546c4bf1be2d0a64eb4c36415c138a8db4013127d548b3135bb73840887.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/terminal%2Fterminal-95d2bc2ea3df675ba1a13a3d546b9d62d37993ae994d577bdd6888173a4e5ec5.yml
1 change: 0 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Methods:

Response Types:

- <a href="https://pkg.go.dev/github.com/terminaldotshop/terminal-sdk-go">terminal</a>.<a href="https://pkg.go.dev/github.com/terminaldotshop/terminal-sdk-go#User">User</a>
- <a href="https://pkg.go.dev/github.com/terminaldotshop/terminal-sdk-go">terminal</a>.<a href="https://pkg.go.dev/github.com/terminaldotshop/terminal-sdk-go#UserMeResponse">UserMeResponse</a>

Methods:
Expand Down
53 changes: 27 additions & 26 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,48 +37,49 @@ func (r *UserService) Me(ctx context.Context, opts ...option.RequestOption) (res
return
}

type User struct {
ID string `json:"id,required"`
Email string `json:"email,required,nullable"`
Fingerprint string `json:"fingerprint,required,nullable"`
StripeCustomerID string `json:"stripeCustomerID,required"`
JSON userJSON `json:"-"`
type UserMeResponse struct {
Result UserMeResponseResult `json:"result,required"`
JSON userMeResponseJSON `json:"-"`
}

// userJSON contains the JSON metadata for the struct [User]
type userJSON struct {
ID apijson.Field
Email apijson.Field
Fingerprint apijson.Field
StripeCustomerID apijson.Field
raw string
ExtraFields map[string]apijson.Field
// userMeResponseJSON contains the JSON metadata for the struct [UserMeResponse]
type userMeResponseJSON struct {
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

func (r userJSON) RawJSON() string {
func (r userMeResponseJSON) RawJSON() string {
return r.raw
}

type UserMeResponse struct {
Result User `json:"result,required"`
JSON userMeResponseJSON `json:"-"`
type UserMeResponseResult struct {
ID string `json:"id,required"`
Email string `json:"email,required,nullable"`
Fingerprint string `json:"fingerprint,required,nullable"`
StripeCustomerID string `json:"stripeCustomerID,required"`
JSON userMeResponseResultJSON `json:"-"`
}

// userMeResponseJSON contains the JSON metadata for the struct [UserMeResponse]
type userMeResponseJSON struct {
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
// userMeResponseResultJSON contains the JSON metadata for the struct
// [UserMeResponseResult]
type userMeResponseResultJSON struct {
ID apijson.Field
Email apijson.Field
Fingerprint apijson.Field
StripeCustomerID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

func (r userMeResponseJSON) RawJSON() string {
func (r userMeResponseResultJSON) RawJSON() string {
return r.raw
}

0 comments on commit 82ea930

Please sign in to comment.