Skip to content

Commit bdbbdba

Browse files
feat(api): manual updates
1 parent fcf606f commit bdbbdba

14 files changed

+651
-24
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 19
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper%2Fbeeper-desktop-api-3f6555bfea11258c6e8882455360ae08202067a270313716ee15571b83ada577.yml
3-
openapi_spec_hash: 020324a708981384284f8fad8ac8c66c
4-
config_hash: 48ff2d23c2ebc82bd3c15787f0041684
1+
configured_endpoints: 23
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper%2Fbeeper-desktop-api-ee25e67fc85ccc86cedb2ca0865385709877582132103e0afa68d7b43551784a.yml
3+
openapi_spec_hash: d41fd99c9a8645a1fd69c519cd25a637
4+
config_hash: 01fba090f51e67f4dfd3a4fa6c53d665

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
The Beeper Desktop Go library provides convenient access to the [Beeper Desktop REST API](https://developers.beeper.com/desktop-api/)
1010
from applications written in Go.
1111

12+
## MCP Server
13+
14+
Use the Beeper Desktop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
15+
16+
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40beeper%2Fdesktop-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBiZWVwZXIvZGVza3RvcC1tY3AiXSwiZW52Ijp7IkJFRVBFUl9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4ifX0)
17+
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40beeper%2Fdesktop-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40beeper%2Fdesktop-mcp%22%5D%2C%22env%22%3A%7B%22BEEPER_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%7D%7D)
18+
19+
> Note: You may need to set environment variables in your MCP client.
20+
1221
## Installation
1322

1423
<!-- x-release-please-start-version -->

