diff --git a/sdks/go/api-full/client/client.go b/sdks/go/api-full/client/client.go index a64280c95e..85cd622d3a 100644 --- a/sdks/go/api-full/client/client.go +++ b/sdks/go/api-full/client/client.go @@ -47,7 +47,7 @@ func NewClient(opts ...core.ClientOption) *Client { // 2 round trips: // // - namespace::ops::resolve_for_name_global -// - GET /actors/{} (multiple DCs based on actor IDs) +// - GET /actors (multiple DCs based on actor IDs) // // This path is optimized because we can read the actor IDs fro the key directly from Epoxy with // stale consistency to determine which datacenter the actor lives in. Under most circumstances, @@ -64,9 +64,6 @@ func NewClient(opts ...core.ClientOption) *Client { // - GET /actors (fanout) // // ## Optimized Alternative Routes -// -// For minimal round trips to check if an actor exists for a key, use `GET /actors/by-id`. This -// does not require fetching the actor's state, so it returns immediately. func (c *Client) ActorsList(ctx context.Context, request *sdk.ActorsListRequest) (*sdk.ActorsListResponse, error) { baseURL := "" if c.baseURL != "" { @@ -186,9 +183,6 @@ func (c *Client) ActorsCreate(ctx context.Context, request *sdk.ActorsCreateRequ // actor::get will always be in the same datacenter. // // ## Optimized Alternative Routes -// -// For minimal round trips to get or create an actor, use `PUT /actors/by-id`. This doesn't -// require fetching the actor's state from the other datacenter. func (c *Client) ActorsGetOrCreate(ctx context.Context, request *sdk.ActorsGetOrCreateRequest) (*sdk.ActorsGetOrCreateResponse, error) { baseURL := "" if c.baseURL != "" { @@ -221,93 +215,6 @@ func (c *Client) ActorsGetOrCreate(ctx context.Context, request *sdk.ActorsGetOr return response, nil } -// 1 round trip: -// -// - namespace::ops::resolve_for_name_global -// -// This does not require another round trip since we use stale consistency for the get_id_for_key. -func (c *Client) ActorsGetById(ctx context.Context, request *sdk.ActorsGetByIdRequest) (*sdk.ActorsGetByIdResponse, error) { - baseURL := "" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "actors/by-id" - - queryParams := make(url.Values) - queryParams.Add("namespace", fmt.Sprintf("%v", request.Namespace)) - queryParams.Add("name", fmt.Sprintf("%v", request.Name)) - queryParams.Add("key", fmt.Sprintf("%v", request.Key)) - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - var response *sdk.ActorsGetByIdResponse - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: c.header, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - -// **If actor exists** -// -// 1 round trip: -// -// - namespace::ops::resolve_for_name_global -// -// **If actor does not exist and is created in the current datacenter:** -// -// 2 round trips: -// -// - namespace::ops::resolve_for_name_global -// - [pegboard::workflows::actors::keys::allocate_key] Reserve Epoxy key -// -// **If actor does not exist and is created in a different datacenter:** -// -// 3 round trips: -// -// - namespace::ops::resolve_for_name_global -// - namespace::ops::get (to get namespace name for remote call) -// - POST /actors to remote datacenter -func (c *Client) ActorsGetOrCreateById(ctx context.Context, request *sdk.ActorsGetOrCreateByIdRequest) (*sdk.ActorsGetOrCreateByIdResponse, error) { - baseURL := "" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := baseURL + "/" + "actors/by-id" - - queryParams := make(url.Values) - queryParams.Add("namespace", fmt.Sprintf("%v", request.Namespace)) - if request.Datacenter != nil { - queryParams.Add("datacenter", fmt.Sprintf("%v", *request.Datacenter)) - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - var response *sdk.ActorsGetOrCreateByIdResponse - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodPut, - Headers: c.header, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - // 2 round trips: // // - GET /actors/names (fanout) @@ -346,40 +253,6 @@ func (c *Client) ActorsListNames(ctx context.Context, request *sdk.ActorsListNam return response, nil } -// 2 round trip: -// -// - GET /actors/{} -// - [api-peer] namespace::ops::resolve_for_name_global -func (c *Client) ActorsGet(ctx context.Context, actorId sdk.RivetId, request *sdk.ActorsGetRequest) (*sdk.ActorsGetResponse, error) { - baseURL := "" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := fmt.Sprintf(baseURL+"/"+"actors/%v", actorId) - - queryParams := make(url.Values) - if request.Namespace != nil { - queryParams.Add("namespace", fmt.Sprintf("%v", *request.Namespace)) - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - var response *sdk.ActorsGetResponse - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: c.header, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - // 2 round trip: // // - DELETE /actors/{} diff --git a/sdks/go/api-full/client/options.go b/sdks/go/api-full/client/options.go index 8c1debd9c4..c9de12b7fa 100644 --- a/sdks/go/api-full/client/options.go +++ b/sdks/go/api-full/client/options.go @@ -30,3 +30,10 @@ func WithHTTPHeader(httpHeader http.Header) core.ClientOption { opts.HTTPHeader = httpHeader.Clone() } } + +// WithToken sets the 'Authorization: Bearer ' header on every request. +func WithToken(token string) core.ClientOption { + return func(opts *core.ClientOptions) { + opts.Token = token + } +} diff --git a/sdks/go/api-full/core/client_option.go b/sdks/go/api-full/core/client_option.go index 493b208072..9ef94ca125 100644 --- a/sdks/go/api-full/core/client_option.go +++ b/sdks/go/api-full/core/client_option.go @@ -16,6 +16,7 @@ type ClientOptions struct { BaseURL string HTTPClient HTTPClient HTTPHeader http.Header + Token string } // NewClientOptions returns a new *ClientOptions value. @@ -30,7 +31,13 @@ func NewClientOptions() *ClientOptions { // ToHeader maps the configured client options into a http.Header issued // on every request. -func (c *ClientOptions) ToHeader() http.Header { return c.cloneHeader() } +func (c *ClientOptions) ToHeader() http.Header { + header := c.cloneHeader() + if c.Token != "" { + header.Set("Authorization", "Bearer "+c.Token) + } + return header +} func (c *ClientOptions) cloneHeader() http.Header { return c.HTTPHeader.Clone() diff --git a/sdks/go/api-full/namespaces.go b/sdks/go/api-full/namespaces.go index c9c39b431d..2b81652768 100644 --- a/sdks/go/api-full/namespaces.go +++ b/sdks/go/api-full/namespaces.go @@ -8,8 +8,8 @@ type NamespacesCreateRequest struct { } type NamespacesListRequest struct { - Limit *int `json:"-"` - Cursor *string `json:"-"` - Name *string `json:"-"` - NamespaceId []*RivetId `json:"-"` + Limit *int `json:"-"` + Cursor *string `json:"-"` + Name *string `json:"-"` + NamespaceIds *string `json:"-"` } diff --git a/sdks/go/api-full/namespaces/client.go b/sdks/go/api-full/namespaces/client.go index 5edf914d12..ca1a8c547c 100644 --- a/sdks/go/api-full/namespaces/client.go +++ b/sdks/go/api-full/namespaces/client.go @@ -29,7 +29,7 @@ func NewClient(opts ...core.ClientOption) *Client { } } -func (c *Client) List(ctx context.Context, request *sdk.NamespacesListRequest) (*sdk.NamespacesListResponse, error) { +func (c *Client) List(ctx context.Context, request *sdk.NamespacesListRequest) (*sdk.NamespaceListResponse, error) { baseURL := "" if c.baseURL != "" { baseURL = c.baseURL @@ -46,14 +46,14 @@ func (c *Client) List(ctx context.Context, request *sdk.NamespacesListRequest) ( if request.Name != nil { queryParams.Add("name", fmt.Sprintf("%v", *request.Name)) } - for _, value := range request.NamespaceId { - queryParams.Add("namespace_id", fmt.Sprintf("%v", *value)) + if request.NamespaceIds != nil { + queryParams.Add("namespace_ids", fmt.Sprintf("%v", *request.NamespaceIds)) } if len(queryParams) > 0 { endpointURL += "?" + queryParams.Encode() } - var response *sdk.NamespacesListResponse + var response *sdk.NamespaceListResponse if err := c.caller.Call( ctx, &core.CallParams{ @@ -90,25 +90,3 @@ func (c *Client) Create(ctx context.Context, request *sdk.NamespacesCreateReques } return response, nil } - -func (c *Client) Get(ctx context.Context, namespaceId sdk.RivetId) (*sdk.NamespacesGetResponse, error) { - baseURL := "" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := fmt.Sprintf(baseURL+"/"+"namespaces/%v", namespaceId) - - var response *sdk.NamespacesGetResponse - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: c.header, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} diff --git a/sdks/go/api-full/runner_configs.go b/sdks/go/api-full/runner_configs.go index b4d6134702..0c291fc796 100644 --- a/sdks/go/api-full/runner_configs.go +++ b/sdks/go/api-full/runner_configs.go @@ -13,16 +13,17 @@ type RunnerConfigsDeleteRequest struct { } type RunnerConfigsListRequest struct { - Namespace string `json:"-"` - Limit *int `json:"-"` - Cursor *string `json:"-"` - Variant *RunnerConfigVariant `json:"-"` - RunnerName []*string `json:"-"` + Namespace string `json:"-"` + Limit *int `json:"-"` + Cursor *string `json:"-"` + Variant *RunnerConfigVariant `json:"-"` + RunnerNames *string `json:"-"` } type RunnerConfigsUpsertRequestServerless struct { - MaxRunners int `json:"max_runners"` - MinRunners int `json:"min_runners"` + Headers map[string]string `json:"headers,omitempty"` + MaxRunners int `json:"max_runners"` + MinRunners int `json:"min_runners"` // Seconds. RequestLifespan int `json:"request_lifespan"` RunnersMargin int `json:"runners_margin"` diff --git a/sdks/go/api-full/runnerconfigs/client.go b/sdks/go/api-full/runnerconfigs/client.go index d09d4fe758..85362cb483 100644 --- a/sdks/go/api-full/runnerconfigs/client.go +++ b/sdks/go/api-full/runnerconfigs/client.go @@ -47,8 +47,8 @@ func (c *Client) List(ctx context.Context, request *sdk.RunnerConfigsListRequest if request.Variant != nil { queryParams.Add("variant", fmt.Sprintf("%v", *request.Variant)) } - for _, value := range request.RunnerName { - queryParams.Add("runner_name", fmt.Sprintf("%v", *value)) + if request.RunnerNames != nil { + queryParams.Add("runner_names", fmt.Sprintf("%v", *request.RunnerNames)) } if len(queryParams) > 0 { endpointURL += "?" + queryParams.Encode() diff --git a/sdks/go/api-full/runners.go b/sdks/go/api-full/runners.go index c64b40e72e..6e4bcd3d42 100644 --- a/sdks/go/api-full/runners.go +++ b/sdks/go/api-full/runners.go @@ -2,13 +2,10 @@ package api -type RunnersGetRequest struct { - Namespace *string `json:"-"` -} - type RunnersListRequest struct { Namespace string `json:"-"` Name *string `json:"-"` + RunnerIds *string `json:"-"` IncludeStopped *bool `json:"-"` Limit *int `json:"-"` Cursor *string `json:"-"` diff --git a/sdks/go/api-full/runners/client.go b/sdks/go/api-full/runners/client.go index 58e9a176dc..fc5f83164c 100644 --- a/sdks/go/api-full/runners/client.go +++ b/sdks/go/api-full/runners/client.go @@ -41,6 +41,9 @@ func (c *Client) List(ctx context.Context, request *sdk.RunnersListRequest) (*sd if request.Name != nil { queryParams.Add("name", fmt.Sprintf("%v", *request.Name)) } + if request.RunnerIds != nil { + queryParams.Add("runner_ids", fmt.Sprintf("%v", *request.RunnerIds)) + } if request.IncludeStopped != nil { queryParams.Add("include_stopped", fmt.Sprintf("%v", *request.IncludeStopped)) } @@ -106,33 +109,3 @@ func (c *Client) ListNames(ctx context.Context, request *sdk.RunnersListNamesReq } return response, nil } - -func (c *Client) Get(ctx context.Context, runnerId sdk.RivetId, request *sdk.RunnersGetRequest) (*sdk.RunnersGetResponse, error) { - baseURL := "" - if c.baseURL != "" { - baseURL = c.baseURL - } - endpointURL := fmt.Sprintf(baseURL+"/"+"runners/%v", runnerId) - - queryParams := make(url.Values) - if request.Namespace != nil { - queryParams.Add("namespace", fmt.Sprintf("%v", *request.Namespace)) - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - - var response *sdk.RunnersGetResponse - if err := c.caller.Call( - ctx, - &core.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: c.header, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} diff --git a/sdks/go/api-full/types.go b/sdks/go/api-full/types.go index 7b34443d1d..eeb79a3a5d 100644 --- a/sdks/go/api-full/types.go +++ b/sdks/go/api-full/types.go @@ -22,16 +22,6 @@ type ActorsDeleteRequest struct { Namespace *string `json:"-"` } -type ActorsGetRequest struct { - Namespace *string `json:"-"` -} - -type ActorsGetByIdRequest struct { - Namespace string `json:"-"` - Name string `json:"-"` - Key string `json:"-"` -} - type ActorsGetOrCreateRequest struct { Namespace string `json:"-"` Datacenter *string `json:"-"` @@ -42,16 +32,6 @@ type ActorsGetOrCreateRequest struct { RunnerNameSelector string `json:"runner_name_selector"` } -type ActorsGetOrCreateByIdRequest struct { - Namespace string `json:"-"` - Datacenter *string `json:"-"` - CrashPolicy CrashPolicy `json:"crash_policy,omitempty"` - Input *string `json:"input,omitempty"` - Key string `json:"key"` - Name string `json:"name"` - RunnerNameSelector string `json:"runner_name_selector"` -} - type ActorsListRequest struct { Namespace string `json:"-"` Name *string `json:"-"` @@ -169,65 +149,6 @@ func (a *ActorsCreateResponse) String() string { type ActorsDeleteResponse = map[string]interface{} -type ActorsGetByIdResponse struct { - ActorId *RivetId `json:"actor_id,omitempty"` - - _rawJSON json.RawMessage -} - -func (a *ActorsGetByIdResponse) UnmarshalJSON(data []byte) error { - type unmarshaler ActorsGetByIdResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *a = ActorsGetByIdResponse(value) - a._rawJSON = json.RawMessage(data) - return nil -} - -func (a *ActorsGetByIdResponse) String() string { - if len(a._rawJSON) > 0 { - if value, err := core.StringifyJSON(a._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(a); err == nil { - return value - } - return fmt.Sprintf("%#v", a) -} - -type ActorsGetOrCreateByIdResponse struct { - ActorId RivetId `json:"actor_id"` - Created bool `json:"created"` - - _rawJSON json.RawMessage -} - -func (a *ActorsGetOrCreateByIdResponse) UnmarshalJSON(data []byte) error { - type unmarshaler ActorsGetOrCreateByIdResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *a = ActorsGetOrCreateByIdResponse(value) - a._rawJSON = json.RawMessage(data) - return nil -} - -func (a *ActorsGetOrCreateByIdResponse) String() string { - if len(a._rawJSON) > 0 { - if value, err := core.StringifyJSON(a._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(a); err == nil { - return value - } - return fmt.Sprintf("%#v", a) -} - type ActorsGetOrCreateResponse struct { Actor *Actor `json:"actor,omitempty"` Created bool `json:"created"` @@ -258,35 +179,6 @@ func (a *ActorsGetOrCreateResponse) String() string { return fmt.Sprintf("%#v", a) } -type ActorsGetResponse struct { - Actor *Actor `json:"actor,omitempty"` - - _rawJSON json.RawMessage -} - -func (a *ActorsGetResponse) UnmarshalJSON(data []byte) error { - type unmarshaler ActorsGetResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *a = ActorsGetResponse(value) - a._rawJSON = json.RawMessage(data) - return nil -} - -func (a *ActorsGetResponse) String() string { - if len(a._rawJSON) > 0 { - if value, err := core.StringifyJSON(a._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(a); err == nil { - return value - } - return fmt.Sprintf("%#v", a) -} - type ActorsListNamesResponse struct { Names map[string]*ActorName `json:"names,omitempty"` Pagination *Pagination `json:"pagination,omitempty"` @@ -464,24 +356,25 @@ func (n *Namespace) String() string { return fmt.Sprintf("%#v", n) } -type NamespacesCreateResponse struct { - Namespace *Namespace `json:"namespace,omitempty"` +type NamespaceListResponse struct { + Namespaces []*Namespace `json:"namespaces,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` _rawJSON json.RawMessage } -func (n *NamespacesCreateResponse) UnmarshalJSON(data []byte) error { - type unmarshaler NamespacesCreateResponse +func (n *NamespaceListResponse) UnmarshalJSON(data []byte) error { + type unmarshaler NamespaceListResponse var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *n = NamespacesCreateResponse(value) + *n = NamespaceListResponse(value) n._rawJSON = json.RawMessage(data) return nil } -func (n *NamespacesCreateResponse) String() string { +func (n *NamespaceListResponse) String() string { if len(n._rawJSON) > 0 { if value, err := core.StringifyJSON(n._rawJSON); err == nil { return value @@ -493,54 +386,24 @@ func (n *NamespacesCreateResponse) String() string { return fmt.Sprintf("%#v", n) } -type NamespacesGetResponse struct { +type NamespacesCreateResponse struct { Namespace *Namespace `json:"namespace,omitempty"` _rawJSON json.RawMessage } -func (n *NamespacesGetResponse) UnmarshalJSON(data []byte) error { - type unmarshaler NamespacesGetResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *n = NamespacesGetResponse(value) - n._rawJSON = json.RawMessage(data) - return nil -} - -func (n *NamespacesGetResponse) String() string { - if len(n._rawJSON) > 0 { - if value, err := core.StringifyJSON(n._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(n); err == nil { - return value - } - return fmt.Sprintf("%#v", n) -} - -type NamespacesListResponse struct { - Namespaces []*Namespace `json:"namespaces,omitempty"` - Pagination *Pagination `json:"pagination,omitempty"` - - _rawJSON json.RawMessage -} - -func (n *NamespacesListResponse) UnmarshalJSON(data []byte) error { - type unmarshaler NamespacesListResponse +func (n *NamespacesCreateResponse) UnmarshalJSON(data []byte) error { + type unmarshaler NamespacesCreateResponse var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *n = NamespacesListResponse(value) + *n = NamespacesCreateResponse(value) n._rawJSON = json.RawMessage(data) return nil } -func (n *NamespacesListResponse) String() string { +func (n *NamespacesCreateResponse) String() string { if len(n._rawJSON) > 0 { if value, err := core.StringifyJSON(n._rawJSON); err == nil { return value @@ -656,8 +519,9 @@ func (r *RunnerConfig) String() string { } type RunnerConfigServerless struct { - MaxRunners int `json:"max_runners"` - MinRunners int `json:"min_runners"` + Headers map[string]string `json:"headers,omitempty"` + MaxRunners int `json:"max_runners"` + MinRunners int `json:"min_runners"` // Seconds. RequestLifespan int `json:"request_lifespan"` RunnersMargin int `json:"runners_margin"` @@ -726,35 +590,6 @@ func (r *RunnerConfigsListResponse) String() string { type RunnerConfigsUpsertResponse = map[string]interface{} -type RunnersGetResponse struct { - Runner *Runner `json:"runner,omitempty"` - - _rawJSON json.RawMessage -} - -func (r *RunnersGetResponse) UnmarshalJSON(data []byte) error { - type unmarshaler RunnersGetResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *r = RunnersGetResponse(value) - r._rawJSON = json.RawMessage(data) - return nil -} - -func (r *RunnersGetResponse) String() string { - if len(r._rawJSON) > 0 { - if value, err := core.StringifyJSON(r._rawJSON); err == nil { - return value - } - } - if value, err := core.StringifyJSON(r); err == nil { - return value - } - return fmt.Sprintf("%#v", r) -} - type RunnersListNamesResponse struct { Names []string `json:"names,omitempty"` Pagination *Pagination `json:"pagination,omitempty"` diff --git a/sdks/rust/api-full/rust/.openapi-generator/FILES b/sdks/rust/api-full/rust/.openapi-generator/FILES index 637fb4e031..ff4de20ef7 100644 --- a/sdks/rust/api-full/rust/.openapi-generator/FILES +++ b/sdks/rust/api-full/rust/.openapi-generator/FILES @@ -9,16 +9,9 @@ docs/ActorsCreateApi.md docs/ActorsCreateRequest.md docs/ActorsCreateResponse.md docs/ActorsDeleteApi.md -docs/ActorsGetApi.md -docs/ActorsGetByIdApi.md -docs/ActorsGetByIdResponse.md docs/ActorsGetOrCreateApi.md -docs/ActorsGetOrCreateByIdApi.md -docs/ActorsGetOrCreateByIdRequest.md -docs/ActorsGetOrCreateByIdResponse.md docs/ActorsGetOrCreateRequest.md docs/ActorsGetOrCreateResponse.md -docs/ActorsGetResponse.md docs/ActorsListApi.md docs/ActorsListNamesApi.md docs/ActorsListNamesResponse.md @@ -28,11 +21,10 @@ docs/Datacenter.md docs/DatacentersApi.md docs/DatacentersListResponse.md docs/Namespace.md +docs/NamespaceListResponse.md docs/NamespacesApi.md docs/NamespacesCreateRequest.md docs/NamespacesCreateResponse.md -docs/NamespacesGetResponse.md -docs/NamespacesListResponse.md docs/Pagination.md docs/Runner.md docs/RunnerConfig.md @@ -42,16 +34,12 @@ docs/RunnerConfigsApi.md docs/RunnerConfigsListResponse.md docs/RunnerConfigsUpsertRequest.md docs/RunnersApi.md -docs/RunnersGetResponse.md docs/RunnersListNamesResponse.md docs/RunnersListResponse.md git_push.sh src/apis/actors_create_api.rs src/apis/actors_delete_api.rs -src/apis/actors_get_api.rs -src/apis/actors_get_by_id_api.rs src/apis/actors_get_or_create_api.rs -src/apis/actors_get_or_create_by_id_api.rs src/apis/actors_list_api.rs src/apis/actors_list_names_api.rs src/apis/configuration.rs @@ -65,12 +53,8 @@ src/models/actor.rs src/models/actor_name.rs src/models/actors_create_request.rs src/models/actors_create_response.rs -src/models/actors_get_by_id_response.rs -src/models/actors_get_or_create_by_id_request.rs -src/models/actors_get_or_create_by_id_response.rs src/models/actors_get_or_create_request.rs src/models/actors_get_or_create_response.rs -src/models/actors_get_response.rs src/models/actors_list_names_response.rs src/models/actors_list_response.rs src/models/crash_policy.rs @@ -78,10 +62,9 @@ src/models/datacenter.rs src/models/datacenters_list_response.rs src/models/mod.rs src/models/namespace.rs +src/models/namespace_list_response.rs src/models/namespaces_create_request.rs src/models/namespaces_create_response.rs -src/models/namespaces_get_response.rs -src/models/namespaces_list_response.rs src/models/pagination.rs src/models/runner.rs src/models/runner_config.rs @@ -89,6 +72,5 @@ src/models/runner_config_serverless.rs src/models/runner_config_variant.rs src/models/runner_configs_list_response.rs src/models/runner_configs_upsert_request.rs -src/models/runners_get_response.rs src/models/runners_list_names_response.rs src/models/runners_list_response.rs diff --git a/sdks/rust/api-full/rust/Cargo.toml b/sdks/rust/api-full/rust/Cargo.toml index 17d0140cc3..cbec982873 100644 --- a/sdks/rust/api-full/rust/Cargo.toml +++ b/sdks/rust/api-full/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rivet-api-full" -version = "25.7.0" +version = "25.7.1" authors = ["developer@rivet.gg"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" license = "Apache-2.0" diff --git a/sdks/rust/api-full/rust/README.md b/sdks/rust/api-full/rust/README.md index ba49e0e0e7..a401035e7b 100644 --- a/sdks/rust/api-full/rust/README.md +++ b/sdks/rust/api-full/rust/README.md @@ -7,8 +7,8 @@ No description provided (generated by Openapi Generator https://github.com/opena This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. -- API version: 25.7.0 -- Package version: 25.7.0 +- API version: 25.7.1 +- Package version: 25.7.1 - Generator version: 7.14.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` @@ -28,20 +28,15 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *ActorsCreateApi* | [**actors_create**](docs/ActorsCreateApi.md#actors_create) | **POST** /actors | ## Datacenter Round Trips *ActorsDeleteApi* | [**actors_delete**](docs/ActorsDeleteApi.md#actors_delete) | **DELETE** /actors/{actor_id} | ## Datacenter Round Trips -*ActorsGetApi* | [**actors_get**](docs/ActorsGetApi.md#actors_get) | **GET** /actors/{actor_id} | ## Datacenter Round Trips -*ActorsGetByIdApi* | [**actors_get_by_id**](docs/ActorsGetByIdApi.md#actors_get_by_id) | **GET** /actors/by-id | ## Datacenter Round Trips *ActorsGetOrCreateApi* | [**actors_get_or_create**](docs/ActorsGetOrCreateApi.md#actors_get_or_create) | **PUT** /actors | ## Datacenter Round Trips -*ActorsGetOrCreateByIdApi* | [**actors_get_or_create_by_id**](docs/ActorsGetOrCreateByIdApi.md#actors_get_or_create_by_id) | **PUT** /actors/by-id | ## Datacenter Round Trips *ActorsListApi* | [**actors_list**](docs/ActorsListApi.md#actors_list) | **GET** /actors | ## Datacenter Round Trips *ActorsListNamesApi* | [**actors_list_names**](docs/ActorsListNamesApi.md#actors_list_names) | **GET** /actors/names | ## Datacenter Round Trips *DatacentersApi* | [**datacenters_list**](docs/DatacentersApi.md#datacenters_list) | **GET** /datacenters | *NamespacesApi* | [**namespaces_create**](docs/NamespacesApi.md#namespaces_create) | **POST** /namespaces | -*NamespacesApi* | [**namespaces_get**](docs/NamespacesApi.md#namespaces_get) | **GET** /namespaces/{namespace_id} | *NamespacesApi* | [**namespaces_list**](docs/NamespacesApi.md#namespaces_list) | **GET** /namespaces | *RunnerConfigsApi* | [**runner_configs_delete**](docs/RunnerConfigsApi.md#runner_configs_delete) | **DELETE** /runner-configs/{runner_name} | *RunnerConfigsApi* | [**runner_configs_list**](docs/RunnerConfigsApi.md#runner_configs_list) | **GET** /runner-configs | *RunnerConfigsApi* | [**runner_configs_upsert**](docs/RunnerConfigsApi.md#runner_configs_upsert) | **PUT** /runner-configs/{runner_name} | -*RunnersApi* | [**runners_get**](docs/RunnersApi.md#runners_get) | **GET** /runners/{runner_id} | *RunnersApi* | [**runners_list**](docs/RunnersApi.md#runners_list) | **GET** /runners | *RunnersApi* | [**runners_list_names**](docs/RunnersApi.md#runners_list_names) | **GET** /runners/names | ## Datacenter Round Trips @@ -52,22 +47,17 @@ Class | Method | HTTP request | Description - [ActorName](docs/ActorName.md) - [ActorsCreateRequest](docs/ActorsCreateRequest.md) - [ActorsCreateResponse](docs/ActorsCreateResponse.md) - - [ActorsGetByIdResponse](docs/ActorsGetByIdResponse.md) - - [ActorsGetOrCreateByIdRequest](docs/ActorsGetOrCreateByIdRequest.md) - - [ActorsGetOrCreateByIdResponse](docs/ActorsGetOrCreateByIdResponse.md) - [ActorsGetOrCreateRequest](docs/ActorsGetOrCreateRequest.md) - [ActorsGetOrCreateResponse](docs/ActorsGetOrCreateResponse.md) - - [ActorsGetResponse](docs/ActorsGetResponse.md) - [ActorsListNamesResponse](docs/ActorsListNamesResponse.md) - [ActorsListResponse](docs/ActorsListResponse.md) - [CrashPolicy](docs/CrashPolicy.md) - [Datacenter](docs/Datacenter.md) - [DatacentersListResponse](docs/DatacentersListResponse.md) - [Namespace](docs/Namespace.md) + - [NamespaceListResponse](docs/NamespaceListResponse.md) - [NamespacesCreateRequest](docs/NamespacesCreateRequest.md) - [NamespacesCreateResponse](docs/NamespacesCreateResponse.md) - - [NamespacesGetResponse](docs/NamespacesGetResponse.md) - - [NamespacesListResponse](docs/NamespacesListResponse.md) - [Pagination](docs/Pagination.md) - [Runner](docs/Runner.md) - [RunnerConfig](docs/RunnerConfig.md) @@ -75,7 +65,6 @@ Class | Method | HTTP request | Description - [RunnerConfigVariant](docs/RunnerConfigVariant.md) - [RunnerConfigsListResponse](docs/RunnerConfigsListResponse.md) - [RunnerConfigsUpsertRequest](docs/RunnerConfigsUpsertRequest.md) - - [RunnersGetResponse](docs/RunnersGetResponse.md) - [RunnersListNamesResponse](docs/RunnersListNamesResponse.md) - [RunnersListResponse](docs/RunnersListResponse.md) diff --git a/sdks/rust/api-full/rust/docs/ActorsCreateApi.md b/sdks/rust/api-full/rust/docs/ActorsCreateApi.md index 9199b1d6f8..0d15ce24da 100644 --- a/sdks/rust/api-full/rust/docs/ActorsCreateApi.md +++ b/sdks/rust/api-full/rust/docs/ActorsCreateApi.md @@ -30,7 +30,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers diff --git a/sdks/rust/api-full/rust/docs/ActorsDeleteApi.md b/sdks/rust/api-full/rust/docs/ActorsDeleteApi.md index 74c17b5cb1..1f8365b078 100644 --- a/sdks/rust/api-full/rust/docs/ActorsDeleteApi.md +++ b/sdks/rust/api-full/rust/docs/ActorsDeleteApi.md @@ -29,7 +29,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers diff --git a/sdks/rust/api-full/rust/docs/ActorsGetApi.md b/sdks/rust/api-full/rust/docs/ActorsGetApi.md deleted file mode 100644 index 20fd34cd5f..0000000000 --- a/sdks/rust/api-full/rust/docs/ActorsGetApi.md +++ /dev/null @@ -1,40 +0,0 @@ -# \ActorsGetApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_get**](ActorsGetApi.md#actors_get) | **GET** /actors/{actor_id} | ## Datacenter Round Trips - - - -## actors_get - -> models::ActorsGetResponse actors_get(actor_id, namespace) -## Datacenter Round Trips - -2 round trip: - GET /actors/{} - [api-peer] namespace::ops::resolve_for_name_global - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**actor_id** | **String** | | [required] | -**namespace** | Option<**String**> | | | - -### Return type - -[**models::ActorsGetResponse**](ActorsGetResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-full/rust/docs/ActorsGetByIdApi.md b/sdks/rust/api-full/rust/docs/ActorsGetByIdApi.md deleted file mode 100644 index e634b25e66..0000000000 --- a/sdks/rust/api-full/rust/docs/ActorsGetByIdApi.md +++ /dev/null @@ -1,41 +0,0 @@ -# \ActorsGetByIdApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_get_by_id**](ActorsGetByIdApi.md#actors_get_by_id) | **GET** /actors/by-id | ## Datacenter Round Trips - - - -## actors_get_by_id - -> models::ActorsGetByIdResponse actors_get_by_id(namespace, name, key) -## Datacenter Round Trips - -1 round trip: - namespace::ops::resolve_for_name_global This does not require another round trip since we use stale consistency for the get_id_for_key. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [required] | -**name** | **String** | | [required] | -**key** | **String** | | [required] | - -### Return type - -[**models::ActorsGetByIdResponse**](ActorsGetByIdResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-full/rust/docs/ActorsGetByIdResponse.md b/sdks/rust/api-full/rust/docs/ActorsGetByIdResponse.md deleted file mode 100644 index e76ebe4617..0000000000 --- a/sdks/rust/api-full/rust/docs/ActorsGetByIdResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActorsGetByIdResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor_id** | Option<**String**> | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-full/rust/docs/ActorsGetOrCreateApi.md b/sdks/rust/api-full/rust/docs/ActorsGetOrCreateApi.md index bb4dfa0632..97b92ea103 100644 --- a/sdks/rust/api-full/rust/docs/ActorsGetOrCreateApi.md +++ b/sdks/rust/api-full/rust/docs/ActorsGetOrCreateApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description > models::ActorsGetOrCreateResponse actors_get_or_create(namespace, actors_get_or_create_request, datacenter) ## Datacenter Round Trips -**If actor exists** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors/{} **If actor does not exist and is created in the current datacenter:** 2 round trips: - namespace::ops::resolve_for_name_global - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation) **If actor does not exist and is created in a different datacenter:** 3 round trips: - namespace::ops::resolve_for_name_global - POST /actors to remote datacenter - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation) actor::get will always be in the same datacenter. ## Optimized Alternative Routes For minimal round trips to get or create an actor, use `PUT /actors/by-id`. This doesn't require fetching the actor's state from the other datacenter. +**If actor exists** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors/{} **If actor does not exist and is created in the current datacenter:** 2 round trips: - namespace::ops::resolve_for_name_global - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation) **If actor does not exist and is created in a different datacenter:** 3 round trips: - namespace::ops::resolve_for_name_global - POST /actors to remote datacenter - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation) actor::get will always be in the same datacenter. ## Optimized Alternative Routes ### Parameters @@ -30,7 +30,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers diff --git a/sdks/rust/api-full/rust/docs/ActorsGetOrCreateByIdApi.md b/sdks/rust/api-full/rust/docs/ActorsGetOrCreateByIdApi.md deleted file mode 100644 index dc050b7149..0000000000 --- a/sdks/rust/api-full/rust/docs/ActorsGetOrCreateByIdApi.md +++ /dev/null @@ -1,41 +0,0 @@ -# \ActorsGetOrCreateByIdApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**actors_get_or_create_by_id**](ActorsGetOrCreateByIdApi.md#actors_get_or_create_by_id) | **PUT** /actors/by-id | ## Datacenter Round Trips - - - -## actors_get_or_create_by_id - -> models::ActorsGetOrCreateByIdResponse actors_get_or_create_by_id(namespace, actors_get_or_create_by_id_request, datacenter) -## Datacenter Round Trips - -**If actor exists** 1 round trip: - namespace::ops::resolve_for_name_global **If actor does not exist and is created in the current datacenter:** 2 round trips: - namespace::ops::resolve_for_name_global - [pegboard::workflows::actors::keys::allocate_key] Reserve Epoxy key **If actor does not exist and is created in a different datacenter:** 3 round trips: - namespace::ops::resolve_for_name_global - namespace::ops::get (to get namespace name for remote call) - POST /actors to remote datacenter - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace** | **String** | | [required] | -**actors_get_or_create_by_id_request** | [**ActorsGetOrCreateByIdRequest**](ActorsGetOrCreateByIdRequest.md) | | [required] | -**datacenter** | Option<**String**> | | | - -### Return type - -[**models::ActorsGetOrCreateByIdResponse**](ActorsGetOrCreateByIdResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/sdks/rust/api-full/rust/docs/ActorsGetOrCreateByIdRequest.md b/sdks/rust/api-full/rust/docs/ActorsGetOrCreateByIdRequest.md deleted file mode 100644 index 9c0250de0b..0000000000 --- a/sdks/rust/api-full/rust/docs/ActorsGetOrCreateByIdRequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# ActorsGetOrCreateByIdRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**crash_policy** | [**models::CrashPolicy**](CrashPolicy.md) | | -**input** | Option<**String**> | | [optional] -**key** | **String** | | -**name** | **String** | | -**runner_name_selector** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-full/rust/docs/ActorsGetOrCreateByIdResponse.md b/sdks/rust/api-full/rust/docs/ActorsGetOrCreateByIdResponse.md deleted file mode 100644 index 3a35c2ccf2..0000000000 --- a/sdks/rust/api-full/rust/docs/ActorsGetOrCreateByIdResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ActorsGetOrCreateByIdResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor_id** | **String** | | -**created** | **bool** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-full/rust/docs/ActorsGetResponse.md b/sdks/rust/api-full/rust/docs/ActorsGetResponse.md deleted file mode 100644 index 95f17b3c04..0000000000 --- a/sdks/rust/api-full/rust/docs/ActorsGetResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActorsGetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**actor** | [**models::Actor**](Actor.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-full/rust/docs/ActorsListApi.md b/sdks/rust/api-full/rust/docs/ActorsListApi.md index adb03a7770..aab1c109e5 100644 --- a/sdks/rust/api-full/rust/docs/ActorsListApi.md +++ b/sdks/rust/api-full/rust/docs/ActorsListApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description > models::ActorsListResponse actors_list(namespace, name, key, actor_ids, include_destroyed, limit, cursor) ## Datacenter Round Trips - **If key is some & `include_destroyed` is false** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors/{} (multiple DCs based on actor IDs) This path is optimized because we can read the actor IDs fro the key directly from Epoxy with stale consistency to determine which datacenter the actor lives in. Under most circumstances, this means we don't need to fan out to all datacenters (like normal list does). The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If `include_destroyed` is true, we show all previous iterations of actors with the same key. **Otherwise** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors (fanout) ## Optimized Alternative Routes For minimal round trips to check if an actor exists for a key, use `GET /actors/by-id`. This does not require fetching the actor's state, so it returns immediately. + **If key is some & `include_destroyed` is false** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors (multiple DCs based on actor IDs) This path is optimized because we can read the actor IDs fro the key directly from Epoxy with stale consistency to determine which datacenter the actor lives in. Under most circumstances, this means we don't need to fan out to all datacenters (like normal list does). The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If `include_destroyed` is true, we show all previous iterations of actors with the same key. **Otherwise** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors (fanout) ## Optimized Alternative Routes ### Parameters @@ -34,7 +34,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers diff --git a/sdks/rust/api-full/rust/docs/ActorsListNamesApi.md b/sdks/rust/api-full/rust/docs/ActorsListNamesApi.md index beeac0cc9a..b28c794676 100644 --- a/sdks/rust/api-full/rust/docs/ActorsListNamesApi.md +++ b/sdks/rust/api-full/rust/docs/ActorsListNamesApi.md @@ -30,7 +30,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers diff --git a/sdks/rust/api-full/rust/docs/DatacentersApi.md b/sdks/rust/api-full/rust/docs/DatacentersApi.md index 9538c60cca..0e8cb6b166 100644 --- a/sdks/rust/api-full/rust/docs/DatacentersApi.md +++ b/sdks/rust/api-full/rust/docs/DatacentersApi.md @@ -23,7 +23,7 @@ This endpoint does not need any parameter. ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers diff --git a/sdks/rust/api-full/rust/docs/NamespacesListResponse.md b/sdks/rust/api-full/rust/docs/NamespaceListResponse.md similarity index 94% rename from sdks/rust/api-full/rust/docs/NamespacesListResponse.md rename to sdks/rust/api-full/rust/docs/NamespaceListResponse.md index 30acea28a2..22b63aab0a 100644 --- a/sdks/rust/api-full/rust/docs/NamespacesListResponse.md +++ b/sdks/rust/api-full/rust/docs/NamespaceListResponse.md @@ -1,4 +1,4 @@ -# NamespacesListResponse +# NamespaceListResponse ## Properties diff --git a/sdks/rust/api-full/rust/docs/NamespacesApi.md b/sdks/rust/api-full/rust/docs/NamespacesApi.md index 55bc5f804e..01b82f1c0e 100644 --- a/sdks/rust/api-full/rust/docs/NamespacesApi.md +++ b/sdks/rust/api-full/rust/docs/NamespacesApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**namespaces_create**](NamespacesApi.md#namespaces_create) | **POST** /namespaces | -[**namespaces_get**](NamespacesApi.md#namespaces_get) | **GET** /namespaces/{namespace_id} | [**namespaces_list**](NamespacesApi.md#namespaces_list) | **GET** /namespaces | @@ -28,7 +27,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers @@ -38,37 +37,9 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## namespaces_get - -> models::NamespacesGetResponse namespaces_get(namespace_id) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**namespace_id** | **String** | | [required] | - -### Return type - -[**models::NamespacesGetResponse**](NamespacesGetResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## namespaces_list -> models::NamespacesListResponse namespaces_list(limit, cursor, name, namespace_id) +> models::NamespaceListResponse namespaces_list(limit, cursor, name, namespace_ids) ### Parameters @@ -79,15 +50,15 @@ Name | Type | Description | Required | Notes **limit** | Option<**i32**> | | | **cursor** | Option<**String**> | | | **name** | Option<**String**> | | | -**namespace_id** | Option<[**Vec**](String.md)> | | | +**namespace_ids** | Option<**String**> | | | ### Return type -[**models::NamespacesListResponse**](NamespacesListResponse.md) +[**models::NamespaceListResponse**](NamespaceListResponse.md) ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers diff --git a/sdks/rust/api-full/rust/docs/NamespacesGetResponse.md b/sdks/rust/api-full/rust/docs/NamespacesGetResponse.md deleted file mode 100644 index 07940e3f1f..0000000000 --- a/sdks/rust/api-full/rust/docs/NamespacesGetResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# NamespacesGetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**namespace** | [**models::Namespace**](Namespace.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-full/rust/docs/RunnerConfigServerless.md b/sdks/rust/api-full/rust/docs/RunnerConfigServerless.md index 1cf2aaae70..d857b24dc4 100644 --- a/sdks/rust/api-full/rust/docs/RunnerConfigServerless.md +++ b/sdks/rust/api-full/rust/docs/RunnerConfigServerless.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**headers** | **std::collections::HashMap** | | **max_runners** | **i32** | | **min_runners** | **i32** | | **request_lifespan** | **i32** | Seconds. | diff --git a/sdks/rust/api-full/rust/docs/RunnerConfigsApi.md b/sdks/rust/api-full/rust/docs/RunnerConfigsApi.md index b055642264..ae04305861 100644 --- a/sdks/rust/api-full/rust/docs/RunnerConfigsApi.md +++ b/sdks/rust/api-full/rust/docs/RunnerConfigsApi.md @@ -29,7 +29,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers @@ -41,7 +41,7 @@ No authorization required ## runner_configs_list -> models::RunnerConfigsListResponse runner_configs_list(namespace, limit, cursor, variant, runner_name) +> models::RunnerConfigsListResponse runner_configs_list(namespace, limit, cursor, variant, runner_names) ### Parameters @@ -53,7 +53,7 @@ Name | Type | Description | Required | Notes **limit** | Option<**i32**> | | | **cursor** | Option<**String**> | | | **variant** | Option<[**RunnerConfigVariant**](.md)> | | | -**runner_name** | Option<[**Vec**](String.md)> | | | +**runner_names** | Option<**String**> | | | ### Return type @@ -61,7 +61,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers @@ -91,7 +91,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers diff --git a/sdks/rust/api-full/rust/docs/RunnersApi.md b/sdks/rust/api-full/rust/docs/RunnersApi.md index 324531fcde..2f2f11aff8 100644 --- a/sdks/rust/api-full/rust/docs/RunnersApi.md +++ b/sdks/rust/api-full/rust/docs/RunnersApi.md @@ -4,44 +4,14 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**runners_get**](RunnersApi.md#runners_get) | **GET** /runners/{runner_id} | [**runners_list**](RunnersApi.md#runners_list) | **GET** /runners | [**runners_list_names**](RunnersApi.md#runners_list_names) | **GET** /runners/names | ## Datacenter Round Trips -## runners_get - -> models::RunnersGetResponse runners_get(runner_id, namespace) - - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**runner_id** | **String** | | [required] | -**namespace** | Option<**String**> | | | - -### Return type - -[**models::RunnersGetResponse**](RunnersGetResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## runners_list -> models::RunnersListResponse runners_list(namespace, name, include_stopped, limit, cursor) +> models::RunnersListResponse runners_list(namespace, name, runner_ids, include_stopped, limit, cursor) ### Parameters @@ -51,6 +21,7 @@ Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **namespace** | **String** | | [required] | **name** | Option<**String**> | | | +**runner_ids** | Option<**String**> | | | **include_stopped** | Option<**bool**> | | | **limit** | Option<**i32**> | | | **cursor** | Option<**String**> | | | @@ -61,7 +32,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers @@ -93,7 +64,7 @@ Name | Type | Description | Required | Notes ### Authorization -No authorization required +[bearer_auth](../README.md#bearer_auth) ### HTTP request headers diff --git a/sdks/rust/api-full/rust/docs/RunnersGetResponse.md b/sdks/rust/api-full/rust/docs/RunnersGetResponse.md deleted file mode 100644 index f266995a70..0000000000 --- a/sdks/rust/api-full/rust/docs/RunnersGetResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# RunnersGetResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**runner** | [**models::Runner**](Runner.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/sdks/rust/api-full/rust/src/apis/actors_create_api.rs b/sdks/rust/api-full/rust/src/apis/actors_create_api.rs index 2fb6bfc6ce..cae4d2a314 100644 --- a/sdks/rust/api-full/rust/src/apis/actors_create_api.rs +++ b/sdks/rust/api-full/rust/src/apis/actors_create_api.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -40,6 +40,9 @@ pub async fn actors_create(configuration: &configuration::Configuration, namespa if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; req_builder = req_builder.json(&p_actors_create_request); let req = req_builder.build()?; diff --git a/sdks/rust/api-full/rust/src/apis/actors_delete_api.rs b/sdks/rust/api-full/rust/src/apis/actors_delete_api.rs index a79faed0c8..c5e9165815 100644 --- a/sdks/rust/api-full/rust/src/apis/actors_delete_api.rs +++ b/sdks/rust/api-full/rust/src/apis/actors_delete_api.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -38,6 +38,9 @@ pub async fn actors_delete(configuration: &configuration::Configuration, actor_i if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; diff --git a/sdks/rust/api-full/rust/src/apis/actors_get_api.rs b/sdks/rust/api-full/rust/src/apis/actors_get_api.rs deleted file mode 100644 index 7d75c1e2b9..0000000000 --- a/sdks/rust/api-full/rust/src/apis/actors_get_api.rs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 25.7.0 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsGetError { - UnknownValue(serde_json::Value), -} - - -/// 2 round trip: - GET /actors/{} - [api-peer] namespace::ops::resolve_for_name_global -pub async fn actors_get(configuration: &configuration::Configuration, actor_id: &str, namespace: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_actor_id = actor_id; - let p_namespace = namespace; - - let uri_str = format!("{}/actors/{actor_id}", configuration.base_path, actor_id=crate::apis::urlencode(p_actor_id)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_namespace { - req_builder = req_builder.query(&[("namespace", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsGetResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsGetResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-full/rust/src/apis/actors_get_by_id_api.rs b/sdks/rust/api-full/rust/src/apis/actors_get_by_id_api.rs deleted file mode 100644 index 54d4693377..0000000000 --- a/sdks/rust/api-full/rust/src/apis/actors_get_by_id_api.rs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 25.7.0 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_get_by_id`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsGetByIdError { - UnknownValue(serde_json::Value), -} - - -/// 1 round trip: - namespace::ops::resolve_for_name_global This does not require another round trip since we use stale consistency for the get_id_for_key. -pub async fn actors_get_by_id(configuration: &configuration::Configuration, namespace: &str, name: &str, key: &str) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace = namespace; - let p_name = name; - let p_key = key; - - let uri_str = format!("{}/actors/by-id", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("namespace", &p_namespace.to_string())]); - req_builder = req_builder.query(&[("name", &p_name.to_string())]); - req_builder = req_builder.query(&[("key", &p_key.to_string())]); - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsGetByIdResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsGetByIdResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-full/rust/src/apis/actors_get_or_create_api.rs b/sdks/rust/api-full/rust/src/apis/actors_get_or_create_api.rs index a5a315be95..7c1b7c7d85 100644 --- a/sdks/rust/api-full/rust/src/apis/actors_get_or_create_api.rs +++ b/sdks/rust/api-full/rust/src/apis/actors_get_or_create_api.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -23,7 +23,7 @@ pub enum ActorsGetOrCreateError { } -/// **If actor exists** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors/{} **If actor does not exist and is created in the current datacenter:** 2 round trips: - namespace::ops::resolve_for_name_global - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation) **If actor does not exist and is created in a different datacenter:** 3 round trips: - namespace::ops::resolve_for_name_global - POST /actors to remote datacenter - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation) actor::get will always be in the same datacenter. ## Optimized Alternative Routes For minimal round trips to get or create an actor, use `PUT /actors/by-id`. This doesn't require fetching the actor's state from the other datacenter. +/// **If actor exists** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors/{} **If actor does not exist and is created in the current datacenter:** 2 round trips: - namespace::ops::resolve_for_name_global - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation) **If actor does not exist and is created in a different datacenter:** 3 round trips: - namespace::ops::resolve_for_name_global - POST /actors to remote datacenter - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation) actor::get will always be in the same datacenter. ## Optimized Alternative Routes pub async fn actors_get_or_create(configuration: &configuration::Configuration, namespace: &str, actors_get_or_create_request: models::ActorsGetOrCreateRequest, datacenter: Option<&str>) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_namespace = namespace; @@ -40,6 +40,9 @@ pub async fn actors_get_or_create(configuration: &configuration::Configuration, if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; req_builder = req_builder.json(&p_actors_get_or_create_request); let req = req_builder.build()?; diff --git a/sdks/rust/api-full/rust/src/apis/actors_get_or_create_by_id_api.rs b/sdks/rust/api-full/rust/src/apis/actors_get_or_create_by_id_api.rs deleted file mode 100644 index 7a7cef69b8..0000000000 --- a/sdks/rust/api-full/rust/src/apis/actors_get_or_create_by_id_api.rs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 25.7.0 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration, ContentType}; - - -/// struct for typed errors of method [`actors_get_or_create_by_id`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActorsGetOrCreateByIdError { - UnknownValue(serde_json::Value), -} - - -/// **If actor exists** 1 round trip: - namespace::ops::resolve_for_name_global **If actor does not exist and is created in the current datacenter:** 2 round trips: - namespace::ops::resolve_for_name_global - [pegboard::workflows::actors::keys::allocate_key] Reserve Epoxy key **If actor does not exist and is created in a different datacenter:** 3 round trips: - namespace::ops::resolve_for_name_global - namespace::ops::get (to get namespace name for remote call) - POST /actors to remote datacenter -pub async fn actors_get_or_create_by_id(configuration: &configuration::Configuration, namespace: &str, actors_get_or_create_by_id_request: models::ActorsGetOrCreateByIdRequest, datacenter: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace = namespace; - let p_actors_get_or_create_by_id_request = actors_get_or_create_by_id_request; - let p_datacenter = datacenter; - - let uri_str = format!("{}/actors/by-id", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - req_builder = req_builder.query(&[("namespace", &p_namespace.to_string())]); - if let Some(ref param_value) = p_datacenter { - req_builder = req_builder.query(&[("datacenter", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_actors_get_or_create_by_id_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActorsGetOrCreateByIdResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActorsGetOrCreateByIdResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - diff --git a/sdks/rust/api-full/rust/src/apis/actors_list_api.rs b/sdks/rust/api-full/rust/src/apis/actors_list_api.rs index 6be0a5be93..b723124a6d 100644 --- a/sdks/rust/api-full/rust/src/apis/actors_list_api.rs +++ b/sdks/rust/api-full/rust/src/apis/actors_list_api.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -23,7 +23,7 @@ pub enum ActorsListError { } -/// **If key is some & `include_destroyed` is false** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors/{} (multiple DCs based on actor IDs) This path is optimized because we can read the actor IDs fro the key directly from Epoxy with stale consistency to determine which datacenter the actor lives in. Under most circumstances, this means we don't need to fan out to all datacenters (like normal list does). The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If `include_destroyed` is true, we show all previous iterations of actors with the same key. **Otherwise** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors (fanout) ## Optimized Alternative Routes For minimal round trips to check if an actor exists for a key, use `GET /actors/by-id`. This does not require fetching the actor's state, so it returns immediately. +/// **If key is some & `include_destroyed` is false** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors (multiple DCs based on actor IDs) This path is optimized because we can read the actor IDs fro the key directly from Epoxy with stale consistency to determine which datacenter the actor lives in. Under most circumstances, this means we don't need to fan out to all datacenters (like normal list does). The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If `include_destroyed` is true, we show all previous iterations of actors with the same key. **Otherwise** 2 round trips: - namespace::ops::resolve_for_name_global - GET /actors (fanout) ## Optimized Alternative Routes pub async fn actors_list(configuration: &configuration::Configuration, namespace: &str, name: Option<&str>, key: Option<&str>, actor_ids: Option<&str>, include_destroyed: Option, limit: Option, cursor: Option<&str>) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_namespace = namespace; @@ -59,6 +59,9 @@ pub async fn actors_list(configuration: &configuration::Configuration, namespace if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; diff --git a/sdks/rust/api-full/rust/src/apis/actors_list_names_api.rs b/sdks/rust/api-full/rust/src/apis/actors_list_names_api.rs index 69875312e7..4f15d37624 100644 --- a/sdks/rust/api-full/rust/src/apis/actors_list_names_api.rs +++ b/sdks/rust/api-full/rust/src/apis/actors_list_names_api.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -43,6 +43,9 @@ pub async fn actors_list_names(configuration: &configuration::Configuration, nam if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; diff --git a/sdks/rust/api-full/rust/src/apis/configuration.rs b/sdks/rust/api-full/rust/src/apis/configuration.rs index 42d4013267..73b6d42890 100644 --- a/sdks/rust/api-full/rust/src/apis/configuration.rs +++ b/sdks/rust/api-full/rust/src/apis/configuration.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -40,7 +40,7 @@ impl Default for Configuration { fn default() -> Self { Configuration { base_path: "http://localhost".to_owned(), - user_agent: Some("OpenAPI-Generator/25.7.0/rust".to_owned()), + user_agent: Some("OpenAPI-Generator/25.7.1/rust".to_owned()), client: reqwest::Client::new(), basic_auth: None, oauth_access_token: None, diff --git a/sdks/rust/api-full/rust/src/apis/datacenters_api.rs b/sdks/rust/api-full/rust/src/apis/datacenters_api.rs index bf40f38374..25874dd54a 100644 --- a/sdks/rust/api-full/rust/src/apis/datacenters_api.rs +++ b/sdks/rust/api-full/rust/src/apis/datacenters_api.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -31,6 +31,9 @@ pub async fn datacenters_list(configuration: &configuration::Configuration, ) -> if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; diff --git a/sdks/rust/api-full/rust/src/apis/mod.rs b/sdks/rust/api-full/rust/src/apis/mod.rs index e2fc9daf6d..7af8f990f5 100644 --- a/sdks/rust/api-full/rust/src/apis/mod.rs +++ b/sdks/rust/api-full/rust/src/apis/mod.rs @@ -113,10 +113,7 @@ impl From<&str> for ContentType { pub mod actors_create_api; pub mod actors_delete_api; -pub mod actors_get_api; -pub mod actors_get_by_id_api; pub mod actors_get_or_create_api; -pub mod actors_get_or_create_by_id_api; pub mod actors_list_api; pub mod actors_list_names_api; pub mod datacenters_api; diff --git a/sdks/rust/api-full/rust/src/apis/namespaces_api.rs b/sdks/rust/api-full/rust/src/apis/namespaces_api.rs index 1eb08dc8d7..41728665d8 100644 --- a/sdks/rust/api-full/rust/src/apis/namespaces_api.rs +++ b/sdks/rust/api-full/rust/src/apis/namespaces_api.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -22,13 +22,6 @@ pub enum NamespacesCreateError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`namespaces_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum NamespacesGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`namespaces_list`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -47,6 +40,9 @@ pub async fn namespaces_create(configuration: &configuration::Configuration, nam if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; req_builder = req_builder.json(&p_namespaces_create_request); let req = req_builder.build()?; @@ -74,48 +70,12 @@ pub async fn namespaces_create(configuration: &configuration::Configuration, nam } } -pub async fn namespaces_get(configuration: &configuration::Configuration, namespace_id: &str) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_namespace_id = namespace_id; - - let uri_str = format!("{}/namespaces/{namespace_id}", configuration.base_path, namespace_id=crate::apis::urlencode(p_namespace_id)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NamespacesGetResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NamespacesGetResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -pub async fn namespaces_list(configuration: &configuration::Configuration, limit: Option, cursor: Option<&str>, name: Option<&str>, namespace_id: Option>) -> Result> { +pub async fn namespaces_list(configuration: &configuration::Configuration, limit: Option, cursor: Option<&str>, name: Option<&str>, namespace_ids: Option<&str>) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_limit = limit; let p_cursor = cursor; let p_name = name; - let p_namespace_id = namespace_id; + let p_namespace_ids = namespace_ids; let uri_str = format!("{}/namespaces", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -129,15 +89,15 @@ pub async fn namespaces_list(configuration: &configuration::Configuration, limit if let Some(ref param_value) = p_name { req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); } - if let Some(ref param_value) = p_namespace_id { - req_builder = match "multi" { - "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("namespace_id".to_owned(), p.to_string())).collect::>()), - _ => req_builder.query(&[("namespace_id", ¶m_value.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), - }; + if let Some(ref param_value) = p_namespace_ids { + req_builder = req_builder.query(&[("namespace_ids", ¶m_value.to_string())]); } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -154,8 +114,8 @@ pub async fn namespaces_list(configuration: &configuration::Configuration, limit let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NamespacesListResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NamespacesListResponse`")))), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NamespaceListResponse`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NamespaceListResponse`")))), } } else { let content = resp.text().await?; diff --git a/sdks/rust/api-full/rust/src/apis/runner_configs_api.rs b/sdks/rust/api-full/rust/src/apis/runner_configs_api.rs index 45d22839ba..5e44d81724 100644 --- a/sdks/rust/api-full/rust/src/apis/runner_configs_api.rs +++ b/sdks/rust/api-full/rust/src/apis/runner_configs_api.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -49,6 +49,9 @@ pub async fn runner_configs_delete(configuration: &configuration::Configuration, if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -75,13 +78,13 @@ pub async fn runner_configs_delete(configuration: &configuration::Configuration, } } -pub async fn runner_configs_list(configuration: &configuration::Configuration, namespace: &str, limit: Option, cursor: Option<&str>, variant: Option, runner_name: Option>) -> Result> { +pub async fn runner_configs_list(configuration: &configuration::Configuration, namespace: &str, limit: Option, cursor: Option<&str>, variant: Option, runner_names: Option<&str>) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_namespace = namespace; let p_limit = limit; let p_cursor = cursor; let p_variant = variant; - let p_runner_name = runner_name; + let p_runner_names = runner_names; let uri_str = format!("{}/runner-configs", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -96,15 +99,15 @@ pub async fn runner_configs_list(configuration: &configuration::Configuration, n if let Some(ref param_value) = p_variant { req_builder = req_builder.query(&[("variant", ¶m_value.to_string())]); } - if let Some(ref param_value) = p_runner_name { - req_builder = match "multi" { - "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("runner_name".to_owned(), p.to_string())).collect::>()), - _ => req_builder.query(&[("runner_name", ¶m_value.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), - }; + if let Some(ref param_value) = p_runner_names { + req_builder = req_builder.query(&[("runner_names", ¶m_value.to_string())]); } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -144,6 +147,9 @@ pub async fn runner_configs_upsert(configuration: &configuration::Configuration, if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; req_builder = req_builder.json(&p_runner_configs_upsert_request); let req = req_builder.build()?; diff --git a/sdks/rust/api-full/rust/src/apis/runners_api.rs b/sdks/rust/api-full/rust/src/apis/runners_api.rs index 15897860e7..ea46b715a3 100644 --- a/sdks/rust/api-full/rust/src/apis/runners_api.rs +++ b/sdks/rust/api-full/rust/src/apis/runners_api.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -15,13 +15,6 @@ use crate::{apis::ResponseContent, models}; use super::{Error, configuration, ContentType}; -/// struct for typed errors of method [`runners_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RunnersGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`runners_list`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -37,50 +30,11 @@ pub enum RunnersListNamesError { } -pub async fn runners_get(configuration: &configuration::Configuration, runner_id: &str, namespace: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_runner_id = runner_id; - let p_namespace = namespace; - - let uri_str = format!("{}/runners/{runner_id}", configuration.base_path, runner_id=crate::apis::urlencode(p_runner_id)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_namespace { - req_builder = req_builder.query(&[("namespace", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnersGetResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RunnersGetResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -pub async fn runners_list(configuration: &configuration::Configuration, namespace: &str, name: Option<&str>, include_stopped: Option, limit: Option, cursor: Option<&str>) -> Result> { +pub async fn runners_list(configuration: &configuration::Configuration, namespace: &str, name: Option<&str>, runner_ids: Option<&str>, include_stopped: Option, limit: Option, cursor: Option<&str>) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_namespace = namespace; let p_name = name; + let p_runner_ids = runner_ids; let p_include_stopped = include_stopped; let p_limit = limit; let p_cursor = cursor; @@ -92,6 +46,9 @@ pub async fn runners_list(configuration: &configuration::Configuration, namespac if let Some(ref param_value) = p_name { req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_runner_ids { + req_builder = req_builder.query(&[("runner_ids", ¶m_value.to_string())]); + } if let Some(ref param_value) = p_include_stopped { req_builder = req_builder.query(&[("include_stopped", ¶m_value.to_string())]); } @@ -104,6 +61,9 @@ pub async fn runners_list(configuration: &configuration::Configuration, namespac if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -150,6 +110,9 @@ pub async fn runners_list_names(configuration: &configuration::Configuration, na if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; diff --git a/sdks/rust/api-full/rust/src/models/actor.rs b/sdks/rust/api-full/rust/src/models/actor.rs index a70d8595d3..456fbea726 100644 --- a/sdks/rust/api-full/rust/src/models/actor.rs +++ b/sdks/rust/api-full/rust/src/models/actor.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/actor_name.rs b/sdks/rust/api-full/rust/src/models/actor_name.rs index 80e94a7f6e..4bf4508680 100644 --- a/sdks/rust/api-full/rust/src/models/actor_name.rs +++ b/sdks/rust/api-full/rust/src/models/actor_name.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/actors_create_request.rs b/sdks/rust/api-full/rust/src/models/actors_create_request.rs index 1f00a917c1..84014becc2 100644 --- a/sdks/rust/api-full/rust/src/models/actors_create_request.rs +++ b/sdks/rust/api-full/rust/src/models/actors_create_request.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/actors_create_response.rs b/sdks/rust/api-full/rust/src/models/actors_create_response.rs index 552fff3484..3b1b160409 100644 --- a/sdks/rust/api-full/rust/src/models/actors_create_response.rs +++ b/sdks/rust/api-full/rust/src/models/actors_create_response.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/actors_get_by_id_response.rs b/sdks/rust/api-full/rust/src/models/actors_get_by_id_response.rs deleted file mode 100644 index 802548991a..0000000000 --- a/sdks/rust/api-full/rust/src/models/actors_get_by_id_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 25.7.0 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsGetByIdResponse { - #[serde(rename = "actor_id", skip_serializing_if = "Option::is_none")] - pub actor_id: Option, -} - -impl ActorsGetByIdResponse { - pub fn new() -> ActorsGetByIdResponse { - ActorsGetByIdResponse { - actor_id: None, - } - } -} - diff --git a/sdks/rust/api-full/rust/src/models/actors_get_or_create_by_id_request.rs b/sdks/rust/api-full/rust/src/models/actors_get_or_create_by_id_request.rs deleted file mode 100644 index aa448fa037..0000000000 --- a/sdks/rust/api-full/rust/src/models/actors_get_or_create_by_id_request.rs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 25.7.0 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsGetOrCreateByIdRequest { - #[serde(rename = "crash_policy")] - pub crash_policy: models::CrashPolicy, - #[serde(rename = "input", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] - pub input: Option>, - #[serde(rename = "key")] - pub key: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "runner_name_selector")] - pub runner_name_selector: String, -} - -impl ActorsGetOrCreateByIdRequest { - pub fn new(crash_policy: models::CrashPolicy, key: String, name: String, runner_name_selector: String) -> ActorsGetOrCreateByIdRequest { - ActorsGetOrCreateByIdRequest { - crash_policy, - input: None, - key, - name, - runner_name_selector, - } - } -} - diff --git a/sdks/rust/api-full/rust/src/models/actors_get_or_create_by_id_response.rs b/sdks/rust/api-full/rust/src/models/actors_get_or_create_by_id_response.rs deleted file mode 100644 index a6f8bad968..0000000000 --- a/sdks/rust/api-full/rust/src/models/actors_get_or_create_by_id_response.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 25.7.0 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsGetOrCreateByIdResponse { - #[serde(rename = "actor_id")] - pub actor_id: String, - #[serde(rename = "created")] - pub created: bool, -} - -impl ActorsGetOrCreateByIdResponse { - pub fn new(actor_id: String, created: bool) -> ActorsGetOrCreateByIdResponse { - ActorsGetOrCreateByIdResponse { - actor_id, - created, - } - } -} - diff --git a/sdks/rust/api-full/rust/src/models/actors_get_or_create_request.rs b/sdks/rust/api-full/rust/src/models/actors_get_or_create_request.rs index 91fef4cb84..85fff76b41 100644 --- a/sdks/rust/api-full/rust/src/models/actors_get_or_create_request.rs +++ b/sdks/rust/api-full/rust/src/models/actors_get_or_create_request.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/actors_get_or_create_response.rs b/sdks/rust/api-full/rust/src/models/actors_get_or_create_response.rs index 98b2cc5e4b..c9e06728bb 100644 --- a/sdks/rust/api-full/rust/src/models/actors_get_or_create_response.rs +++ b/sdks/rust/api-full/rust/src/models/actors_get_or_create_response.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/actors_get_response.rs b/sdks/rust/api-full/rust/src/models/actors_get_response.rs deleted file mode 100644 index c9c9996963..0000000000 --- a/sdks/rust/api-full/rust/src/models/actors_get_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 25.7.0 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActorsGetResponse { - #[serde(rename = "actor")] - pub actor: Box, -} - -impl ActorsGetResponse { - pub fn new(actor: models::Actor) -> ActorsGetResponse { - ActorsGetResponse { - actor: Box::new(actor), - } - } -} - diff --git a/sdks/rust/api-full/rust/src/models/actors_list_names_response.rs b/sdks/rust/api-full/rust/src/models/actors_list_names_response.rs index d7b30eef5a..c2cfb8d022 100644 --- a/sdks/rust/api-full/rust/src/models/actors_list_names_response.rs +++ b/sdks/rust/api-full/rust/src/models/actors_list_names_response.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/actors_list_response.rs b/sdks/rust/api-full/rust/src/models/actors_list_response.rs index 78499463b3..82d9920b63 100644 --- a/sdks/rust/api-full/rust/src/models/actors_list_response.rs +++ b/sdks/rust/api-full/rust/src/models/actors_list_response.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/crash_policy.rs b/sdks/rust/api-full/rust/src/models/crash_policy.rs index 5ab95d51b2..283a5020e4 100644 --- a/sdks/rust/api-full/rust/src/models/crash_policy.rs +++ b/sdks/rust/api-full/rust/src/models/crash_policy.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/datacenter.rs b/sdks/rust/api-full/rust/src/models/datacenter.rs index 6399e56d95..5fbabe0220 100644 --- a/sdks/rust/api-full/rust/src/models/datacenter.rs +++ b/sdks/rust/api-full/rust/src/models/datacenter.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/datacenters_list_response.rs b/sdks/rust/api-full/rust/src/models/datacenters_list_response.rs index 05795eb0da..998a30e2d3 100644 --- a/sdks/rust/api-full/rust/src/models/datacenters_list_response.rs +++ b/sdks/rust/api-full/rust/src/models/datacenters_list_response.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/mod.rs b/sdks/rust/api-full/rust/src/models/mod.rs index a3325072a3..e481d42abd 100644 --- a/sdks/rust/api-full/rust/src/models/mod.rs +++ b/sdks/rust/api-full/rust/src/models/mod.rs @@ -6,18 +6,10 @@ pub mod actors_create_request; pub use self::actors_create_request::ActorsCreateRequest; pub mod actors_create_response; pub use self::actors_create_response::ActorsCreateResponse; -pub mod actors_get_by_id_response; -pub use self::actors_get_by_id_response::ActorsGetByIdResponse; -pub mod actors_get_or_create_by_id_request; -pub use self::actors_get_or_create_by_id_request::ActorsGetOrCreateByIdRequest; -pub mod actors_get_or_create_by_id_response; -pub use self::actors_get_or_create_by_id_response::ActorsGetOrCreateByIdResponse; pub mod actors_get_or_create_request; pub use self::actors_get_or_create_request::ActorsGetOrCreateRequest; pub mod actors_get_or_create_response; pub use self::actors_get_or_create_response::ActorsGetOrCreateResponse; -pub mod actors_get_response; -pub use self::actors_get_response::ActorsGetResponse; pub mod actors_list_names_response; pub use self::actors_list_names_response::ActorsListNamesResponse; pub mod actors_list_response; @@ -30,14 +22,12 @@ pub mod datacenters_list_response; pub use self::datacenters_list_response::DatacentersListResponse; pub mod namespace; pub use self::namespace::Namespace; +pub mod namespace_list_response; +pub use self::namespace_list_response::NamespaceListResponse; pub mod namespaces_create_request; pub use self::namespaces_create_request::NamespacesCreateRequest; pub mod namespaces_create_response; pub use self::namespaces_create_response::NamespacesCreateResponse; -pub mod namespaces_get_response; -pub use self::namespaces_get_response::NamespacesGetResponse; -pub mod namespaces_list_response; -pub use self::namespaces_list_response::NamespacesListResponse; pub mod pagination; pub use self::pagination::Pagination; pub mod runner; @@ -52,8 +42,6 @@ pub mod runner_configs_list_response; pub use self::runner_configs_list_response::RunnerConfigsListResponse; pub mod runner_configs_upsert_request; pub use self::runner_configs_upsert_request::RunnerConfigsUpsertRequest; -pub mod runners_get_response; -pub use self::runners_get_response::RunnersGetResponse; pub mod runners_list_names_response; pub use self::runners_list_names_response::RunnersListNamesResponse; pub mod runners_list_response; diff --git a/sdks/rust/api-full/rust/src/models/namespace.rs b/sdks/rust/api-full/rust/src/models/namespace.rs index 305f3c98a6..cdc2b166e5 100644 --- a/sdks/rust/api-full/rust/src/models/namespace.rs +++ b/sdks/rust/api-full/rust/src/models/namespace.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/namespaces_list_response.rs b/sdks/rust/api-full/rust/src/models/namespace_list_response.rs similarity index 77% rename from sdks/rust/api-full/rust/src/models/namespaces_list_response.rs rename to sdks/rust/api-full/rust/src/models/namespace_list_response.rs index 9c57c11515..64ebfacc91 100644 --- a/sdks/rust/api-full/rust/src/models/namespaces_list_response.rs +++ b/sdks/rust/api-full/rust/src/models/namespace_list_response.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -12,16 +12,16 @@ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NamespacesListResponse { +pub struct NamespaceListResponse { #[serde(rename = "namespaces")] pub namespaces: Vec, #[serde(rename = "pagination")] pub pagination: Box, } -impl NamespacesListResponse { - pub fn new(namespaces: Vec, pagination: models::Pagination) -> NamespacesListResponse { - NamespacesListResponse { +impl NamespaceListResponse { + pub fn new(namespaces: Vec, pagination: models::Pagination) -> NamespaceListResponse { + NamespaceListResponse { namespaces, pagination: Box::new(pagination), } diff --git a/sdks/rust/api-full/rust/src/models/namespaces_create_request.rs b/sdks/rust/api-full/rust/src/models/namespaces_create_request.rs index c6f564b098..6586725cc9 100644 --- a/sdks/rust/api-full/rust/src/models/namespaces_create_request.rs +++ b/sdks/rust/api-full/rust/src/models/namespaces_create_request.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/namespaces_create_response.rs b/sdks/rust/api-full/rust/src/models/namespaces_create_response.rs index d6298987e1..53030f49b1 100644 --- a/sdks/rust/api-full/rust/src/models/namespaces_create_response.rs +++ b/sdks/rust/api-full/rust/src/models/namespaces_create_response.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/namespaces_get_response.rs b/sdks/rust/api-full/rust/src/models/namespaces_get_response.rs deleted file mode 100644 index aeaed5e703..0000000000 --- a/sdks/rust/api-full/rust/src/models/namespaces_get_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 25.7.0 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NamespacesGetResponse { - #[serde(rename = "namespace")] - pub namespace: Box, -} - -impl NamespacesGetResponse { - pub fn new(namespace: models::Namespace) -> NamespacesGetResponse { - NamespacesGetResponse { - namespace: Box::new(namespace), - } - } -} - diff --git a/sdks/rust/api-full/rust/src/models/pagination.rs b/sdks/rust/api-full/rust/src/models/pagination.rs index f887c81981..44f530cbee 100644 --- a/sdks/rust/api-full/rust/src/models/pagination.rs +++ b/sdks/rust/api-full/rust/src/models/pagination.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/runner.rs b/sdks/rust/api-full/rust/src/models/runner.rs index 7d0eb52b7a..573e4d5622 100644 --- a/sdks/rust/api-full/rust/src/models/runner.rs +++ b/sdks/rust/api-full/rust/src/models/runner.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/runner_config.rs b/sdks/rust/api-full/rust/src/models/runner_config.rs index 9da4b528d4..7b80fbec1e 100644 --- a/sdks/rust/api-full/rust/src/models/runner_config.rs +++ b/sdks/rust/api-full/rust/src/models/runner_config.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/runner_config_serverless.rs b/sdks/rust/api-full/rust/src/models/runner_config_serverless.rs index 67f49bb32e..3e8fd9ce2d 100644 --- a/sdks/rust/api-full/rust/src/models/runner_config_serverless.rs +++ b/sdks/rust/api-full/rust/src/models/runner_config_serverless.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ @@ -13,6 +13,8 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RunnerConfigServerless { + #[serde(rename = "headers")] + pub headers: std::collections::HashMap, #[serde(rename = "max_runners")] pub max_runners: i32, #[serde(rename = "min_runners")] @@ -29,8 +31,9 @@ pub struct RunnerConfigServerless { } impl RunnerConfigServerless { - pub fn new(max_runners: i32, min_runners: i32, request_lifespan: i32, runners_margin: i32, slots_per_runner: i32, url: String) -> RunnerConfigServerless { + pub fn new(headers: std::collections::HashMap, max_runners: i32, min_runners: i32, request_lifespan: i32, runners_margin: i32, slots_per_runner: i32, url: String) -> RunnerConfigServerless { RunnerConfigServerless { + headers, max_runners, min_runners, request_lifespan, diff --git a/sdks/rust/api-full/rust/src/models/runner_config_variant.rs b/sdks/rust/api-full/rust/src/models/runner_config_variant.rs index a417e93140..50af2e8536 100644 --- a/sdks/rust/api-full/rust/src/models/runner_config_variant.rs +++ b/sdks/rust/api-full/rust/src/models/runner_config_variant.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/runner_configs_list_response.rs b/sdks/rust/api-full/rust/src/models/runner_configs_list_response.rs index d52292df39..f54ea5f817 100644 --- a/sdks/rust/api-full/rust/src/models/runner_configs_list_response.rs +++ b/sdks/rust/api-full/rust/src/models/runner_configs_list_response.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/runner_configs_upsert_request.rs b/sdks/rust/api-full/rust/src/models/runner_configs_upsert_request.rs index 3ffa1cb8db..6976713b15 100644 --- a/sdks/rust/api-full/rust/src/models/runner_configs_upsert_request.rs +++ b/sdks/rust/api-full/rust/src/models/runner_configs_upsert_request.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/runners_get_response.rs b/sdks/rust/api-full/rust/src/models/runners_get_response.rs deleted file mode 100644 index b4db23b182..0000000000 --- a/sdks/rust/api-full/rust/src/models/runners_get_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * rivet-api-public - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 25.7.0 - * Contact: developer@rivet.gg - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RunnersGetResponse { - #[serde(rename = "runner")] - pub runner: models::Runner, -} - -impl RunnersGetResponse { - pub fn new(runner: models::Runner) -> RunnersGetResponse { - RunnersGetResponse { - runner, - } - } -} - diff --git a/sdks/rust/api-full/rust/src/models/runners_list_names_response.rs b/sdks/rust/api-full/rust/src/models/runners_list_names_response.rs index a1c1fa7615..6996e3c209 100644 --- a/sdks/rust/api-full/rust/src/models/runners_list_names_response.rs +++ b/sdks/rust/api-full/rust/src/models/runners_list_names_response.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/rust/api-full/rust/src/models/runners_list_response.rs b/sdks/rust/api-full/rust/src/models/runners_list_response.rs index 04439ff85b..2dec37a0bf 100644 --- a/sdks/rust/api-full/rust/src/models/runners_list_response.rs +++ b/sdks/rust/api-full/rust/src/models/runners_list_response.rs @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 25.7.0 + * The version of the OpenAPI document: 25.7.1 * Contact: developer@rivet.gg * Generated by: https://openapi-generator.tech */ diff --git a/sdks/typescript/api-full/src/Client.ts b/sdks/typescript/api-full/src/Client.ts index bb0f2c5851..6cb545b367 100644 --- a/sdks/typescript/api-full/src/Client.ts +++ b/sdks/typescript/api-full/src/Client.ts @@ -17,6 +17,7 @@ export declare namespace RivetClient { environment: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; + token: core.Supplier; fetcher?: core.FetchFunction; } @@ -62,7 +63,7 @@ export class RivetClient { * 2 round trips: * * - namespace::ops::resolve_for_name_global - * - GET /actors/{} (multiple DCs based on actor IDs) + * - GET /actors (multiple DCs based on actor IDs) * * This path is optimized because we can read the actor IDs fro the key directly from Epoxy with * stale consistency to determine which datacenter the actor lives in. Under most circumstances, @@ -80,9 +81,6 @@ export class RivetClient { * * ## Optimized Alternative Routes * - * For minimal round trips to check if an actor exists for a key, use `GET /actors/by-id`. This - * does not require fetching the actor's state, so it returns immediately. - * * @param {Rivet.ActorsListRequest} request * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -130,6 +128,7 @@ export class RivetClient { ), method: "GET", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -222,6 +221,7 @@ export class RivetClient { ), method: "POST", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -294,9 +294,6 @@ export class RivetClient { * * ## Optimized Alternative Routes * - * For minimal round trips to get or create an actor, use `PUT /actors/by-id`. This doesn't - * require fetching the actor's state from the other datacenter. - * * @param {Rivet.ActorsGetOrCreateRequest} request * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -328,6 +325,7 @@ export class RivetClient { ), method: "PUT", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -373,182 +371,6 @@ export class RivetClient { } } - /** - * 1 round trip: - * - * - namespace::ops::resolve_for_name_global - * - * This does not require another round trip since we use stale consistency for the get_id_for_key. - * - * @param {Rivet.ActorsGetByIdRequest} request - * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.actorsGetById({ - * namespace: "namespace", - * name: "name", - * key: "key" - * }) - */ - public async actorsGetById( - request: Rivet.ActorsGetByIdRequest, - requestOptions?: RivetClient.RequestOptions, - ): Promise { - const { namespace, name, key } = request; - const _queryParams: Record = {}; - _queryParams["namespace"] = namespace; - _queryParams["name"] = name; - _queryParams["key"] = key; - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: urlJoin( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)), - "actors/by-id", - ), - method: "GET", - headers: { - "X-Fern-Language": "JavaScript", - "X-Fern-Runtime": core.RUNTIME.type, - "X-Fern-Runtime-Version": core.RUNTIME.version, - ...requestOptions?.headers, - }, - contentType: "application/json", - queryParameters: _queryParams, - requestType: "json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return serializers.ActorsGetByIdResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }); - } - - if (_response.error.reason === "status-code") { - throw new errors.RivetError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.RivetError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /actors/by-id."); - case "unknown": - throw new errors.RivetError({ - message: _response.error.errorMessage, - }); - } - } - - /** - * **If actor exists** - * - * 1 round trip: - * - * - namespace::ops::resolve_for_name_global - * - * **If actor does not exist and is created in the current datacenter:** - * - * 2 round trips: - * - * - namespace::ops::resolve_for_name_global - * - [pegboard::workflows::actors::keys::allocate_key] Reserve Epoxy key - * - * **If actor does not exist and is created in a different datacenter:** - * - * 3 round trips: - * - * - namespace::ops::resolve_for_name_global - * - namespace::ops::get (to get namespace name for remote call) - * - POST /actors to remote datacenter - * - * @param {Rivet.ActorsGetOrCreateByIdRequest} request - * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.actorsGetOrCreateById({ - * namespace: "namespace", - * crashPolicy: "restart", - * key: "key", - * name: "name", - * runnerNameSelector: "runner_name_selector" - * }) - */ - public async actorsGetOrCreateById( - request: Rivet.ActorsGetOrCreateByIdRequest, - requestOptions?: RivetClient.RequestOptions, - ): Promise { - const { namespace, datacenter, ..._body } = request; - const _queryParams: Record = {}; - _queryParams["namespace"] = namespace; - if (datacenter != null) { - _queryParams["datacenter"] = datacenter; - } - - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: urlJoin( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)), - "actors/by-id", - ), - method: "PUT", - headers: { - "X-Fern-Language": "JavaScript", - "X-Fern-Runtime": core.RUNTIME.type, - "X-Fern-Runtime-Version": core.RUNTIME.version, - ...requestOptions?.headers, - }, - contentType: "application/json", - queryParameters: _queryParams, - requestType: "json", - body: serializers.ActorsGetOrCreateByIdRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return serializers.ActorsGetOrCreateByIdResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }); - } - - if (_response.error.reason === "status-code") { - throw new errors.RivetError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.RivetError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.RivetTimeoutError("Timeout exceeded when calling PUT /actors/by-id."); - case "unknown": - throw new errors.RivetError({ - message: _response.error.errorMessage, - }); - } - } - /** * 2 round trips: * @@ -586,6 +408,7 @@ export class RivetClient { ), method: "GET", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -630,82 +453,6 @@ export class RivetClient { } } - /** - * 2 round trip: - * - * - GET /actors/{} - * - [api-peer] namespace::ops::resolve_for_name_global - * - * @param {Rivet.RivetId} actorId - * @param {Rivet.ActorsGetRequest} request - * @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.actorsGet("actor_id") - */ - public async actorsGet( - actorId: Rivet.RivetId, - request: Rivet.ActorsGetRequest = {}, - requestOptions?: RivetClient.RequestOptions, - ): Promise { - const { namespace } = request; - const _queryParams: Record = {}; - if (namespace != null) { - _queryParams["namespace"] = namespace; - } - - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: urlJoin( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)), - `actors/${encodeURIComponent(serializers.RivetId.jsonOrThrow(actorId))}`, - ), - method: "GET", - headers: { - "X-Fern-Language": "JavaScript", - "X-Fern-Runtime": core.RUNTIME.type, - "X-Fern-Runtime-Version": core.RUNTIME.version, - ...requestOptions?.headers, - }, - contentType: "application/json", - queryParameters: _queryParams, - requestType: "json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return serializers.ActorsGetResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }); - } - - if (_response.error.reason === "status-code") { - throw new errors.RivetError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.RivetError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /actors/{actor_id}."); - case "unknown": - throw new errors.RivetError({ - message: _response.error.errorMessage, - }); - } - } - /** * 2 round trip: * @@ -738,6 +485,7 @@ export class RivetClient { ), method: "DELETE", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -781,4 +529,8 @@ export class RivetClient { }); } } + + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; + } } diff --git a/sdks/typescript/api-full/src/api/client/requests/ActorsGetByIdRequest.ts b/sdks/typescript/api-full/src/api/client/requests/ActorsGetByIdRequest.ts deleted file mode 100644 index 76cc77d2aa..0000000000 --- a/sdks/typescript/api-full/src/api/client/requests/ActorsGetByIdRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * @example - * { - * namespace: "namespace", - * name: "name", - * key: "key" - * } - */ -export interface ActorsGetByIdRequest { - namespace: string; - name: string; - key: string; -} diff --git a/sdks/typescript/api-full/src/api/client/requests/ActorsGetOrCreateByIdRequest.ts b/sdks/typescript/api-full/src/api/client/requests/ActorsGetOrCreateByIdRequest.ts deleted file mode 100644 index 32fb04b1f8..0000000000 --- a/sdks/typescript/api-full/src/api/client/requests/ActorsGetOrCreateByIdRequest.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Rivet from "../../index"; - -/** - * @example - * { - * namespace: "namespace", - * crashPolicy: "restart", - * key: "key", - * name: "name", - * runnerNameSelector: "runner_name_selector" - * } - */ -export interface ActorsGetOrCreateByIdRequest { - namespace: string; - datacenter?: string; - crashPolicy: Rivet.CrashPolicy; - input?: string; - key: string; - name: string; - runnerNameSelector: string; -} diff --git a/sdks/typescript/api-full/src/api/client/requests/ActorsGetRequest.ts b/sdks/typescript/api-full/src/api/client/requests/ActorsGetRequest.ts deleted file mode 100644 index 4c83607b9e..0000000000 --- a/sdks/typescript/api-full/src/api/client/requests/ActorsGetRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * @example - * {} - */ -export interface ActorsGetRequest { - namespace?: string; -} diff --git a/sdks/typescript/api-full/src/api/client/requests/index.ts b/sdks/typescript/api-full/src/api/client/requests/index.ts index 7e003a2a9d..4bdd3fc857 100644 --- a/sdks/typescript/api-full/src/api/client/requests/index.ts +++ b/sdks/typescript/api-full/src/api/client/requests/index.ts @@ -1,8 +1,5 @@ export { type ActorsListRequest } from "./ActorsListRequest"; export { type ActorsCreateRequest } from "./ActorsCreateRequest"; export { type ActorsGetOrCreateRequest } from "./ActorsGetOrCreateRequest"; -export { type ActorsGetByIdRequest } from "./ActorsGetByIdRequest"; -export { type ActorsGetOrCreateByIdRequest } from "./ActorsGetOrCreateByIdRequest"; export { type ActorsListNamesRequest } from "./ActorsListNamesRequest"; -export { type ActorsGetRequest } from "./ActorsGetRequest"; export { type ActorsDeleteRequest } from "./ActorsDeleteRequest"; diff --git a/sdks/typescript/api-full/src/api/resources/datacenters/client/Client.ts b/sdks/typescript/api-full/src/api/resources/datacenters/client/Client.ts index e83190d5f8..bced27b262 100644 --- a/sdks/typescript/api-full/src/api/resources/datacenters/client/Client.ts +++ b/sdks/typescript/api-full/src/api/resources/datacenters/client/Client.ts @@ -13,6 +13,7 @@ export declare namespace Datacenters { environment: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; + token: core.Supplier; fetcher?: core.FetchFunction; } @@ -46,6 +47,7 @@ export class Datacenters { ), method: "GET", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -88,4 +90,8 @@ export class Datacenters { }); } } + + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; + } } diff --git a/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts b/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts index 3a34d0314e..99f5e558bc 100644 --- a/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts +++ b/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts @@ -4,8 +4,8 @@ import * as core from "../../../../core"; import * as Rivet from "../../../index"; -import * as serializers from "../../../../serialization/index"; import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; import * as errors from "../../../../errors/index"; export declare namespace Namespaces { @@ -13,6 +13,7 @@ export declare namespace Namespaces { environment: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; + token: core.Supplier; fetcher?: core.FetchFunction; } @@ -41,8 +42,8 @@ export class Namespaces { public async list( request: Rivet.NamespacesListRequest = {}, requestOptions?: Namespaces.RequestOptions, - ): Promise { - const { limit, cursor, name, namespaceId } = request; + ): Promise { + const { limit, cursor, name, namespaceIds } = request; const _queryParams: Record = {}; if (limit != null) { _queryParams["limit"] = limit.toString(); @@ -56,14 +57,8 @@ export class Namespaces { _queryParams["name"] = name; } - if (namespaceId != null) { - if (Array.isArray(namespaceId)) { - _queryParams["namespace_id"] = namespaceId.map((item) => - serializers.RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams["namespace_id"] = namespaceId; - } + if (namespaceIds != null) { + _queryParams["namespace_ids"] = namespaceIds; } const _response = await (this._options.fetcher ?? core.fetcher)({ @@ -74,6 +69,7 @@ export class Namespaces { ), method: "GET", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -87,7 +83,7 @@ export class Namespaces { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return serializers.NamespacesListResponse.parseOrThrow(_response.body, { + return serializers.NamespaceListResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -140,6 +136,7 @@ export class Namespaces { ), method: "POST", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -184,65 +181,7 @@ export class Namespaces { } } - /** - * @param {Rivet.RivetId} namespaceId - * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.namespaces.get("namespace_id") - */ - public async get( - namespaceId: Rivet.RivetId, - requestOptions?: Namespaces.RequestOptions, - ): Promise { - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: urlJoin( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)), - `namespaces/${encodeURIComponent(serializers.RivetId.jsonOrThrow(namespaceId))}`, - ), - method: "GET", - headers: { - "X-Fern-Language": "JavaScript", - "X-Fern-Runtime": core.RUNTIME.type, - "X-Fern-Runtime-Version": core.RUNTIME.version, - ...requestOptions?.headers, - }, - contentType: "application/json", - requestType: "json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return serializers.NamespacesGetResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }); - } - - if (_response.error.reason === "status-code") { - throw new errors.RivetError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.RivetError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /namespaces/{namespace_id}."); - case "unknown": - throw new errors.RivetError({ - message: _response.error.errorMessage, - }); - } + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts b/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts index 6f6cc6e9d9..c05f5d60a9 100644 --- a/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts +++ b/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts @@ -2,8 +2,6 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; - /** * @example * {} @@ -12,5 +10,5 @@ export interface NamespacesListRequest { limit?: number; cursor?: string; name?: string; - namespaceId?: Rivet.RivetId | Rivet.RivetId[]; + namespaceIds?: string; } diff --git a/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/Client.ts b/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/Client.ts index 7f2775e602..0f767469ef 100644 --- a/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/Client.ts +++ b/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/Client.ts @@ -13,6 +13,7 @@ export declare namespace RunnerConfigs { environment: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; + token: core.Supplier; fetcher?: core.FetchFunction; } @@ -44,7 +45,7 @@ export class RunnerConfigs { request: Rivet.RunnerConfigsListRequest, requestOptions?: RunnerConfigs.RequestOptions, ): Promise { - const { namespace, limit, cursor, variant, runnerName } = request; + const { namespace, limit, cursor, variant, runnerNames } = request; const _queryParams: Record = {}; _queryParams["namespace"] = namespace; if (limit != null) { @@ -61,12 +62,8 @@ export class RunnerConfigs { }); } - if (runnerName != null) { - if (Array.isArray(runnerName)) { - _queryParams["runner_name"] = runnerName.map((item) => item); - } else { - _queryParams["runner_name"] = runnerName; - } + if (runnerNames != null) { + _queryParams["runner_names"] = runnerNames; } const _response = await (this._options.fetcher ?? core.fetcher)({ @@ -77,6 +74,7 @@ export class RunnerConfigs { ), method: "GET", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -130,6 +128,9 @@ export class RunnerConfigs { * await client.runnerConfigs.upsert("runner_name", { * namespace: "namespace", * serverless: { + * headers: { + * "key": "value" + * }, * maxRunners: 1, * minRunners: 1, * requestLifespan: 1, @@ -155,6 +156,7 @@ export class RunnerConfigs { ), method: "PUT", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -226,6 +228,7 @@ export class RunnerConfigs { ), method: "DELETE", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -271,4 +274,8 @@ export class RunnerConfigs { }); } } + + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; + } } diff --git a/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/requests/RunnerConfigsListRequest.ts b/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/requests/RunnerConfigsListRequest.ts index e73d7778eb..67a0a31c4c 100644 --- a/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/requests/RunnerConfigsListRequest.ts +++ b/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/requests/RunnerConfigsListRequest.ts @@ -15,5 +15,5 @@ export interface RunnerConfigsListRequest { limit?: number; cursor?: string; variant?: Rivet.RunnerConfigVariant; - runnerName?: string | string[]; + runnerNames?: string; } diff --git a/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/requests/RunnerConfigsUpsertRequest.ts b/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/requests/RunnerConfigsUpsertRequest.ts index eed1172004..79478a01d3 100644 --- a/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/requests/RunnerConfigsUpsertRequest.ts +++ b/sdks/typescript/api-full/src/api/resources/runnerConfigs/client/requests/RunnerConfigsUpsertRequest.ts @@ -9,6 +9,9 @@ import * as Rivet from "../../../../index"; * { * namespace: "namespace", * serverless: { + * headers: { + * "key": "value" + * }, * maxRunners: 1, * minRunners: 1, * requestLifespan: 1, diff --git a/sdks/typescript/api-full/src/api/resources/runnerConfigs/types/RunnerConfigsUpsertRequestServerless.ts b/sdks/typescript/api-full/src/api/resources/runnerConfigs/types/RunnerConfigsUpsertRequestServerless.ts index 8010e452a5..cb63ce5f81 100644 --- a/sdks/typescript/api-full/src/api/resources/runnerConfigs/types/RunnerConfigsUpsertRequestServerless.ts +++ b/sdks/typescript/api-full/src/api/resources/runnerConfigs/types/RunnerConfigsUpsertRequestServerless.ts @@ -3,6 +3,7 @@ */ export interface RunnerConfigsUpsertRequestServerless { + headers: Record; maxRunners: number; minRunners: number; /** Seconds. */ diff --git a/sdks/typescript/api-full/src/api/resources/runners/client/Client.ts b/sdks/typescript/api-full/src/api/resources/runners/client/Client.ts index d3cafeb31e..770de7d8b0 100644 --- a/sdks/typescript/api-full/src/api/resources/runners/client/Client.ts +++ b/sdks/typescript/api-full/src/api/resources/runners/client/Client.ts @@ -13,6 +13,7 @@ export declare namespace Runners { environment: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; + token: core.Supplier; fetcher?: core.FetchFunction; } @@ -44,13 +45,17 @@ export class Runners { request: Rivet.RunnersListRequest, requestOptions?: Runners.RequestOptions, ): Promise { - const { namespace, name, includeStopped, limit, cursor } = request; + const { namespace, name, runnerIds, includeStopped, limit, cursor } = request; const _queryParams: Record = {}; _queryParams["namespace"] = namespace; if (name != null) { _queryParams["name"] = name; } + if (runnerIds != null) { + _queryParams["runner_ids"] = runnerIds; + } + if (includeStopped != null) { _queryParams["include_stopped"] = includeStopped.toString(); } @@ -71,6 +76,7 @@ export class Runners { ), method: "GET", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -152,6 +158,7 @@ export class Runners { ), method: "GET", headers: { + Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, @@ -196,74 +203,7 @@ export class Runners { } } - /** - * @param {Rivet.RivetId} runnerId - * @param {Rivet.RunnersGetRequest} request - * @param {Runners.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.runners.get("runner_id") - */ - public async get( - runnerId: Rivet.RivetId, - request: Rivet.RunnersGetRequest = {}, - requestOptions?: Runners.RequestOptions, - ): Promise { - const { namespace } = request; - const _queryParams: Record = {}; - if (namespace != null) { - _queryParams["namespace"] = namespace; - } - - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: urlJoin( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)), - `runners/${encodeURIComponent(serializers.RivetId.jsonOrThrow(runnerId))}`, - ), - method: "GET", - headers: { - "X-Fern-Language": "JavaScript", - "X-Fern-Runtime": core.RUNTIME.type, - "X-Fern-Runtime-Version": core.RUNTIME.version, - ...requestOptions?.headers, - }, - contentType: "application/json", - queryParameters: _queryParams, - requestType: "json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return serializers.RunnersGetResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }); - } - - if (_response.error.reason === "status-code") { - throw new errors.RivetError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.RivetError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.RivetTimeoutError("Timeout exceeded when calling GET /runners/{runner_id}."); - case "unknown": - throw new errors.RivetError({ - message: _response.error.errorMessage, - }); - } + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersGetRequest.ts b/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersGetRequest.ts deleted file mode 100644 index 472c56a195..0000000000 --- a/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersGetRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * @example - * {} - */ -export interface RunnersGetRequest { - namespace?: string; -} diff --git a/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListRequest.ts b/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListRequest.ts index b58ab4d510..c8acfe7fe0 100644 --- a/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListRequest.ts +++ b/sdks/typescript/api-full/src/api/resources/runners/client/requests/RunnersListRequest.ts @@ -11,6 +11,7 @@ export interface RunnersListRequest { namespace: string; name?: string; + runnerIds?: string; includeStopped?: boolean; limit?: number; cursor?: string; diff --git a/sdks/typescript/api-full/src/api/resources/runners/client/requests/index.ts b/sdks/typescript/api-full/src/api/resources/runners/client/requests/index.ts index 5753ea5841..f0ed35df2c 100644 --- a/sdks/typescript/api-full/src/api/resources/runners/client/requests/index.ts +++ b/sdks/typescript/api-full/src/api/resources/runners/client/requests/index.ts @@ -1,3 +1,2 @@ export { type RunnersListRequest } from "./RunnersListRequest"; export { type RunnersListNamesRequest } from "./RunnersListNamesRequest"; -export { type RunnersGetRequest } from "./RunnersGetRequest"; diff --git a/sdks/typescript/api-full/src/api/types/ActorsGetByIdResponse.ts b/sdks/typescript/api-full/src/api/types/ActorsGetByIdResponse.ts deleted file mode 100644 index 1c9ec7e076..0000000000 --- a/sdks/typescript/api-full/src/api/types/ActorsGetByIdResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Rivet from "../index"; - -export interface ActorsGetByIdResponse { - actorId?: Rivet.RivetId; -} diff --git a/sdks/typescript/api-full/src/api/types/ActorsGetOrCreateByIdResponse.ts b/sdks/typescript/api-full/src/api/types/ActorsGetOrCreateByIdResponse.ts deleted file mode 100644 index 42823c1731..0000000000 --- a/sdks/typescript/api-full/src/api/types/ActorsGetOrCreateByIdResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Rivet from "../index"; - -export interface ActorsGetOrCreateByIdResponse { - actorId: Rivet.RivetId; - created: boolean; -} diff --git a/sdks/typescript/api-full/src/api/types/ActorsGetResponse.ts b/sdks/typescript/api-full/src/api/types/ActorsGetResponse.ts deleted file mode 100644 index 197148375c..0000000000 --- a/sdks/typescript/api-full/src/api/types/ActorsGetResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Rivet from "../index"; - -export interface ActorsGetResponse { - actor: Rivet.Actor; -} diff --git a/sdks/typescript/api-full/src/api/types/NamespacesListResponse.ts b/sdks/typescript/api-full/src/api/types/NamespaceListResponse.ts similarity index 81% rename from sdks/typescript/api-full/src/api/types/NamespacesListResponse.ts rename to sdks/typescript/api-full/src/api/types/NamespaceListResponse.ts index 6a9b4a457c..13231f665d 100644 --- a/sdks/typescript/api-full/src/api/types/NamespacesListResponse.ts +++ b/sdks/typescript/api-full/src/api/types/NamespaceListResponse.ts @@ -4,7 +4,7 @@ import * as Rivet from "../index"; -export interface NamespacesListResponse { +export interface NamespaceListResponse { namespaces: Rivet.Namespace[]; pagination: Rivet.Pagination; } diff --git a/sdks/typescript/api-full/src/api/types/NamespacesGetResponse.ts b/sdks/typescript/api-full/src/api/types/NamespacesGetResponse.ts deleted file mode 100644 index 7b1d81304b..0000000000 --- a/sdks/typescript/api-full/src/api/types/NamespacesGetResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Rivet from "../index"; - -export interface NamespacesGetResponse { - namespace: Rivet.Namespace; -} diff --git a/sdks/typescript/api-full/src/api/types/RunnerConfigServerless.ts b/sdks/typescript/api-full/src/api/types/RunnerConfigServerless.ts index bf1512bcc7..c963fb30ca 100644 --- a/sdks/typescript/api-full/src/api/types/RunnerConfigServerless.ts +++ b/sdks/typescript/api-full/src/api/types/RunnerConfigServerless.ts @@ -3,6 +3,7 @@ */ export interface RunnerConfigServerless { + headers: Record; maxRunners: number; minRunners: number; /** Seconds. */ diff --git a/sdks/typescript/api-full/src/api/types/RunnersGetResponse.ts b/sdks/typescript/api-full/src/api/types/RunnersGetResponse.ts deleted file mode 100644 index 9ed5dee7eb..0000000000 --- a/sdks/typescript/api-full/src/api/types/RunnersGetResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Rivet from "../index"; - -export interface RunnersGetResponse { - runner: Rivet.Runner; -} diff --git a/sdks/typescript/api-full/src/api/types/index.ts b/sdks/typescript/api-full/src/api/types/index.ts index e2ee18b8fb..7f35694d54 100644 --- a/sdks/typescript/api-full/src/api/types/index.ts +++ b/sdks/typescript/api-full/src/api/types/index.ts @@ -2,19 +2,15 @@ export * from "./Actor"; export * from "./ActorName"; export * from "./ActorsCreateResponse"; export * from "./ActorsDeleteResponse"; -export * from "./ActorsGetByIdResponse"; -export * from "./ActorsGetOrCreateByIdResponse"; export * from "./ActorsGetOrCreateResponse"; -export * from "./ActorsGetResponse"; export * from "./ActorsListNamesResponse"; export * from "./ActorsListResponse"; export * from "./CrashPolicy"; export * from "./Datacenter"; export * from "./DatacentersListResponse"; export * from "./Namespace"; +export * from "./NamespaceListResponse"; export * from "./NamespacesCreateResponse"; -export * from "./NamespacesGetResponse"; -export * from "./NamespacesListResponse"; export * from "./Pagination"; export * from "./RivetId"; export * from "./Runner"; @@ -24,6 +20,5 @@ export * from "./RunnerConfigVariant"; export * from "./RunnerConfigsDeleteResponse"; export * from "./RunnerConfigsListResponse"; export * from "./RunnerConfigsUpsertResponse"; -export * from "./RunnersGetResponse"; export * from "./RunnersListNamesResponse"; export * from "./RunnersListResponse"; diff --git a/sdks/typescript/api-full/src/core/auth/BasicAuth.ts b/sdks/typescript/api-full/src/core/auth/BasicAuth.ts new file mode 100644 index 0000000000..146df2150a --- /dev/null +++ b/sdks/typescript/api-full/src/core/auth/BasicAuth.ts @@ -0,0 +1,31 @@ +import { Base64 } from "js-base64"; + +export interface BasicAuth { + username: string; + password: string; +} + +const BASIC_AUTH_HEADER_PREFIX = /^Basic /i; + +export const BasicAuth = { + toAuthorizationHeader: (basicAuth: BasicAuth | undefined): string | undefined => { + if (basicAuth == null) { + return undefined; + } + const token = Base64.encode(`${basicAuth.username}:${basicAuth.password}`); + return `Basic ${token}`; + }, + fromAuthorizationHeader: (header: string): BasicAuth => { + const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, ""); + const decoded = Base64.decode(credentials); + const [username, password] = decoded.split(":", 2); + + if (username == null || password == null) { + throw new Error("Invalid basic auth"); + } + return { + username, + password, + }; + }, +}; diff --git a/sdks/typescript/api-full/src/core/auth/BearerToken.ts b/sdks/typescript/api-full/src/core/auth/BearerToken.ts new file mode 100644 index 0000000000..fe987fc9c4 --- /dev/null +++ b/sdks/typescript/api-full/src/core/auth/BearerToken.ts @@ -0,0 +1,15 @@ +export type BearerToken = string; + +const BEARER_AUTH_HEADER_PREFIX = /^Bearer /i; + +export const BearerToken = { + toAuthorizationHeader: (token: BearerToken | undefined): string | undefined => { + if (token == null) { + return undefined; + } + return `Bearer ${token}`; + }, + fromAuthorizationHeader: (header: string): BearerToken => { + return header.replace(BEARER_AUTH_HEADER_PREFIX, "").trim() as BearerToken; + }, +}; diff --git a/sdks/typescript/api-full/src/core/auth/index.ts b/sdks/typescript/api-full/src/core/auth/index.ts new file mode 100644 index 0000000000..ee293b3435 --- /dev/null +++ b/sdks/typescript/api-full/src/core/auth/index.ts @@ -0,0 +1,2 @@ +export { BasicAuth } from "./BasicAuth"; +export { BearerToken } from "./BearerToken"; diff --git a/sdks/typescript/api-full/src/core/index.ts b/sdks/typescript/api-full/src/core/index.ts index e3006860f4..2d20c46f3e 100644 --- a/sdks/typescript/api-full/src/core/index.ts +++ b/sdks/typescript/api-full/src/core/index.ts @@ -1,3 +1,4 @@ export * from "./fetcher"; +export * from "./auth"; export * from "./runtime"; export * as serialization from "./schemas"; diff --git a/sdks/typescript/api-full/src/serialization/client/requests/ActorsGetOrCreateByIdRequest.ts b/sdks/typescript/api-full/src/serialization/client/requests/ActorsGetOrCreateByIdRequest.ts deleted file mode 100644 index 015df282b2..0000000000 --- a/sdks/typescript/api-full/src/serialization/client/requests/ActorsGetOrCreateByIdRequest.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../index"; -import * as Rivet from "../../../api/index"; -import * as core from "../../../core"; -import { CrashPolicy } from "../../types/CrashPolicy"; - -export const ActorsGetOrCreateByIdRequest: core.serialization.Schema< - serializers.ActorsGetOrCreateByIdRequest.Raw, - Omit -> = core.serialization.object({ - crashPolicy: core.serialization.property("crash_policy", CrashPolicy), - input: core.serialization.string().optional(), - key: core.serialization.string(), - name: core.serialization.string(), - runnerNameSelector: core.serialization.property("runner_name_selector", core.serialization.string()), -}); - -export declare namespace ActorsGetOrCreateByIdRequest { - export interface Raw { - crash_policy: CrashPolicy.Raw; - input?: string | null; - key: string; - name: string; - runner_name_selector: string; - } -} diff --git a/sdks/typescript/api-full/src/serialization/client/requests/index.ts b/sdks/typescript/api-full/src/serialization/client/requests/index.ts index 8e0dca40ba..d8f3bedaaa 100644 --- a/sdks/typescript/api-full/src/serialization/client/requests/index.ts +++ b/sdks/typescript/api-full/src/serialization/client/requests/index.ts @@ -1,3 +1,2 @@ export { ActorsCreateRequest } from "./ActorsCreateRequest"; export { ActorsGetOrCreateRequest } from "./ActorsGetOrCreateRequest"; -export { ActorsGetOrCreateByIdRequest } from "./ActorsGetOrCreateByIdRequest"; diff --git a/sdks/typescript/api-full/src/serialization/resources/runnerConfigs/types/RunnerConfigsUpsertRequestServerless.ts b/sdks/typescript/api-full/src/serialization/resources/runnerConfigs/types/RunnerConfigsUpsertRequestServerless.ts index 218dab97ec..5d13cccb8d 100644 --- a/sdks/typescript/api-full/src/serialization/resources/runnerConfigs/types/RunnerConfigsUpsertRequestServerless.ts +++ b/sdks/typescript/api-full/src/serialization/resources/runnerConfigs/types/RunnerConfigsUpsertRequestServerless.ts @@ -10,6 +10,7 @@ export const RunnerConfigsUpsertRequestServerless: core.serialization.ObjectSche serializers.RunnerConfigsUpsertRequestServerless.Raw, Rivet.RunnerConfigsUpsertRequestServerless > = core.serialization.object({ + headers: core.serialization.record(core.serialization.string(), core.serialization.string()), maxRunners: core.serialization.property("max_runners", core.serialization.number()), minRunners: core.serialization.property("min_runners", core.serialization.number()), requestLifespan: core.serialization.property("request_lifespan", core.serialization.number()), @@ -20,6 +21,7 @@ export const RunnerConfigsUpsertRequestServerless: core.serialization.ObjectSche export declare namespace RunnerConfigsUpsertRequestServerless { export interface Raw { + headers: Record; max_runners: number; min_runners: number; request_lifespan: number; diff --git a/sdks/typescript/api-full/src/serialization/types/ActorsGetByIdResponse.ts b/sdks/typescript/api-full/src/serialization/types/ActorsGetByIdResponse.ts deleted file mode 100644 index 6168094421..0000000000 --- a/sdks/typescript/api-full/src/serialization/types/ActorsGetByIdResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Rivet from "../../api/index"; -import * as core from "../../core"; -import { RivetId } from "./RivetId"; - -export const ActorsGetByIdResponse: core.serialization.ObjectSchema< - serializers.ActorsGetByIdResponse.Raw, - Rivet.ActorsGetByIdResponse -> = core.serialization.object({ - actorId: core.serialization.property("actor_id", RivetId.optional()), -}); - -export declare namespace ActorsGetByIdResponse { - export interface Raw { - actor_id?: RivetId.Raw | null; - } -} diff --git a/sdks/typescript/api-full/src/serialization/types/ActorsGetOrCreateByIdResponse.ts b/sdks/typescript/api-full/src/serialization/types/ActorsGetOrCreateByIdResponse.ts deleted file mode 100644 index 4c37c5257d..0000000000 --- a/sdks/typescript/api-full/src/serialization/types/ActorsGetOrCreateByIdResponse.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Rivet from "../../api/index"; -import * as core from "../../core"; -import { RivetId } from "./RivetId"; - -export const ActorsGetOrCreateByIdResponse: core.serialization.ObjectSchema< - serializers.ActorsGetOrCreateByIdResponse.Raw, - Rivet.ActorsGetOrCreateByIdResponse -> = core.serialization.object({ - actorId: core.serialization.property("actor_id", RivetId), - created: core.serialization.boolean(), -}); - -export declare namespace ActorsGetOrCreateByIdResponse { - export interface Raw { - actor_id: RivetId.Raw; - created: boolean; - } -} diff --git a/sdks/typescript/api-full/src/serialization/types/ActorsGetResponse.ts b/sdks/typescript/api-full/src/serialization/types/ActorsGetResponse.ts deleted file mode 100644 index 5c3742b43a..0000000000 --- a/sdks/typescript/api-full/src/serialization/types/ActorsGetResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Rivet from "../../api/index"; -import * as core from "../../core"; -import { Actor } from "./Actor"; - -export const ActorsGetResponse: core.serialization.ObjectSchema< - serializers.ActorsGetResponse.Raw, - Rivet.ActorsGetResponse -> = core.serialization.object({ - actor: Actor, -}); - -export declare namespace ActorsGetResponse { - export interface Raw { - actor: Actor.Raw; - } -} diff --git a/sdks/typescript/api-full/src/serialization/types/NamespacesListResponse.ts b/sdks/typescript/api-full/src/serialization/types/NamespaceListResponse.ts similarity index 71% rename from sdks/typescript/api-full/src/serialization/types/NamespacesListResponse.ts rename to sdks/typescript/api-full/src/serialization/types/NamespaceListResponse.ts index 5dc1e050a4..6ade545cc6 100644 --- a/sdks/typescript/api-full/src/serialization/types/NamespacesListResponse.ts +++ b/sdks/typescript/api-full/src/serialization/types/NamespaceListResponse.ts @@ -8,15 +8,15 @@ import * as core from "../../core"; import { Namespace } from "./Namespace"; import { Pagination } from "./Pagination"; -export const NamespacesListResponse: core.serialization.ObjectSchema< - serializers.NamespacesListResponse.Raw, - Rivet.NamespacesListResponse +export const NamespaceListResponse: core.serialization.ObjectSchema< + serializers.NamespaceListResponse.Raw, + Rivet.NamespaceListResponse > = core.serialization.object({ namespaces: core.serialization.list(Namespace), pagination: Pagination, }); -export declare namespace NamespacesListResponse { +export declare namespace NamespaceListResponse { export interface Raw { namespaces: Namespace.Raw[]; pagination: Pagination.Raw; diff --git a/sdks/typescript/api-full/src/serialization/types/NamespacesGetResponse.ts b/sdks/typescript/api-full/src/serialization/types/NamespacesGetResponse.ts deleted file mode 100644 index 580c0ce5b7..0000000000 --- a/sdks/typescript/api-full/src/serialization/types/NamespacesGetResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Rivet from "../../api/index"; -import * as core from "../../core"; -import { Namespace } from "./Namespace"; - -export const NamespacesGetResponse: core.serialization.ObjectSchema< - serializers.NamespacesGetResponse.Raw, - Rivet.NamespacesGetResponse -> = core.serialization.object({ - namespace: Namespace, -}); - -export declare namespace NamespacesGetResponse { - export interface Raw { - namespace: Namespace.Raw; - } -} diff --git a/sdks/typescript/api-full/src/serialization/types/RunnerConfigServerless.ts b/sdks/typescript/api-full/src/serialization/types/RunnerConfigServerless.ts index 6ef29cd106..689bfa04cd 100644 --- a/sdks/typescript/api-full/src/serialization/types/RunnerConfigServerless.ts +++ b/sdks/typescript/api-full/src/serialization/types/RunnerConfigServerless.ts @@ -10,6 +10,7 @@ export const RunnerConfigServerless: core.serialization.ObjectSchema< serializers.RunnerConfigServerless.Raw, Rivet.RunnerConfigServerless > = core.serialization.object({ + headers: core.serialization.record(core.serialization.string(), core.serialization.string()), maxRunners: core.serialization.property("max_runners", core.serialization.number()), minRunners: core.serialization.property("min_runners", core.serialization.number()), requestLifespan: core.serialization.property("request_lifespan", core.serialization.number()), @@ -20,6 +21,7 @@ export const RunnerConfigServerless: core.serialization.ObjectSchema< export declare namespace RunnerConfigServerless { export interface Raw { + headers: Record; max_runners: number; min_runners: number; request_lifespan: number; diff --git a/sdks/typescript/api-full/src/serialization/types/RunnersGetResponse.ts b/sdks/typescript/api-full/src/serialization/types/RunnersGetResponse.ts deleted file mode 100644 index 930ba31bdb..0000000000 --- a/sdks/typescript/api-full/src/serialization/types/RunnersGetResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Rivet from "../../api/index"; -import * as core from "../../core"; -import { Runner } from "./Runner"; - -export const RunnersGetResponse: core.serialization.ObjectSchema< - serializers.RunnersGetResponse.Raw, - Rivet.RunnersGetResponse -> = core.serialization.object({ - runner: Runner, -}); - -export declare namespace RunnersGetResponse { - export interface Raw { - runner: Runner.Raw; - } -} diff --git a/sdks/typescript/api-full/src/serialization/types/index.ts b/sdks/typescript/api-full/src/serialization/types/index.ts index e2ee18b8fb..7f35694d54 100644 --- a/sdks/typescript/api-full/src/serialization/types/index.ts +++ b/sdks/typescript/api-full/src/serialization/types/index.ts @@ -2,19 +2,15 @@ export * from "./Actor"; export * from "./ActorName"; export * from "./ActorsCreateResponse"; export * from "./ActorsDeleteResponse"; -export * from "./ActorsGetByIdResponse"; -export * from "./ActorsGetOrCreateByIdResponse"; export * from "./ActorsGetOrCreateResponse"; -export * from "./ActorsGetResponse"; export * from "./ActorsListNamesResponse"; export * from "./ActorsListResponse"; export * from "./CrashPolicy"; export * from "./Datacenter"; export * from "./DatacentersListResponse"; export * from "./Namespace"; +export * from "./NamespaceListResponse"; export * from "./NamespacesCreateResponse"; -export * from "./NamespacesGetResponse"; -export * from "./NamespacesListResponse"; export * from "./Pagination"; export * from "./RivetId"; export * from "./Runner"; @@ -24,6 +20,5 @@ export * from "./RunnerConfigVariant"; export * from "./RunnerConfigsDeleteResponse"; export * from "./RunnerConfigsListResponse"; export * from "./RunnerConfigsUpsertResponse"; -export * from "./RunnersGetResponse"; export * from "./RunnersListNamesResponse"; export * from "./RunnersListResponse";