Skip to content

Commit c64fc6d

Browse files
feat(api): api update
1 parent 651e447 commit c64fc6d

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-eacfa676c4ac9c051f61d4d25c1074315959b2e3d418bca529e6de2a9f6636e7.yml
3-
openapi_spec_hash: 1d56caf3dd011e888fb911d34bd34aef
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-7bb11ed57c80e483748c1fbe854ed623e290bb60be3dfddf1a88833d8fe67163.yml
3+
openapi_spec_hash: f87078b271f0d9501b1b125f7455a1b8
44
config_hash: 50b86276412e927f8eb0e69e2857b1c7

endpoint.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,16 @@ const (
368368
)
369369

370370
type EndpointListParams struct {
371+
// If true, return only endpoints owned by the caller
372+
Mine param.Opt[bool] `query:"mine,omitzero" json:"-"`
371373
// Filter endpoints by type
372374
//
373375
// Any of "dedicated", "serverless".
374376
Type EndpointListParamsType `query:"type,omitzero" json:"-"`
377+
// Filter endpoints by usage type
378+
//
379+
// Any of "on-demand", "reserved".
380+
UsageType EndpointListParamsUsageType `query:"usage_type,omitzero" json:"-"`
375381
paramObj
376382
}
377383

@@ -390,3 +396,11 @@ const (
390396
EndpointListParamsTypeDedicated EndpointListParamsType = "dedicated"
391397
EndpointListParamsTypeServerless EndpointListParamsType = "serverless"
392398
)
399+
400+
// Filter endpoints by usage type
401+
type EndpointListParamsUsageType string
402+
403+
const (
404+
EndpointListParamsUsageTypeOnDemand EndpointListParamsUsageType = "on-demand"
405+
EndpointListParamsUsageTypeReserved EndpointListParamsUsageType = "reserved"
406+
)

endpoint_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ func TestEndpointListWithOptionalParams(t *testing.T) {
116116
option.WithAPIKey("My API Key"),
117117
)
118118
_, err := client.Endpoints.List(context.TODO(), together.EndpointListParams{
119-
Type: together.EndpointListParamsTypeDedicated,
119+
Mine: together.Bool(true),
120+
Type: together.EndpointListParamsTypeDedicated,
121+
UsageType: together.EndpointListParamsUsageTypeOnDemand,
120122
})
121123
if err != nil {
122124
var apierr *together.Error

0 commit comments

Comments
 (0)