account.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,11 @@ func (r *AccountService) List(ctx context.Context, opts ...option.RequestOption)
5151
type Account struct {
5252
// Chat account added to Beeper. Use this to route account-scoped actions.
5353
AccountID string `json:"accountID,required"`
54-
// Display-only human-readable network name (e.g., 'WhatsApp', 'Messenger').
55-
//
56-
// Deprecated: deprecated
57-
Network string `json:"network,required"`
5854
// User the account belongs to.
5955
User shared.User `json:"user,required"`
6056
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
6157
JSON struct {
6258
AccountID respjson.Field
63-
Network respjson.Field
6459
User respjson.Field
6560
ExtraFields map[string]respjson.Field
6661
raw string

accountcontact.go

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
"github.com/beeper/desktop-api-go/internal/apiquery"
1515
"github.com/beeper/desktop-api-go/internal/requestconfig"
1616
"github.com/beeper/desktop-api-go/option"
17+
"github.com/beeper/desktop-api-go/packages/pagination"
18+
"github.com/beeper/desktop-api-go/packages/param"
1719
"github.com/beeper/desktop-api-go/packages/respjson"
1820
"github.com/beeper/desktop-api-go/shared"
1921
)
@@ -39,6 +41,33 @@ func NewAccountContactService(opts ...option.RequestOption) (r AccountContactSer
3941
return
4042
}
4143

44+
// List merged contacts for a specific account with cursor-based pagination.
45+
func (r *AccountContactService) List(ctx context.Context, accountID string, query AccountContactListParams, opts ...option.RequestOption) (res *pagination.CursorSearch[shared.User], err error) {
46+
var raw *http.Response
47+
opts = slices.Concat(r.Options, opts)
48+
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
49+
if accountID == "" {
50+
err = errors.New("missing required accountID parameter")
51+
return
52+
}
53+
path := fmt.Sprintf("v1/accounts/%s/contacts/list", accountID)
54+
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
55+
if err != nil {
56+
return nil, err
57+
}
58+
err = cfg.Execute()
59+
if err != nil {
60+
return nil, err
61+
}
62+
res.SetPageConfig(cfg, raw)
63+
return res, nil
64+
}
65+
66+
// List merged contacts for a specific account with cursor-based pagination.
67+
func (r *AccountContactService) ListAutoPaging(ctx context.Context, accountID string, query AccountContactListParams, opts ...option.RequestOption) *pagination.CursorSearchAutoPager[shared.User] {
68+
return pagination.NewCursorSearchAutoPager(r.List(ctx, accountID, query, opts...))
69+
}
70+
4271
// Search contacts on a specific account using merged account contacts, network
4372
// search, and exact identifier lookup.
4473
func (r *AccountContactService) Search(ctx context.Context, accountID string, query AccountContactSearchParams, opts ...option.RequestOption) (res *AccountContactSearchResponse, err error) {
@@ -68,6 +97,39 @@ func (r *AccountContactSearchResponse) UnmarshalJSON(data []byte) error {
6897
return apijson.UnmarshalRoot(data, r)
6998
}
7099

100+
type AccountContactListParams struct {
101+
// Opaque pagination cursor; do not inspect. Use together with 'direction'.
102+
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
103+
// Maximum contacts to return per page.
104+
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
105+
// Optional search query for blended contact lookup.
106+
Query param.Opt[string] `query:"query,omitzero" json:"-"`
107+
// Pagination direction used with 'cursor': 'before' fetches older results, 'after'
108+
// fetches newer results. Defaults to 'before' when only 'cursor' is provided.
109+
//
110+
// Any of "after", "before".
111+
Direction AccountContactListParamsDirection `query:"direction,omitzero" json:"-"`
112+
paramObj
113+
}
114+
115+
// URLQuery serializes [AccountContactListParams]'s query parameters as
116+
// `url.Values`.
117+
func (r AccountContactListParams) URLQuery() (v url.Values, err error) {
118+
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
119+
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
120+
NestedFormat: apiquery.NestedQueryFormatBrackets,
121+
})
122+
}
123+
124+
// Pagination direction used with 'cursor': 'before' fetches older results, 'after'
125+
// fetches newer results. Defaults to 'before' when only 'cursor' is provided.
126+
type AccountContactListParamsDirection string
127+
128+
const (
129+
AccountContactListParamsDirectionAfter AccountContactListParamsDirection = "after"
130+
AccountContactListParamsDirectionBefore AccountContactListParamsDirection = "before"
131+
)
132+
71133
type AccountContactSearchParams struct {
72134
// Text to search users by. Network-specific behavior.
73135
Query string `query:"query,required" json:"-"`

accountcontact_test.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,37 @@ import (
1313
"github.com/beeper/desktop-api-go/option"
1414
)
1515

16+
func TestAccountContactListWithOptionalParams(t *testing.T) {
17+
baseURL := "http://localhost:4010"
18+
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
19+
baseURL = envURL
20+
}
21+
if !testutil.CheckTestServer(t, baseURL) {
22+
return
23+
}
24+
client := beeperdesktopapi.NewClient(
25+
option.WithBaseURL(baseURL),
26+
option.WithAccessToken("My Access Token"),
27+
)
28+
_, err := client.Accounts.Contacts.List(
29+
context.TODO(),
30+
"accountID",
31+
beeperdesktopapi.AccountContactListParams{
32+
Cursor: beeperdesktopapi.String("1725489123456|c29tZUltc2dQYWdl"),
33+
Direction: beeperdesktopapi.AccountContactListParamsDirectionBefore,
34+
Limit: beeperdesktopapi.Int(1),
35+
Query: beeperdesktopapi.String("x"),
36+
},
37+
)
38+
if err != nil {
39+
var apierr *beeperdesktopapi.Error
40+
if errors.As(err, &apierr) {
41+
t.Log(string(apierr.DumpRequest(true)))
42+
}
43+
t.Fatalf("err should be nil: %s", err.Error())
44+
}
45+
}
46+
1647
func TestAccountContactSearch(t *testing.T) {
1748
baseURL := "http://localhost:4010"
1849
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {

api.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Response Types:
3535

3636
Methods:
3737

38+
- <code title="get /v1/accounts/{accountID}/contacts/list">client.Accounts.Contacts.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AccountContactService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, accountID <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AccountContactListParams">AccountContactListParams</a>) (\*<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go/packages/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go/packages/pagination#CursorSearch">CursorSearch</a>[<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go/shared#User">User</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
3839
- <code title="get /v1/accounts/{accountID}/contacts">client.Accounts.Contacts.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AccountContactService.Search">Search</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, accountID <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AccountContactSearchParams">AccountContactSearchParams</a>) (\*<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AccountContactSearchResponse">AccountContactSearchResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
3940

4041
# Chats
@@ -60,6 +61,20 @@ Methods:
6061
- <code title="post /v1/chats/{chatID}/reminders">client.Chats.Reminders.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatReminderService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, chatID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatReminderNewParams">ChatReminderNewParams</a>) <a href="https://pkg.go.dev/builtin#error">error</a></code>
6162
- <code title="delete /v1/chats/{chatID}/reminders">client.Chats.Reminders.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatReminderService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, chatID <a href="https://pkg.go.dev/builtin#string">string</a>) <a href="https://pkg.go.dev/builtin#error">error</a></code>
6263

64+
## Messages
65+
66+
### Reactions
67+
68+
Response Types:
69+
70+
- <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatMessageReactionDeleteResponse">ChatMessageReactionDeleteResponse</a>
71+
- <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatMessageReactionAddResponse">ChatMessageReactionAddResponse</a>
72+
73+
Methods:
74+
75+
- <code title="delete /v1/chats/{chatID}/messages/{messageID}/reactions">client.Chats.Messages.Reactions.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatMessageReactionService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, messageID <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatMessageReactionDeleteParams">ChatMessageReactionDeleteParams</a>) (\*<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatMessageReactionDeleteResponse">ChatMessageReactionDeleteResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
76+
- <code title="post /v1/chats/{chatID}/messages/{messageID}/reactions">client.Chats.Messages.Reactions.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatMessageReactionService.Add">Add</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, messageID <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatMessageReactionAddParams">ChatMessageReactionAddParams</a>) (\*<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#ChatMessageReactionAddResponse">ChatMessageReactionAddResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
77+
6378
# Messages
6479

6580
Response Types:
@@ -88,3 +103,13 @@ Methods:
88103
- <code title="get /v1/assets/serve">client.Assets.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AssetService.Serve">Serve</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AssetServeParams">AssetServeParams</a>) <a href="https://pkg.go.dev/builtin#error">error</a></code>
89104
- <code title="post /v1/assets/upload">client.Assets.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AssetService.Upload">Upload</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AssetUploadParams">AssetUploadParams</a>) (\*<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AssetUploadResponse">AssetUploadResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
90105
- <code title="post /v1/assets/upload/base64">client.Assets.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AssetService.UploadBase64">UploadBase64</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AssetUploadBase64Params">AssetUploadBase64Params</a>) (\*<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#AssetUploadBase64Response">AssetUploadBase64Response</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
106+
107+
# Info
108+
109+
Response Types:
110+
111+
- <a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#InfoGetResponse">InfoGetResponse</a>
112+
113+
Methods:
114+
115+
- <code title="get /v1/info">client.Info.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#InfoService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>) (\*<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go">beeperdesktopapi</a>.<a href="https://pkg.go.dev/github.com/beeper/desktop-api-go#InfoGetResponse">InfoGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

chat.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type ChatService struct {
3333
Options []option.RequestOption
3434
// Manage reminders for chats
3535
Reminders ChatReminderService
36+
// Manage chat messages
37+
Messages ChatMessageService
3638
}
3739

3840
// NewChatService generates a new service that applies the given options to each
@@ -42,6 +44,7 @@ func NewChatService(opts ...option.RequestOption) (r ChatService) {
4244
r = ChatService{}
4345
r.Options = opts
4446
r.Reminders = NewChatReminderService(opts...)
47+
r.Messages = NewChatMessageService(opts...)
4548
return
4649
}
4750

@@ -135,10 +138,6 @@ type Chat struct {
135138
ID string `json:"id,required"`
136139
// Account ID this chat belongs to.
137140
AccountID string `json:"accountID,required"`
138-
// Display-only human-readable network name (e.g., 'WhatsApp', 'Messenger').
139-
//
140-
// Deprecated: deprecated
141-
Network string `json:"network,required"`
142141
// Chat participants information.
143142
Participants ChatParticipants `json:"participants,required"`
144143
// Display title of the chat as computed by the client/server.
@@ -165,7 +164,6 @@ type Chat struct {
165164
JSON struct {
166165
ID respjson.Field
167166
AccountID respjson.Field
168-
Network respjson.Field
169167
Participants respjson.Field
170168
Title respjson.Field
171169
Type respjson.Field
@@ -276,22 +274,22 @@ type ChatNewParams struct {
276274
//
277275

278276
// This field is a request body variant, only one variant field can be set.
279-
OfObject *ChatNewParamsBodyObject `json:",inline"`
277+
OfObject *ChatNewParamsChatObject `json:",inline"`
280278
// This field is a request body variant, only one variant field can be set.
281-
OfChatNewsBodyObject *ChatNewParamsBodyObject `json:",inline"`
279+
OfChatNewsChatObject *ChatNewParamsChatObject `json:",inline"`
282280

283281
paramObj
284282
}
285283

286284
func (u ChatNewParams) MarshalJSON() ([]byte, error) {
287-
return param.MarshalUnion(u, u.OfObject, u.OfChatNewsBodyObject)
285+
return param.MarshalUnion(u, u.OfObject, u.OfChatNewsChatObject)
288286
}
289287
func (r *ChatNewParams) UnmarshalJSON(data []byte) error {
290288
return apijson.UnmarshalRoot(data, r)
291289
}
292290

293291
// The properties AccountID, ParticipantIDs, Type are required.
294-
type ChatNewParamsBodyObject struct {
292+
type ChatNewParamsChatObject struct {
295293
// Account to create the chat on.
296294
AccountID string `json:"accountID,required"`
297295
// User IDs to include in the new chat.
@@ -312,19 +310,19 @@ type ChatNewParamsBodyObject struct {
312310
paramObj
313311
}
314312

315-
func (r ChatNewParamsBodyObject) MarshalJSON() (data []byte, err error) {
316-
type shadow ChatNewParamsBodyObject
313+
func (r ChatNewParamsChatObject) MarshalJSON() (data []byte, err error) {
314+
type shadow ChatNewParamsChatObject
317315
return param.MarshalObject(r, (*shadow)(&r))
318316
}
319-
func (r *ChatNewParamsBodyObject) UnmarshalJSON(data []byte) error {
317+
func (r *ChatNewParamsChatObject) UnmarshalJSON(data []byte) error {
320318
return apijson.UnmarshalRoot(data, r)
321319
}
322320

323321
func init() {
324-
apijson.RegisterFieldValidator[ChatNewParamsBodyObject](
322+
apijson.RegisterFieldValidator[ChatNewParamsChatObject](
325323
"type", "single", "group",
326324
)
327-
apijson.RegisterFieldValidator[ChatNewParamsBodyObject](
325+
apijson.RegisterFieldValidator[ChatNewParamsChatObject](
328326
"mode", "create",
329327
)
330328
}

chat_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestChatNewWithOptionalParams(t *testing.T) {
2727
option.WithAccessToken("My Access Token"),
2828
)
2929
_, err := client.Chats.New(context.TODO(), beeperdesktopapi.ChatNewParams{
30-
OfObject: &beeperdesktopapi.ChatNewParamsBodyObject{
30+
OfObject: &beeperdesktopapi.ChatNewParamsChatObject{
3131
AccountID: "accountID",
3232
ParticipantIDs: []string{"string"},
3333
Type: "single",

0 commit comments

Comments
 (0)