From 39a1851f2c9b3236fbbcfdb9e431c79cb8f73773 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Tue, 10 Sep 2024 11:31:23 -0400 Subject: [PATCH] Expose beta 'svix stream' api --- go/internal/openapi/api_sink.go | 421 + go/internal/openapi/api_stream.go | 1121 ++ go/internal/openapi/client.go | 6 + .../model_list_response_stream_sink_out_.go | 229 + .../openapi/model_oauth2_auth_method_in.go | 2 +- go/internal/openapi/model_s3_config.go | 195 + go/internal/openapi/model_sink_in.go | 28 + go/internal/openapi/model_sink_in_one_of_4.go | 137 + go/internal/openapi/model_sink_out.go | 28 + .../openapi/model_sink_payload_format.go | 108 + go/internal/openapi/model_sink_status.go | 112 + go/internal/openapi/model_sink_status_in.go | 110 + go/internal/openapi/model_stream_sink_in.go | 169 + .../openapi/model_stream_sink_in_one_of.go | 137 + .../openapi/model_stream_sink_in_one_of_1.go | 137 + .../openapi/model_stream_sink_in_one_of_2.go | 137 + .../model_stream_sink_in_one_of_config.go | 108 + go/internal/openapi/model_stream_sink_out.go | 169 + .../openapi/model_stream_sink_patch.go | 169 + openapi.json | 10997 +++++++++------- rust/src/api.rs | 16 + rust/src/lib.rs | 2 +- 22 files changed, 9998 insertions(+), 4540 deletions(-) create mode 100644 go/internal/openapi/api_sink.go create mode 100644 go/internal/openapi/api_stream.go create mode 100644 go/internal/openapi/model_list_response_stream_sink_out_.go create mode 100644 go/internal/openapi/model_s3_config.go create mode 100644 go/internal/openapi/model_sink_in_one_of_4.go create mode 100644 go/internal/openapi/model_sink_payload_format.go create mode 100644 go/internal/openapi/model_sink_status.go create mode 100644 go/internal/openapi/model_sink_status_in.go create mode 100644 go/internal/openapi/model_stream_sink_in.go create mode 100644 go/internal/openapi/model_stream_sink_in_one_of.go create mode 100644 go/internal/openapi/model_stream_sink_in_one_of_1.go create mode 100644 go/internal/openapi/model_stream_sink_in_one_of_2.go create mode 100644 go/internal/openapi/model_stream_sink_in_one_of_config.go create mode 100644 go/internal/openapi/model_stream_sink_out.go create mode 100644 go/internal/openapi/model_stream_sink_patch.go diff --git a/go/internal/openapi/api_sink.go b/go/internal/openapi/api_sink.go new file mode 100644 index 000000000..aac13f39b --- /dev/null +++ b/go/internal/openapi/api_sink.go @@ -0,0 +1,421 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" + "time" +) + +// Linger please +var ( + _ _context.Context +) + +// SinkApiService SinkApi service +type SinkApiService service + +type ApiV1StreamCreateEventsRequest struct { + ctx _context.Context + ApiService *SinkApiService + streamId string + createStreamIn *CreateStreamIn + idempotencyKey *string +} + +func (r ApiV1StreamCreateEventsRequest) CreateStreamIn(createStreamIn CreateStreamIn) ApiV1StreamCreateEventsRequest { + r.createStreamIn = &createStreamIn + return r +} +func (r ApiV1StreamCreateEventsRequest) IdempotencyKey(idempotencyKey string) ApiV1StreamCreateEventsRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiV1StreamCreateEventsRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { + return r.ApiService.V1StreamCreateEventsExecute(r) +} + +/* + * V1StreamCreateEvents Append To Stream + * Creates streaming events. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param streamId + * @return ApiV1StreamCreateEventsRequest + */ +func (a *SinkApiService) V1StreamCreateEvents(ctx _context.Context, streamId string) ApiV1StreamCreateEventsRequest { + return ApiV1StreamCreateEventsRequest{ + ApiService: a, + ctx: ctx, + streamId: streamId, + } +} + +/* + * Execute executes the request + * @return map[string]interface{} + */ +func (a *SinkApiService) V1StreamCreateEventsExecute(r ApiV1StreamCreateEventsRequest) (map[string]interface{}, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SinkApiService.V1StreamCreateEvents") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/stream/{stream_id}/events" + localVarPath = strings.Replace(localVarPath, "{"+"stream_id"+"}", _neturl.PathEscape(parameterToString(r.streamId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.createStreamIn == nil { + return localVarReturnValue, nil, reportError("createStreamIn is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + } + // body params + localVarPostBody = r.createStreamIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiV1StreamEventsGetRequest struct { + ctx _context.Context + ApiService *SinkApiService + streamId string + limit *int32 + iterator *string + after *time.Time +} + +func (r ApiV1StreamEventsGetRequest) Limit(limit int32) ApiV1StreamEventsGetRequest { + r.limit = &limit + return r +} +func (r ApiV1StreamEventsGetRequest) Iterator(iterator string) ApiV1StreamEventsGetRequest { + r.iterator = &iterator + return r +} +func (r ApiV1StreamEventsGetRequest) After(after time.Time) ApiV1StreamEventsGetRequest { + r.after = &after + return r +} + +func (r ApiV1StreamEventsGetRequest) Execute() (EventStreamOut, *_nethttp.Response, error) { + return r.ApiService.V1StreamEventsGetExecute(r) +} + +/* + * V1StreamEventsGet Stream Events + * Iterate over a stream of events. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param streamId + * @return ApiV1StreamEventsGetRequest + */ +func (a *SinkApiService) V1StreamEventsGet(ctx _context.Context, streamId string) ApiV1StreamEventsGetRequest { + return ApiV1StreamEventsGetRequest{ + ApiService: a, + ctx: ctx, + streamId: streamId, + } +} + +/* + * Execute executes the request + * @return EventStreamOut + */ +func (a *SinkApiService) V1StreamEventsGetExecute(r ApiV1StreamEventsGetRequest) (EventStreamOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue EventStreamOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SinkApiService.V1StreamEventsGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/stream/{stream_id}/events" + localVarPath = strings.Replace(localVarPath, "{"+"stream_id"+"}", _neturl.PathEscape(parameterToString(r.streamId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + if r.iterator != nil { + localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + } + if r.after != nil { + localVarQueryParams.Add("after", parameterToString(*r.after, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/go/internal/openapi/api_stream.go b/go/internal/openapi/api_stream.go new file mode 100644 index 000000000..ac829c93f --- /dev/null +++ b/go/internal/openapi/api_stream.go @@ -0,0 +1,1121 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// StreamApiService StreamApi service +type StreamApiService service + +type ApiV1StreamCreateRequest struct { + ctx _context.Context + ApiService *StreamApiService + streamIn *StreamIn + idempotencyKey *string +} + +func (r ApiV1StreamCreateRequest) StreamIn(streamIn StreamIn) ApiV1StreamCreateRequest { + r.streamIn = &streamIn + return r +} +func (r ApiV1StreamCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1StreamCreateRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiV1StreamCreateRequest) Execute() (StreamOut, *_nethttp.Response, error) { + return r.ApiService.V1StreamCreateExecute(r) +} + +/* + * V1StreamCreate Create Stream + * Creates a new stream. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiV1StreamCreateRequest + */ +func (a *StreamApiService) V1StreamCreate(ctx _context.Context) ApiV1StreamCreateRequest { + return ApiV1StreamCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return StreamOut + */ +func (a *StreamApiService) V1StreamCreateExecute(r ApiV1StreamCreateRequest) (StreamOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue StreamOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamApiService.V1StreamCreate") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/stream" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.streamIn == nil { + return localVarReturnValue, nil, reportError("streamIn is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + } + // body params + localVarPostBody = r.streamIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiV1StreamDeleteRequest struct { + ctx _context.Context + ApiService *StreamApiService + streamId string +} + + +func (r ApiV1StreamDeleteRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.V1StreamDeleteExecute(r) +} + +/* + * V1StreamDelete Delete Stream + * Delete a stream. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param streamId + * @return ApiV1StreamDeleteRequest + */ +func (a *StreamApiService) V1StreamDelete(ctx _context.Context, streamId string) ApiV1StreamDeleteRequest { + return ApiV1StreamDeleteRequest{ + ApiService: a, + ctx: ctx, + streamId: streamId, + } +} + +/* + * Execute executes the request + */ +func (a *StreamApiService) V1StreamDeleteExecute(r ApiV1StreamDeleteRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamApiService.V1StreamDelete") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/stream/{stream_id}" + localVarPath = strings.Replace(localVarPath, "{"+"stream_id"+"}", _neturl.PathEscape(parameterToString(r.streamId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiV1StreamGetRequest struct { + ctx _context.Context + ApiService *StreamApiService + streamId string +} + + +func (r ApiV1StreamGetRequest) Execute() (StreamOut, *_nethttp.Response, error) { + return r.ApiService.V1StreamGetExecute(r) +} + +/* + * V1StreamGet Get Stream + * Get a stream by id or uid. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param streamId + * @return ApiV1StreamGetRequest + */ +func (a *StreamApiService) V1StreamGet(ctx _context.Context, streamId string) ApiV1StreamGetRequest { + return ApiV1StreamGetRequest{ + ApiService: a, + ctx: ctx, + streamId: streamId, + } +} + +/* + * Execute executes the request + * @return StreamOut + */ +func (a *StreamApiService) V1StreamGetExecute(r ApiV1StreamGetRequest) (StreamOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue StreamOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamApiService.V1StreamGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/stream/{stream_id}" + localVarPath = strings.Replace(localVarPath, "{"+"stream_id"+"}", _neturl.PathEscape(parameterToString(r.streamId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiV1StreamListRequest struct { + ctx _context.Context + ApiService *StreamApiService + limit *int32 + iterator *string + order *Ordering +} + +func (r ApiV1StreamListRequest) Limit(limit int32) ApiV1StreamListRequest { + r.limit = &limit + return r +} +func (r ApiV1StreamListRequest) Iterator(iterator string) ApiV1StreamListRequest { + r.iterator = &iterator + return r +} +func (r ApiV1StreamListRequest) Order(order Ordering) ApiV1StreamListRequest { + r.order = &order + return r +} + +func (r ApiV1StreamListRequest) Execute() (ListResponseStreamOut, *_nethttp.Response, error) { + return r.ApiService.V1StreamListExecute(r) +} + +/* + * V1StreamList List Streams + * List of all the organization's streams. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiV1StreamListRequest + */ +func (a *StreamApiService) V1StreamList(ctx _context.Context) ApiV1StreamListRequest { + return ApiV1StreamListRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return ListResponseStreamOut + */ +func (a *StreamApiService) V1StreamListExecute(r ApiV1StreamListRequest) (ListResponseStreamOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ListResponseStreamOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamApiService.V1StreamList") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/stream" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + if r.iterator != nil { + localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + } + if r.order != nil { + localVarQueryParams.Add("order", parameterToString(*r.order, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiV1StreamPatchRequest struct { + ctx _context.Context + ApiService *StreamApiService + streamId string + streamPatch *StreamPatch +} + +func (r ApiV1StreamPatchRequest) StreamPatch(streamPatch StreamPatch) ApiV1StreamPatchRequest { + r.streamPatch = &streamPatch + return r +} + +func (r ApiV1StreamPatchRequest) Execute() (StreamOut, *_nethttp.Response, error) { + return r.ApiService.V1StreamPatchExecute(r) +} + +/* + * V1StreamPatch Patch Stream + * Partially update a stream. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param streamId + * @return ApiV1StreamPatchRequest + */ +func (a *StreamApiService) V1StreamPatch(ctx _context.Context, streamId string) ApiV1StreamPatchRequest { + return ApiV1StreamPatchRequest{ + ApiService: a, + ctx: ctx, + streamId: streamId, + } +} + +/* + * Execute executes the request + * @return StreamOut + */ +func (a *StreamApiService) V1StreamPatchExecute(r ApiV1StreamPatchRequest) (StreamOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue StreamOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamApiService.V1StreamPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/stream/{stream_id}" + localVarPath = strings.Replace(localVarPath, "{"+"stream_id"+"}", _neturl.PathEscape(parameterToString(r.streamId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.streamPatch == nil { + return localVarReturnValue, nil, reportError("streamPatch is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.streamPatch + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiV1StreamUpdateRequest struct { + ctx _context.Context + ApiService *StreamApiService + streamId string + streamIn *StreamIn +} + +func (r ApiV1StreamUpdateRequest) StreamIn(streamIn StreamIn) ApiV1StreamUpdateRequest { + r.streamIn = &streamIn + return r +} + +func (r ApiV1StreamUpdateRequest) Execute() (StreamOut, *_nethttp.Response, error) { + return r.ApiService.V1StreamUpdateExecute(r) +} + +/* + * V1StreamUpdate Update Stream + * Update a stream. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param streamId + * @return ApiV1StreamUpdateRequest + */ +func (a *StreamApiService) V1StreamUpdate(ctx _context.Context, streamId string) ApiV1StreamUpdateRequest { + return ApiV1StreamUpdateRequest{ + ApiService: a, + ctx: ctx, + streamId: streamId, + } +} + +/* + * Execute executes the request + * @return StreamOut + */ +func (a *StreamApiService) V1StreamUpdateExecute(r ApiV1StreamUpdateRequest) (StreamOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue StreamOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamApiService.V1StreamUpdate") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/stream/{stream_id}" + localVarPath = strings.Replace(localVarPath, "{"+"stream_id"+"}", _neturl.PathEscape(parameterToString(r.streamId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.streamIn == nil { + return localVarReturnValue, nil, reportError("streamIn is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.streamIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/go/internal/openapi/client.go b/go/internal/openapi/client.go index c57b31ab7..22d1654f9 100644 --- a/go/internal/openapi/client.go +++ b/go/internal/openapi/client.go @@ -80,8 +80,12 @@ type APIClient struct { MessageAttemptApi *MessageAttemptApiService + SinkApi *SinkApiService + StatisticsApi *StatisticsApiService + StreamApi *StreamApiService + TransformationTemplateApi *TransformationTemplateApiService } @@ -115,7 +119,9 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.IntegrationApi = (*IntegrationApiService)(&c.common) c.MessageApi = (*MessageApiService)(&c.common) c.MessageAttemptApi = (*MessageAttemptApiService)(&c.common) + c.SinkApi = (*SinkApiService)(&c.common) c.StatisticsApi = (*StatisticsApiService)(&c.common) + c.StreamApi = (*StreamApiService)(&c.common) c.TransformationTemplateApi = (*TransformationTemplateApiService)(&c.common) return c diff --git a/go/internal/openapi/model_list_response_stream_sink_out_.go b/go/internal/openapi/model_list_response_stream_sink_out_.go new file mode 100644 index 000000000..ee98d38de --- /dev/null +++ b/go/internal/openapi/model_list_response_stream_sink_out_.go @@ -0,0 +1,229 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// ListResponseStreamSinkOut struct for ListResponseStreamSinkOut +type ListResponseStreamSinkOut struct { + Data []StreamSinkOut `json:"data"` + Done bool `json:"done"` + Iterator NullableString `json:"iterator,omitempty"` + PrevIterator NullableString `json:"prevIterator,omitempty"` +} + +// NewListResponseStreamSinkOut instantiates a new ListResponseStreamSinkOut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListResponseStreamSinkOut(data []StreamSinkOut, done bool) *ListResponseStreamSinkOut { + this := ListResponseStreamSinkOut{} + this.Data = data + this.Done = done + return &this +} + +// NewListResponseStreamSinkOutWithDefaults instantiates a new ListResponseStreamSinkOut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListResponseStreamSinkOutWithDefaults() *ListResponseStreamSinkOut { + this := ListResponseStreamSinkOut{} + return &this +} + +// GetData returns the Data field value +func (o *ListResponseStreamSinkOut) GetData() []StreamSinkOut { + if o == nil { + var ret []StreamSinkOut + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListResponseStreamSinkOut) GetDataOk() (*[]StreamSinkOut, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListResponseStreamSinkOut) SetData(v []StreamSinkOut) { + o.Data = v +} + +// GetDone returns the Done field value +func (o *ListResponseStreamSinkOut) GetDone() bool { + if o == nil { + var ret bool + return ret + } + + return o.Done +} + +// GetDoneOk returns a tuple with the Done field value +// and a boolean to check if the value has been set. +func (o *ListResponseStreamSinkOut) GetDoneOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Done, true +} + +// SetDone sets field value +func (o *ListResponseStreamSinkOut) SetDone(v bool) { + o.Done = v +} + +// GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListResponseStreamSinkOut) GetIterator() string { + if o == nil || o.Iterator.Get() == nil { + var ret string + return ret + } + return *o.Iterator.Get() +} + +// GetIteratorOk returns a tuple with the Iterator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListResponseStreamSinkOut) GetIteratorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Iterator.Get(), o.Iterator.IsSet() +} + +// HasIterator returns a boolean if a field has been set. +func (o *ListResponseStreamSinkOut) HasIterator() bool { + if o != nil && o.Iterator.IsSet() { + return true + } + + return false +} + +// SetIterator gets a reference to the given NullableString and assigns it to the Iterator field. +func (o *ListResponseStreamSinkOut) SetIterator(v string) { + o.Iterator.Set(&v) +} +// SetIteratorNil sets the value for Iterator to be an explicit nil +func (o *ListResponseStreamSinkOut) SetIteratorNil() { + o.Iterator.Set(nil) +} + +// UnsetIterator ensures that no value is present for Iterator, not even an explicit nil +func (o *ListResponseStreamSinkOut) UnsetIterator() { + o.Iterator.Unset() +} + +// GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListResponseStreamSinkOut) GetPrevIterator() string { + if o == nil || o.PrevIterator.Get() == nil { + var ret string + return ret + } + return *o.PrevIterator.Get() +} + +// GetPrevIteratorOk returns a tuple with the PrevIterator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListResponseStreamSinkOut) GetPrevIteratorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PrevIterator.Get(), o.PrevIterator.IsSet() +} + +// HasPrevIterator returns a boolean if a field has been set. +func (o *ListResponseStreamSinkOut) HasPrevIterator() bool { + if o != nil && o.PrevIterator.IsSet() { + return true + } + + return false +} + +// SetPrevIterator gets a reference to the given NullableString and assigns it to the PrevIterator field. +func (o *ListResponseStreamSinkOut) SetPrevIterator(v string) { + o.PrevIterator.Set(&v) +} +// SetPrevIteratorNil sets the value for PrevIterator to be an explicit nil +func (o *ListResponseStreamSinkOut) SetPrevIteratorNil() { + o.PrevIterator.Set(nil) +} + +// UnsetPrevIterator ensures that no value is present for PrevIterator, not even an explicit nil +func (o *ListResponseStreamSinkOut) UnsetPrevIterator() { + o.PrevIterator.Unset() +} + +func (o ListResponseStreamSinkOut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["data"] = o.Data + } + if true { + toSerialize["done"] = o.Done + } + if o.Iterator.IsSet() { + toSerialize["iterator"] = o.Iterator.Get() + } + if o.PrevIterator.IsSet() { + toSerialize["prevIterator"] = o.PrevIterator.Get() + } + return json.Marshal(toSerialize) +} + +type NullableListResponseStreamSinkOut struct { + value *ListResponseStreamSinkOut + isSet bool +} + +func (v NullableListResponseStreamSinkOut) Get() *ListResponseStreamSinkOut { + return v.value +} + +func (v *NullableListResponseStreamSinkOut) Set(val *ListResponseStreamSinkOut) { + v.value = val + v.isSet = true +} + +func (v NullableListResponseStreamSinkOut) IsSet() bool { + return v.isSet +} + +func (v *NullableListResponseStreamSinkOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListResponseStreamSinkOut(val *ListResponseStreamSinkOut) *NullableListResponseStreamSinkOut { + return &NullableListResponseStreamSinkOut{value: val, isSet: true} +} + +func (v NullableListResponseStreamSinkOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListResponseStreamSinkOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_oauth2_auth_method_in.go b/go/internal/openapi/model_oauth2_auth_method_in.go index ebc9cfd5b..2d308645d 100644 --- a/go/internal/openapi/model_oauth2_auth_method_in.go +++ b/go/internal/openapi/model_oauth2_auth_method_in.go @@ -15,7 +15,7 @@ import ( "fmt" ) -// Oauth2AuthMethodIn The method used for authenticating to the OAuth authorization server. `clientSecretJwt` will construct a JWT used for authentication with the oauth authorization server. This method is less commonly used and may not be supported by all oauth providers. `clientSecretBasic` will authenticate to the oauth authorization server using an `Authorization` header with the client secret as the value. This is the most common means of authentication. `clientSecretPost` will authenticate to the oauth authorization server by passing the client secret in a `client_secret` field in the request body. This method may not be supported by all oauth providers, and in general `clientSecretBasic` should be preferred. +// Oauth2AuthMethodIn The method used for authenticating to the OAuth authorization server. `clientSecretJwt` will construct a JWT used for authentication with the oauth authorization server. This method is less commonly used and may not be supported by all oauth providers. `clientSecretBasic` will authenticate to the oauth authorization server using an `Authorization` header with the client secret as the value. This is the most common means of authentication. `clientSecretPost` will authenticate to the oauth authorization server by passing the client secret in a `client_secret` field in the request body. This method may not be supported by all oauth providers, and in general `clientSecretBasic` should be preferred. type Oauth2AuthMethodIn string // List of Oauth2AuthMethodIn diff --git a/go/internal/openapi/model_s3_config.go b/go/internal/openapi/model_s3_config.go new file mode 100644 index 000000000..3c1cc4ae5 --- /dev/null +++ b/go/internal/openapi/model_s3_config.go @@ -0,0 +1,195 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// S3Config struct for S3Config +type S3Config struct { + AccessKey string `json:"accessKey"` + Bucket string `json:"bucket"` + Region string `json:"region"` + SecretAccessKey string `json:"secretAccessKey"` +} + +// NewS3Config instantiates a new S3Config object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewS3Config(accessKey string, bucket string, region string, secretAccessKey string) *S3Config { + this := S3Config{} + this.AccessKey = accessKey + this.Bucket = bucket + this.Region = region + this.SecretAccessKey = secretAccessKey + return &this +} + +// NewS3ConfigWithDefaults instantiates a new S3Config object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewS3ConfigWithDefaults() *S3Config { + this := S3Config{} + return &this +} + +// GetAccessKey returns the AccessKey field value +func (o *S3Config) GetAccessKey() string { + if o == nil { + var ret string + return ret + } + + return o.AccessKey +} + +// GetAccessKeyOk returns a tuple with the AccessKey field value +// and a boolean to check if the value has been set. +func (o *S3Config) GetAccessKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessKey, true +} + +// SetAccessKey sets field value +func (o *S3Config) SetAccessKey(v string) { + o.AccessKey = v +} + +// GetBucket returns the Bucket field value +func (o *S3Config) GetBucket() string { + if o == nil { + var ret string + return ret + } + + return o.Bucket +} + +// GetBucketOk returns a tuple with the Bucket field value +// and a boolean to check if the value has been set. +func (o *S3Config) GetBucketOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bucket, true +} + +// SetBucket sets field value +func (o *S3Config) SetBucket(v string) { + o.Bucket = v +} + +// GetRegion returns the Region field value +func (o *S3Config) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *S3Config) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *S3Config) SetRegion(v string) { + o.Region = v +} + +// GetSecretAccessKey returns the SecretAccessKey field value +func (o *S3Config) GetSecretAccessKey() string { + if o == nil { + var ret string + return ret + } + + return o.SecretAccessKey +} + +// GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field value +// and a boolean to check if the value has been set. +func (o *S3Config) GetSecretAccessKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SecretAccessKey, true +} + +// SetSecretAccessKey sets field value +func (o *S3Config) SetSecretAccessKey(v string) { + o.SecretAccessKey = v +} + +func (o S3Config) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["accessKey"] = o.AccessKey + } + if true { + toSerialize["bucket"] = o.Bucket + } + if true { + toSerialize["region"] = o.Region + } + if true { + toSerialize["secretAccessKey"] = o.SecretAccessKey + } + return json.Marshal(toSerialize) +} + +type NullableS3Config struct { + value *S3Config + isSet bool +} + +func (v NullableS3Config) Get() *S3Config { + return v.value +} + +func (v *NullableS3Config) Set(val *S3Config) { + v.value = val + v.isSet = true +} + +func (v NullableS3Config) IsSet() bool { + return v.isSet +} + +func (v *NullableS3Config) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableS3Config(val *S3Config) *NullableS3Config { + return &NullableS3Config{value: val, isSet: true} +} + +func (v NullableS3Config) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableS3Config) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_sink_in.go b/go/internal/openapi/model_sink_in.go index 96aee7081..b5055b4a1 100644 --- a/go/internal/openapi/model_sink_in.go +++ b/go/internal/openapi/model_sink_in.go @@ -21,6 +21,7 @@ type SinkIn struct { SinkInOneOf1 *SinkInOneOf1 SinkInOneOf2 *SinkInOneOf2 SinkInOneOf3 *SinkInOneOf3 + SinkInOneOf4 *SinkInOneOf4 } // SinkInOneOfAsSinkIn is a convenience function that returns SinkInOneOf wrapped in SinkIn @@ -43,6 +44,11 @@ func SinkInOneOf3AsSinkIn(v *SinkInOneOf3) SinkIn { return SinkIn{ SinkInOneOf3: v} } +// SinkInOneOf4AsSinkIn is a convenience function that returns SinkInOneOf4 wrapped in SinkIn +func SinkInOneOf4AsSinkIn(v *SinkInOneOf4) SinkIn { + return SinkIn{ SinkInOneOf4: v} +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *SinkIn) UnmarshalJSON(data []byte) error { @@ -100,12 +106,26 @@ func (dst *SinkIn) UnmarshalJSON(data []byte) error { dst.SinkInOneOf3 = nil } + // try to unmarshal data into SinkInOneOf4 + err = json.Unmarshal(data, &dst.SinkInOneOf4) + if err == nil { + jsonSinkInOneOf4, _ := json.Marshal(dst.SinkInOneOf4) + if string(jsonSinkInOneOf4) == "{}" { // empty struct + dst.SinkInOneOf4 = nil + } else { + match++ + } + } else { + dst.SinkInOneOf4 = nil + } + if match > 1 { // more than 1 match // reset to nil dst.SinkInOneOf = nil dst.SinkInOneOf1 = nil dst.SinkInOneOf2 = nil dst.SinkInOneOf3 = nil + dst.SinkInOneOf4 = nil return fmt.Errorf("Data matches more than one schema in oneOf(SinkIn)") } else if match == 1 { @@ -133,6 +153,10 @@ func (src SinkIn) MarshalJSON() ([]byte, error) { return json.Marshal(&src.SinkInOneOf3) } + if src.SinkInOneOf4 != nil { + return json.Marshal(&src.SinkInOneOf4) + } + return nil, nil // no data in oneOf schemas } @@ -154,6 +178,10 @@ func (obj *SinkIn) GetActualInstance() (interface{}) { return obj.SinkInOneOf3 } + if obj.SinkInOneOf4 != nil { + return obj.SinkInOneOf4 + } + // all schemas are nil return nil } diff --git a/go/internal/openapi/model_sink_in_one_of_4.go b/go/internal/openapi/model_sink_in_one_of_4.go new file mode 100644 index 000000000..b8d1ced13 --- /dev/null +++ b/go/internal/openapi/model_sink_in_one_of_4.go @@ -0,0 +1,137 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// SinkInOneOf4 struct for SinkInOneOf4 +type SinkInOneOf4 struct { + Type string `json:"type"` + Url string `json:"url"` +} + +// NewSinkInOneOf4 instantiates a new SinkInOneOf4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSinkInOneOf4(type_ string, url string) *SinkInOneOf4 { + this := SinkInOneOf4{} + this.Type = type_ + this.Url = url + return &this +} + +// NewSinkInOneOf4WithDefaults instantiates a new SinkInOneOf4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSinkInOneOf4WithDefaults() *SinkInOneOf4 { + this := SinkInOneOf4{} + return &this +} + +// GetType returns the Type field value +func (o *SinkInOneOf4) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SinkInOneOf4) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *SinkInOneOf4) SetType(v string) { + o.Type = v +} + +// GetUrl returns the Url field value +func (o *SinkInOneOf4) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *SinkInOneOf4) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *SinkInOneOf4) SetUrl(v string) { + o.Url = v +} + +func (o SinkInOneOf4) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["type"] = o.Type + } + if true { + toSerialize["url"] = o.Url + } + return json.Marshal(toSerialize) +} + +type NullableSinkInOneOf4 struct { + value *SinkInOneOf4 + isSet bool +} + +func (v NullableSinkInOneOf4) Get() *SinkInOneOf4 { + return v.value +} + +func (v *NullableSinkInOneOf4) Set(val *SinkInOneOf4) { + v.value = val + v.isSet = true +} + +func (v NullableSinkInOneOf4) IsSet() bool { + return v.isSet +} + +func (v *NullableSinkInOneOf4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSinkInOneOf4(val *SinkInOneOf4) *NullableSinkInOneOf4 { + return &NullableSinkInOneOf4{value: val, isSet: true} +} + +func (v NullableSinkInOneOf4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSinkInOneOf4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_sink_out.go b/go/internal/openapi/model_sink_out.go index 22a8439c9..e2416df5e 100644 --- a/go/internal/openapi/model_sink_out.go +++ b/go/internal/openapi/model_sink_out.go @@ -21,6 +21,7 @@ type SinkOut struct { SinkInOneOf1 *SinkInOneOf1 SinkInOneOf2 *SinkInOneOf2 SinkInOneOf3 *SinkInOneOf3 + SinkInOneOf4 *SinkInOneOf4 } // SinkInOneOfAsSinkOut is a convenience function that returns SinkInOneOf wrapped in SinkOut @@ -43,6 +44,11 @@ func SinkInOneOf3AsSinkOut(v *SinkInOneOf3) SinkOut { return SinkOut{ SinkInOneOf3: v} } +// SinkInOneOf4AsSinkOut is a convenience function that returns SinkInOneOf4 wrapped in SinkOut +func SinkInOneOf4AsSinkOut(v *SinkInOneOf4) SinkOut { + return SinkOut{ SinkInOneOf4: v} +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *SinkOut) UnmarshalJSON(data []byte) error { @@ -100,12 +106,26 @@ func (dst *SinkOut) UnmarshalJSON(data []byte) error { dst.SinkInOneOf3 = nil } + // try to unmarshal data into SinkInOneOf4 + err = json.Unmarshal(data, &dst.SinkInOneOf4) + if err == nil { + jsonSinkInOneOf4, _ := json.Marshal(dst.SinkInOneOf4) + if string(jsonSinkInOneOf4) == "{}" { // empty struct + dst.SinkInOneOf4 = nil + } else { + match++ + } + } else { + dst.SinkInOneOf4 = nil + } + if match > 1 { // more than 1 match // reset to nil dst.SinkInOneOf = nil dst.SinkInOneOf1 = nil dst.SinkInOneOf2 = nil dst.SinkInOneOf3 = nil + dst.SinkInOneOf4 = nil return fmt.Errorf("Data matches more than one schema in oneOf(SinkOut)") } else if match == 1 { @@ -133,6 +153,10 @@ func (src SinkOut) MarshalJSON() ([]byte, error) { return json.Marshal(&src.SinkInOneOf3) } + if src.SinkInOneOf4 != nil { + return json.Marshal(&src.SinkInOneOf4) + } + return nil, nil // no data in oneOf schemas } @@ -154,6 +178,10 @@ func (obj *SinkOut) GetActualInstance() (interface{}) { return obj.SinkInOneOf3 } + if obj.SinkInOneOf4 != nil { + return obj.SinkInOneOf4 + } + // all schemas are nil return nil } diff --git a/go/internal/openapi/model_sink_payload_format.go b/go/internal/openapi/model_sink_payload_format.go new file mode 100644 index 000000000..416108206 --- /dev/null +++ b/go/internal/openapi/model_sink_payload_format.go @@ -0,0 +1,108 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// SinkPayloadFormat the model 'SinkPayloadFormat' +type SinkPayloadFormat string + +// List of SinkPayloadFormat +const ( + SINKPAYLOADFORMAT_JSON SinkPayloadFormat = "json" +) + +var allowedSinkPayloadFormatEnumValues = []SinkPayloadFormat{ + "json", +} + +func (v *SinkPayloadFormat) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SinkPayloadFormat(value) + for _, existing := range allowedSinkPayloadFormatEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SinkPayloadFormat", value) +} + +// NewSinkPayloadFormatFromValue returns a pointer to a valid SinkPayloadFormat +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSinkPayloadFormatFromValue(v string) (*SinkPayloadFormat, error) { + ev := SinkPayloadFormat(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SinkPayloadFormat: valid values are %v", v, allowedSinkPayloadFormatEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SinkPayloadFormat) IsValid() bool { + for _, existing := range allowedSinkPayloadFormatEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SinkPayloadFormat value +func (v SinkPayloadFormat) Ptr() *SinkPayloadFormat { + return &v +} + +type NullableSinkPayloadFormat struct { + value *SinkPayloadFormat + isSet bool +} + +func (v NullableSinkPayloadFormat) Get() *SinkPayloadFormat { + return v.value +} + +func (v *NullableSinkPayloadFormat) Set(val *SinkPayloadFormat) { + v.value = val + v.isSet = true +} + +func (v NullableSinkPayloadFormat) IsSet() bool { + return v.isSet +} + +func (v *NullableSinkPayloadFormat) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSinkPayloadFormat(val *SinkPayloadFormat) *NullableSinkPayloadFormat { + return &NullableSinkPayloadFormat{value: val, isSet: true} +} + +func (v NullableSinkPayloadFormat) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSinkPayloadFormat) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/go/internal/openapi/model_sink_status.go b/go/internal/openapi/model_sink_status.go new file mode 100644 index 000000000..be0722504 --- /dev/null +++ b/go/internal/openapi/model_sink_status.go @@ -0,0 +1,112 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// SinkStatus the model 'SinkStatus' +type SinkStatus string + +// List of SinkStatus +const ( + SINKSTATUS_ENABLED SinkStatus = "enabled" + SINKSTATUS_PAUSED SinkStatus = "paused" + SINKSTATUS_DISABLED SinkStatus = "disabled" +) + +var allowedSinkStatusEnumValues = []SinkStatus{ + "enabled", + "paused", + "disabled", +} + +func (v *SinkStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SinkStatus(value) + for _, existing := range allowedSinkStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SinkStatus", value) +} + +// NewSinkStatusFromValue returns a pointer to a valid SinkStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSinkStatusFromValue(v string) (*SinkStatus, error) { + ev := SinkStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SinkStatus: valid values are %v", v, allowedSinkStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SinkStatus) IsValid() bool { + for _, existing := range allowedSinkStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SinkStatus value +func (v SinkStatus) Ptr() *SinkStatus { + return &v +} + +type NullableSinkStatus struct { + value *SinkStatus + isSet bool +} + +func (v NullableSinkStatus) Get() *SinkStatus { + return v.value +} + +func (v *NullableSinkStatus) Set(val *SinkStatus) { + v.value = val + v.isSet = true +} + +func (v NullableSinkStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableSinkStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSinkStatus(val *SinkStatus) *NullableSinkStatus { + return &NullableSinkStatus{value: val, isSet: true} +} + +func (v NullableSinkStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSinkStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/go/internal/openapi/model_sink_status_in.go b/go/internal/openapi/model_sink_status_in.go new file mode 100644 index 000000000..0ec0e7c33 --- /dev/null +++ b/go/internal/openapi/model_sink_status_in.go @@ -0,0 +1,110 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// SinkStatusIn the model 'SinkStatusIn' +type SinkStatusIn string + +// List of SinkStatusIn +const ( + SINKSTATUSIN_ENABLED SinkStatusIn = "enabled" + SINKSTATUSIN_PAUSED SinkStatusIn = "paused" +) + +var allowedSinkStatusInEnumValues = []SinkStatusIn{ + "enabled", + "paused", +} + +func (v *SinkStatusIn) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SinkStatusIn(value) + for _, existing := range allowedSinkStatusInEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SinkStatusIn", value) +} + +// NewSinkStatusInFromValue returns a pointer to a valid SinkStatusIn +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSinkStatusInFromValue(v string) (*SinkStatusIn, error) { + ev := SinkStatusIn(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SinkStatusIn: valid values are %v", v, allowedSinkStatusInEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SinkStatusIn) IsValid() bool { + for _, existing := range allowedSinkStatusInEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SinkStatusIn value +func (v SinkStatusIn) Ptr() *SinkStatusIn { + return &v +} + +type NullableSinkStatusIn struct { + value *SinkStatusIn + isSet bool +} + +func (v NullableSinkStatusIn) Get() *SinkStatusIn { + return v.value +} + +func (v *NullableSinkStatusIn) Set(val *SinkStatusIn) { + v.value = val + v.isSet = true +} + +func (v NullableSinkStatusIn) IsSet() bool { + return v.isSet +} + +func (v *NullableSinkStatusIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSinkStatusIn(val *SinkStatusIn) *NullableSinkStatusIn { + return &NullableSinkStatusIn{value: val, isSet: true} +} + +func (v NullableSinkStatusIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSinkStatusIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/go/internal/openapi/model_stream_sink_in.go b/go/internal/openapi/model_stream_sink_in.go new file mode 100644 index 000000000..0962ad2ea --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in.go @@ -0,0 +1,169 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// StreamSinkIn - struct for StreamSinkIn +type StreamSinkIn struct { + StreamSinkInOneOf *StreamSinkInOneOf + StreamSinkInOneOf1 *StreamSinkInOneOf1 + StreamSinkInOneOf2 *StreamSinkInOneOf2 +} + +// StreamSinkInOneOfAsStreamSinkIn is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkIn +func StreamSinkInOneOfAsStreamSinkIn(v *StreamSinkInOneOf) StreamSinkIn { + return StreamSinkIn{ StreamSinkInOneOf: v} +} + +// StreamSinkInOneOf1AsStreamSinkIn is a convenience function that returns StreamSinkInOneOf1 wrapped in StreamSinkIn +func StreamSinkInOneOf1AsStreamSinkIn(v *StreamSinkInOneOf1) StreamSinkIn { + return StreamSinkIn{ StreamSinkInOneOf1: v} +} + +// StreamSinkInOneOf2AsStreamSinkIn is a convenience function that returns StreamSinkInOneOf2 wrapped in StreamSinkIn +func StreamSinkInOneOf2AsStreamSinkIn(v *StreamSinkInOneOf2) StreamSinkIn { + return StreamSinkIn{ StreamSinkInOneOf2: v} +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *StreamSinkIn) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into StreamSinkInOneOf + err = json.Unmarshal(data, &dst.StreamSinkInOneOf) + if err == nil { + jsonStreamSinkInOneOf, _ := json.Marshal(dst.StreamSinkInOneOf) + if string(jsonStreamSinkInOneOf) == "{}" { // empty struct + dst.StreamSinkInOneOf = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf = nil + } + + // try to unmarshal data into StreamSinkInOneOf1 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf1) + if err == nil { + jsonStreamSinkInOneOf1, _ := json.Marshal(dst.StreamSinkInOneOf1) + if string(jsonStreamSinkInOneOf1) == "{}" { // empty struct + dst.StreamSinkInOneOf1 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf1 = nil + } + + // try to unmarshal data into StreamSinkInOneOf2 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf2) + if err == nil { + jsonStreamSinkInOneOf2, _ := json.Marshal(dst.StreamSinkInOneOf2) + if string(jsonStreamSinkInOneOf2) == "{}" { // empty struct + dst.StreamSinkInOneOf2 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf2 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.StreamSinkInOneOf = nil + dst.StreamSinkInOneOf1 = nil + dst.StreamSinkInOneOf2 = nil + + return fmt.Errorf("Data matches more than one schema in oneOf(StreamSinkIn)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("Data failed to match schemas in oneOf(StreamSinkIn)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src StreamSinkIn) MarshalJSON() ([]byte, error) { + if src.StreamSinkInOneOf != nil { + return json.Marshal(&src.StreamSinkInOneOf) + } + + if src.StreamSinkInOneOf1 != nil { + return json.Marshal(&src.StreamSinkInOneOf1) + } + + if src.StreamSinkInOneOf2 != nil { + return json.Marshal(&src.StreamSinkInOneOf2) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *StreamSinkIn) GetActualInstance() (interface{}) { + if obj.StreamSinkInOneOf != nil { + return obj.StreamSinkInOneOf + } + + if obj.StreamSinkInOneOf1 != nil { + return obj.StreamSinkInOneOf1 + } + + if obj.StreamSinkInOneOf2 != nil { + return obj.StreamSinkInOneOf2 + } + + // all schemas are nil + return nil +} + +type NullableStreamSinkIn struct { + value *StreamSinkIn + isSet bool +} + +func (v NullableStreamSinkIn) Get() *StreamSinkIn { + return v.value +} + +func (v *NullableStreamSinkIn) Set(val *StreamSinkIn) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkIn) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkIn(val *StreamSinkIn) *NullableStreamSinkIn { + return &NullableStreamSinkIn{value: val, isSet: true} +} + +func (v NullableStreamSinkIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_in_one_of.go b/go/internal/openapi/model_stream_sink_in_one_of.go new file mode 100644 index 000000000..40d0e5b53 --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of.go @@ -0,0 +1,137 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// StreamSinkInOneOf struct for StreamSinkInOneOf +type StreamSinkInOneOf struct { + Config StreamSinkInOneOfConfig `json:"config"` + Type string `json:"type"` +} + +// NewStreamSinkInOneOf instantiates a new StreamSinkInOneOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStreamSinkInOneOf(config StreamSinkInOneOfConfig, type_ string) *StreamSinkInOneOf { + this := StreamSinkInOneOf{} + this.Config = config + this.Type = type_ + return &this +} + +// NewStreamSinkInOneOfWithDefaults instantiates a new StreamSinkInOneOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStreamSinkInOneOfWithDefaults() *StreamSinkInOneOf { + this := StreamSinkInOneOf{} + return &this +} + +// GetConfig returns the Config field value +func (o *StreamSinkInOneOf) GetConfig() StreamSinkInOneOfConfig { + if o == nil { + var ret StreamSinkInOneOfConfig + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf) GetConfigOk() (*StreamSinkInOneOfConfig, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *StreamSinkInOneOf) SetConfig(v StreamSinkInOneOfConfig) { + o.Config = v +} + +// GetType returns the Type field value +func (o *StreamSinkInOneOf) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *StreamSinkInOneOf) SetType(v string) { + o.Type = v +} + +func (o StreamSinkInOneOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["config"] = o.Config + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableStreamSinkInOneOf struct { + value *StreamSinkInOneOf + isSet bool +} + +func (v NullableStreamSinkInOneOf) Get() *StreamSinkInOneOf { + return v.value +} + +func (v *NullableStreamSinkInOneOf) Set(val *StreamSinkInOneOf) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOf) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOf(val *StreamSinkInOneOf) *NullableStreamSinkInOneOf { + return &NullableStreamSinkInOneOf{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_in_one_of_1.go b/go/internal/openapi/model_stream_sink_in_one_of_1.go new file mode 100644 index 000000000..a5e5052d8 --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of_1.go @@ -0,0 +1,137 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// StreamSinkInOneOf1 struct for StreamSinkInOneOf1 +type StreamSinkInOneOf1 struct { + Config StreamSinkInOneOfConfig `json:"config"` + Type string `json:"type"` +} + +// NewStreamSinkInOneOf1 instantiates a new StreamSinkInOneOf1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStreamSinkInOneOf1(config StreamSinkInOneOfConfig, type_ string) *StreamSinkInOneOf1 { + this := StreamSinkInOneOf1{} + this.Config = config + this.Type = type_ + return &this +} + +// NewStreamSinkInOneOf1WithDefaults instantiates a new StreamSinkInOneOf1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStreamSinkInOneOf1WithDefaults() *StreamSinkInOneOf1 { + this := StreamSinkInOneOf1{} + return &this +} + +// GetConfig returns the Config field value +func (o *StreamSinkInOneOf1) GetConfig() StreamSinkInOneOfConfig { + if o == nil { + var ret StreamSinkInOneOfConfig + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf1) GetConfigOk() (*StreamSinkInOneOfConfig, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *StreamSinkInOneOf1) SetConfig(v StreamSinkInOneOfConfig) { + o.Config = v +} + +// GetType returns the Type field value +func (o *StreamSinkInOneOf1) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf1) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *StreamSinkInOneOf1) SetType(v string) { + o.Type = v +} + +func (o StreamSinkInOneOf1) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["config"] = o.Config + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableStreamSinkInOneOf1 struct { + value *StreamSinkInOneOf1 + isSet bool +} + +func (v NullableStreamSinkInOneOf1) Get() *StreamSinkInOneOf1 { + return v.value +} + +func (v *NullableStreamSinkInOneOf1) Set(val *StreamSinkInOneOf1) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOf1) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOf1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOf1(val *StreamSinkInOneOf1) *NullableStreamSinkInOneOf1 { + return &NullableStreamSinkInOneOf1{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOf1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOf1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_in_one_of_2.go b/go/internal/openapi/model_stream_sink_in_one_of_2.go new file mode 100644 index 000000000..ec180924b --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of_2.go @@ -0,0 +1,137 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// StreamSinkInOneOf2 struct for StreamSinkInOneOf2 +type StreamSinkInOneOf2 struct { + Config S3Config `json:"config"` + Type string `json:"type"` +} + +// NewStreamSinkInOneOf2 instantiates a new StreamSinkInOneOf2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStreamSinkInOneOf2(config S3Config, type_ string) *StreamSinkInOneOf2 { + this := StreamSinkInOneOf2{} + this.Config = config + this.Type = type_ + return &this +} + +// NewStreamSinkInOneOf2WithDefaults instantiates a new StreamSinkInOneOf2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStreamSinkInOneOf2WithDefaults() *StreamSinkInOneOf2 { + this := StreamSinkInOneOf2{} + return &this +} + +// GetConfig returns the Config field value +func (o *StreamSinkInOneOf2) GetConfig() S3Config { + if o == nil { + var ret S3Config + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf2) GetConfigOk() (*S3Config, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *StreamSinkInOneOf2) SetConfig(v S3Config) { + o.Config = v +} + +// GetType returns the Type field value +func (o *StreamSinkInOneOf2) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf2) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *StreamSinkInOneOf2) SetType(v string) { + o.Type = v +} + +func (o StreamSinkInOneOf2) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["config"] = o.Config + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableStreamSinkInOneOf2 struct { + value *StreamSinkInOneOf2 + isSet bool +} + +func (v NullableStreamSinkInOneOf2) Get() *StreamSinkInOneOf2 { + return v.value +} + +func (v *NullableStreamSinkInOneOf2) Set(val *StreamSinkInOneOf2) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOf2) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOf2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOf2(val *StreamSinkInOneOf2) *NullableStreamSinkInOneOf2 { + return &NullableStreamSinkInOneOf2{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOf2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOf2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_in_one_of_config.go b/go/internal/openapi/model_stream_sink_in_one_of_config.go new file mode 100644 index 000000000..ae15db50f --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of_config.go @@ -0,0 +1,108 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// StreamSinkInOneOfConfig struct for StreamSinkInOneOfConfig +type StreamSinkInOneOfConfig struct { + Url string `json:"url"` +} + +// NewStreamSinkInOneOfConfig instantiates a new StreamSinkInOneOfConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStreamSinkInOneOfConfig(url string) *StreamSinkInOneOfConfig { + this := StreamSinkInOneOfConfig{} + this.Url = url + return &this +} + +// NewStreamSinkInOneOfConfigWithDefaults instantiates a new StreamSinkInOneOfConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStreamSinkInOneOfConfigWithDefaults() *StreamSinkInOneOfConfig { + this := StreamSinkInOneOfConfig{} + return &this +} + +// GetUrl returns the Url field value +func (o *StreamSinkInOneOfConfig) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOfConfig) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *StreamSinkInOneOfConfig) SetUrl(v string) { + o.Url = v +} + +func (o StreamSinkInOneOfConfig) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["url"] = o.Url + } + return json.Marshal(toSerialize) +} + +type NullableStreamSinkInOneOfConfig struct { + value *StreamSinkInOneOfConfig + isSet bool +} + +func (v NullableStreamSinkInOneOfConfig) Get() *StreamSinkInOneOfConfig { + return v.value +} + +func (v *NullableStreamSinkInOneOfConfig) Set(val *StreamSinkInOneOfConfig) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOfConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOfConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOfConfig(val *StreamSinkInOneOfConfig) *NullableStreamSinkInOneOfConfig { + return &NullableStreamSinkInOneOfConfig{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOfConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOfConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_out.go b/go/internal/openapi/model_stream_sink_out.go new file mode 100644 index 000000000..a301c651e --- /dev/null +++ b/go/internal/openapi/model_stream_sink_out.go @@ -0,0 +1,169 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// StreamSinkOut - struct for StreamSinkOut +type StreamSinkOut struct { + StreamSinkInOneOf *StreamSinkInOneOf + StreamSinkInOneOf1 *StreamSinkInOneOf1 + StreamSinkInOneOf2 *StreamSinkInOneOf2 +} + +// StreamSinkInOneOfAsStreamSinkOut is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkOut +func StreamSinkInOneOfAsStreamSinkOut(v *StreamSinkInOneOf) StreamSinkOut { + return StreamSinkOut{ StreamSinkInOneOf: v} +} + +// StreamSinkInOneOf1AsStreamSinkOut is a convenience function that returns StreamSinkInOneOf1 wrapped in StreamSinkOut +func StreamSinkInOneOf1AsStreamSinkOut(v *StreamSinkInOneOf1) StreamSinkOut { + return StreamSinkOut{ StreamSinkInOneOf1: v} +} + +// StreamSinkInOneOf2AsStreamSinkOut is a convenience function that returns StreamSinkInOneOf2 wrapped in StreamSinkOut +func StreamSinkInOneOf2AsStreamSinkOut(v *StreamSinkInOneOf2) StreamSinkOut { + return StreamSinkOut{ StreamSinkInOneOf2: v} +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *StreamSinkOut) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into StreamSinkInOneOf + err = json.Unmarshal(data, &dst.StreamSinkInOneOf) + if err == nil { + jsonStreamSinkInOneOf, _ := json.Marshal(dst.StreamSinkInOneOf) + if string(jsonStreamSinkInOneOf) == "{}" { // empty struct + dst.StreamSinkInOneOf = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf = nil + } + + // try to unmarshal data into StreamSinkInOneOf1 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf1) + if err == nil { + jsonStreamSinkInOneOf1, _ := json.Marshal(dst.StreamSinkInOneOf1) + if string(jsonStreamSinkInOneOf1) == "{}" { // empty struct + dst.StreamSinkInOneOf1 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf1 = nil + } + + // try to unmarshal data into StreamSinkInOneOf2 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf2) + if err == nil { + jsonStreamSinkInOneOf2, _ := json.Marshal(dst.StreamSinkInOneOf2) + if string(jsonStreamSinkInOneOf2) == "{}" { // empty struct + dst.StreamSinkInOneOf2 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf2 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.StreamSinkInOneOf = nil + dst.StreamSinkInOneOf1 = nil + dst.StreamSinkInOneOf2 = nil + + return fmt.Errorf("Data matches more than one schema in oneOf(StreamSinkOut)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("Data failed to match schemas in oneOf(StreamSinkOut)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src StreamSinkOut) MarshalJSON() ([]byte, error) { + if src.StreamSinkInOneOf != nil { + return json.Marshal(&src.StreamSinkInOneOf) + } + + if src.StreamSinkInOneOf1 != nil { + return json.Marshal(&src.StreamSinkInOneOf1) + } + + if src.StreamSinkInOneOf2 != nil { + return json.Marshal(&src.StreamSinkInOneOf2) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *StreamSinkOut) GetActualInstance() (interface{}) { + if obj.StreamSinkInOneOf != nil { + return obj.StreamSinkInOneOf + } + + if obj.StreamSinkInOneOf1 != nil { + return obj.StreamSinkInOneOf1 + } + + if obj.StreamSinkInOneOf2 != nil { + return obj.StreamSinkInOneOf2 + } + + // all schemas are nil + return nil +} + +type NullableStreamSinkOut struct { + value *StreamSinkOut + isSet bool +} + +func (v NullableStreamSinkOut) Get() *StreamSinkOut { + return v.value +} + +func (v *NullableStreamSinkOut) Set(val *StreamSinkOut) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkOut) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkOut(val *StreamSinkOut) *NullableStreamSinkOut { + return &NullableStreamSinkOut{value: val, isSet: true} +} + +func (v NullableStreamSinkOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_patch.go b/go/internal/openapi/model_stream_sink_patch.go new file mode 100644 index 000000000..facc6a586 --- /dev/null +++ b/go/internal/openapi/model_stream_sink_patch.go @@ -0,0 +1,169 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// StreamSinkPatch - struct for StreamSinkPatch +type StreamSinkPatch struct { + StreamSinkInOneOf *StreamSinkInOneOf + StreamSinkInOneOf1 *StreamSinkInOneOf1 + StreamSinkInOneOf2 *StreamSinkInOneOf2 +} + +// StreamSinkInOneOfAsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkPatch +func StreamSinkInOneOfAsStreamSinkPatch(v *StreamSinkInOneOf) StreamSinkPatch { + return StreamSinkPatch{ StreamSinkInOneOf: v} +} + +// StreamSinkInOneOf1AsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf1 wrapped in StreamSinkPatch +func StreamSinkInOneOf1AsStreamSinkPatch(v *StreamSinkInOneOf1) StreamSinkPatch { + return StreamSinkPatch{ StreamSinkInOneOf1: v} +} + +// StreamSinkInOneOf2AsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf2 wrapped in StreamSinkPatch +func StreamSinkInOneOf2AsStreamSinkPatch(v *StreamSinkInOneOf2) StreamSinkPatch { + return StreamSinkPatch{ StreamSinkInOneOf2: v} +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *StreamSinkPatch) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into StreamSinkInOneOf + err = json.Unmarshal(data, &dst.StreamSinkInOneOf) + if err == nil { + jsonStreamSinkInOneOf, _ := json.Marshal(dst.StreamSinkInOneOf) + if string(jsonStreamSinkInOneOf) == "{}" { // empty struct + dst.StreamSinkInOneOf = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf = nil + } + + // try to unmarshal data into StreamSinkInOneOf1 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf1) + if err == nil { + jsonStreamSinkInOneOf1, _ := json.Marshal(dst.StreamSinkInOneOf1) + if string(jsonStreamSinkInOneOf1) == "{}" { // empty struct + dst.StreamSinkInOneOf1 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf1 = nil + } + + // try to unmarshal data into StreamSinkInOneOf2 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf2) + if err == nil { + jsonStreamSinkInOneOf2, _ := json.Marshal(dst.StreamSinkInOneOf2) + if string(jsonStreamSinkInOneOf2) == "{}" { // empty struct + dst.StreamSinkInOneOf2 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf2 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.StreamSinkInOneOf = nil + dst.StreamSinkInOneOf1 = nil + dst.StreamSinkInOneOf2 = nil + + return fmt.Errorf("Data matches more than one schema in oneOf(StreamSinkPatch)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("Data failed to match schemas in oneOf(StreamSinkPatch)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src StreamSinkPatch) MarshalJSON() ([]byte, error) { + if src.StreamSinkInOneOf != nil { + return json.Marshal(&src.StreamSinkInOneOf) + } + + if src.StreamSinkInOneOf1 != nil { + return json.Marshal(&src.StreamSinkInOneOf1) + } + + if src.StreamSinkInOneOf2 != nil { + return json.Marshal(&src.StreamSinkInOneOf2) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *StreamSinkPatch) GetActualInstance() (interface{}) { + if obj.StreamSinkInOneOf != nil { + return obj.StreamSinkInOneOf + } + + if obj.StreamSinkInOneOf1 != nil { + return obj.StreamSinkInOneOf1 + } + + if obj.StreamSinkInOneOf2 != nil { + return obj.StreamSinkInOneOf2 + } + + // all schemas are nil + return nil +} + +type NullableStreamSinkPatch struct { + value *StreamSinkPatch + isSet bool +} + +func (v NullableStreamSinkPatch) Get() *StreamSinkPatch { + return v.value +} + +func (v *NullableStreamSinkPatch) Set(val *StreamSinkPatch) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkPatch(val *StreamSinkPatch) *NullableStreamSinkPatch { + return &NullableStreamSinkPatch{value: val, isSet: true} +} + +func (v NullableStreamSinkPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/openapi.json b/openapi.json index d882bd043..47ce4ec66 100644 --- a/openapi.json +++ b/openapi.json @@ -2925,6 +2925,34 @@ ], "type": "object" }, + "ListResponse_StreamSinkOut_": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/StreamSinkOut" + }, + "type": "array" + }, + "done": { + "type": "boolean" + }, + "iterator": { + "example": "iterator", + "nullable": true, + "type": "string" + }, + "prevIterator": { + "example": "-iterator", + "nullable": true, + "type": "string" + } + }, + "required": [ + "data", + "done" + ], + "type": "object" + }, "ListResponse_TemplateOut_": { "properties": { "data": { @@ -3582,7 +3610,7 @@ "properties": { "application": { "$ref": "#/components/schemas/ApplicationIn", - "description": "Optionally creates a new application alongside the message. If the application id or uid that is used in the path already exists, this argument is ignored.", + "description": "Optionally creates a new application alongside the message.\n\nIf the application id or uid that is used in the path already exists, this argument is ignored.", "nullable": true }, "channels": { @@ -3827,7 +3855,7 @@ "type": "object" }, "Oauth2AuthMethodIn": { - "description": "The method used for authenticating to the OAuth authorization server. `clientSecretJwt` will construct a JWT used for authentication with the oauth authorization server. This method is less commonly used and may not be supported by all oauth providers. `clientSecretBasic` will authenticate to the oauth authorization server using an `Authorization` header with the client secret as the value. This is the most common means of authentication. `clientSecretPost` will authenticate to the oauth authorization server by passing the client secret in a `client_secret` field in the request body. This method may not be supported by all oauth providers, and in general `clientSecretBasic` should be preferred.", + "description": "The method used for authenticating to the OAuth authorization server.\n\n`clientSecretJwt` will construct a JWT used for authentication with the oauth authorization server. This method is less commonly used and may not be supported by all oauth providers. `clientSecretBasic` will authenticate to the oauth authorization server using an `Authorization` header with the client secret as the value. This is the most common means of authentication. `clientSecretPost` will authenticate to the oauth authorization server by passing the client secret in a `client_secret` field in the request body. This method may not be supported by all oauth providers, and in general `clientSecretBasic` should be preferred.", "enum": [ "clientSecretJwt", "clientSecretBasic", @@ -3976,6 +4004,29 @@ ], "type": "object" }, + "S3Config": { + "properties": { + "accessKey": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "region": { + "type": "string" + }, + "secretAccessKey": { + "type": "string" + } + }, + "required": [ + "accessKey", + "bucket", + "region", + "secretAccessKey" + ], + "type": "object" + }, "SettingsIn": { "properties": { "colorPaletteDark": { @@ -4267,6 +4318,25 @@ "url" ], "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "http" + ], + "type": "string" + }, + "url": { + "format": "uri", + "type": "string" + } + }, + "required": [ + "type", + "url" + ], + "type": "object" } ], "properties": { @@ -4472,6 +4542,25 @@ "url" ], "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "http" + ], + "type": "string" + }, + "url": { + "format": "uri", + "type": "string" + } + }, + "required": [ + "type", + "url" + ], + "type": "object" } ], "properties": { @@ -4577,6 +4666,27 @@ ], "type": "object" }, + "SinkPayloadFormat": { + "enum": [ + "json" + ], + "type": "string" + }, + "SinkStatus": { + "enum": [ + "enabled", + "paused", + "disabled" + ], + "type": "string" + }, + "SinkStatusIn": { + "enum": [ + "enabled", + "paused" + ], + "type": "string" + }, "SinkTransformIn": { "properties": { "code": { @@ -4692,128 +4802,219 @@ }, "type": "object" }, - "TemplateIn": { - "properties": { - "description": { - "default": "", - "type": "string" - }, - "featureFlag": { - "example": "cool-new-feature", - "maxLength": 256, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "filterTypes": { - "example": [ - "user.signup", - "user.deleted" - ], - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" + "StreamSinkIn": { + "oneOf": [ + { + "properties": { + "config": { + "properties": { + "url": { + "format": "uri", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "type": { + "enum": [ + "otelV1HttpTrace" + ], + "type": "string" + } }, - "minItems": 1, - "nullable": true, - "type": "array", - "uniqueItems": true + "required": [ + "config", + "type" + ], + "type": "object" }, - "instructions": { - "default": "", - "type": "string" + { + "properties": { + "config": { + "properties": { + "url": { + "format": "uri", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "type": { + "enum": [ + "http" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" }, - "instructionsLink": { - "default": null, - "format": "uri", - "nullable": true, - "type": "string" + { + "properties": { + "config": { + "$ref": "#/components/schemas/S3Config" + }, + "type": { + "enum": [ + "amazonS3" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + } + ], + "properties": { + "batchSize": { + "default": 100, + "format": "uint16", + "maximum": 1000, + "minimum": 0, + "type": "integer" }, - "kind": { - "$ref": "#/components/schemas/TransformationTemplateKind", - "default": "Custom" + "format": { + "$ref": "#/components/schemas/SinkPayloadFormat" }, - "logo": { - "format": "uri", - "type": "string" + "maxWaitSecs": { + "default": 0, + "format": "uint16", + "maximum": 3600, + "minimum": 0, + "type": "integer" }, - "name": { - "type": "string" + "status": { + "$ref": "#/components/schemas/SinkStatusIn" }, - "transformation": { - "maxLength": 51200, - "minLength": 10, + "uid": { + "nullable": true, "type": "string" } }, "required": [ - "logo", - "name", - "transformation" + "format" ], "type": "object" }, - "TemplateOut": { - "properties": { - "createdAt": { - "format": "date-time", - "type": "string" - }, - "description": { - "type": "string" - }, - "featureFlag": { - "example": "cool-new-feature", - "maxLength": 256, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "filterTypes": { - "example": [ - "user.signup", - "user.deleted" - ], - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" + "StreamSinkOut": { + "oneOf": [ + { + "properties": { + "config": { + "properties": { + "url": { + "format": "uri", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "type": { + "enum": [ + "otelV1HttpTrace" + ], + "type": "string" + } }, - "minItems": 1, - "nullable": true, - "type": "array", - "uniqueItems": true + "required": [ + "config", + "type" + ], + "type": "object" }, - "id": { + { + "properties": { + "config": { + "properties": { + "url": { + "format": "uri", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "type": { + "enum": [ + "http" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/S3Config" + }, + "type": { + "enum": [ + "amazonS3" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + } + ], + "properties": { + "batchSize": { + "format": "int32", + "type": "integer" + }, + "createdAt": { + "format": "date-time", "type": "string" }, - "instructions": { + "currentIterator": { + "nullable": true, "type": "string" }, - "instructionsLink": { - "format": "uri", + "disabledReason": { "nullable": true, "type": "string" }, - "kind": { - "$ref": "#/components/schemas/TransformationTemplateKind" + "format": { + "$ref": "#/components/schemas/SinkPayloadFormat" }, - "logo": { - "format": "uri", + "id": { "type": "string" }, - "name": { - "type": "string" + "maxWaitSecs": { + "format": "int32", + "type": "integer" }, - "orgId": { - "type": "string" + "status": { + "$ref": "#/components/schemas/SinkStatus" }, - "transformation": { + "uid": { + "nullable": true, "type": "string" }, "updatedAt": { @@ -4822,22 +5023,128 @@ } }, "required": [ + "batchSize", "createdAt", - "description", + "format", "id", - "instructions", - "kind", - "logo", - "name", - "orgId", - "transformation", + "maxWaitSecs", + "status", "updatedAt" ], "type": "object" }, - "TemplatePatch": { + "StreamSinkPatch": { + "oneOf": [ + { + "properties": { + "config": { + "properties": { + "url": { + "format": "uri", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "type": { + "enum": [ + "otelV1HttpTrace" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + }, + { + "properties": { + "config": { + "properties": { + "url": { + "format": "uri", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "type": { + "enum": [ + "http" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/S3Config" + }, + "type": { + "enum": [ + "amazonS3" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + } + ], + "properties": { + "batchSize": { + "default": null, + "format": "uint16", + "maximum": 1000, + "minimum": 0, + "nullable": true, + "type": "integer" + }, + "format": { + "$ref": "#/components/schemas/SinkPayloadFormat", + "default": null, + "nullable": true + }, + "maxWaitSecs": { + "default": null, + "format": "uint16", + "maximum": 3600, + "minimum": 0, + "nullable": true, + "type": "integer" + }, + "status": { + "$ref": "#/components/schemas/SinkStatusIn", + "nullable": true + }, + "uid": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "TemplateIn": { "properties": { "description": { + "default": "", "type": "string" }, "featureFlag": { @@ -4865,15 +5172,18 @@ "uniqueItems": true }, "instructions": { + "default": "", "type": "string" }, "instructionsLink": { + "default": null, "format": "uri", "nullable": true, "type": "string" }, "kind": { - "$ref": "#/components/schemas/TransformationTemplateKind" + "$ref": "#/components/schemas/TransformationTemplateKind", + "default": "Custom" }, "logo": { "format": "uri", @@ -4888,12 +5198,20 @@ "type": "string" } }, + "required": [ + "logo", + "name", + "transformation" + ], "type": "object" }, - "TemplateUpdate": { + "TemplateOut": { "properties": { + "createdAt": { + "format": "date-time", + "type": "string" + }, "description": { - "default": "", "type": "string" }, "featureFlag": { @@ -4920,8 +5238,10 @@ "type": "array", "uniqueItems": true }, + "id": { + "type": "string" + }, "instructions": { - "default": "", "type": "string" }, "instructionsLink": { @@ -4930,59 +5250,188 @@ "type": "string" }, "kind": { - "$ref": "#/components/schemas/TransformationTemplateKind", - "default": "Custom" + "$ref": "#/components/schemas/TransformationTemplateKind" }, "logo": { "format": "uri", "type": "string" }, "name": { - "default": "", + "type": "string" + }, + "orgId": { "type": "string" }, "transformation": { - "maxLength": 51200, - "minLength": 10, + "type": "string" + }, + "updatedAt": { + "format": "date-time", "type": "string" } }, "required": [ + "createdAt", + "description", + "id", + "instructions", + "kind", "logo", - "transformation" + "name", + "orgId", + "transformation", + "updatedAt" ], "type": "object" }, - "TransformationHttpMethod": { - "enum": [ - "POST", - "PUT" - ], - "type": "string" - }, - "TransformationSimulateIn": { + "TemplatePatch": { "properties": { - "channels": { + "description": { + "type": "string" + }, + "featureFlag": { + "example": "cool-new-feature", + "maxLength": 256, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "filterTypes": { + "example": [ + "user.signup", + "user.deleted" + ], "items": { - "example": "project_1337", - "maxLength": 128, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, + "minItems": 1, "nullable": true, "type": "array", "uniqueItems": true }, - "code": { - "maxLength": 51200, - "minLength": 10, - "type": "string" - }, - "eventType": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "instructions": { + "type": "string" + }, + "instructionsLink": { + "format": "uri", + "nullable": true, + "type": "string" + }, + "kind": { + "$ref": "#/components/schemas/TransformationTemplateKind" + }, + "logo": { + "format": "uri", + "type": "string" + }, + "name": { + "type": "string" + }, + "transformation": { + "maxLength": 51200, + "minLength": 10, + "type": "string" + } + }, + "type": "object" + }, + "TemplateUpdate": { + "properties": { + "description": { + "default": "", + "type": "string" + }, + "featureFlag": { + "example": "cool-new-feature", + "maxLength": 256, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "filterTypes": { + "example": [ + "user.signup", + "user.deleted" + ], + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "minItems": 1, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "instructions": { + "default": "", + "type": "string" + }, + "instructionsLink": { + "format": "uri", + "nullable": true, + "type": "string" + }, + "kind": { + "$ref": "#/components/schemas/TransformationTemplateKind", + "default": "Custom" + }, + "logo": { + "format": "uri", + "type": "string" + }, + "name": { + "default": "", + "type": "string" + }, + "transformation": { + "maxLength": 51200, + "minLength": 10, + "type": "string" + } + }, + "required": [ + "logo", + "transformation" + ], + "type": "object" + }, + "TransformationHttpMethod": { + "enum": [ + "POST", + "PUT" + ], + "type": "string" + }, + "TransformationSimulateIn": { + "properties": { + "channels": { + "items": { + "example": "project_1337", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "code": { + "maxLength": 51200, + "minLength": 10, + "type": "string" + }, + "eventType": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "payload": { @@ -5045,47 +5494,1706 @@ }, "type": "array" }, - "msg": { - "description": "The message accompanying the validation error item.", - "type": "string" + "msg": { + "description": "The message accompanying the validation error item.", + "type": "string" + }, + "type": { + "description": "The type of error, often \"type_error\" or \"value_error\", but sometimes with more context like as \"value_error.number.not_ge\"", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "type": "object" + } + }, + "securitySchemes": { + "HTTPBearer": { + "bearerFormat": null, + "description": "HTTP Bearer token passed in the `Authorization` header", + "scheme": "bearer", + "type": "http" + } + } + }, + "info": { + "description": "", + "title": "Svix API", + "version": "1.1.1", + "x-logo": { + "altText": "Svix Logo", + "url": "https://www.svix.com/static/img/brand-padded.svg" + } + }, + "openapi": "3.0.2", + "paths": { + "/api/v1/app": { + "get": { + "description": "List of all the organization's applications.", + "operationId": "v1.application.list", + "parameters": [ + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", + "schema": { + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_ApplicationOut_" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "List Applications", + "tags": [ + "Application" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseApplicationOut = await svix.application.list();" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseApplicationOut = await svix.application.list();" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_application_out = svix.application.list(None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_application_out = await svix.application.list(None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseApplicationOut, err := svixClient.Application.List(ctx, nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseApplicationOut = svix.application.list()" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseApplicationOut listResponseApplicationOut = svix.getApplication().list()" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_application_out = svix.application.list()" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_application_out = svix.application().list(None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseApplicationOut = await svix.Application.ListAsync()" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application list " + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "post": { + "description": "Create a new application.", + "operationId": "v1.application.create", + "parameters": [ + { + "description": "Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs.", + "in": "query", + "name": "get_if_exists", + "schema": { + "default": false, + "description": "Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs.", + "type": "boolean" + }, + "style": "form" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationIn" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + }, + "description": "" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Create Application", + "tags": [ + "Application" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.create({\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.create({\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "application_out = svix.application.create(ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "application_out = await svix.application.create(ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "applicationOut, err := svixClient.Application.Create(ctx, &ApplicationIn{\n Name: \"My first application\",\n RateLimit: nil,\n Uid: \"unique-app-identifier\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val applicationOut = svix.application.create(ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "ApplicationOut applicationOut = svix.getApplication().create(new ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "application_out = svix.application.create(Svix::ApplicationIn.new({\n \"name\": \"My first application\",\n \"rate_limit\": nil,\n \"uid\": \"unique-app-identifier\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let application_out = svix.application().create(ApplicationIn {\n name: \"My first application\".to_string(),\n rate_limit: None,\n uid: Some(\"unique-app-identifier\".to_string()),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var applicationOut = await svix.Application.CreateAsync(new ApplicationIn{\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application create '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n }'" + } + ] + } + }, + "/api/v1/app/stats/usage": { + "get": { + "description": "Get basic statistics for all applications.", + "operationId": "get_app_usage_stats_api_v1_app_stats_usage__get", + "parameters": [ + { + "description": "Filter the range to data after this date", + "in": "query", + "name": "since", + "required": true, + "schema": { + "description": "Filter the range to data after this date", + "format": "date-time", + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter the range to data before this date", + "in": "query", + "name": "until", + "required": true, + "schema": { + "description": "Filter the range to data before this date", + "format": "date-time", + "type": "string" + }, + "style": "form" + }, + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "default": 50, + "description": "Limit the number of returned items", + "format": "int", + "maximum": 250, + "nullable": true, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator to use (depends on the chosen ordering)", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator to use (depends on the chosen ordering)", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, + "type": "string" + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_ApplicationStats_" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Get App Usage Stats", + "tags": [ + "Application" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseApplicationStats = await svix.app.stats();" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseApplicationStats = await svix.app.stats();" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_application_stats = svix.app.stats()" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_application_stats = await svix.app.stats()" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseApplicationStats, err := svixClient.App.Stats(ctx)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseApplicationStats = svix.app.stats()" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseApplicationStats listResponseApplicationStats = svix.getApp().stats()" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_application_stats = svix.app.stats()" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_application_stats = svix.app().stats().await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseApplicationStats = await svix.App.StatsAsync()" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix app stats " + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/stats/usage' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}": { + "delete": { + "description": "Delete an application.", + "operationId": "v1.application.delete", + "parameters": [ + { + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Delete Application", + "tags": [ + "Application" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.application.delete(\"app_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.application.delete(\"app_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.application.delete(\"app_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.application.delete(\"app_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Application.Delete(ctx, \"app_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.application.delete(\"app_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getApplication().delete(\"app_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.application.delete(\"app_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.application().delete(\"app_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Application.DeleteAsync(\"app_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application delete \"app_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "get": { + "description": "Get an application.", + "operationId": "v1.application.get", + "parameters": [ + { + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Get Application", + "tags": [ + "Application" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.get(\"app_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.get(\"app_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "application_out = svix.application.get(\"app_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "application_out = await svix.application.get(\"app_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "applicationOut, err := svixClient.Application.Get(ctx, \"app_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val applicationOut = svix.application.get(\"app_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ApplicationOut applicationOut = svix.getApplication().get(\"app_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "application_out = svix.application.get(\"app_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let application_out = svix.application().get(\"app_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var applicationOut = await svix.Application.GetAsync(\"app_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application get \"app_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "patch": { + "description": "Partially update an application.", + "operationId": "v1.application.patch", + "parameters": [ + { + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationPatch" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Patch Application", + "tags": [ + "Application" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.patch(\"app_id\", {\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.patch(\"app_id\", {\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "application_out = svix.application.patch(\"app_id\", ApplicationPatch(\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "application_out = await svix.application.patch(\"app_id\", ApplicationPatch(\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "applicationOut, err := svixClient.Application.Patch(ctx, \"app_id\", &ApplicationPatch{\n RateLimit: nil,\n Uid: \"unique-app-identifier\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val applicationOut = svix.application.patch(\"app_id\", ApplicationPatch()\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "ApplicationOut applicationOut = svix.getApplication().patch(\"app_id\", new ApplicationPatch()\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "application_out = svix.application.patch(\"app_id\", Svix::ApplicationPatch.new({\n \"rate_limit\": nil,\n \"uid\": \"unique-app-identifier\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let application_out = svix.application().patch(\"app_id\", ApplicationPatch {\n rate_limit: None,\n uid: Some(\"unique-app-identifier\".to_string()),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var applicationOut = await svix.Application.PatchAsync(\"app_id\", new ApplicationPatch{\n rateLimit: null,\n uid: \"unique-app-identifier\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application patch \"app_id\" '{\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n }'" + } + ] + }, + "put": { + "description": "Update an application.", + "operationId": "v1.application.update", + "parameters": [ + { + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationIn" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + }, + "description": "" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Update Application", + "tags": [ + "Application" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.update(\"app_id\", {\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.update(\"app_id\", {\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "application_out = svix.application.update(\"app_id\", ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "application_out = await svix.application.update(\"app_id\", ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "applicationOut, err := svixClient.Application.Update(ctx, \"app_id\", &ApplicationIn{\n Name: \"My first application\",\n RateLimit: nil,\n Uid: \"unique-app-identifier\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val applicationOut = svix.application.update(\"app_id\", ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "ApplicationOut applicationOut = svix.getApplication().update(\"app_id\", new ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "application_out = svix.application.update(\"app_id\", Svix::ApplicationIn.new({\n \"name\": \"My first application\",\n \"rate_limit\": nil,\n \"uid\": \"unique-app-identifier\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let application_out = svix.application().update(\"app_id\", ApplicationIn {\n name: \"My first application\".to_string(),\n rate_limit: None,\n uid: Some(\"unique-app-identifier\".to_string()),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var applicationOut = await svix.Application.UpdateAsync(\"app_id\", new ApplicationIn{\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application update \"app_id\" '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}": { + "get": { + "description": "List attempts by endpoint id\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "operationId": "v1.message-attempt.list-by-endpoint", + "parameters": [ + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the delivery status", + "in": "query", + "name": "status", + "schema": { + "$ref": "#/components/schemas/MessageStatus", + "description": "Filter response based on the delivery status", + "nullable": true + }, + "style": "form" + }, + { + "description": "Filter response based on the HTTP status code", + "in": "query", + "name": "status_code_class", + "schema": { + "$ref": "#/components/schemas/StatusCodeClass", + "description": "Filter response based on the HTTP status code", + "nullable": true + }, + "style": "form" + }, + { + "description": "Filter response based on the channel", + "in": "query", + "name": "channel", + "schema": { + "description": "Filter response based on the channel", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the tag", + "in": "query", + "name": "tag", + "schema": { + "description": "Filter response based on the tag", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "Only include items created before a certain date", + "in": "query", + "name": "before", + "schema": { + "description": "Only include items created before a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Only include items created after a certain date", + "in": "query", + "name": "after", + "schema": { + "description": "Only include items created after a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "When `true` attempt content is included in the response", + "in": "query", + "name": "with_content", + "schema": { + "default": true, + "description": "When `true` attempt content is included in the response", + "type": "boolean" + }, + "style": "form" + }, + { + "description": "When `true`, the message information is included in the response", + "in": "query", + "name": "with_msg", + "schema": { + "default": false, + "description": "When `true`, the message information is included in the response", + "type": "boolean" + }, + "style": "form" + }, + { + "description": "Filter response based on the event type", + "in": "query", + "name": "event_types", + "schema": { + "description": "Filter response based on the event type", + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" + }, + { + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_MessageAttemptOut_" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "List Attempts By Endpoint", + "tags": [ + "Message Attempt" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByEndpoint(\"app_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByEndpoint(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseMessageAttemptOut, err := svixClient.MessageAttempt.ListByEndpoint(ctx, \"app_id\", \"endpoint_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseMessageAttemptOut = svix.messageAttempt.listByEndpoint(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseMessageAttemptOut listResponseMessageAttemptOut = svix.getMessageAttempt().listByEndpoint(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_message_attempt_out = svix.message_attempt().list_by_endpoint(\"app_id\", \"endpoint_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseMessageAttemptOut = await svix.MessageAttempt.ListByEndpointAsync(\"app_id\", \"endpoint_id\")" }, - "type": { - "description": "The type of error, often \"type_error\" or \"value_error\", but sometimes with more context like as \"value_error.number.not_ge\"", - "type": "string" + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt list-by-endpoint \"app_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } - }, - "required": [ - "loc", - "msg", - "type" - ], - "type": "object" + ] } }, - "securitySchemes": { - "HTTPBearer": { - "bearerFormat": null, - "description": "HTTP Bearer token passed in the `Authorization` header", - "scheme": "bearer", - "type": "http" - } - } - }, - "info": { - "description": "", - "title": "Svix API", - "version": "1.1.1", - "x-logo": { - "altText": "Svix Logo", - "url": "https://www.svix.com/static/img/brand-padded.svg" - } - }, - "openapi": "3.0.2", - "paths": { - "/api/v1/app": { + "/api/v1/app/{app_id}/attempt/msg/{msg_id}": { "get": { - "description": "List of all the organization's applications.", - "operationId": "v1.application.list", + "description": "List attempts by message id\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "operationId": "v1.message-attempt.list-by-msg", "parameters": [ { "description": "Limit the number of returned items", @@ -5106,22 +7214,160 @@ "name": "iterator", "schema": { "description": "The iterator returned from a prior invocation", - "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", "nullable": true, "type": "string" }, "style": "form" }, { - "description": "The sorting order of the returned items", + "description": "Filter response based on the delivery status", "in": "query", - "name": "order", + "name": "status", "schema": { - "$ref": "#/components/schemas/Ordering", - "description": "The sorting order of the returned items", + "$ref": "#/components/schemas/MessageStatus", + "description": "Filter response based on the delivery status", + "nullable": true + }, + "style": "form" + }, + { + "description": "Filter response based on the HTTP status code", + "in": "query", + "name": "status_code_class", + "schema": { + "$ref": "#/components/schemas/StatusCodeClass", + "description": "Filter response based on the HTTP status code", "nullable": true }, "style": "form" + }, + { + "description": "Filter response based on the channel", + "in": "query", + "name": "channel", + "schema": { + "description": "Filter response based on the channel", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the tag", + "in": "query", + "name": "tag", + "schema": { + "description": "Filter response based on the tag", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter the attempts based on the attempted endpoint", + "in": "query", + "name": "endpoint_id", + "schema": { + "description": "Filter the attempts based on the attempted endpoint", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "Only include items created before a certain date", + "in": "query", + "name": "before", + "schema": { + "description": "Only include items created before a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Only include items created after a certain date", + "in": "query", + "name": "after", + "schema": { + "description": "Only include items created after a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "When `true` attempt content is included in the response", + "in": "query", + "name": "with_content", + "schema": { + "default": true, + "description": "When `true` attempt content is included in the response", + "type": "boolean" + }, + "style": "form" + }, + { + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The msg's ID or UID", + "in": "path", + "name": "msg_id", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "example": "unique-msg-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Filter response based on the event type", + "in": "query", + "name": "event_types", + "schema": { + "description": "Filter response based on the event type", + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" } ], "responses": { @@ -5129,7 +7375,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_ApplicationOut_" + "$ref": "#/components/schemas/ListResponse_MessageAttemptOut_" } } }, @@ -5211,124 +7457,137 @@ "HTTPBearer": [] } ], - "summary": "List Applications", + "summary": "List Attempts By Msg", "tags": [ - "Application" + "Message Attempt" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseApplicationOut = await svix.application.list();" + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsg(\"app_id\", \"msg_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseApplicationOut = await svix.application.list();" + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsg(\"app_id\", \"msg_id\");" }, { "label": "Python", "lang": "Python", - "source": "list_response_application_out = svix.application.list(None)" + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_application_out = await svix.application.list(None)" + "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "listResponseApplicationOut, err := svixClient.Application.List(ctx, nil)" + "source": "listResponseMessageAttemptOut, err := svixClient.MessageAttempt.ListByMsg(ctx, \"app_id\", \"msg_id\", nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseApplicationOut = svix.application.list()" + "source": "val listResponseMessageAttemptOut = svix.messageAttempt.listByMsg(\"app_id\", \"msg_id\")" }, { "label": "Java", "lang": "Java", - "source": "ListResponseApplicationOut listResponseApplicationOut = svix.getApplication().list()" + "source": "ListResponseMessageAttemptOut listResponseMessageAttemptOut = svix.getMessageAttempt().listByMsg(\"app_id\", \"msg_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_application_out = svix.application.list()" + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_application_out = svix.application().list(None).await?;" + "source": "let list_response_message_attempt_out = svix.message_attempt().list_by_msg(\"app_id\", \"msg_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseApplicationOut = await svix.Application.ListAsync()" + "source": "var listResponseMessageAttemptOut = await svix.MessageAttempt.ListByMsgAsync(\"app_id\", \"msg_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix application list " + "source": "svix message-attempt list-by-msg \"app_id\" \"msg_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/attempt/msg/{msg_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - }, - "post": { - "description": "Create a new application.", - "operationId": "v1.application.create", + } + }, + "/api/v1/app/{app_id}/endpoint": { + "get": { + "description": "List the application's endpoints.", + "operationId": "v1.endpoint.list", "parameters": [ { - "description": "Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs.", + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Limit the number of returned items", "in": "query", - "name": "get_if_exists", + "name": "limit", "schema": { - "default": false, - "description": "Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs.", - "type": "boolean" + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" }, "style": "form" }, { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", "schema": { + "description": "The iterator returned from a prior invocation", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, "type": "string" }, - "style": "simple" + "style": "form" + }, + { + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", + "schema": { + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApplicationIn" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationOut" - } - } - }, - "description": "" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApplicationOut" + "$ref": "#/components/schemas/ListResponse_EndpointOut_" } } }, @@ -5410,136 +7669,118 @@ "HTTPBearer": [] } ], - "summary": "Create Application", + "summary": "List Endpoints", "tags": [ - "Application" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const applicationOut = await svix.application.create({\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + "source": "const listResponseEndpointOut = await svix.endpoint.list(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const applicationOut = await svix.application.create({\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + "source": "const listResponseEndpointOut = await svix.endpoint.list(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "application_out = svix.application.create(ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n), None)" + "source": "list_response_endpoint_out = svix.endpoint.list(\"app_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "application_out = await svix.application.create(ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n), None)" + "source": "list_response_endpoint_out = await svix.endpoint.list(\"app_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "applicationOut, err := svixClient.Application.Create(ctx, &ApplicationIn{\n Name: \"My first application\",\n RateLimit: nil,\n Uid: \"unique-app-identifier\",\n})" + "source": "listResponseEndpointOut, err := svixClient.Endpoint.List(ctx, \"app_id\", nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val applicationOut = svix.application.create(ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + "source": "val listResponseEndpointOut = svix.endpoint.list(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "ApplicationOut applicationOut = svix.getApplication().create(new ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + "source": "ListResponseEndpointOut listResponseEndpointOut = svix.getEndpoint().list(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "application_out = svix.application.create(Svix::ApplicationIn.new({\n \"name\": \"My first application\",\n \"rate_limit\": nil,\n \"uid\": \"unique-app-identifier\"\n}))" + "source": "list_response_endpoint_out = svix.endpoint.list(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let application_out = svix.application().create(ApplicationIn {\n name: \"My first application\".to_string(),\n rate_limit: None,\n uid: Some(\"unique-app-identifier\".to_string()),\n}, None).await?;" + "source": "let list_response_endpoint_out = svix.endpoint().list(\"app_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var applicationOut = await svix.Application.CreateAsync(new ApplicationIn{\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n})" + "source": "var listResponseEndpointOut = await svix.Endpoint.ListAsync(\"app_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix application create '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n}'" + "source": "svix endpoint list \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/app/stats/usage": { - "get": { - "description": "Get basic statistics for all applications.", - "operationId": "get_app_usage_stats_api_v1_app_stats_usage__get", + }, + "post": { + "description": "Create a new endpoint for the application.\n\nWhen `secret` is `null` the secret is automatically generated (recommended)", + "operationId": "v1.endpoint.create", "parameters": [ { - "description": "Filter the range to data after this date", - "in": "query", - "name": "since", - "required": true, - "schema": { - "description": "Filter the range to data after this date", - "format": "date-time", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter the range to data before this date", - "in": "query", - "name": "until", + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", "required": true, "schema": { - "description": "Filter the range to data before this date", - "format": "date-time", + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, - "style": "form" - }, - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "default": 50, - "description": "Limit the number of returned items", - "format": "int", - "maximum": 250, - "nullable": true, - "type": "integer" - }, - "style": "form" + "style": "simple" }, { - "description": "The iterator to use (depends on the chosen ordering)", - "in": "query", - "name": "iterator", + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The iterator to use (depends on the chosen ordering)", - "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, "type": "string" }, - "style": "form" + "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointIn" + } + } + }, + "required": true + }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_ApplicationStats_" + "$ref": "#/components/schemas/EndpointOut" } } }, @@ -5621,78 +7862,78 @@ "HTTPBearer": [] } ], - "summary": "Get App Usage Stats", + "summary": "Create Endpoint", "tags": [ - "Application" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseApplicationStats = await svix.app.stats();" + "source": "const endpointOut = await svix.endpoint.create(\"app_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"],\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseApplicationStats = await svix.app.stats();" + "source": "const endpointOut = await svix.endpoint.create(\"app_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"],\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" }, { "label": "Python", "lang": "Python", - "source": "list_response_application_stats = svix.app.stats()" + "source": "endpoint_out = svix.endpoint.create(\"app_id\", EndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"],\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_application_stats = await svix.app.stats()" + "source": "endpoint_out = await svix.endpoint.create(\"app_id\", EndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"],\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" }, { "label": "Go", "lang": "Go", - "source": "listResponseApplicationStats, err := svixClient.App.Stats(ctx)" + "source": "endpointOut, err := svixClient.Endpoint.Create(ctx, \"app_id\", &EndpointIn{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Url: \"https://example.com/webhook/\",\n Version: 1,\n Disabled: false,\n FilterTypes: []string{\"user.signup\", \"user.deleted\"},\n Channels: []string{\"project_123\", \"group_2\"},\n Secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseApplicationStats = svix.app.stats()" + "source": "val endpointOut = svix.endpoint.create(\"app_id\", EndpointIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(arrayOf(\"user.signup\", \"user.deleted\"))\n .channels(arrayOf(\"project_123\", \"group_2\"))\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" }, { "label": "Java", "lang": "Java", - "source": "ListResponseApplicationStats listResponseApplicationStats = svix.getApp().stats()" + "source": "EndpointOut endpointOut = svix.getEndpoint().create(\"app_id\", new EndpointIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(new String[]{\"user.signup\", \"user.deleted\"})\n .channels(new String[]{\"project_123\", \"group_2\"})\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_application_stats = svix.app.stats()" + "source": "endpoint_out = svix.endpoint.create(\"app_id\", Svix::EndpointIn.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filter_types\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"],\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_application_stats = svix.app().stats().await?;" + "source": "let endpoint_out = svix.endpoint().create(\"app_id\", EndpointIn {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n url: \"https://example.com/webhook/\".to_string(),\n version: Some(1),\n disabled: Some(false),\n filter_types: Some(vec![\"user.signup\".to_string(), \"user.deleted\".to_string()]),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n secret: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseApplicationStats = await svix.App.StatsAsync()" + "source": "var endpointOut = await svix.Endpoint.CreateAsync(\"app_id\", new EndpointIn{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: new string[] {\"user.signup\", \"user.deleted\"},\n channels: new string[] {\"project_123\", \"group_2\"},\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix app stats " + "source": "svix endpoint create \"app_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"],\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/stats/usage' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"],\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" } ] } }, - "/api/v1/app/{app_id}": { + "/api/v1/app/{app_id}/endpoint/{endpoint_id}": { "delete": { - "description": "Delete an application.", - "operationId": "v1.application.delete", + "description": "Delete an endpoint.", + "operationId": "v1.endpoint.delete", "parameters": [ { "description": "The app's ID or UID", @@ -5708,6 +7949,21 @@ "type": "string" }, "style": "simple" + }, + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" } ], "responses": { @@ -5790,76 +8046,76 @@ "HTTPBearer": [] } ], - "summary": "Delete Application", + "summary": "Delete Endpoint", "tags": [ - "Application" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.application.delete(\"app_id\");" + "source": "await svix.endpoint.delete(\"app_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.application.delete(\"app_id\");" + "source": "await svix.endpoint.delete(\"app_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "svix.application.delete(\"app_id\")" + "source": "svix.endpoint.delete(\"app_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.application.delete(\"app_id\")" + "source": "await svix.endpoint.delete(\"app_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Application.Delete(ctx, \"app_id\")" + "source": "err := svixClient.Endpoint.Delete(ctx, \"app_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.application.delete(\"app_id\")" + "source": "svix.endpoint.delete(\"app_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "svix.getApplication().delete(\"app_id\")" + "source": "svix.getEndpoint().delete(\"app_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.application.delete(\"app_id\")" + "source": "svix.endpoint.delete(\"app_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "svix.application().delete(\"app_id\").await?;" + "source": "svix.endpoint().delete(\"app_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Application.DeleteAsync(\"app_id\")" + "source": "await svix.Endpoint.DeleteAsync(\"app_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix application delete \"app_id\"" + "source": "svix endpoint delete \"app_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] }, "get": { - "description": "Get an application.", - "operationId": "v1.application.get", + "description": "Get an endpoint.", + "operationId": "v1.endpoint.get", "parameters": [ { "description": "The app's ID or UID", @@ -5875,6 +8131,21 @@ "type": "string" }, "style": "simple" + }, + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" } ], "responses": { @@ -5882,7 +8153,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationOut" + "$ref": "#/components/schemas/EndpointOut" } } }, @@ -5964,76 +8235,76 @@ "HTTPBearer": [] } ], - "summary": "Get Application", + "summary": "Get Endpoint", "tags": [ - "Application" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const applicationOut = await svix.application.get(\"app_id\");" + "source": "const endpointOut = await svix.endpoint.get(\"app_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const applicationOut = await svix.application.get(\"app_id\");" + "source": "const endpointOut = await svix.endpoint.get(\"app_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "application_out = svix.application.get(\"app_id\")" + "source": "endpoint_out = svix.endpoint.get(\"app_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "application_out = await svix.application.get(\"app_id\")" + "source": "endpoint_out = await svix.endpoint.get(\"app_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "applicationOut, err := svixClient.Application.Get(ctx, \"app_id\")" + "source": "endpointOut, err := svixClient.Endpoint.Get(ctx, \"app_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val applicationOut = svix.application.get(\"app_id\")" + "source": "val endpointOut = svix.endpoint.get(\"app_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "ApplicationOut applicationOut = svix.getApplication().get(\"app_id\")" + "source": "EndpointOut endpointOut = svix.getEndpoint().get(\"app_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "application_out = svix.application.get(\"app_id\")" + "source": "endpoint_out = svix.endpoint.get(\"app_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let application_out = svix.application().get(\"app_id\").await?;" + "source": "let endpoint_out = svix.endpoint().get(\"app_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var applicationOut = await svix.Application.GetAsync(\"app_id\")" + "source": "var endpointOut = await svix.Endpoint.GetAsync(\"app_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix application get \"app_id\"" + "source": "svix endpoint get \"app_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] }, "patch": { - "description": "Partially update an application.", - "operationId": "v1.application.patch", + "description": "Partially update an endpoint.", + "operationId": "v1.endpoint.patch", "parameters": [ { "description": "The app's ID or UID", @@ -6049,13 +8320,28 @@ "type": "string" }, "style": "simple" + }, + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" } ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationPatch" + "$ref": "#/components/schemas/EndpointPatch" } } }, @@ -6066,7 +8352,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationOut" + "$ref": "#/components/schemas/EndpointOut" } } }, @@ -6148,76 +8434,76 @@ "HTTPBearer": [] } ], - "summary": "Patch Application", + "summary": "Patch Endpoint", "tags": [ - "Application" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const applicationOut = await svix.application.patch(\"app_id\", {\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + "source": "const endpointOut = await svix.endpoint.patch(\"app_id\", \"endpoint_id\", {\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n version: 1,\n filterTypes: null,\n channels: null,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const applicationOut = await svix.application.patch(\"app_id\", {\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + "source": "const endpointOut = await svix.endpoint.patch(\"app_id\", \"endpoint_id\", {\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n version: 1,\n filterTypes: null,\n channels: null,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" }, { "label": "Python", "lang": "Python", - "source": "application_out = svix.application.patch(\"app_id\", ApplicationPatch(\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + "source": "endpoint_out = svix.endpoint.patch(\"app_id\", \"endpoint_id\", EndpointPatch(\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n version=1,\n filter_types=None,\n channels=None,\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "application_out = await svix.application.patch(\"app_id\", ApplicationPatch(\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + "source": "endpoint_out = await svix.endpoint.patch(\"app_id\", \"endpoint_id\", EndpointPatch(\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n version=1,\n filter_types=None,\n channels=None,\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n))" }, { "label": "Go", "lang": "Go", - "source": "applicationOut, err := svixClient.Application.Patch(ctx, \"app_id\", &ApplicationPatch{\n RateLimit: nil,\n Uid: \"unique-app-identifier\",\n})" + "source": "endpointOut, err := svixClient.Endpoint.Patch(ctx, \"app_id\", \"endpoint_id\", &EndpointPatch{\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Version: 1,\n FilterTypes: nil,\n Channels: nil,\n Secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val applicationOut = svix.application.patch(\"app_id\", ApplicationPatch()\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + "source": "val endpointOut = svix.endpoint.patch(\"app_id\", \"endpoint_id\", EndpointPatch()\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .version(1)\n .filterTypes(null)\n .channels(null)\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" }, { "label": "Java", "lang": "Java", - "source": "ApplicationOut applicationOut = svix.getApplication().patch(\"app_id\", new ApplicationPatch()\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + "source": "EndpointOut endpointOut = svix.getEndpoint().patch(\"app_id\", \"endpoint_id\", new EndpointPatch()\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .version(1)\n .filterTypes(null)\n .channels(null)\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "application_out = svix.application.patch(\"app_id\", Svix::ApplicationPatch.new({\n \"rate_limit\": nil,\n \"uid\": \"unique-app-identifier\"\n}))" + "source": "endpoint_out = svix.endpoint.patch(\"app_id\", \"endpoint_id\", Svix::EndpointPatch.new({\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1,\n \"filter_types\": nil,\n \"channels\": nil,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let application_out = svix.application().patch(\"app_id\", ApplicationPatch {\n rate_limit: None,\n uid: Some(\"unique-app-identifier\".to_string()),\n}).await?;" + "source": "let endpoint_out = svix.endpoint().patch(\"app_id\", \"endpoint_id\", EndpointPatch {\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n version: Some(1),\n filter_types: None,\n channels: None,\n secret: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var applicationOut = await svix.Application.PatchAsync(\"app_id\", new ApplicationPatch{\n rateLimit: null,\n uid: \"unique-app-identifier\"\n})" + "source": "var endpointOut = await svix.Endpoint.PatchAsync(\"app_id\", \"endpoint_id\", new EndpointPatch{\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n version: 1,\n filterTypes: null,\n channels: null,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix application patch \"app_id\" '{\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n}'" + "source": "svix endpoint patch \"app_id\" \"endpoint_id\" '{\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1,\n \"filterTypes\": null,\n \"channels\": null,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n }'" + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1,\n \"filterTypes\": null,\n \"channels\": null,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" } ] }, "put": { - "description": "Update an application.", - "operationId": "v1.application.update", + "description": "Update an endpoint.", + "operationId": "v1.endpoint.update", "parameters": [ { "description": "The app's ID or UID", @@ -6233,13 +8519,28 @@ "type": "string" }, "style": "simple" + }, + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" } ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationIn" + "$ref": "#/components/schemas/EndpointUpdate" } } }, @@ -6250,7 +8551,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationOut" + "$ref": "#/components/schemas/EndpointOut" } } }, @@ -6260,7 +8561,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationOut" + "$ref": "#/components/schemas/EndpointOut" } } }, @@ -6342,219 +8643,79 @@ "HTTPBearer": [] } ], - "summary": "Update Application", + "summary": "Update Endpoint", "tags": [ - "Application" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const applicationOut = await svix.application.update(\"app_id\", {\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + "source": "const endpointOut = await svix.endpoint.update(\"app_id\", \"endpoint_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"]\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const applicationOut = await svix.application.update(\"app_id\", {\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + "source": "const endpointOut = await svix.endpoint.update(\"app_id\", \"endpoint_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"]\n});" }, { "label": "Python", "lang": "Python", - "source": "application_out = svix.application.update(\"app_id\", ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + "source": "endpoint_out = svix.endpoint.update(\"app_id\", \"endpoint_id\", EndpointUpdate(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "application_out = await svix.application.update(\"app_id\", ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + "source": "endpoint_out = await svix.endpoint.update(\"app_id\", \"endpoint_id\", EndpointUpdate(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n))" }, { "label": "Go", "lang": "Go", - "source": "applicationOut, err := svixClient.Application.Update(ctx, \"app_id\", &ApplicationIn{\n Name: \"My first application\",\n RateLimit: nil,\n Uid: \"unique-app-identifier\",\n})" + "source": "endpointOut, err := svixClient.Endpoint.Update(ctx, \"app_id\", \"endpoint_id\", &EndpointUpdate{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Url: \"https://example.com/webhook/\",\n Version: 1,\n Disabled: false,\n FilterTypes: []string{\"user.signup\", \"user.deleted\"},\n Channels: []string{\"project_123\", \"group_2\"},\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val applicationOut = svix.application.update(\"app_id\", ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + "source": "val endpointOut = svix.endpoint.update(\"app_id\", \"endpoint_id\", EndpointUpdate()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(arrayOf(\"user.signup\", \"user.deleted\"))\n .channels(arrayOf(\"project_123\", \"group_2\"))\n)" }, { "label": "Java", "lang": "Java", - "source": "ApplicationOut applicationOut = svix.getApplication().update(\"app_id\", new ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "application_out = svix.application.update(\"app_id\", Svix::ApplicationIn.new({\n \"name\": \"My first application\",\n \"rate_limit\": nil,\n \"uid\": \"unique-app-identifier\"\n}))" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let application_out = svix.application().update(\"app_id\", ApplicationIn {\n name: \"My first application\".to_string(),\n rate_limit: None,\n uid: Some(\"unique-app-identifier\".to_string()),\n}).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var applicationOut = await svix.Application.UpdateAsync(\"app_id\", new ApplicationIn{\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n})" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix application update \"app_id\" '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n}'" - }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n }'" - } - ] - } - }, - "/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}": { - "get": { - "description": "List attempts by endpoint id\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", - "operationId": "v1.message-attempt.list-by-endpoint", - "parameters": [ - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the delivery status", - "in": "query", - "name": "status", - "schema": { - "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the delivery status", - "nullable": true - }, - "style": "form" - }, - { - "description": "Filter response based on the HTTP status code", - "in": "query", - "name": "status_code_class", - "schema": { - "$ref": "#/components/schemas/StatusCodeClass", - "description": "Filter response based on the HTTP status code", - "nullable": true - }, - "style": "form" - }, - { - "description": "Filter response based on the channel", - "in": "query", - "name": "channel", - "schema": { - "description": "Filter response based on the channel", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the tag", - "in": "query", - "name": "tag", - "schema": { - "description": "Filter response based on the tag", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Only include items created before a certain date", - "in": "query", - "name": "before", - "schema": { - "description": "Only include items created before a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only include items created after a certain date", - "in": "query", - "name": "after", - "schema": { - "description": "Only include items created after a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" + "source": "EndpointOut endpointOut = svix.getEndpoint().update(\"app_id\", \"endpoint_id\", new EndpointUpdate()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(new String[]{\"user.signup\", \"user.deleted\"})\n .channels(new String[]{\"project_123\", \"group_2\"})\n)" }, { - "description": "When `true` attempt content is included in the response", - "in": "query", - "name": "with_content", - "schema": { - "default": true, - "description": "When `true` attempt content is included in the response", - "type": "boolean" - }, - "style": "form" + "label": "Ruby", + "lang": "Ruby", + "source": "endpoint_out = svix.endpoint.update(\"app_id\", \"endpoint_id\", Svix::EndpointUpdate.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filter_types\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n}))" }, { - "description": "When `true`, the message information is included in the response", - "in": "query", - "name": "with_msg", - "schema": { - "default": false, - "description": "When `true`, the message information is included in the response", - "type": "boolean" - }, - "style": "form" + "label": "Rust", + "lang": "Rust", + "source": "let endpoint_out = svix.endpoint().update(\"app_id\", \"endpoint_id\", EndpointUpdate {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n url: \"https://example.com/webhook/\".to_string(),\n version: Some(1),\n disabled: Some(false),\n filter_types: Some(vec![\"user.signup\".to_string(), \"user.deleted\".to_string()]),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n}).await?;" }, { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", - "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" + "label": "C#", + "lang": "C#", + "source": "var endpointOut = await svix.Endpoint.UpdateAsync(\"app_id\", \"endpoint_id\", new EndpointUpdate{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: new string[] {\"user.signup\", \"user.deleted\"},\n channels: new string[] {\"project_123\", \"group_2\"}\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint update \"app_id\" \"endpoint_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n}'" }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers": { + "get": { + "description": "Get the additional headers to be sent with the webhook", + "operationId": "v1.endpoint.get-headers", + "parameters": [ { "description": "The app's ID or UID", "in": "path", @@ -6591,7 +8752,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_MessageAttemptOut_" + "$ref": "#/components/schemas/EndpointHeadersOut" } } }, @@ -6673,204 +8834,77 @@ "HTTPBearer": [] } ], - "summary": "List Attempts By Endpoint", + "summary": "Get Endpoint Headers", "tags": [ - "Message Attempt" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByEndpoint(\"app_id\", \"endpoint_id\");" + "source": "const endpointHeadersOut = await svix.endpoint.getHeaders(\"app_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByEndpoint(\"app_id\", \"endpoint_id\");" + "source": "const endpointHeadersOut = await svix.endpoint.getHeaders(\"app_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "list_response_message_attempt_out = svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\", None)" + "source": "endpoint_headers_out = svix.endpoint.get_headers(\"app_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\", None)" + "source": "endpoint_headers_out = await svix.endpoint.get_headers(\"app_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "listResponseMessageAttemptOut, err := svixClient.MessageAttempt.ListByEndpoint(ctx, \"app_id\", \"endpoint_id\", nil)" + "source": "endpointHeadersOut, err := svixClient.Endpoint.GetHeaders(ctx, \"app_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseMessageAttemptOut = svix.messageAttempt.listByEndpoint(\"app_id\", \"endpoint_id\")" + "source": "val endpointHeadersOut = svix.endpoint.getHeaders(\"app_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "ListResponseMessageAttemptOut listResponseMessageAttemptOut = svix.getMessageAttempt().listByEndpoint(\"app_id\", \"endpoint_id\")" + "source": "EndpointHeadersOut endpointHeadersOut = svix.getEndpoint().getHeaders(\"app_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_message_attempt_out = svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\")" + "source": "endpoint_headers_out = svix.endpoint.get_headers(\"app_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_message_attempt_out = svix.message_attempt().list_by_endpoint(\"app_id\", \"endpoint_id\", None).await?;" + "source": "let endpoint_headers_out = svix.endpoint().get_headers(\"app_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseMessageAttemptOut = await svix.MessageAttempt.ListByEndpointAsync(\"app_id\", \"endpoint_id\")" + "source": "var endpointHeadersOut = await svix.Endpoint.GetHeadersAsync(\"app_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message-attempt list-by-endpoint \"app_id\" \"endpoint_id\"" + "source": "svix endpoint get-headers \"app_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/app/{app_id}/attempt/msg/{msg_id}": { - "get": { - "description": "List attempts by message id\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", - "operationId": "v1.message-attempt.list-by-msg", + }, + "patch": { + "description": "Partially set the additional headers to be sent with the webhook", + "operationId": "v1.endpoint.patch-headers", "parameters": [ - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the delivery status", - "in": "query", - "name": "status", - "schema": { - "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the delivery status", - "nullable": true - }, - "style": "form" - }, - { - "description": "Filter response based on the HTTP status code", - "in": "query", - "name": "status_code_class", - "schema": { - "$ref": "#/components/schemas/StatusCodeClass", - "description": "Filter response based on the HTTP status code", - "nullable": true - }, - "style": "form" - }, - { - "description": "Filter response based on the channel", - "in": "query", - "name": "channel", - "schema": { - "description": "Filter response based on the channel", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the tag", - "in": "query", - "name": "tag", - "schema": { - "description": "Filter response based on the tag", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter the attempts based on the attempted endpoint", - "in": "query", - "name": "endpoint_id", - "schema": { - "description": "Filter the attempts based on the attempted endpoint", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Only include items created before a certain date", - "in": "query", - "name": "before", - "schema": { - "description": "Only include items created before a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only include items created after a certain date", - "in": "query", - "name": "after", - "schema": { - "description": "Only include items created after a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "When `true` attempt content is included in the response", - "in": "query", - "name": "with_content", - "schema": { - "default": true, - "description": "When `true` attempt content is included in the response", - "type": "boolean" - }, - "style": "form" - }, { "description": "The app's ID or UID", "in": "path", @@ -6887,50 +8921,34 @@ "style": "simple" }, { - "description": "The msg's ID or UID", + "description": "The ep's ID or UID", "in": "path", - "name": "msg_id", + "name": "endpoint_id", "required": true, "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", - "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" }, - "style": "form" + "style": "simple" } ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListResponse_MessageAttemptOut_" - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointHeadersPatchIn" } - }, - "description": "" + } + }, + "required": true + }, + "responses": { + "204": { + "description": "no content" }, "400": { "content": { @@ -7008,78 +9026,76 @@ "HTTPBearer": [] } ], - "summary": "List Attempts By Msg", + "summary": "Patch Endpoint Headers", "tags": [ - "Message Attempt" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsg(\"app_id\", \"msg_id\");" + "source": "await svix.endpoint.patchHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsg(\"app_id\", \"msg_id\");" + "source": "await svix.endpoint.patchHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" }, { "label": "Python", "lang": "Python", - "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\", None)" + "source": "svix.endpoint.patch_headers(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\", None)" + "source": "await svix.endpoint.patch_headers(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" }, { "label": "Go", "lang": "Go", - "source": "listResponseMessageAttemptOut, err := svixClient.MessageAttempt.ListByMsg(ctx, \"app_id\", \"msg_id\", nil)" + "source": "err := svixClient.Endpoint.PatchHeaders(ctx, \"app_id\", \"endpoint_id\", &EndpointHeadersPatchIn{\n Headers: map[string]interface{}{\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"},\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseMessageAttemptOut = svix.messageAttempt.listByMsg(\"app_id\", \"msg_id\")" + "source": "svix.endpoint.patchHeaders(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn()\n .headers(/* ... */)\n)" }, { "label": "Java", "lang": "Java", - "source": "ListResponseMessageAttemptOut listResponseMessageAttemptOut = svix.getMessageAttempt().listByMsg(\"app_id\", \"msg_id\")" + "source": "svix.getEndpoint().patchHeaders(\"app_id\", \"endpoint_id\", new EndpointHeadersPatchIn()\n .headers(/* ... */)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\")" + "source": "svix.endpoint.patch_headers(\"app_id\", \"endpoint_id\", Svix::EndpointHeadersPatchIn.new({\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_message_attempt_out = svix.message_attempt().list_by_msg(\"app_id\", \"msg_id\", None).await?;" + "source": "svix.endpoint().patch_headers(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn {\n headers: json!({\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}),\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseMessageAttemptOut = await svix.MessageAttempt.ListByMsgAsync(\"app_id\", \"msg_id\")" + "source": "await svix.Endpoint.PatchHeadersAsync(\"app_id\", \"endpoint_id\", new EndpointHeadersPatchIn{\n headers: /* ... */\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix message-attempt list-by-msg \"app_id\" \"msg_id\"" + "source": "svix endpoint patch-headers \"app_id\" \"endpoint_id\" '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/attempt/msg/{msg_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n }'" } ] - } - }, - "/api/v1/app/{app_id}/endpoint": { - "get": { - "description": "List the application's endpoints.", - "operationId": "v1.endpoint.list", + }, + "put": { + "description": "Set the additional headers to be sent with the webhook", + "operationId": "v1.endpoint.update-headers", "parameters": [ { "description": "The app's ID or UID", @@ -7097,52 +9113,34 @@ "style": "simple" }, { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, "schema": { - "description": "The iterator returned from a prior invocation", - "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, - "style": "form" - }, - { - "description": "The sorting order of the returned items", - "in": "query", - "name": "order", - "schema": { - "$ref": "#/components/schemas/Ordering", - "description": "The sorting order of the returned items", - "nullable": true - }, - "style": "form" + "style": "simple" } ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListResponse_EndpointOut_" - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointHeadersIn" } - }, - "description": "" + } + }, + "required": true + }, + "responses": { + "204": { + "description": "no content" }, "400": { "content": { @@ -7220,7 +9218,7 @@ "HTTPBearer": [] } ], - "summary": "List Endpoints", + "summary": "Update Endpoint Headers", "tags": [ "Endpoint" ], @@ -7228,69 +9226,170 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseEndpointOut = await svix.endpoint.list(\"app_id\");" + "source": "await svix.endpoint.updateHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseEndpointOut = await svix.endpoint.list(\"app_id\");" + "source": "await svix.endpoint.updateHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" }, { "label": "Python", "lang": "Python", - "source": "list_response_endpoint_out = svix.endpoint.list(\"app_id\", None)" + "source": "svix.endpoint.update_headers(\"app_id\", \"endpoint_id\", EndpointHeadersIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_endpoint_out = await svix.endpoint.list(\"app_id\", None)" + "source": "await svix.endpoint.update_headers(\"app_id\", \"endpoint_id\", EndpointHeadersIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" }, { "label": "Go", "lang": "Go", - "source": "listResponseEndpointOut, err := svixClient.Endpoint.List(ctx, \"app_id\", nil)" + "source": "err := svixClient.Endpoint.UpdateHeaders(ctx, \"app_id\", \"endpoint_id\", &EndpointHeadersIn{\n Headers: map[string]interface{}{\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"},\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseEndpointOut = svix.endpoint.list(\"app_id\")" + "source": "svix.endpoint.updateHeaders(\"app_id\", \"endpoint_id\", EndpointHeadersIn()\n .headers(/* ... */)\n)" }, { "label": "Java", "lang": "Java", - "source": "ListResponseEndpointOut listResponseEndpointOut = svix.getEndpoint().list(\"app_id\")" + "source": "svix.getEndpoint().updateHeaders(\"app_id\", \"endpoint_id\", new EndpointHeadersIn()\n .headers(/* ... */)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_endpoint_out = svix.endpoint.list(\"app_id\")" + "source": "svix.endpoint.update_headers(\"app_id\", \"endpoint_id\", Svix::EndpointHeadersIn.new({\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_endpoint_out = svix.endpoint().list(\"app_id\", None).await?;" + "source": "svix.endpoint().update_headers(\"app_id\", \"endpoint_id\", EndpointHeadersIn {\n headers: json!({\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}),\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseEndpointOut = await svix.Endpoint.ListAsync(\"app_id\")" + "source": "await svix.Endpoint.UpdateHeadersAsync(\"app_id\", \"endpoint_id\", new EndpointHeadersIn{\n headers: /* ... */\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint update-headers \"app_id\" \"endpoint_id\" '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg": { + "get": { + "description": "List messages for a particular endpoint. Additionally includes metadata about the latest message attempt.\n\nThe `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "operationId": "v1.message-attempt.list-attempted-messages", + "parameters": [ + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the channel", + "in": "query", + "name": "channel", + "schema": { + "description": "Filter response based on the channel", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the message tags", + "in": "query", + "name": "tag", + "schema": { + "description": "Filter response based on the message tags", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the delivery status", + "in": "query", + "name": "status", + "schema": { + "$ref": "#/components/schemas/MessageStatus", + "description": "Filter response based on the delivery status", + "nullable": true + }, + "style": "form" + }, + { + "description": "Only include items created before a certain date", + "in": "query", + "name": "before", + "schema": { + "description": "Only include items created before a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Only include items created after a certain date", + "in": "query", + "name": "after", + "schema": { + "description": "Only include items created after a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" }, { - "label": "CLI", - "lang": "Shell", - "source": "svix endpoint list \"app_id\"" + "description": "When `true` message payloads are included in the response", + "in": "query", + "name": "with_content", + "schema": { + "default": true, + "description": "When `true` message payloads are included in the response", + "type": "boolean" + }, + "style": "form" }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" - } - ] - }, - "post": { - "description": "Create a new endpoint for the application.\n\nWhen `secret` is `null` the secret is automatically generated (recommended)", - "operationId": "v1.endpoint.create", - "parameters": [ { "description": "The app's ID or UID", "in": "path", @@ -7307,31 +9406,46 @@ "style": "simple" }, { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" + }, + { + "description": "Filter response based on the event type", + "in": "query", + "name": "event_types", + "schema": { + "description": "Filter response based on the event type", + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointIn" - } - } - }, - "required": true - }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EndpointOut" + "$ref": "#/components/schemas/ListResponse_EndpointMessageOut_" } } }, @@ -7413,78 +9527,78 @@ "HTTPBearer": [] } ], - "summary": "Create Endpoint", + "summary": "List Attempted Messages", "tags": [ - "Endpoint" + "Message Attempt" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const endpointOut = await svix.endpoint.create(\"app_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"],\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "const listResponseEndpointMessageOut = await svix.messageAttempt.listAttemptedMessages(\"app_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const endpointOut = await svix.endpoint.create(\"app_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"],\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "const listResponseEndpointMessageOut = await svix.messageAttempt.listAttemptedMessages(\"app_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "endpoint_out = svix.endpoint.create(\"app_id\", EndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"],\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + "source": "list_response_endpoint_message_out = svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_out = await svix.endpoint.create(\"app_id\", EndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"],\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + "source": "list_response_endpoint_message_out = await svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "endpointOut, err := svixClient.Endpoint.Create(ctx, \"app_id\", &EndpointIn{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Url: \"https://example.com/webhook/\",\n Version: 1,\n Disabled: false,\n FilterTypes: []string{\"user.signup\", \"user.deleted\"},\n Channels: []string{\"project_123\", \"group_2\"},\n Secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" + "source": "listResponseEndpointMessageOut, err := svixClient.MessageAttempt.ListAttemptedMessages(ctx, \"app_id\", \"endpoint_id\", nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val endpointOut = svix.endpoint.create(\"app_id\", EndpointIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(arrayOf(\"user.signup\", \"user.deleted\"))\n .channels(arrayOf(\"project_123\", \"group_2\"))\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + "source": "val listResponseEndpointMessageOut = svix.messageAttempt.listAttemptedMessages(\"app_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "EndpointOut endpointOut = svix.getEndpoint().create(\"app_id\", new EndpointIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(new String[]{\"user.signup\", \"user.deleted\"})\n .channels(new String[]{\"project_123\", \"group_2\"})\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + "source": "ListResponseEndpointMessageOut listResponseEndpointMessageOut = svix.getMessageAttempt().listAttemptedMessages(\"app_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "endpoint_out = svix.endpoint.create(\"app_id\", Svix::EndpointIn.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filter_types\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"],\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" + "source": "list_response_endpoint_message_out = svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let endpoint_out = svix.endpoint().create(\"app_id\", EndpointIn {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n url: \"https://example.com/webhook/\".to_string(),\n version: Some(1),\n disabled: Some(false),\n filter_types: Some(vec![\"user.signup\".to_string(), \"user.deleted\".to_string()]),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n secret: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}, None).await?;" + "source": "let list_response_endpoint_message_out = svix.message_attempt().list_attempted_messages(\"app_id\", \"endpoint_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var endpointOut = await svix.Endpoint.CreateAsync(\"app_id\", new EndpointIn{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: new string[] {\"user.signup\", \"user.deleted\"},\n channels: new string[] {\"project_123\", \"group_2\"},\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n})" + "source": "var listResponseEndpointMessageOut = await svix.MessageAttempt.ListAttemptedMessagesAsync(\"app_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint create \"app_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"],\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" + "source": "svix message-attempt list-attempted-messages \"app_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"],\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}": { - "delete": { - "description": "Delete an endpoint.", - "operationId": "v1.endpoint.delete", + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/test-attempt": { + "post": { + "description": "Creates and sends a message to the specified endpoint. The message attempt and response from the endpoint is returned.\nFIXME: use MessageIn for expediency, even though the `application` parameter is unused. Since this endpoint isn't publicly documented anyway, it should be fine", + "operationId": "create_message_attempt_for_endpoint", "parameters": [ { "description": "The app's ID or UID", @@ -7515,11 +9629,37 @@ "type": "string" }, "style": "simple" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageIn" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "no content" + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageAttemptOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -7597,76 +9737,16 @@ "HTTPBearer": [] } ], - "summary": "Delete Endpoint", + "summary": "Create Message Attempt For Endpoint", "tags": [ - "Endpoint" - ], - "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "await svix.endpoint.delete(\"app_id\", \"endpoint_id\");" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "await svix.endpoint.delete(\"app_id\", \"endpoint_id\");" - }, - { - "label": "Python", - "lang": "Python", - "source": "svix.endpoint.delete(\"app_id\", \"endpoint_id\")" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "await svix.endpoint.delete(\"app_id\", \"endpoint_id\")" - }, - { - "label": "Go", - "lang": "Go", - "source": "err := svixClient.Endpoint.Delete(ctx, \"app_id\", \"endpoint_id\")" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "svix.endpoint.delete(\"app_id\", \"endpoint_id\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "svix.getEndpoint().delete(\"app_id\", \"endpoint_id\")" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "svix.endpoint.delete(\"app_id\", \"endpoint_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "svix.endpoint().delete(\"app_id\", \"endpoint_id\").await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "await svix.Endpoint.DeleteAsync(\"app_id\", \"endpoint_id\")" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix endpoint delete \"app_id\" \"endpoint_id\"" - }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" - } + "Message" ] - }, - "get": { - "description": "Get an endpoint.", - "operationId": "v1.endpoint.get", + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls": { + "delete": { + "description": "Delete endpoint mTLS configuration", + "operationId": "v1.endpoint.delete-mtls-config", "parameters": [ { "description": "The app's ID or UID", @@ -7700,15 +9780,8 @@ } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -7786,7 +9859,7 @@ "HTTPBearer": [] } ], - "summary": "Get Endpoint", + "summary": "Delete Endpoint Mtls Config", "tags": [ "Endpoint" ], @@ -7794,68 +9867,68 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const endpointOut = await svix.endpoint.get(\"app_id\", \"endpoint_id\");" + "source": "await svix.endpoint.deleteMtlsConfig(\"app_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const endpointOut = await svix.endpoint.get(\"app_id\", \"endpoint_id\");" + "source": "await svix.endpoint.deleteMtlsConfig(\"app_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "endpoint_out = svix.endpoint.get(\"app_id\", \"endpoint_id\")" + "source": "svix.endpoint.delete_mtls_config(\"app_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_out = await svix.endpoint.get(\"app_id\", \"endpoint_id\")" + "source": "await svix.endpoint.delete_mtls_config(\"app_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "endpointOut, err := svixClient.Endpoint.Get(ctx, \"app_id\", \"endpoint_id\")" + "source": "err := svixClient.Endpoint.DeleteMtlsConfig(ctx, \"app_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val endpointOut = svix.endpoint.get(\"app_id\", \"endpoint_id\")" + "source": "svix.endpoint.deleteMtlsConfig(\"app_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "EndpointOut endpointOut = svix.getEndpoint().get(\"app_id\", \"endpoint_id\")" + "source": "svix.getEndpoint().deleteMtlsConfig(\"app_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "endpoint_out = svix.endpoint.get(\"app_id\", \"endpoint_id\")" + "source": "svix.endpoint.delete_mtls_config(\"app_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let endpoint_out = svix.endpoint().get(\"app_id\", \"endpoint_id\").await?;" + "source": "svix.endpoint().delete_mtls_config(\"app_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var endpointOut = await svix.Endpoint.GetAsync(\"app_id\", \"endpoint_id\")" + "source": "await svix.Endpoint.DeleteMtlsConfigAsync(\"app_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint get \"app_id\" \"endpoint_id\"" + "source": "svix endpoint delete-mtls-config \"app_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] }, - "patch": { - "description": "Partially update an endpoint.", - "operationId": "v1.endpoint.patch", + "put": { + "description": "Create/update endpoint mTLS configuration", + "operationId": "v1.endpoint.update-mtls-config", "parameters": [ { "description": "The app's ID or UID", @@ -7892,22 +9965,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EndpointPatch" + "$ref": "#/components/schemas/EndpointMtlsConfigIn" } } }, "required": true }, "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -7985,7 +10051,7 @@ "HTTPBearer": [] } ], - "summary": "Patch Endpoint", + "summary": "Update Endpoint Mtls Config", "tags": [ "Endpoint" ], @@ -7993,68 +10059,70 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const endpointOut = await svix.endpoint.patch(\"app_id\", \"endpoint_id\", {\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n version: 1,\n filterTypes: null,\n channels: null,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "await svix.endpoint.updateMtlsConfig(\"app_id\", \"endpoint_id\", {\n serverCaCert: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const endpointOut = await svix.endpoint.patch(\"app_id\", \"endpoint_id\", {\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n version: 1,\n filterTypes: null,\n channels: null,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "await svix.endpoint.updateMtlsConfig(\"app_id\", \"endpoint_id\", {\n serverCaCert: null\n});" }, { "label": "Python", "lang": "Python", - "source": "endpoint_out = svix.endpoint.patch(\"app_id\", \"endpoint_id\", EndpointPatch(\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n version=1,\n filter_types=None,\n channels=None,\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n))" + "source": "svix.endpoint.update_mtls_config(\"app_id\", \"endpoint_id\", EndpointMtlsConfigIn(\n server_ca_cert=None\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_out = await svix.endpoint.patch(\"app_id\", \"endpoint_id\", EndpointPatch(\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n version=1,\n filter_types=None,\n channels=None,\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n))" + "source": "await svix.endpoint.update_mtls_config(\"app_id\", \"endpoint_id\", EndpointMtlsConfigIn(\n server_ca_cert=None\n))" }, { "label": "Go", "lang": "Go", - "source": "endpointOut, err := svixClient.Endpoint.Patch(ctx, \"app_id\", \"endpoint_id\", &EndpointPatch{\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Version: 1,\n FilterTypes: nil,\n Channels: nil,\n Secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" + "source": "err := svixClient.Endpoint.UpdateMtlsConfig(ctx, \"app_id\", \"endpoint_id\", &EndpointMtlsConfigIn{\n ServerCaCert: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val endpointOut = svix.endpoint.patch(\"app_id\", \"endpoint_id\", EndpointPatch()\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .version(1)\n .filterTypes(null)\n .channels(null)\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + "source": "svix.endpoint.updateMtlsConfig(\"app_id\", \"endpoint_id\", EndpointMtlsConfigIn()\n .serverCaCert(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "EndpointOut endpointOut = svix.getEndpoint().patch(\"app_id\", \"endpoint_id\", new EndpointPatch()\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .version(1)\n .filterTypes(null)\n .channels(null)\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + "source": "svix.getEndpoint().updateMtlsConfig(\"app_id\", \"endpoint_id\", new EndpointMtlsConfigIn()\n .serverCaCert(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "endpoint_out = svix.endpoint.patch(\"app_id\", \"endpoint_id\", Svix::EndpointPatch.new({\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1,\n \"filter_types\": nil,\n \"channels\": nil,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" + "source": "svix.endpoint.update_mtls_config(\"app_id\", \"endpoint_id\", Svix::EndpointMtlsConfigIn.new({\n \"server_ca_cert\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let endpoint_out = svix.endpoint().patch(\"app_id\", \"endpoint_id\", EndpointPatch {\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n version: Some(1),\n filter_types: None,\n channels: None,\n secret: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}).await?;" + "source": "svix.endpoint().update_mtls_config(\"app_id\", \"endpoint_id\", EndpointMtlsConfigIn {\n server_ca_cert: None,\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var endpointOut = await svix.Endpoint.PatchAsync(\"app_id\", \"endpoint_id\", new EndpointPatch{\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n version: 1,\n filterTypes: null,\n channels: null,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n})" + "source": "await svix.Endpoint.UpdateMtlsConfigAsync(\"app_id\", \"endpoint_id\", new EndpointMtlsConfigIn{\n serverCaCert: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint patch \"app_id\" \"endpoint_id\" '{\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1,\n \"filterTypes\": null,\n \"channels\": null,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" + "source": "svix endpoint update-mtls-config \"app_id\" \"endpoint_id\" '{\n \"serverCaCert\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1,\n \"filterTypes\": null,\n \"channels\": null,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"serverCaCert\": null\n }'" } ] - }, - "put": { - "description": "Update an endpoint.", - "operationId": "v1.endpoint.update", + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth": { + "delete": { + "description": "Delete endpoint OAuth configuration", + "operationId": "v1.endpoint.delete-oauth-config", "parameters": [ { "description": "The app's ID or UID", @@ -8087,36 +10155,9 @@ "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointUpdate" - } - } - }, - "required": true - }, "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointOut" - } - } - }, - "description": "" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -8194,7 +10235,7 @@ "HTTPBearer": [] } ], - "summary": "Update Endpoint", + "summary": "Delete Endpoint Oauth Config", "tags": [ "Endpoint" ], @@ -8202,70 +10243,68 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const endpointOut = await svix.endpoint.update(\"app_id\", \"endpoint_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"]\n});" + "source": "await svix.endpoint.deleteOauthConfig(\"app_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const endpointOut = await svix.endpoint.update(\"app_id\", \"endpoint_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"]\n});" + "source": "await svix.endpoint.deleteOauthConfig(\"app_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "endpoint_out = svix.endpoint.update(\"app_id\", \"endpoint_id\", EndpointUpdate(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n))" + "source": "svix.endpoint.delete_oauth_config(\"app_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_out = await svix.endpoint.update(\"app_id\", \"endpoint_id\", EndpointUpdate(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n))" + "source": "await svix.endpoint.delete_oauth_config(\"app_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "endpointOut, err := svixClient.Endpoint.Update(ctx, \"app_id\", \"endpoint_id\", &EndpointUpdate{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Url: \"https://example.com/webhook/\",\n Version: 1,\n Disabled: false,\n FilterTypes: []string{\"user.signup\", \"user.deleted\"},\n Channels: []string{\"project_123\", \"group_2\"},\n})" + "source": "err := svixClient.Endpoint.DeleteOauthConfig(ctx, \"app_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val endpointOut = svix.endpoint.update(\"app_id\", \"endpoint_id\", EndpointUpdate()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(arrayOf(\"user.signup\", \"user.deleted\"))\n .channels(arrayOf(\"project_123\", \"group_2\"))\n)" + "source": "svix.endpoint.deleteOauthConfig(\"app_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "EndpointOut endpointOut = svix.getEndpoint().update(\"app_id\", \"endpoint_id\", new EndpointUpdate()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(new String[]{\"user.signup\", \"user.deleted\"})\n .channels(new String[]{\"project_123\", \"group_2\"})\n)" + "source": "svix.getEndpoint().deleteOauthConfig(\"app_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "endpoint_out = svix.endpoint.update(\"app_id\", \"endpoint_id\", Svix::EndpointUpdate.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filter_types\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n}))" + "source": "svix.endpoint.delete_oauth_config(\"app_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let endpoint_out = svix.endpoint().update(\"app_id\", \"endpoint_id\", EndpointUpdate {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n url: \"https://example.com/webhook/\".to_string(),\n version: Some(1),\n disabled: Some(false),\n filter_types: Some(vec![\"user.signup\".to_string(), \"user.deleted\".to_string()]),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n}).await?;" + "source": "svix.endpoint().delete_oauth_config(\"app_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var endpointOut = await svix.Endpoint.UpdateAsync(\"app_id\", \"endpoint_id\", new EndpointUpdate{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: new string[] {\"user.signup\", \"user.deleted\"},\n channels: new string[] {\"project_123\", \"group_2\"}\n})" + "source": "await svix.Endpoint.DeleteOauthConfigAsync(\"app_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint update \"app_id\" \"endpoint_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n}'" + "source": "svix endpoint delete-oauth-config \"app_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n }'" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers": { - "get": { - "description": "Get the additional headers to be sent with the webhook", - "operationId": "v1.endpoint.get-headers", + }, + "put": { + "description": "Create/update endpoint OAuth configuration", + "operationId": "v1.endpoint.update-oauth-config", "parameters": [ { "description": "The app's ID or UID", @@ -8298,16 +10337,19 @@ "style": "simple" } ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointHeadersOut" - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointOauthConfigIn" } - }, - "description": "" + } + }, + "required": true + }, + "responses": { + "204": { + "description": "no content" }, "400": { "content": { @@ -8385,7 +10427,7 @@ "HTTPBearer": [] } ], - "summary": "Get Endpoint Headers", + "summary": "Update Endpoint Oauth Config", "tags": [ "Endpoint" ], @@ -8393,68 +10435,70 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const endpointHeadersOut = await svix.endpoint.getHeaders(\"app_id\", \"endpoint_id\");" + "source": "await svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", {\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null,\n refreshToken: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const endpointHeadersOut = await svix.endpoint.getHeaders(\"app_id\", \"endpoint_id\");" + "source": "await svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", {\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null,\n refreshToken: null\n});" }, { "label": "Python", "lang": "Python", - "source": "endpoint_headers_out = svix.endpoint.get_headers(\"app_id\", \"endpoint_id\")" + "source": "svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn(\n jwt_params=None,\n client_secret=None,\n scopes=None,\n extra_params=None,\n refresh_token=None\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_headers_out = await svix.endpoint.get_headers(\"app_id\", \"endpoint_id\")" + "source": "await svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn(\n jwt_params=None,\n client_secret=None,\n scopes=None,\n extra_params=None,\n refresh_token=None\n))" }, { "label": "Go", "lang": "Go", - "source": "endpointHeadersOut, err := svixClient.Endpoint.GetHeaders(ctx, \"app_id\", \"endpoint_id\")" + "source": "err := svixClient.Endpoint.UpdateOauthConfig(ctx, \"app_id\", \"endpoint_id\", &EndpointOauthConfigIn{\n JwtParams: nil,\n ClientSecret: nil,\n Scopes: nil,\n ExtraParams: nil,\n RefreshToken: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val endpointHeadersOut = svix.endpoint.getHeaders(\"app_id\", \"endpoint_id\")" + "source": "svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn()\n .jwtParams(null)\n .clientSecret(null)\n .scopes(null)\n .extraParams(null)\n .refreshToken(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "EndpointHeadersOut endpointHeadersOut = svix.getEndpoint().getHeaders(\"app_id\", \"endpoint_id\")" + "source": "svix.getEndpoint().updateOauthConfig(\"app_id\", \"endpoint_id\", new EndpointOauthConfigIn()\n .jwtParams(null)\n .clientSecret(null)\n .scopes(null)\n .extraParams(null)\n .refreshToken(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "endpoint_headers_out = svix.endpoint.get_headers(\"app_id\", \"endpoint_id\")" + "source": "svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", Svix::EndpointOauthConfigIn.new({\n \"jwt_params\": nil,\n \"client_secret\": nil,\n \"scopes\": nil,\n \"extra_params\": nil,\n \"refresh_token\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let endpoint_headers_out = svix.endpoint().get_headers(\"app_id\", \"endpoint_id\").await?;" + "source": "svix.endpoint().update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn {\n jwt_params: None,\n client_secret: None,\n scopes: None,\n extra_params: None,\n refresh_token: None,\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var endpointHeadersOut = await svix.Endpoint.GetHeadersAsync(\"app_id\", \"endpoint_id\")" + "source": "await svix.Endpoint.UpdateOauthConfigAsync(\"app_id\", \"endpoint_id\", new EndpointOauthConfigIn{\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null,\n refreshToken: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint get-headers \"app_id\" \"endpoint_id\"" + "source": "svix endpoint update-oauth-config \"app_id\" \"endpoint_id\" '{\n \"jwtParams\": null,\n \"clientSecret\": null,\n \"scopes\": null,\n \"extraParams\": null,\n \"refreshToken\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"jwtParams\": null,\n \"clientSecret\": null,\n \"scopes\": null,\n \"extraParams\": null,\n \"refreshToken\": null\n }'" } ] - }, - "patch": { - "description": "Partially set the additional headers to be sent with the webhook", - "operationId": "v1.endpoint.patch-headers", + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover": { + "post": { + "description": "Resend all failed messages since a given time.", + "operationId": "v1.endpoint.recover", "parameters": [ { "description": "The app's ID or UID", @@ -8485,21 +10529,37 @@ "type": "string" }, "style": "simple" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" } ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EndpointHeadersPatchIn" + "$ref": "#/components/schemas/RecoverIn" } } }, "required": true }, "responses": { - "204": { - "description": "no content" + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecoverOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -8577,7 +10637,7 @@ "HTTPBearer": [] } ], - "summary": "Patch Endpoint Headers", + "summary": "Recover Failed Webhooks", "tags": [ "Endpoint" ], @@ -8585,68 +10645,70 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.endpoint.patchHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" + "source": "const recoverOut = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", {\n until: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.endpoint.patchHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" + "source": "const recoverOut = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", {\n until: null\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.endpoint.patch_headers(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" + "source": "recover_out = svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn(\n until=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.patch_headers(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" + "source": "recover_out = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn(\n until=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Endpoint.PatchHeaders(ctx, \"app_id\", \"endpoint_id\", &EndpointHeadersPatchIn{\n Headers: map[string]interface{}{\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"},\n})" + "source": "recoverOut, err := svixClient.Endpoint.Recover(ctx, \"app_id\", \"endpoint_id\", &RecoverIn{\n Until: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.endpoint.patchHeaders(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn()\n .headers(/* ... */)\n)" + "source": "val recoverOut = svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn()\n .until(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getEndpoint().patchHeaders(\"app_id\", \"endpoint_id\", new EndpointHeadersPatchIn()\n .headers(/* ... */)\n)" + "source": "RecoverOut recoverOut = svix.getEndpoint().recover(\"app_id\", \"endpoint_id\", new RecoverIn()\n .until(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.endpoint.patch_headers(\"app_id\", \"endpoint_id\", Svix::EndpointHeadersPatchIn.new({\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}))" + "source": "recover_out = svix.endpoint.recover(\"app_id\", \"endpoint_id\", Svix::RecoverIn.new({\n \"until\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.endpoint().patch_headers(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn {\n headers: json!({\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}),\n}).await?;" + "source": "let recover_out = svix.endpoint().recover(\"app_id\", \"endpoint_id\", RecoverIn {\n until: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Endpoint.PatchHeadersAsync(\"app_id\", \"endpoint_id\", new EndpointHeadersPatchIn{\n headers: /* ... */\n})" + "source": "var recoverOut = await svix.Endpoint.RecoverAsync(\"app_id\", \"endpoint_id\", new RecoverIn{\n until: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint patch-headers \"app_id\" \"endpoint_id\" '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}'" + "source": "svix endpoint recover \"app_id\" \"endpoint_id\" '{\n \"until\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"until\": null\n }'" } ] - }, - "put": { - "description": "Set the additional headers to be sent with the webhook", - "operationId": "v1.endpoint.update-headers", + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing": { + "post": { + "description": "Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent.", + "operationId": "v1.endpoint.replay", "parameters": [ { "description": "The app's ID or UID", @@ -8677,21 +10739,37 @@ "type": "string" }, "style": "simple" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" } ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EndpointHeadersIn" + "$ref": "#/components/schemas/ReplayIn" } } }, "required": true }, "responses": { - "204": { - "description": "no content" + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReplayOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -8769,7 +10847,7 @@ "HTTPBearer": [] } ], - "summary": "Update Endpoint Headers", + "summary": "Replay Missing Webhooks", "tags": [ "Endpoint" ], @@ -8777,170 +10855,71 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.endpoint.updateHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" + "source": "const replayOut = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", {\n until: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.endpoint.updateHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" + "source": "const replayOut = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", {\n until: null\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.endpoint.update_headers(\"app_id\", \"endpoint_id\", EndpointHeadersIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" + "source": "replay_out = svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn(\n until=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.update_headers(\"app_id\", \"endpoint_id\", EndpointHeadersIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" + "source": "replay_out = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn(\n until=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Endpoint.UpdateHeaders(ctx, \"app_id\", \"endpoint_id\", &EndpointHeadersIn{\n Headers: map[string]interface{}{\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"},\n})" + "source": "replayOut, err := svixClient.Endpoint.Replay(ctx, \"app_id\", \"endpoint_id\", &ReplayIn{\n Until: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.endpoint.updateHeaders(\"app_id\", \"endpoint_id\", EndpointHeadersIn()\n .headers(/* ... */)\n)" + "source": "val replayOut = svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn()\n .until(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getEndpoint().updateHeaders(\"app_id\", \"endpoint_id\", new EndpointHeadersIn()\n .headers(/* ... */)\n)" + "source": "ReplayOut replayOut = svix.getEndpoint().replay(\"app_id\", \"endpoint_id\", new ReplayIn()\n .until(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.endpoint.update_headers(\"app_id\", \"endpoint_id\", Svix::EndpointHeadersIn.new({\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}))" + "source": "replay_out = svix.endpoint.replay(\"app_id\", \"endpoint_id\", Svix::ReplayIn.new({\n \"until\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.endpoint().update_headers(\"app_id\", \"endpoint_id\", EndpointHeadersIn {\n headers: json!({\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}),\n}).await?;" + "source": "let replay_out = svix.endpoint().replay(\"app_id\", \"endpoint_id\", ReplayIn {\n until: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Endpoint.UpdateHeadersAsync(\"app_id\", \"endpoint_id\", new EndpointHeadersIn{\n headers: /* ... */\n})" + "source": "var replayOut = await svix.Endpoint.ReplayAsync(\"app_id\", \"endpoint_id\", new ReplayIn{\n until: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint update-headers \"app_id\" \"endpoint_id\" '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}'" + "source": "svix endpoint replay \"app_id\" \"endpoint_id\" '{\n \"until\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"until\": null\n }'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg": { + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret": { "get": { - "description": "List messages for a particular endpoint. Additionally includes metadata about the latest message attempt.\n\nThe `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", - "operationId": "v1.message-attempt.list-attempted-messages", + "description": "Get the endpoint's signing secret.\n\nThis is used to verify the authenticity of the webhook.\nFor more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).", + "operationId": "v1.endpoint.get-secret", "parameters": [ - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the channel", - "in": "query", - "name": "channel", - "schema": { - "description": "Filter response based on the channel", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the message tags", - "in": "query", - "name": "tag", - "schema": { - "description": "Filter response based on the message tags", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the delivery status", - "in": "query", - "name": "status", - "schema": { - "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the delivery status", - "nullable": true - }, - "style": "form" - }, - { - "description": "Only include items created before a certain date", - "in": "query", - "name": "before", - "schema": { - "description": "Only include items created before a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only include items created after a certain date", - "in": "query", - "name": "after", - "schema": { - "description": "Only include items created after a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "When `true` message payloads are included in the response", - "in": "query", - "name": "with_content", - "schema": { - "default": true, - "description": "When `true` message payloads are included in the response", - "type": "boolean" - }, - "style": "form" - }, { "description": "The app's ID or UID", "in": "path", @@ -8970,25 +10949,6 @@ "type": "string" }, "style": "simple" - }, - { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", - "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" } ], "responses": { @@ -8996,7 +10956,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_EndpointMessageOut_" + "$ref": "#/components/schemas/EndpointSecretOut" } } }, @@ -9078,78 +11038,78 @@ "HTTPBearer": [] } ], - "summary": "List Attempted Messages", + "summary": "Get Endpoint Secret", "tags": [ - "Message Attempt" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseEndpointMessageOut = await svix.messageAttempt.listAttemptedMessages(\"app_id\", \"endpoint_id\");" + "source": "const endpointSecretOut = await svix.endpoint.getSecret(\"app_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseEndpointMessageOut = await svix.messageAttempt.listAttemptedMessages(\"app_id\", \"endpoint_id\");" + "source": "const endpointSecretOut = await svix.endpoint.getSecret(\"app_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "list_response_endpoint_message_out = svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\", None)" + "source": "endpoint_secret_out = svix.endpoint.get_secret(\"app_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_endpoint_message_out = await svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\", None)" + "source": "endpoint_secret_out = await svix.endpoint.get_secret(\"app_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "listResponseEndpointMessageOut, err := svixClient.MessageAttempt.ListAttemptedMessages(ctx, \"app_id\", \"endpoint_id\", nil)" + "source": "endpointSecretOut, err := svixClient.Endpoint.GetSecret(ctx, \"app_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseEndpointMessageOut = svix.messageAttempt.listAttemptedMessages(\"app_id\", \"endpoint_id\")" + "source": "val endpointSecretOut = svix.endpoint.getSecret(\"app_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "ListResponseEndpointMessageOut listResponseEndpointMessageOut = svix.getMessageAttempt().listAttemptedMessages(\"app_id\", \"endpoint_id\")" + "source": "EndpointSecretOut endpointSecretOut = svix.getEndpoint().getSecret(\"app_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_endpoint_message_out = svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\")" + "source": "endpoint_secret_out = svix.endpoint.get_secret(\"app_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_endpoint_message_out = svix.message_attempt().list_attempted_messages(\"app_id\", \"endpoint_id\", None).await?;" + "source": "let endpoint_secret_out = svix.endpoint().get_secret(\"app_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseEndpointMessageOut = await svix.MessageAttempt.ListAttemptedMessagesAsync(\"app_id\", \"endpoint_id\")" + "source": "var endpointSecretOut = await svix.Endpoint.GetSecretAsync(\"app_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message-attempt list-attempted-messages \"app_id\" \"endpoint_id\"" + "source": "svix endpoint get-secret \"app_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/test-attempt": { + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate": { "post": { - "description": "Creates and sends a message to the specified endpoint. The message attempt and response from the endpoint is returned.\nFIXME: use MessageIn for expediency, even though the `application` parameter is unused. Since this endpoint isn't publicly documented anyway, it should be fine", - "operationId": "create_message_attempt_for_endpoint", + "description": "Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours.", + "operationId": "v1.endpoint.rotate-secret", "parameters": [ { "description": "The app's ID or UID", @@ -9195,22 +11155,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageIn" + "$ref": "#/components/schemas/EndpointSecretRotateIn" } } }, "required": true }, "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MessageAttemptOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -9285,19 +11238,81 @@ }, "security": [ { - "HTTPBearer": [] + "HTTPBearer": [] + } + ], + "summary": "Rotate Endpoint Secret", + "tags": [ + "Endpoint" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.endpoint.rotateSecret(\"app_id\", \"endpoint_id\", {\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.endpoint.rotateSecret(\"app_id\", \"endpoint_id\", {\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Endpoint.RotateSecret(ctx, \"app_id\", \"endpoint_id\", &EndpointSecretRotateIn{\n Key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.endpoint.rotateSecret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn()\n .key(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getEndpoint().rotateSecret(\"app_id\", \"endpoint_id\", new EndpointSecretRotateIn()\n .key(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", Svix::EndpointSecretRotateIn.new({\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.endpoint().rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn {\n key: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Endpoint.RotateSecretAsync(\"app_id\", \"endpoint_id\", new EndpointSecretRotateIn{\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint rotate-secret \"app_id\" \"endpoint_id\" '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" } - ], - "summary": "Create Message Attempt For Endpoint", - "tags": [ - "Message" ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls": { - "delete": { - "description": "Delete endpoint mTLS configuration", - "operationId": "v1.endpoint.delete-mtls-config", + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example": { + "post": { + "description": "Send an example message for an event", + "operationId": "v1.endpoint.send-example", "parameters": [ { "description": "The app's ID or UID", @@ -9328,11 +11343,37 @@ "type": "string" }, "style": "simple" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventExampleIn" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "no content" + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -9410,7 +11451,7 @@ "HTTPBearer": [] } ], - "summary": "Delete Endpoint Mtls Config", + "summary": "Send Event Type Example Message", "tags": [ "Endpoint" ], @@ -9418,68 +11459,70 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.endpoint.deleteMtlsConfig(\"app_id\", \"endpoint_id\");" + "source": "const messageOut = await svix.endpoint.sendExample(\"app_id\", \"endpoint_id\", {\n eventType: \"user.signup\"\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.endpoint.deleteMtlsConfig(\"app_id\", \"endpoint_id\");" + "source": "const messageOut = await svix.endpoint.sendExample(\"app_id\", \"endpoint_id\", {\n eventType: \"user.signup\"\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.endpoint.delete_mtls_config(\"app_id\", \"endpoint_id\")" + "source": "message_out = svix.endpoint.send_example(\"app_id\", \"endpoint_id\", EventExampleIn(\n event_type=\"user.signup\"\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.delete_mtls_config(\"app_id\", \"endpoint_id\")" + "source": "message_out = await svix.endpoint.send_example(\"app_id\", \"endpoint_id\", EventExampleIn(\n event_type=\"user.signup\"\n), None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Endpoint.DeleteMtlsConfig(ctx, \"app_id\", \"endpoint_id\")" + "source": "messageOut, err := svixClient.Endpoint.SendExample(ctx, \"app_id\", \"endpoint_id\", &EventExampleIn{\n EventType: \"user.signup\",\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.endpoint.deleteMtlsConfig(\"app_id\", \"endpoint_id\")" + "source": "val messageOut = svix.endpoint.sendExample(\"app_id\", \"endpoint_id\", EventExampleIn()\n .eventType(\"user.signup\")\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getEndpoint().deleteMtlsConfig(\"app_id\", \"endpoint_id\")" + "source": "MessageOut messageOut = svix.getEndpoint().sendExample(\"app_id\", \"endpoint_id\", new EventExampleIn()\n .eventType(\"user.signup\")\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.endpoint.delete_mtls_config(\"app_id\", \"endpoint_id\")" + "source": "message_out = svix.endpoint.send_example(\"app_id\", \"endpoint_id\", Svix::EventExampleIn.new({\n \"event_type\": \"user.signup\"\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.endpoint().delete_mtls_config(\"app_id\", \"endpoint_id\").await?;" + "source": "let message_out = svix.endpoint().send_example(\"app_id\", \"endpoint_id\", EventExampleIn {\n event_type: \"user.signup\".to_string(),\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Endpoint.DeleteMtlsConfigAsync(\"app_id\", \"endpoint_id\")" + "source": "var messageOut = await svix.Endpoint.SendExampleAsync(\"app_id\", \"endpoint_id\", new EventExampleIn{\n eventType: \"user.signup\"\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint delete-mtls-config \"app_id\" \"endpoint_id\"" + "source": "svix endpoint send-example \"app_id\" \"endpoint_id\" '{\n \"eventType\": \"user.signup\"\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventType\": \"user.signup\"\n }'" } ] - }, - "put": { - "description": "Create/update endpoint mTLS configuration", - "operationId": "v1.endpoint.update-mtls-config", + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats": { + "get": { + "description": "Get basic statistics for the endpoint.", + "operationId": "v1.endpoint.get-stats", "parameters": [ { "description": "The app's ID or UID", @@ -9510,21 +11553,42 @@ "type": "string" }, "style": "simple" + }, + { + "description": "Filter the range to data starting from this date", + "in": "query", + "name": "since", + "schema": { + "description": "Filter the range to data starting from this date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter the range to data ending by this date", + "in": "query", + "name": "until", + "schema": { + "description": "Filter the range to data ending by this date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointMtlsConfigIn" - } - } - }, - "required": true - }, "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointStats" + } + } + }, + "description": "" }, "400": { "content": { @@ -9602,7 +11666,7 @@ "HTTPBearer": [] } ], - "summary": "Update Endpoint Mtls Config", + "summary": "Endpoint Stats", "tags": [ "Endpoint" ], @@ -9610,70 +11674,70 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.endpoint.updateMtlsConfig(\"app_id\", \"endpoint_id\", {\n serverCaCert: null\n});" + "source": "const endpointStats = await svix.endpoint.getStats(\"app_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.endpoint.updateMtlsConfig(\"app_id\", \"endpoint_id\", {\n serverCaCert: null\n});" + "source": "const endpointStats = await svix.endpoint.getStats(\"app_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "svix.endpoint.update_mtls_config(\"app_id\", \"endpoint_id\", EndpointMtlsConfigIn(\n server_ca_cert=None\n))" + "source": "endpoint_stats = svix.endpoint.get_stats(\"app_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.update_mtls_config(\"app_id\", \"endpoint_id\", EndpointMtlsConfigIn(\n server_ca_cert=None\n))" + "source": "endpoint_stats = await svix.endpoint.get_stats(\"app_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Endpoint.UpdateMtlsConfig(ctx, \"app_id\", \"endpoint_id\", &EndpointMtlsConfigIn{\n ServerCaCert: nil,\n})" + "source": "endpointStats, err := svixClient.Endpoint.GetStats(ctx, \"app_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.endpoint.updateMtlsConfig(\"app_id\", \"endpoint_id\", EndpointMtlsConfigIn()\n .serverCaCert(null)\n)" + "source": "val endpointStats = svix.endpoint.getStats(\"app_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "svix.getEndpoint().updateMtlsConfig(\"app_id\", \"endpoint_id\", new EndpointMtlsConfigIn()\n .serverCaCert(null)\n)" + "source": "EndpointStats endpointStats = svix.getEndpoint().getStats(\"app_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.endpoint.update_mtls_config(\"app_id\", \"endpoint_id\", Svix::EndpointMtlsConfigIn.new({\n \"server_ca_cert\": nil\n}))" + "source": "endpoint_stats = svix.endpoint.get_stats(\"app_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "svix.endpoint().update_mtls_config(\"app_id\", \"endpoint_id\", EndpointMtlsConfigIn {\n server_ca_cert: None,\n}).await?;" + "source": "let endpoint_stats = svix.endpoint().get_stats(\"app_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Endpoint.UpdateMtlsConfigAsync(\"app_id\", \"endpoint_id\", new EndpointMtlsConfigIn{\n serverCaCert: null\n})" + "source": "var endpointStats = await svix.Endpoint.GetStatsAsync(\"app_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint update-mtls-config \"app_id\" \"endpoint_id\" '{\n \"serverCaCert\": null\n}'" + "source": "svix endpoint get-stats \"app_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"serverCaCert\": null\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth": { - "delete": { - "description": "Delete endpoint OAuth configuration", - "operationId": "v1.endpoint.delete-oauth-config", + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation": { + "get": { + "description": "Get the transformation code associated with this endpoint", + "operationId": "v1.endpoint.transformation-get", "parameters": [ { "description": "The app's ID or UID", @@ -9707,8 +11771,15 @@ } ], "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointTransformationOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -9786,7 +11857,7 @@ "HTTPBearer": [] } ], - "summary": "Delete Endpoint Oauth Config", + "summary": "Get Endpoint Transformation", "tags": [ "Endpoint" ], @@ -9794,68 +11865,68 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.endpoint.deleteOauthConfig(\"app_id\", \"endpoint_id\");" + "source": "const endpointTransformationOut = await svix.endpoint.transformationGet(\"app_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.endpoint.deleteOauthConfig(\"app_id\", \"endpoint_id\");" + "source": "const endpointTransformationOut = await svix.endpoint.transformationGet(\"app_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "svix.endpoint.delete_oauth_config(\"app_id\", \"endpoint_id\")" + "source": "endpoint_transformation_out = svix.endpoint.transformation_get(\"app_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.delete_oauth_config(\"app_id\", \"endpoint_id\")" + "source": "endpoint_transformation_out = await svix.endpoint.transformation_get(\"app_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Endpoint.DeleteOauthConfig(ctx, \"app_id\", \"endpoint_id\")" + "source": "endpointTransformationOut, err := svixClient.Endpoint.TransformationGet(ctx, \"app_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.endpoint.deleteOauthConfig(\"app_id\", \"endpoint_id\")" + "source": "val endpointTransformationOut = svix.endpoint.transformationGet(\"app_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "svix.getEndpoint().deleteOauthConfig(\"app_id\", \"endpoint_id\")" + "source": "EndpointTransformationOut endpointTransformationOut = svix.getEndpoint().transformationGet(\"app_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.endpoint.delete_oauth_config(\"app_id\", \"endpoint_id\")" + "source": "endpoint_transformation_out = svix.endpoint.transformation_get(\"app_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "svix.endpoint().delete_oauth_config(\"app_id\", \"endpoint_id\").await?;" + "source": "let endpoint_transformation_out = svix.endpoint().transformation_get(\"app_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Endpoint.DeleteOauthConfigAsync(\"app_id\", \"endpoint_id\")" + "source": "var endpointTransformationOut = await svix.Endpoint.TransformationGetAsync(\"app_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint delete-oauth-config \"app_id\" \"endpoint_id\"" + "source": "svix endpoint transformation-get \"app_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] }, - "put": { - "description": "Create/update endpoint OAuth configuration", - "operationId": "v1.endpoint.update-oauth-config", + "patch": { + "description": "Set or unset the transformation code associated with this endpoint", + "operationId": "v1.endpoint.transformation-partial-update", "parameters": [ { "description": "The app's ID or UID", @@ -9892,7 +11963,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EndpointOauthConfigIn" + "$ref": "#/components/schemas/EndpointTransformationIn" } } }, @@ -9978,7 +12049,7 @@ "HTTPBearer": [] } ], - "summary": "Update Endpoint Oauth Config", + "summary": "Set Endpoint Transformation", "tags": [ "Endpoint" ], @@ -9986,70 +12057,70 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", {\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null,\n refreshToken: null\n});" + "source": "await svix.endpoint.transformationPartialUpdate(\"app_id\", \"endpoint_id\", {\n code: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", {\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null,\n refreshToken: null\n});" + "source": "await svix.endpoint.transformationPartialUpdate(\"app_id\", \"endpoint_id\", {\n code: null\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn(\n jwt_params=None,\n client_secret=None,\n scopes=None,\n extra_params=None,\n refresh_token=None\n))" + "source": "svix.endpoint.transformation_partial_update(\"app_id\", \"endpoint_id\", EndpointTransformationIn(\n code=None\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn(\n jwt_params=None,\n client_secret=None,\n scopes=None,\n extra_params=None,\n refresh_token=None\n))" + "source": "await svix.endpoint.transformation_partial_update(\"app_id\", \"endpoint_id\", EndpointTransformationIn(\n code=None\n))" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Endpoint.UpdateOauthConfig(ctx, \"app_id\", \"endpoint_id\", &EndpointOauthConfigIn{\n JwtParams: nil,\n ClientSecret: nil,\n Scopes: nil,\n ExtraParams: nil,\n RefreshToken: nil,\n})" + "source": "err := svixClient.Endpoint.TransformationPartialUpdate(ctx, \"app_id\", \"endpoint_id\", &EndpointTransformationIn{\n Code: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn()\n .jwtParams(null)\n .clientSecret(null)\n .scopes(null)\n .extraParams(null)\n .refreshToken(null)\n)" + "source": "svix.endpoint.transformationPartialUpdate(\"app_id\", \"endpoint_id\", EndpointTransformationIn()\n .code(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getEndpoint().updateOauthConfig(\"app_id\", \"endpoint_id\", new EndpointOauthConfigIn()\n .jwtParams(null)\n .clientSecret(null)\n .scopes(null)\n .extraParams(null)\n .refreshToken(null)\n)" + "source": "svix.getEndpoint().transformationPartialUpdate(\"app_id\", \"endpoint_id\", new EndpointTransformationIn()\n .code(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", Svix::EndpointOauthConfigIn.new({\n \"jwt_params\": nil,\n \"client_secret\": nil,\n \"scopes\": nil,\n \"extra_params\": nil,\n \"refresh_token\": nil\n}))" + "source": "svix.endpoint.transformation_partial_update(\"app_id\", \"endpoint_id\", Svix::EndpointTransformationIn.new({\n \"code\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.endpoint().update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn {\n jwt_params: None,\n client_secret: None,\n scopes: None,\n extra_params: None,\n refresh_token: None,\n}).await?;" + "source": "svix.endpoint().transformation_partial_update(\"app_id\", \"endpoint_id\", EndpointTransformationIn {\n code: None,\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Endpoint.UpdateOauthConfigAsync(\"app_id\", \"endpoint_id\", new EndpointOauthConfigIn{\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null,\n refreshToken: null\n})" + "source": "await svix.Endpoint.TransformationPartialUpdateAsync(\"app_id\", \"endpoint_id\", new EndpointTransformationIn{\n code: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint update-oauth-config \"app_id\" \"endpoint_id\" '{\n \"jwtParams\": null,\n \"clientSecret\": null,\n \"scopes\": null,\n \"extraParams\": null,\n \"refreshToken\": null\n}'" + "source": "svix endpoint transformation-partial-update \"app_id\" \"endpoint_id\" '{\n \"code\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"jwtParams\": null,\n \"clientSecret\": null,\n \"scopes\": null,\n \"extraParams\": null,\n \"refreshToken\": null\n }'" + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"code\": null\n }'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover": { - "post": { - "description": "Resend all failed messages since a given time.", - "operationId": "v1.endpoint.recover", + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation-template/oauth/hubspot": { + "put": { + "description": "Create/update endpoint Hubsport OAuth configuration\nSpecific private endpoint just for us, to avoid exposing the Hubspot secret to the client.", + "operationId": "v1.endpoint.update-hubspot-oauth-config", "parameters": [ { "description": "The app's ID or UID", @@ -10072,20 +12143,11 @@ "name": "endpoint_id", "required": true, "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", - "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" @@ -10095,22 +12157,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RecoverIn" + "$ref": "#/components/schemas/HubspotOauthConfigIn" } } }, "required": true }, "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RecoverOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -10188,78 +12243,78 @@ "HTTPBearer": [] } ], - "summary": "Recover Failed Webhooks", + "summary": "Update Hubspot Oauth Config", "tags": [ - "Endpoint" + "Transformation Template" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const recoverOut = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", {\n until: null\n});" + "source": "await svix.endpoint.updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", \n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const recoverOut = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", {\n until: null\n});" + "source": "await svix.endpoint.updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", \n});" }, { "label": "Python", "lang": "Python", - "source": "recover_out = svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn(\n until=None\n), None)" + "source": "svix.endpoint.update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "recover_out = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn(\n until=None\n), None)" + "source": "await svix.endpoint.update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn\n))" }, { "label": "Go", "lang": "Go", - "source": "recoverOut, err := svixClient.Endpoint.Recover(ctx, \"app_id\", \"endpoint_id\", &RecoverIn{\n Until: nil,\n})" + "source": "err := svixClient.Endpoint.UpdateHubspotOauthConfig(ctx, \"app_id\", \"endpoint_id\", &HubspotOauthConfigIn{\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val recoverOut = svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn()\n .until(null)\n)" + "source": "svix.endpoint.updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn()\n)" }, { "label": "Java", "lang": "Java", - "source": "RecoverOut recoverOut = svix.getEndpoint().recover(\"app_id\", \"endpoint_id\", new RecoverIn()\n .until(null)\n)" + "source": "svix.getEndpoint().updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", new HubspotOauthConfigIn()\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "recover_out = svix.endpoint.recover(\"app_id\", \"endpoint_id\", Svix::RecoverIn.new({\n \"until\": nil\n}))" + "source": "svix.endpoint.update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", Svix::HubspotOauthConfigIn.new(\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let recover_out = svix.endpoint().recover(\"app_id\", \"endpoint_id\", RecoverIn {\n until: None,\n}, None).await?;" + "source": "svix.endpoint().update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn {\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var recoverOut = await svix.Endpoint.RecoverAsync(\"app_id\", \"endpoint_id\", new RecoverIn{\n until: null\n})" + "source": "await svix.Endpoint.UpdateHubspotOauthConfigAsync(\"app_id\", \"endpoint_id\", new HubspotOauthConfigIn\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint recover \"app_id\" \"endpoint_id\" '{\n \"until\": null\n}'" + "source": "svix endpoint update-hubspot-oauth-config \"app_id\" \"endpoint_id\" '\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"until\": null\n }'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation-template/oauth/hubspot' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '\n }'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing": { + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate": { "post": { - "description": "Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent.", - "operationId": "v1.endpoint.replay", + "description": "Simulate running the transformation on the payload and code", + "operationId": "v1.endpoint.transformation-simulate", "parameters": [ { "description": "The app's ID or UID", @@ -10305,18 +12360,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReplayIn" + "$ref": "#/components/schemas/EndpointTransformationSimulateIn" } } }, "required": true }, "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReplayOut" + "$ref": "#/components/schemas/EndpointTransformationSimulateOut" } } }, @@ -10398,7 +12453,7 @@ "HTTPBearer": [] } ], - "summary": "Replay Missing Webhooks", + "summary": "Simulate", "tags": [ "Endpoint" ], @@ -10406,70 +12461,70 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const replayOut = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", {\n until: null\n});" + "source": "const endpointTransformationSimulateOut = await svix.endpoint.transformationSimulate(\"app_id\", \"endpoint_id\", {\n eventType: \"user.signup\",\n channels: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const replayOut = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", {\n until: null\n});" + "source": "const endpointTransformationSimulateOut = await svix.endpoint.transformationSimulate(\"app_id\", \"endpoint_id\", {\n eventType: \"user.signup\",\n channels: null\n});" }, { "label": "Python", "lang": "Python", - "source": "replay_out = svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn(\n until=None\n), None)" + "source": "endpoint_transformation_simulate_out = svix.endpoint.transformation_simulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "replay_out = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn(\n until=None\n), None)" + "source": "endpoint_transformation_simulate_out = await svix.endpoint.transformation_simulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "replayOut, err := svixClient.Endpoint.Replay(ctx, \"app_id\", \"endpoint_id\", &ReplayIn{\n Until: nil,\n})" + "source": "endpointTransformationSimulateOut, err := svixClient.Endpoint.TransformationSimulate(ctx, \"app_id\", \"endpoint_id\", &EndpointTransformationSimulateIn{\n EventType: \"user.signup\",\n Channels: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val replayOut = svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn()\n .until(null)\n)" + "source": "val endpointTransformationSimulateOut = svix.endpoint.transformationSimulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn()\n .eventType(\"user.signup\")\n .channels(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "ReplayOut replayOut = svix.getEndpoint().replay(\"app_id\", \"endpoint_id\", new ReplayIn()\n .until(null)\n)" + "source": "EndpointTransformationSimulateOut endpointTransformationSimulateOut = svix.getEndpoint().transformationSimulate(\"app_id\", \"endpoint_id\", new EndpointTransformationSimulateIn()\n .eventType(\"user.signup\")\n .channels(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "replay_out = svix.endpoint.replay(\"app_id\", \"endpoint_id\", Svix::ReplayIn.new({\n \"until\": nil\n}))" + "source": "endpoint_transformation_simulate_out = svix.endpoint.transformation_simulate(\"app_id\", \"endpoint_id\", Svix::EndpointTransformationSimulateIn.new({\n \"event_type\": \"user.signup\",\n \"channels\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let replay_out = svix.endpoint().replay(\"app_id\", \"endpoint_id\", ReplayIn {\n until: None,\n}, None).await?;" + "source": "let endpoint_transformation_simulate_out = svix.endpoint().transformation_simulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn {\n event_type: \"user.signup\".to_string(),\n channels: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var replayOut = await svix.Endpoint.ReplayAsync(\"app_id\", \"endpoint_id\", new ReplayIn{\n until: null\n})" + "source": "var endpointTransformationSimulateOut = await svix.Endpoint.TransformationSimulateAsync(\"app_id\", \"endpoint_id\", new EndpointTransformationSimulateIn{\n eventType: \"user.signup\",\n channels: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint replay \"app_id\" \"endpoint_id\" '{\n \"until\": null\n}'" + "source": "svix endpoint transformation-simulate \"app_id\" \"endpoint_id\" '{\n \"eventType\": \"user.signup\",\n \"channels\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"until\": null\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventType\": \"user.signup\",\n \"channels\": null\n }'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret": { + "/api/v1/app/{app_id}/events": { "get": { - "description": "Get the endpoint's signing secret.\n\nThis is used to verify the authenticity of the webhook.\nFor more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).", - "operationId": "v1.endpoint.get-secret", + "description": "Reads the stream of created messages for an application", + "operationId": "v1.message.events", "parameters": [ { "description": "The app's ID or UID", @@ -10487,19 +12542,75 @@ "style": "simple" }, { - "description": "The ep's ID or UID", - "in": "path", - "name": "endpoint_id", - "required": true, + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "nullable": true, "type": "string" }, - "style": "simple" + "style": "form" + }, + { + "description": "Filter response based on the event type", + "in": "query", + "name": "event_types", + "schema": { + "description": "Filter response based on the event type", + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" + }, + { + "description": "Filter response based on the event type", + "in": "query", + "name": "channels", + "schema": { + "description": "Filter response based on the event type", + "items": { + "example": "project_1337", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" + }, + { + "in": "query", + "name": "after", + "schema": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" } ], "responses": { @@ -10507,7 +12618,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EndpointSecretOut" + "$ref": "#/components/schemas/MessageEventsOut" } } }, @@ -10589,78 +12700,78 @@ "HTTPBearer": [] } ], - "summary": "Get Endpoint Secret", + "summary": "Message Events", "tags": [ - "Endpoint" + "Message" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const endpointSecretOut = await svix.endpoint.getSecret(\"app_id\", \"endpoint_id\");" + "source": "const messageEventsOut = await svix.message.events(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const endpointSecretOut = await svix.endpoint.getSecret(\"app_id\", \"endpoint_id\");" + "source": "const messageEventsOut = await svix.message.events(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "endpoint_secret_out = svix.endpoint.get_secret(\"app_id\", \"endpoint_id\")" + "source": "message_events_out = svix.message.events(\"app_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_secret_out = await svix.endpoint.get_secret(\"app_id\", \"endpoint_id\")" + "source": "message_events_out = await svix.message.events(\"app_id\")" }, { "label": "Go", "lang": "Go", - "source": "endpointSecretOut, err := svixClient.Endpoint.GetSecret(ctx, \"app_id\", \"endpoint_id\")" + "source": "messageEventsOut, err := svixClient.Message.Events(ctx, \"app_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val endpointSecretOut = svix.endpoint.getSecret(\"app_id\", \"endpoint_id\")" + "source": "val messageEventsOut = svix.message.events(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "EndpointSecretOut endpointSecretOut = svix.getEndpoint().getSecret(\"app_id\", \"endpoint_id\")" + "source": "MessageEventsOut messageEventsOut = svix.getMessage().events(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "endpoint_secret_out = svix.endpoint.get_secret(\"app_id\", \"endpoint_id\")" + "source": "message_events_out = svix.message.events(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let endpoint_secret_out = svix.endpoint().get_secret(\"app_id\", \"endpoint_id\").await?;" + "source": "let message_events_out = svix.message().events(\"app_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var endpointSecretOut = await svix.Endpoint.GetSecretAsync(\"app_id\", \"endpoint_id\")" + "source": "var messageEventsOut = await svix.Message.EventsAsync(\"app_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint get-secret \"app_id\" \"endpoint_id\"" + "source": "svix message events \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate": { - "post": { - "description": "Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours.", - "operationId": "v1.endpoint.rotate-secret", + "/api/v1/app/{app_id}/events/subscription/{subscription_id}": { + "get": { + "description": "Reads the stream of created messages for an application, but using server-managed iterator tracking.", + "operationId": "v1.message.events-subscription", "parameters": [ { "description": "The app's ID or UID", @@ -10668,53 +12779,112 @@ "name": "app_id", "required": true, "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The esub's ID or UID", + "in": "path", + "name": "subscription_id", + "required": true, + "schema": { + "description": "The esub's ID or UID", + "example": "unique-esub-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the event type", + "in": "query", + "name": "event_types", + "schema": { + "description": "Filter response based on the event type", + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true }, - "style": "simple" + "style": "form" }, { - "description": "The ep's ID or UID", - "in": "path", - "name": "endpoint_id", - "required": true, + "description": "Filter response based on the event type", + "in": "query", + "name": "channels", "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" + "description": "Filter response based on the event type", + "items": { + "example": "project_1337", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true }, - "style": "simple" + "style": "form" }, { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "in": "query", + "name": "after", "schema": { + "format": "date-time", + "nullable": true, "type": "string" }, - "style": "simple" + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointSecretRotateIn" - } - } - }, - "required": true - }, "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageEventsOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -10792,78 +12962,78 @@ "HTTPBearer": [] } ], - "summary": "Rotate Endpoint Secret", + "summary": "Message Events Subscription", "tags": [ - "Endpoint" + "Message" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.endpoint.rotateSecret(\"app_id\", \"endpoint_id\", {\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "const messageEventsOut = await svix.message.eventsSubscription(\"app_id\", \"subscription_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.endpoint.rotateSecret(\"app_id\", \"endpoint_id\", {\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "const messageEventsOut = await svix.message.eventsSubscription(\"app_id\", \"subscription_id\");" }, { "label": "Python", "lang": "Python", - "source": "svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + "source": "message_events_out = svix.message.events_subscription(\"app_id\", \"subscription_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + "source": "message_events_out = await svix.message.events_subscription(\"app_id\", \"subscription_id\")" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Endpoint.RotateSecret(ctx, \"app_id\", \"endpoint_id\", &EndpointSecretRotateIn{\n Key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" + "source": "messageEventsOut, err := svixClient.Message.EventsSubscription(ctx, \"app_id\", \"subscription_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.endpoint.rotateSecret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn()\n .key(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + "source": "val messageEventsOut = svix.message.eventsSubscription(\"app_id\", \"subscription_id\")" }, { "label": "Java", "lang": "Java", - "source": "svix.getEndpoint().rotateSecret(\"app_id\", \"endpoint_id\", new EndpointSecretRotateIn()\n .key(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + "source": "MessageEventsOut messageEventsOut = svix.getMessage().eventsSubscription(\"app_id\", \"subscription_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", Svix::EndpointSecretRotateIn.new({\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" + "source": "message_events_out = svix.message.events_subscription(\"app_id\", \"subscription_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "svix.endpoint().rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn {\n key: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}, None).await?;" + "source": "let message_events_out = svix.message().events_subscription(\"app_id\", \"subscription_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Endpoint.RotateSecretAsync(\"app_id\", \"endpoint_id\", new EndpointSecretRotateIn{\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n})" + "source": "var messageEventsOut = await svix.Message.EventsSubscriptionAsync(\"app_id\", \"subscription_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint rotate-secret \"app_id\" \"endpoint_id\" '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" + "source": "svix message events-subscription \"app_id\" \"subscription_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/events/subscription/{subscription_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example": { + "/api/v1/app/{app_id}/events/subscription/{subscription_id}/create-token": { "post": { - "description": "Send an example message for an event", - "operationId": "v1.endpoint.send-example", + "description": "Creates an auth token that can be used with the `v1.message.events-subscription` endpoint", + "operationId": "v1.message.events-subscription.create-token", "parameters": [ { "description": "The app's ID or UID", @@ -10881,13 +13051,13 @@ "style": "simple" }, { - "description": "The ep's ID or UID", + "description": "The esub's ID or UID", "in": "path", - "name": "endpoint_id", + "name": "subscription_id", "required": true, "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", + "description": "The esub's ID or UID", + "example": "unique-esub-identifier", "maxLength": 256, "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_.]+$", @@ -10905,22 +13075,12 @@ "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EventExampleIn" - } - } - }, - "required": true - }, "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageOut" + "$ref": "#/components/schemas/MessageSubscriberAuthTokenOut" } } }, @@ -11002,78 +13162,78 @@ "HTTPBearer": [] } ], - "summary": "Send Event Type Example Message", + "summary": "Message Events Create Token", "tags": [ - "Endpoint" + "Message" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageOut = await svix.endpoint.sendExample(\"app_id\", \"endpoint_id\", {\n eventType: \"user.signup\"\n});" + "source": "const messageSubscriberAuthTokenOut = await svix.message.eventsSubscription(\"app_id\", \"subscription_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageOut = await svix.endpoint.sendExample(\"app_id\", \"endpoint_id\", {\n eventType: \"user.signup\"\n});" + "source": "const messageSubscriberAuthTokenOut = await svix.message.eventsSubscription(\"app_id\", \"subscription_id\");" }, { "label": "Python", "lang": "Python", - "source": "message_out = svix.endpoint.send_example(\"app_id\", \"endpoint_id\", EventExampleIn(\n event_type=\"user.signup\"\n), None)" + "source": "message_subscriber_auth_token_out = svix.message.events_subscription(\"app_id\", \"subscription_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_out = await svix.endpoint.send_example(\"app_id\", \"endpoint_id\", EventExampleIn(\n event_type=\"user.signup\"\n), None)" + "source": "message_subscriber_auth_token_out = await svix.message.events_subscription(\"app_id\", \"subscription_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "messageOut, err := svixClient.Endpoint.SendExample(ctx, \"app_id\", \"endpoint_id\", &EventExampleIn{\n EventType: \"user.signup\",\n})" + "source": "messageSubscriberAuthTokenOut, err := svixClient.Message.EventsSubscription(ctx, \"app_id\", \"subscription_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageOut = svix.endpoint.sendExample(\"app_id\", \"endpoint_id\", EventExampleIn()\n .eventType(\"user.signup\")\n)" + "source": "val messageSubscriberAuthTokenOut = svix.message.eventsSubscription(\"app_id\", \"subscription_id\")" }, { "label": "Java", "lang": "Java", - "source": "MessageOut messageOut = svix.getEndpoint().sendExample(\"app_id\", \"endpoint_id\", new EventExampleIn()\n .eventType(\"user.signup\")\n)" + "source": "MessageSubscriberAuthTokenOut messageSubscriberAuthTokenOut = svix.getMessage().eventsSubscription(\"app_id\", \"subscription_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_out = svix.endpoint.send_example(\"app_id\", \"endpoint_id\", Svix::EventExampleIn.new({\n \"event_type\": \"user.signup\"\n}))" + "source": "message_subscriber_auth_token_out = svix.message.events_subscription(\"app_id\", \"subscription_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let message_out = svix.endpoint().send_example(\"app_id\", \"endpoint_id\", EventExampleIn {\n event_type: \"user.signup\".to_string(),\n}, None).await?;" + "source": "let message_subscriber_auth_token_out = svix.message().events_subscription(\"app_id\", \"subscription_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageOut = await svix.Endpoint.SendExampleAsync(\"app_id\", \"endpoint_id\", new EventExampleIn{\n eventType: \"user.signup\"\n})" + "source": "var messageSubscriberAuthTokenOut = await svix.Message.EventsSubscriptionAsync(\"app_id\", \"subscription_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint send-example \"app_id\" \"endpoint_id\" '{\n \"eventType\": \"user.signup\"\n}'" + "source": "svix message events-subscription \"app_id\" \"subscription_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventType\": \"user.signup\"\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/events/subscription/{subscription_id}/create-token' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats": { - "get": { - "description": "Get basic statistics for the endpoint.", - "operationId": "v1.endpoint.get-stats", + "/api/v1/app/{app_id}/inbound/msg/{inbound_token}": { + "post": { + "description": "Handles a raw inbound webhook for the application.", + "operationId": "v1.inbound.msg", "parameters": [ { "description": "The app's ID or UID", @@ -11091,51 +13251,54 @@ "style": "simple" }, { - "description": "The ep's ID or UID", "in": "path", - "name": "endpoint_id", + "name": "inbound_token", "required": true, "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" }, { - "description": "Filter the range to data starting from this date", + "description": "The event type's name", "in": "query", - "name": "since", + "name": "event_type", "schema": { - "description": "Filter the range to data starting from this date", - "format": "date-time", + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "form" }, { - "description": "Filter the range to data ending by this date", - "in": "query", - "name": "until", + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "Filter the range to data ending by this date", - "format": "date-time", - "nullable": true, "type": "string" }, - "style": "form" + "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, "responses": { - "200": { + "202": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EndpointStats" + "$ref": "#/components/schemas/MessageOut" } } }, @@ -11217,78 +13380,78 @@ "HTTPBearer": [] } ], - "summary": "Endpoint Stats", + "summary": "Handle Inbound", "tags": [ - "Endpoint" + "Inbound" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const endpointStats = await svix.endpoint.getStats(\"app_id\", \"endpoint_id\");" + "source": "const messageOut = await svix.inbound.msg(\"app_id\", \"inbound_token\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const endpointStats = await svix.endpoint.getStats(\"app_id\", \"endpoint_id\");" + "source": "const messageOut = await svix.inbound.msg(\"app_id\", \"inbound_token\");" }, { "label": "Python", "lang": "Python", - "source": "endpoint_stats = svix.endpoint.get_stats(\"app_id\", \"endpoint_id\")" + "source": "message_out = svix.inbound.msg(\"app_id\", \"inbound_token\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_stats = await svix.endpoint.get_stats(\"app_id\", \"endpoint_id\")" + "source": "message_out = await svix.inbound.msg(\"app_id\", \"inbound_token\", None)" }, { "label": "Go", "lang": "Go", - "source": "endpointStats, err := svixClient.Endpoint.GetStats(ctx, \"app_id\", \"endpoint_id\")" + "source": "messageOut, err := svixClient.Inbound.Msg(ctx, \"app_id\", \"inbound_token\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val endpointStats = svix.endpoint.getStats(\"app_id\", \"endpoint_id\")" + "source": "val messageOut = svix.inbound.msg(\"app_id\", \"inbound_token\")" }, { "label": "Java", "lang": "Java", - "source": "EndpointStats endpointStats = svix.getEndpoint().getStats(\"app_id\", \"endpoint_id\")" + "source": "MessageOut messageOut = svix.getInbound().msg(\"app_id\", \"inbound_token\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "endpoint_stats = svix.endpoint.get_stats(\"app_id\", \"endpoint_id\")" + "source": "message_out = svix.inbound.msg(\"app_id\", \"inbound_token\")" }, { "label": "Rust", "lang": "Rust", - "source": "let endpoint_stats = svix.endpoint().get_stats(\"app_id\", \"endpoint_id\").await?;" + "source": "let message_out = svix.inbound().msg(\"app_id\", \"inbound_token\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var endpointStats = await svix.Endpoint.GetStatsAsync(\"app_id\", \"endpoint_id\")" + "source": "var messageOut = await svix.Inbound.MsgAsync(\"app_id\", \"inbound_token\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint get-stats \"app_id\" \"endpoint_id\"" + "source": "svix inbound msg \"app_id\" \"inbound_token\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/inbound/msg/{inbound_token}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation": { - "get": { - "description": "Get the transformation code associated with this endpoint", - "operationId": "v1.endpoint.transformation-get", + "/api/v1/app/{app_id}/inbound/rotate-url": { + "post": { + "description": "Invalidates the previous inbound url (if one exists), producing a new inbound\nURL for this app", + "operationId": "v1.inbound.rotate-url", "parameters": [ { "description": "The app's ID or UID", @@ -11306,16 +13469,10 @@ "style": "simple" }, { - "description": "The ep's ID or UID", - "in": "path", - "name": "endpoint_id", - "required": true, - "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { "type": "string" }, "style": "simple" @@ -11326,7 +13483,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EndpointTransformationOut" + "$ref": "#/components/schemas/RotatedUrlOut" } } }, @@ -11408,76 +13565,78 @@ "HTTPBearer": [] } ], - "summary": "Get Endpoint Transformation", + "summary": "Rotate Url", "tags": [ - "Endpoint" + "Inbound" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const endpointTransformationOut = await svix.endpoint.transformationGet(\"app_id\", \"endpoint_id\");" + "source": "const rotatedUrlOut = await svix.inbound.rotateUrl(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const endpointTransformationOut = await svix.endpoint.transformationGet(\"app_id\", \"endpoint_id\");" + "source": "const rotatedUrlOut = await svix.inbound.rotateUrl(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "endpoint_transformation_out = svix.endpoint.transformation_get(\"app_id\", \"endpoint_id\")" + "source": "rotated_url_out = svix.inbound.rotate_url(\"app_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_transformation_out = await svix.endpoint.transformation_get(\"app_id\", \"endpoint_id\")" + "source": "rotated_url_out = await svix.inbound.rotate_url(\"app_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "endpointTransformationOut, err := svixClient.Endpoint.TransformationGet(ctx, \"app_id\", \"endpoint_id\")" + "source": "rotatedUrlOut, err := svixClient.Inbound.RotateUrl(ctx, \"app_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val endpointTransformationOut = svix.endpoint.transformationGet(\"app_id\", \"endpoint_id\")" + "source": "val rotatedUrlOut = svix.inbound.rotateUrl(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "EndpointTransformationOut endpointTransformationOut = svix.getEndpoint().transformationGet(\"app_id\", \"endpoint_id\")" + "source": "RotatedUrlOut rotatedUrlOut = svix.getInbound().rotateUrl(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "endpoint_transformation_out = svix.endpoint.transformation_get(\"app_id\", \"endpoint_id\")" + "source": "rotated_url_out = svix.inbound.rotate_url(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let endpoint_transformation_out = svix.endpoint().transformation_get(\"app_id\", \"endpoint_id\").await?;" + "source": "let rotated_url_out = svix.inbound().rotate_url(\"app_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var endpointTransformationOut = await svix.Endpoint.TransformationGetAsync(\"app_id\", \"endpoint_id\")" + "source": "var rotatedUrlOut = await svix.Inbound.RotateUrlAsync(\"app_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint transformation-get \"app_id\" \"endpoint_id\"" + "source": "svix inbound rotate-url \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/inbound/rotate-url' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - }, - "patch": { - "description": "Set or unset the transformation code associated with this endpoint", - "operationId": "v1.endpoint.transformation-partial-update", + } + }, + "/api/v1/app/{app_id}/integration": { + "get": { + "description": "List the application's integrations.", + "operationId": "v1.integration.list", "parameters": [ { "description": "The app's ID or UID", @@ -11495,34 +13654,52 @@ "style": "simple" }, { - "description": "The ep's ID or UID", - "in": "path", - "name": "endpoint_id", - "required": true, + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, "type": "string" }, - "style": "simple" + "style": "form" + }, + { + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", + "schema": { + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointTransformationIn" - } - } - }, - "required": true - }, "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_IntegrationOut_" + } + } + }, + "description": "" }, "400": { "content": { @@ -11600,78 +13777,76 @@ "HTTPBearer": [] } ], - "summary": "Set Endpoint Transformation", + "summary": "List Integrations", "tags": [ - "Endpoint" + "Integration" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.endpoint.transformationPartialUpdate(\"app_id\", \"endpoint_id\", {\n code: null\n});" + "source": "const listResponseIntegrationOut = await svix.integration.list(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.endpoint.transformationPartialUpdate(\"app_id\", \"endpoint_id\", {\n code: null\n});" + "source": "const listResponseIntegrationOut = await svix.integration.list(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "svix.endpoint.transformation_partial_update(\"app_id\", \"endpoint_id\", EndpointTransformationIn(\n code=None\n))" + "source": "list_response_integration_out = svix.integration.list(\"app_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.transformation_partial_update(\"app_id\", \"endpoint_id\", EndpointTransformationIn(\n code=None\n))" + "source": "list_response_integration_out = await svix.integration.list(\"app_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Endpoint.TransformationPartialUpdate(ctx, \"app_id\", \"endpoint_id\", &EndpointTransformationIn{\n Code: nil,\n})" + "source": "listResponseIntegrationOut, err := svixClient.Integration.List(ctx, \"app_id\", nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.endpoint.transformationPartialUpdate(\"app_id\", \"endpoint_id\", EndpointTransformationIn()\n .code(null)\n)" + "source": "val listResponseIntegrationOut = svix.integration.list(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "svix.getEndpoint().transformationPartialUpdate(\"app_id\", \"endpoint_id\", new EndpointTransformationIn()\n .code(null)\n)" + "source": "ListResponseIntegrationOut listResponseIntegrationOut = svix.getIntegration().list(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.endpoint.transformation_partial_update(\"app_id\", \"endpoint_id\", Svix::EndpointTransformationIn.new({\n \"code\": nil\n}))" + "source": "list_response_integration_out = svix.integration.list(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "svix.endpoint().transformation_partial_update(\"app_id\", \"endpoint_id\", EndpointTransformationIn {\n code: None,\n}).await?;" + "source": "let list_response_integration_out = svix.integration().list(\"app_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Endpoint.TransformationPartialUpdateAsync(\"app_id\", \"endpoint_id\", new EndpointTransformationIn{\n code: null\n})" + "source": "var listResponseIntegrationOut = await svix.Integration.ListAsync(\"app_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint transformation-partial-update \"app_id\" \"endpoint_id\" '{\n \"code\": null\n}'" + "source": "svix integration list \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"code\": null\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation-template/oauth/hubspot": { - "put": { - "description": "Create/update endpoint Hubsport OAuth configuration\nSpecific private endpoint just for us, to avoid exposing the Hubspot secret to the client.", - "operationId": "v1.endpoint.update-hubspot-oauth-config", + }, + "post": { + "description": "Create an integration.", + "operationId": "v1.integration.create", "parameters": [ { "description": "The app's ID or UID", @@ -11689,16 +13864,10 @@ "style": "simple" }, { - "description": "The ep's ID or UID", - "in": "path", - "name": "endpoint_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" @@ -11708,15 +13877,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HubspotOauthConfigIn" + "$ref": "#/components/schemas/IntegrationIn" } } }, "required": true }, "responses": { - "204": { - "description": "no content" + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -11794,78 +13970,78 @@ "HTTPBearer": [] } ], - "summary": "Update Hubspot Oauth Config", + "summary": "Create Integration", "tags": [ - "Transformation Template" + "Integration" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.endpoint.updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", \n});" + "source": "const integrationOut = await svix.integration.create(\"app_id\", {\n name: \"Example Integration\"\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.endpoint.updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", \n});" + "source": "const integrationOut = await svix.integration.create(\"app_id\", {\n name: \"Example Integration\"\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.endpoint.update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn\n))" + "source": "integration_out = svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn\n))" + "source": "integration_out = await svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Endpoint.UpdateHubspotOauthConfig(ctx, \"app_id\", \"endpoint_id\", &HubspotOauthConfigIn{\n})" + "source": "integrationOut, err := svixClient.Integration.Create(ctx, \"app_id\", &IntegrationIn{\n Name: \"Example Integration\",\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.endpoint.updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn()\n)" + "source": "val integrationOut = svix.integration.create(\"app_id\", IntegrationIn()\n .name(\"Example Integration\")\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getEndpoint().updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", new HubspotOauthConfigIn()\n)" + "source": "IntegrationOut integrationOut = svix.getIntegration().create(\"app_id\", new IntegrationIn()\n .name(\"Example Integration\")\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.endpoint.update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", Svix::HubspotOauthConfigIn.new(\n}))" + "source": "integration_out = svix.integration.create(\"app_id\", Svix::IntegrationIn.new({\n \"name\": \"Example Integration\"\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.endpoint().update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn {\n}).await?;" + "source": "let integration_out = svix.integration().create(\"app_id\", IntegrationIn {\n name: \"Example Integration\".to_string(),\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Endpoint.UpdateHubspotOauthConfigAsync(\"app_id\", \"endpoint_id\", new HubspotOauthConfigIn\n})" + "source": "var integrationOut = await svix.Integration.CreateAsync(\"app_id\", new IntegrationIn{\n name: \"Example Integration\"\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint update-hubspot-oauth-config \"app_id\" \"endpoint_id\" '\n}'" + "source": "svix integration create \"app_id\" '{\n \"name\": \"Example Integration\"\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation-template/oauth/hubspot' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"Example Integration\"\n }'" } ] } }, - "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate": { - "post": { - "description": "Simulate running the transformation on the payload and code", - "operationId": "v1.endpoint.transformation-simulate", + "/api/v1/app/{app_id}/integration/{integ_id}": { + "delete": { + "description": "Delete an integration.", + "operationId": "v1.integration.delete", "parameters": [ { "description": "The app's ID or UID", @@ -11883,50 +14059,21 @@ "style": "simple" }, { - "description": "The ep's ID or UID", + "description": "The integ's ID", "in": "path", - "name": "endpoint_id", + "name": "integ_id", "required": true, "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", - "schema": { + "description": "The integ's ID", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointTransformationSimulateIn" - } - } - }, - "required": true - }, "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EndpointTransformationSimulateOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -12004,78 +14151,76 @@ "HTTPBearer": [] } ], - "summary": "Simulate", + "summary": "Delete Integration", "tags": [ - "Endpoint" + "Integration" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const endpointTransformationSimulateOut = await svix.endpoint.transformationSimulate(\"app_id\", \"endpoint_id\", {\n eventType: \"user.signup\",\n channels: null\n});" + "source": "await svix.integration.delete(\"app_id\", \"integ_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const endpointTransformationSimulateOut = await svix.endpoint.transformationSimulate(\"app_id\", \"endpoint_id\", {\n eventType: \"user.signup\",\n channels: null\n});" + "source": "await svix.integration.delete(\"app_id\", \"integ_id\");" }, { "label": "Python", "lang": "Python", - "source": "endpoint_transformation_simulate_out = svix.endpoint.transformation_simulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), None)" + "source": "svix.integration.delete(\"app_id\", \"integ_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_transformation_simulate_out = await svix.endpoint.transformation_simulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), None)" + "source": "await svix.integration.delete(\"app_id\", \"integ_id\")" }, { "label": "Go", "lang": "Go", - "source": "endpointTransformationSimulateOut, err := svixClient.Endpoint.TransformationSimulate(ctx, \"app_id\", \"endpoint_id\", &EndpointTransformationSimulateIn{\n EventType: \"user.signup\",\n Channels: nil,\n})" + "source": "err := svixClient.Integration.Delete(ctx, \"app_id\", \"integ_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val endpointTransformationSimulateOut = svix.endpoint.transformationSimulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn()\n .eventType(\"user.signup\")\n .channels(null)\n)" + "source": "svix.integration.delete(\"app_id\", \"integ_id\")" }, { "label": "Java", "lang": "Java", - "source": "EndpointTransformationSimulateOut endpointTransformationSimulateOut = svix.getEndpoint().transformationSimulate(\"app_id\", \"endpoint_id\", new EndpointTransformationSimulateIn()\n .eventType(\"user.signup\")\n .channels(null)\n)" + "source": "svix.getIntegration().delete(\"app_id\", \"integ_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "endpoint_transformation_simulate_out = svix.endpoint.transformation_simulate(\"app_id\", \"endpoint_id\", Svix::EndpointTransformationSimulateIn.new({\n \"event_type\": \"user.signup\",\n \"channels\": nil\n}))" + "source": "svix.integration.delete(\"app_id\", \"integ_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let endpoint_transformation_simulate_out = svix.endpoint().transformation_simulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn {\n event_type: \"user.signup\".to_string(),\n channels: None,\n}, None).await?;" + "source": "svix.integration().delete(\"app_id\", \"integ_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var endpointTransformationSimulateOut = await svix.Endpoint.TransformationSimulateAsync(\"app_id\", \"endpoint_id\", new EndpointTransformationSimulateIn{\n eventType: \"user.signup\",\n channels: null\n})" + "source": "await svix.Integration.DeleteAsync(\"app_id\", \"integ_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint transformation-simulate \"app_id\" \"endpoint_id\" '{\n \"eventType\": \"user.signup\",\n \"channels\": null\n}'" + "source": "svix integration delete \"app_id\" \"integ_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventType\": \"user.signup\",\n \"channels\": null\n }'" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/app/{app_id}/events": { + }, "get": { - "description": "Reads the stream of created messages for an application", - "operationId": "v1.message.events", + "description": "Get an integration.", + "operationId": "v1.integration.get", "parameters": [ { "description": "The app's ID or UID", @@ -12093,75 +14238,16 @@ "style": "simple" }, { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", - "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" - }, - { - "description": "Filter response based on the event type", - "in": "query", - "name": "channels", - "schema": { - "description": "Filter response based on the event type", - "items": { - "example": "project_1337", - "maxLength": 128, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" - }, - { - "in": "query", - "name": "after", + "description": "The integ's ID", + "in": "path", + "name": "integ_id", + "required": true, "schema": { - "format": "date-time", - "nullable": true, + "description": "The integ's ID", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, - "style": "form" + "style": "simple" } ], "responses": { @@ -12169,7 +14255,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageEventsOut" + "$ref": "#/components/schemas/IntegrationOut" } } }, @@ -12251,78 +14337,76 @@ "HTTPBearer": [] } ], - "summary": "Message Events", + "summary": "Get Integration", "tags": [ - "Message" + "Integration" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageEventsOut = await svix.message.events(\"app_id\");" + "source": "const integrationOut = await svix.integration.get(\"app_id\", \"integ_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageEventsOut = await svix.message.events(\"app_id\");" + "source": "const integrationOut = await svix.integration.get(\"app_id\", \"integ_id\");" }, { "label": "Python", "lang": "Python", - "source": "message_events_out = svix.message.events(\"app_id\")" + "source": "integration_out = svix.integration.get(\"app_id\", \"integ_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_events_out = await svix.message.events(\"app_id\")" + "source": "integration_out = await svix.integration.get(\"app_id\", \"integ_id\")" }, { "label": "Go", "lang": "Go", - "source": "messageEventsOut, err := svixClient.Message.Events(ctx, \"app_id\")" + "source": "integrationOut, err := svixClient.Integration.Get(ctx, \"app_id\", \"integ_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageEventsOut = svix.message.events(\"app_id\")" + "source": "val integrationOut = svix.integration.get(\"app_id\", \"integ_id\")" }, { "label": "Java", "lang": "Java", - "source": "MessageEventsOut messageEventsOut = svix.getMessage().events(\"app_id\")" + "source": "IntegrationOut integrationOut = svix.getIntegration().get(\"app_id\", \"integ_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_events_out = svix.message.events(\"app_id\")" + "source": "integration_out = svix.integration.get(\"app_id\", \"integ_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let message_events_out = svix.message().events(\"app_id\").await?;" + "source": "let integration_out = svix.integration().get(\"app_id\", \"integ_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageEventsOut = await svix.Message.EventsAsync(\"app_id\")" + "source": "var integrationOut = await svix.Integration.GetAsync(\"app_id\", \"integ_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message events \"app_id\"" + "source": "svix integration get \"app_id\" \"integ_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/app/{app_id}/events/subscription/{subscription_id}": { - "get": { - "description": "Reads the stream of created messages for an application, but using server-managed iterator tracking.", - "operationId": "v1.message.events-subscription", + }, + "put": { + "description": "Update an integration.", + "operationId": "v1.integration.update", "parameters": [ { "description": "The app's ID or UID", @@ -12340,98 +14424,34 @@ "style": "simple" }, { - "description": "The esub's ID or UID", + "description": "The integ's ID", "in": "path", - "name": "subscription_id", + "name": "integ_id", "required": true, "schema": { - "description": "The esub's ID or UID", - "example": "unique-esub-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "description": "The integ's ID", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, "style": "simple" - }, - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", - "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" - }, - { - "description": "Filter response based on the event type", - "in": "query", - "name": "channels", - "schema": { - "description": "Filter response based on the event type", - "items": { - "example": "project_1337", - "maxLength": 128, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" - }, - { - "in": "query", - "name": "after", - "schema": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationUpdate" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageEventsOut" + "$ref": "#/components/schemas/IntegrationOut" } } }, @@ -12513,78 +14533,79 @@ "HTTPBearer": [] } ], - "summary": "Message Events Subscription", + "summary": "Update Integration", "tags": [ - "Message" + "Integration" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageEventsOut = await svix.message.eventsSubscription(\"app_id\", \"subscription_id\");" + "source": "const integrationOut = await svix.integration.update(\"app_id\", \"integ_id\", {\n name: \"Example Integration\"\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageEventsOut = await svix.message.eventsSubscription(\"app_id\", \"subscription_id\");" + "source": "const integrationOut = await svix.integration.update(\"app_id\", \"integ_id\", {\n name: \"Example Integration\"\n});" }, { "label": "Python", "lang": "Python", - "source": "message_events_out = svix.message.events_subscription(\"app_id\", \"subscription_id\")" + "source": "integration_out = svix.integration.update(\"app_id\", \"integ_id\", IntegrationUpdate(\n name=\"Example Integration\"\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_events_out = await svix.message.events_subscription(\"app_id\", \"subscription_id\")" + "source": "integration_out = await svix.integration.update(\"app_id\", \"integ_id\", IntegrationUpdate(\n name=\"Example Integration\"\n))" }, { "label": "Go", "lang": "Go", - "source": "messageEventsOut, err := svixClient.Message.EventsSubscription(ctx, \"app_id\", \"subscription_id\")" + "source": "integrationOut, err := svixClient.Integration.Update(ctx, \"app_id\", \"integ_id\", &IntegrationUpdate{\n Name: \"Example Integration\",\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageEventsOut = svix.message.eventsSubscription(\"app_id\", \"subscription_id\")" + "source": "val integrationOut = svix.integration.update(\"app_id\", \"integ_id\", IntegrationUpdate()\n .name(\"Example Integration\")\n)" }, { "label": "Java", "lang": "Java", - "source": "MessageEventsOut messageEventsOut = svix.getMessage().eventsSubscription(\"app_id\", \"subscription_id\")" + "source": "IntegrationOut integrationOut = svix.getIntegration().update(\"app_id\", \"integ_id\", new IntegrationUpdate()\n .name(\"Example Integration\")\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_events_out = svix.message.events_subscription(\"app_id\", \"subscription_id\")" + "source": "integration_out = svix.integration.update(\"app_id\", \"integ_id\", Svix::IntegrationUpdate.new({\n \"name\": \"Example Integration\"\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let message_events_out = svix.message().events_subscription(\"app_id\", \"subscription_id\").await?;" + "source": "let integration_out = svix.integration().update(\"app_id\", \"integ_id\", IntegrationUpdate {\n name: \"Example Integration\".to_string(),\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageEventsOut = await svix.Message.EventsSubscriptionAsync(\"app_id\", \"subscription_id\")" + "source": "var integrationOut = await svix.Integration.UpdateAsync(\"app_id\", \"integ_id\", new IntegrationUpdate{\n name: \"Example Integration\"\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix message events-subscription \"app_id\" \"subscription_id\"" + "source": "svix integration update \"app_id\" \"integ_id\" '{\n \"name\": \"Example Integration\"\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/events/subscription/{subscription_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"Example Integration\"\n }'" } ] } }, - "/api/v1/app/{app_id}/events/subscription/{subscription_id}/create-token": { - "post": { - "description": "Creates an auth token that can be used with the `v1.message.events-subscription` endpoint", - "operationId": "v1.message.events-subscription.create-token", + "/api/v1/app/{app_id}/integration/{integ_id}/key": { + "get": { + "deprecated": true, + "description": "Get an integration's key.", + "operationId": "v1.integration.get-key", "parameters": [ { "description": "The app's ID or UID", @@ -12602,25 +14623,13 @@ "style": "simple" }, { - "description": "The esub's ID or UID", + "description": "The integ's ID", "in": "path", - "name": "subscription_id", + "name": "integ_id", "required": true, "schema": { - "description": "The esub's ID or UID", - "example": "unique-esub-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", - "schema": { + "description": "The integ's ID", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, "style": "simple" @@ -12631,7 +14640,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageSubscriberAuthTokenOut" + "$ref": "#/components/schemas/IntegrationKeyOut" } } }, @@ -12713,78 +14722,78 @@ "HTTPBearer": [] } ], - "summary": "Message Events Create Token", + "summary": "Get Integration Key", "tags": [ - "Message" + "Integration" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageSubscriberAuthTokenOut = await svix.message.eventsSubscription(\"app_id\", \"subscription_id\");" + "source": "const integrationKeyOut = await svix.integration.getKey(\"app_id\", \"integ_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageSubscriberAuthTokenOut = await svix.message.eventsSubscription(\"app_id\", \"subscription_id\");" + "source": "const integrationKeyOut = await svix.integration.getKey(\"app_id\", \"integ_id\");" }, { "label": "Python", "lang": "Python", - "source": "message_subscriber_auth_token_out = svix.message.events_subscription(\"app_id\", \"subscription_id\", None)" + "source": "integration_key_out = svix.integration.get_key(\"app_id\", \"integ_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_subscriber_auth_token_out = await svix.message.events_subscription(\"app_id\", \"subscription_id\", None)" + "source": "integration_key_out = await svix.integration.get_key(\"app_id\", \"integ_id\")" }, { "label": "Go", "lang": "Go", - "source": "messageSubscriberAuthTokenOut, err := svixClient.Message.EventsSubscription(ctx, \"app_id\", \"subscription_id\")" + "source": "integrationKeyOut, err := svixClient.Integration.GetKey(ctx, \"app_id\", \"integ_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageSubscriberAuthTokenOut = svix.message.eventsSubscription(\"app_id\", \"subscription_id\")" + "source": "val integrationKeyOut = svix.integration.getKey(\"app_id\", \"integ_id\")" }, { "label": "Java", "lang": "Java", - "source": "MessageSubscriberAuthTokenOut messageSubscriberAuthTokenOut = svix.getMessage().eventsSubscription(\"app_id\", \"subscription_id\")" + "source": "IntegrationKeyOut integrationKeyOut = svix.getIntegration().getKey(\"app_id\", \"integ_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_subscriber_auth_token_out = svix.message.events_subscription(\"app_id\", \"subscription_id\")" + "source": "integration_key_out = svix.integration.get_key(\"app_id\", \"integ_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let message_subscriber_auth_token_out = svix.message().events_subscription(\"app_id\", \"subscription_id\", None).await?;" + "source": "let integration_key_out = svix.integration().get_key(\"app_id\", \"integ_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageSubscriberAuthTokenOut = await svix.Message.EventsSubscriptionAsync(\"app_id\", \"subscription_id\")" + "source": "var integrationKeyOut = await svix.Integration.GetKeyAsync(\"app_id\", \"integ_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message events-subscription \"app_id\" \"subscription_id\"" + "source": "svix integration get-key \"app_id\" \"integ_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/events/subscription/{subscription_id}/create-token' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}/key' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/inbound/msg/{inbound_token}": { + "/api/v1/app/{app_id}/integration/{integ_id}/key/rotate": { "post": { - "description": "Handles a raw inbound webhook for the application.", - "operationId": "v1.inbound.msg", + "description": "Rotate the integration's key. The previous key will be immediately revoked.", + "operationId": "v1.integration.rotate-key", "parameters": [ { "description": "The app's ID or UID", @@ -12802,28 +14811,17 @@ "style": "simple" }, { + "description": "The integ's ID", "in": "path", - "name": "inbound_token", + "name": "integ_id", "required": true, "schema": { + "description": "The integ's ID", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, "style": "simple" }, - { - "description": "The event type's name", - "in": "query", - "name": "event_type", - "schema": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "form" - }, { "description": "The request's idempotency key", "in": "header", @@ -12834,22 +14832,12 @@ "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - }, - "required": true - }, "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageOut" + "$ref": "#/components/schemas/IntegrationKeyOut" } } }, @@ -12931,78 +14919,78 @@ "HTTPBearer": [] } ], - "summary": "Handle Inbound", + "summary": "Rotate Integration Key", "tags": [ - "Inbound" + "Integration" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageOut = await svix.inbound.msg(\"app_id\", \"inbound_token\");" + "source": "const integrationKeyOut = await svix.integration.rotateKey(\"app_id\", \"integ_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageOut = await svix.inbound.msg(\"app_id\", \"inbound_token\");" + "source": "const integrationKeyOut = await svix.integration.rotateKey(\"app_id\", \"integ_id\");" }, { "label": "Python", "lang": "Python", - "source": "message_out = svix.inbound.msg(\"app_id\", \"inbound_token\", None)" + "source": "integration_key_out = svix.integration.rotate_key(\"app_id\", \"integ_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_out = await svix.inbound.msg(\"app_id\", \"inbound_token\", None)" + "source": "integration_key_out = await svix.integration.rotate_key(\"app_id\", \"integ_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "messageOut, err := svixClient.Inbound.Msg(ctx, \"app_id\", \"inbound_token\")" + "source": "integrationKeyOut, err := svixClient.Integration.RotateKey(ctx, \"app_id\", \"integ_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageOut = svix.inbound.msg(\"app_id\", \"inbound_token\")" + "source": "val integrationKeyOut = svix.integration.rotateKey(\"app_id\", \"integ_id\")" }, { "label": "Java", "lang": "Java", - "source": "MessageOut messageOut = svix.getInbound().msg(\"app_id\", \"inbound_token\")" + "source": "IntegrationKeyOut integrationKeyOut = svix.getIntegration().rotateKey(\"app_id\", \"integ_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_out = svix.inbound.msg(\"app_id\", \"inbound_token\")" + "source": "integration_key_out = svix.integration.rotate_key(\"app_id\", \"integ_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let message_out = svix.inbound().msg(\"app_id\", \"inbound_token\", None).await?;" + "source": "let integration_key_out = svix.integration().rotate_key(\"app_id\", \"integ_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageOut = await svix.Inbound.MsgAsync(\"app_id\", \"inbound_token\")" + "source": "var integrationKeyOut = await svix.Integration.RotateKeyAsync(\"app_id\", \"integ_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix inbound msg \"app_id\" \"inbound_token\"" + "source": "svix integration rotate-key \"app_id\" \"integ_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/inbound/msg/{inbound_token}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}/key/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/inbound/rotate-url": { - "post": { - "description": "Invalidates the previous inbound url (if one exists), producing a new inbound\nURL for this app", - "operationId": "v1.inbound.rotate-url", + "/api/v1/app/{app_id}/msg": { + "get": { + "description": "List all of the application's messages.\n\nThe `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results\nwithin a certain window.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "operationId": "v1.message.list", "parameters": [ { "description": "The app's ID or UID", @@ -13020,13 +15008,111 @@ "style": "simple" }, { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the channel", + "in": "query", + "name": "channel", "schema": { + "description": "Filter response based on the channel", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.:]+$", "type": "string" }, - "style": "simple" + "style": "form" + }, + { + "description": "Only include items created before a certain date", + "in": "query", + "name": "before", + "schema": { + "description": "Only include items created before a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Only include items created after a certain date", + "in": "query", + "name": "after", + "schema": { + "description": "Only include items created after a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "When `true` message payloads are included in the response", + "in": "query", + "name": "with_content", + "schema": { + "default": true, + "description": "When `true` message payloads are included in the response", + "type": "boolean" + }, + "style": "form" + }, + { + "description": "Filter messages matching the provided tag", + "in": "query", + "name": "tag", + "schema": { + "description": "Filter messages matching the provided tag", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the event type", + "in": "query", + "name": "event_types", + "schema": { + "description": "Filter response based on the event type", + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" } ], "responses": { @@ -13034,7 +15120,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RotatedUrlOut" + "$ref": "#/components/schemas/ListResponse_MessageOut_" } } }, @@ -13116,78 +15202,76 @@ "HTTPBearer": [] } ], - "summary": "Rotate Url", + "summary": "List Messages", "tags": [ - "Inbound" + "Message" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const rotatedUrlOut = await svix.inbound.rotateUrl(\"app_id\");" + "source": "const listResponseMessageOut = await svix.message.list(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const rotatedUrlOut = await svix.inbound.rotateUrl(\"app_id\");" + "source": "const listResponseMessageOut = await svix.message.list(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "rotated_url_out = svix.inbound.rotate_url(\"app_id\", None)" + "source": "list_response_message_out = svix.message.list(\"app_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "rotated_url_out = await svix.inbound.rotate_url(\"app_id\", None)" + "source": "list_response_message_out = await svix.message.list(\"app_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "rotatedUrlOut, err := svixClient.Inbound.RotateUrl(ctx, \"app_id\")" + "source": "listResponseMessageOut, err := svixClient.Message.List(ctx, \"app_id\", nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val rotatedUrlOut = svix.inbound.rotateUrl(\"app_id\")" + "source": "val listResponseMessageOut = svix.message.list(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "RotatedUrlOut rotatedUrlOut = svix.getInbound().rotateUrl(\"app_id\")" + "source": "ListResponseMessageOut listResponseMessageOut = svix.getMessage().list(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "rotated_url_out = svix.inbound.rotate_url(\"app_id\")" + "source": "list_response_message_out = svix.message.list(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let rotated_url_out = svix.inbound().rotate_url(\"app_id\", None).await?;" + "source": "let list_response_message_out = svix.message().list(\"app_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var rotatedUrlOut = await svix.Inbound.RotateUrlAsync(\"app_id\")" + "source": "var listResponseMessageOut = await svix.Message.ListAsync(\"app_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix inbound rotate-url \"app_id\"" + "source": "svix message list \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/inbound/rotate-url' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/app/{app_id}/integration": { - "get": { - "description": "List the application's integrations.", - "operationId": "v1.integration.list", + }, + "post": { + "description": "Creates a new message and dispatches it to all of the application's endpoints.\n\nThe `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made.\nIf a message with the same `eventId` already exists for the application, a 409 conflict error will be returned.\n\nThe `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types.\nMessages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema.\n\nThe `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.", + "operationId": "v1.message.create", "parameters": [ { "description": "The app's ID or UID", @@ -13205,48 +15289,42 @@ "style": "simple" }, { - "description": "Limit the number of returned items", + "description": "When `true` message payloads are included in the response", "in": "query", - "name": "limit", + "name": "with_content", "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" + "default": true, + "description": "When `true` message payloads are included in the response", + "type": "boolean" }, "style": "form" }, { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The iterator returned from a prior invocation", - "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, "type": "string" }, - "style": "form" - }, - { - "description": "The sorting order of the returned items", - "in": "query", - "name": "order", - "schema": { - "$ref": "#/components/schemas/Ordering", - "description": "The sorting order of the returned items", - "nullable": true - }, - "style": "form" + "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageIn" + } + } + }, + "required": true + }, "responses": { - "200": { + "202": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_IntegrationOut_" + "$ref": "#/components/schemas/MessageOut" } } }, @@ -13302,6 +15380,16 @@ }, "description": "Conflict" }, + "413": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Payload too large" + }, "422": { "content": { "application/json": { @@ -13328,76 +15416,78 @@ "HTTPBearer": [] } ], - "summary": "List Integrations", + "summary": "Create Message", "tags": [ - "Integration" + "Message" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseIntegrationOut = await svix.integration.list(\"app_id\");" + "source": "const messageOut = await svix.message.create(\"app_id\", {\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n channels: [\"project_123\", \"group_2\"],\n application: null,\n tags: [\"my_tag\", \"other\"],\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseIntegrationOut = await svix.integration.list(\"app_id\");" + "source": "const messageOut = await svix.message.create(\"app_id\", {\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n channels: [\"project_123\", \"group_2\"],\n application: null,\n tags: [\"my_tag\", \"other\"],\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: null\n});" }, { "label": "Python", "lang": "Python", - "source": "list_response_integration_out = svix.integration.list(\"app_id\", None)" + "source": "message_out = svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None,\n payload_retention_period=90,\n payload_retention_hours=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_integration_out = await svix.integration.list(\"app_id\", None)" + "source": "message_out = await svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None,\n payload_retention_period=90,\n payload_retention_hours=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "listResponseIntegrationOut, err := svixClient.Integration.List(ctx, \"app_id\", nil)" + "source": "messageOut, err := svixClient.Message.Create(ctx, \"app_id\", &MessageIn{\n EventId: \"unique-msg-identifier\",\n EventType: \"user.signup\",\n Payload: map[string]interface{}{\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n Channels: []string{\"project_123\", \"group_2\"},\n Application: nil,\n Tags: []string{\"my_tag\", \"other\"},\n TransformationsParams: nil,\n PayloadRetentionPeriod: 90,\n PayloadRetentionHours: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseIntegrationOut = svix.integration.list(\"app_id\")" + "source": "val messageOut = svix.message.create(\"app_id\", MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(/* ... */)\n .channels(arrayOf(\"project_123\", \"group_2\"))\n .application(null)\n .tags(arrayOf(\"my_tag\", \"other\"))\n .transformationsParams(null)\n .payloadRetentionPeriod(90)\n .payloadRetentionHours(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "ListResponseIntegrationOut listResponseIntegrationOut = svix.getIntegration().list(\"app_id\")" + "source": "MessageOut messageOut = svix.getMessage().create(\"app_id\", new MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(/* ... */)\n .channels(new String[]{\"project_123\", \"group_2\"})\n .application(null)\n .tags(new String[]{\"my_tag\", \"other\"})\n .transformationsParams(null)\n .payloadRetentionPeriod(90)\n .payloadRetentionHours(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_integration_out = svix.integration.list(\"app_id\")" + "source": "message_out = svix.message.create(\"app_id\", Svix::MessageIn.new({\n \"event_id\": \"unique-msg-identifier\",\n \"event_type\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"application\": nil,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformations_params\": nil,\n \"payload_retention_period\": 90,\n \"payload_retention_hours\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_integration_out = svix.integration().list(\"app_id\", None).await?;" + "source": "let message_out = svix.message().create(\"app_id\", MessageIn {\n event_id: Some(\"unique-msg-identifier\".to_string()),\n event_type: \"user.signup\".to_string(),\n payload: json!({\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"}),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n application: None,\n tags: Some(vec![\"my_tag\".to_string(), \"other\".to_string()]),\n transformations_params: None,\n payload_retention_period: Some(90),\n payload_retention_hours: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseIntegrationOut = await svix.Integration.ListAsync(\"app_id\")" + "source": "var messageOut = await svix.Message.CreateAsync(\"app_id\", new MessageIn{\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: /* ... */,\n channels: new string[] {\"project_123\", \"group_2\"},\n application: null,\n tags: new string[] {\"my_tag\", \"other\"},\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix integration list \"app_id\"" + "source": "svix message create \"app_id\" '{\n \"eventId\": \"unique-msg-identifier\",\n \"eventType\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformationsParams\": null,\n \"payloadRetentionPeriod\": 90,\n \"payloadRetentionHours\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventId\": \"unique-msg-identifier\",\n \"eventType\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformationsParams\": null,\n \"payloadRetentionPeriod\": 90,\n \"payloadRetentionHours\": null\n }'" } ] - }, - "post": { - "description": "Create an integration.", - "operationId": "v1.integration.create", + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}": { + "get": { + "description": "Get a message by its ID or eventID.", + "operationId": "v1.message.get", "parameters": [ { "description": "The app's ID or UID", @@ -13415,31 +15505,38 @@ "style": "simple" }, { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "The msg's ID or UID", + "in": "path", + "name": "msg_id", + "required": true, "schema": { + "description": "The msg's ID or UID", + "example": "unique-msg-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" + }, + { + "description": "When `true` message payloads are included in the response", + "in": "query", + "name": "with_content", + "schema": { + "default": true, + "description": "When `true` message payloads are included in the response", + "type": "boolean" + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationIn" - } - } - }, - "required": true - }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IntegrationOut" + "$ref": "#/components/schemas/MessageOut" } } }, @@ -13521,79 +15618,213 @@ "HTTPBearer": [] } ], - "summary": "Create Integration", + "summary": "Get Message", "tags": [ - "Integration" + "Message" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const integrationOut = await svix.integration.create(\"app_id\", {\n name: \"Example Integration\"\n});" + "source": "const messageOut = await svix.message.get(\"app_id\", \"msg_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const integrationOut = await svix.integration.create(\"app_id\", {\n name: \"Example Integration\"\n});" + "source": "const messageOut = await svix.message.get(\"app_id\", \"msg_id\");" }, { "label": "Python", "lang": "Python", - "source": "integration_out = svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" + "source": "message_out = svix.message.get(\"app_id\", \"msg_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "integration_out = await svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" + "source": "message_out = await svix.message.get(\"app_id\", \"msg_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "messageOut, err := svixClient.Message.Get(ctx, \"app_id\", \"msg_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val messageOut = svix.message.get(\"app_id\", \"msg_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "MessageOut messageOut = svix.getMessage().get(\"app_id\", \"msg_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "message_out = svix.message.get(\"app_id\", \"msg_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let message_out = svix.message().get(\"app_id\", \"msg_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var messageOut = await svix.Message.GetAsync(\"app_id\", \"msg_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message get \"app_id\" \"msg_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/attempt": { + "get": { + "deprecated": true, + "description": "Deprecated: Please use \"List Attempts by Endpoint\" and \"List Attempts by Msg\" instead.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n\n`msg_id`: Use a message id or a message `eventId`", + "operationId": "v1.message-attempt.list-by-msg-deprecated", + "parameters": [ + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter the attempts based on the attempted endpoint", + "in": "query", + "name": "endpoint_id", + "schema": { + "description": "Filter the attempts based on the attempted endpoint", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "form" }, { - "label": "Go", - "lang": "Go", - "source": "integrationOut, err := svixClient.Integration.Create(ctx, \"app_id\", &IntegrationIn{\n Name: \"Example Integration\",\n})" + "description": "Filter response based on the channel", + "in": "query", + "name": "channel", + "schema": { + "description": "Filter response based on the channel", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "type": "string" + }, + "style": "form" }, { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val integrationOut = svix.integration.create(\"app_id\", IntegrationIn()\n .name(\"Example Integration\")\n)" + "description": "Filter response based on the tag", + "in": "query", + "name": "tag", + "schema": { + "description": "Filter response based on the tag", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "form" }, { - "label": "Java", - "lang": "Java", - "source": "IntegrationOut integrationOut = svix.getIntegration().create(\"app_id\", new IntegrationIn()\n .name(\"Example Integration\")\n)" + "description": "Filter response based on the delivery status", + "in": "query", + "name": "status", + "schema": { + "$ref": "#/components/schemas/MessageStatus", + "description": "Filter response based on the delivery status", + "nullable": true + }, + "style": "form" }, { - "label": "Ruby", - "lang": "Ruby", - "source": "integration_out = svix.integration.create(\"app_id\", Svix::IntegrationIn.new({\n \"name\": \"Example Integration\"\n}))" + "description": "Only include items created before a certain date", + "in": "query", + "name": "before", + "schema": { + "description": "Only include items created before a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" }, { - "label": "Rust", - "lang": "Rust", - "source": "let integration_out = svix.integration().create(\"app_id\", IntegrationIn {\n name: \"Example Integration\".to_string(),\n}, None).await?;" + "description": "Only include items created after a certain date", + "in": "query", + "name": "after", + "schema": { + "description": "Only include items created after a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" }, { - "label": "C#", - "lang": "C#", - "source": "var integrationOut = await svix.Integration.CreateAsync(\"app_id\", new IntegrationIn{\n name: \"Example Integration\"\n})" + "description": "Filter response based on the HTTP status code", + "in": "query", + "name": "status_code_class", + "schema": { + "$ref": "#/components/schemas/StatusCodeClass", + "description": "Filter response based on the HTTP status code", + "nullable": true + }, + "style": "form" }, { - "label": "CLI", - "lang": "Shell", - "source": "svix integration create \"app_id\" '{\n \"name\": \"Example Integration\"\n}'" + "description": "Filter response based on the event type", + "in": "query", + "name": "event_types", + "schema": { + "description": "Filter response based on the event type", + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"Example Integration\"\n }'" - } - ] - } - }, - "/api/v1/app/{app_id}/integration/{integ_id}": { - "delete": { - "description": "Delete an integration.", - "operationId": "v1.integration.delete", - "parameters": [ { "description": "The app's ID or UID", "in": "path", @@ -13610,21 +15841,31 @@ "style": "simple" }, { - "description": "The integ's ID", + "description": "The msg's ID or UID", "in": "path", - "name": "integ_id", + "name": "msg_id", "required": true, "schema": { - "description": "The integ's ID", - "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "description": "The msg's ID or UID", + "example": "unique-msg-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" } ], "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_MessageAttemptOut_" + } + } + }, + "description": "" }, "400": { "content": { @@ -13702,76 +15943,78 @@ "HTTPBearer": [] } ], - "summary": "Delete Integration", + "summary": "List Attempts", "tags": [ - "Integration" + "Message Attempt" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.integration.delete(\"app_id\", \"integ_id\");" + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.integration.delete(\"app_id\", \"integ_id\");" + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\");" }, { "label": "Python", "lang": "Python", - "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.integration.delete(\"app_id\", \"integ_id\")" + "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Integration.Delete(ctx, \"app_id\", \"integ_id\")" + "source": "listResponseMessageAttemptOut, err := svixClient.MessageAttempt.ListByMsgDeprecated(ctx, \"app_id\", \"msg_id\", nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + "source": "val listResponseMessageAttemptOut = svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\")" }, { "label": "Java", "lang": "Java", - "source": "svix.getIntegration().delete(\"app_id\", \"integ_id\")" + "source": "ListResponseMessageAttemptOut listResponseMessageAttemptOut = svix.getMessageAttempt().listByMsgDeprecated(\"app_id\", \"msg_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "svix.integration().delete(\"app_id\", \"integ_id\").await?;" + "source": "let list_response_message_attempt_out = svix.message_attempt().list_by_msg_deprecated(\"app_id\", \"msg_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Integration.DeleteAsync(\"app_id\", \"integ_id\")" + "source": "var listResponseMessageAttemptOut = await svix.MessageAttempt.ListByMsgDeprecatedAsync(\"app_id\", \"msg_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix integration delete \"app_id\" \"integ_id\"" + "source": "svix message-attempt list-by-msg-deprecated \"app_id\" \"msg_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - }, + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}": { "get": { - "description": "Get an integration.", - "operationId": "v1.integration.get", + "description": "`msg_id`: Use a message id or a message `eventId`", + "operationId": "v1.message-attempt.get", "parameters": [ { "description": "The app's ID or UID", @@ -13789,13 +16032,28 @@ "style": "simple" }, { - "description": "The integ's ID", + "description": "The msg's ID or UID", "in": "path", - "name": "integ_id", + "name": "msg_id", "required": true, "schema": { - "description": "The integ's ID", - "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "description": "The msg's ID or UID", + "example": "unique-msg-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The attempt's ID", + "in": "path", + "name": "attempt_id", + "required": true, + "schema": { + "description": "The attempt's ID", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, "style": "simple" @@ -13806,7 +16064,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IntegrationOut" + "$ref": "#/components/schemas/MessageAttemptOut" } } }, @@ -13888,76 +16146,78 @@ "HTTPBearer": [] } ], - "summary": "Get Integration", + "summary": "Get Attempt", "tags": [ - "Integration" + "Message Attempt" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const integrationOut = await svix.integration.get(\"app_id\", \"integ_id\");" + "source": "const messageAttemptOut = await svix.messageAttempt.get(\"app_id\", \"msg_id\", \"attempt_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const integrationOut = await svix.integration.get(\"app_id\", \"integ_id\");" + "source": "const messageAttemptOut = await svix.messageAttempt.get(\"app_id\", \"msg_id\", \"attempt_id\");" }, { "label": "Python", "lang": "Python", - "source": "integration_out = svix.integration.get(\"app_id\", \"integ_id\")" + "source": "message_attempt_out = svix.message_attempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "integration_out = await svix.integration.get(\"app_id\", \"integ_id\")" + "source": "message_attempt_out = await svix.message_attempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Go", "lang": "Go", - "source": "integrationOut, err := svixClient.Integration.Get(ctx, \"app_id\", \"integ_id\")" + "source": "messageAttemptOut, err := svixClient.MessageAttempt.Get(ctx, \"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val integrationOut = svix.integration.get(\"app_id\", \"integ_id\")" + "source": "val messageAttemptOut = svix.messageAttempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Java", "lang": "Java", - "source": "IntegrationOut integrationOut = svix.getIntegration().get(\"app_id\", \"integ_id\")" + "source": "MessageAttemptOut messageAttemptOut = svix.getMessageAttempt().get(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "integration_out = svix.integration.get(\"app_id\", \"integ_id\")" + "source": "message_attempt_out = svix.message_attempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let integration_out = svix.integration().get(\"app_id\", \"integ_id\").await?;" + "source": "let message_attempt_out = svix.message_attempt().get(\"app_id\", \"msg_id\", \"attempt_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var integrationOut = await svix.Integration.GetAsync(\"app_id\", \"integ_id\")" + "source": "var messageAttemptOut = await svix.MessageAttempt.GetAsync(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix integration get \"app_id\" \"integ_id\"" + "source": "svix message-attempt get \"app_id\" \"msg_id\" \"attempt_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - }, - "put": { - "description": "Update an integration.", - "operationId": "v1.integration.update", + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content": { + "delete": { + "description": "Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content.", + "operationId": "v1.message-attempt.expunge-content", "parameters": [ { "description": "The app's ID or UID", @@ -13975,38 +16235,36 @@ "style": "simple" }, { - "description": "The integ's ID", + "description": "The msg's ID or UID", + "in": "path", + "name": "msg_id", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "example": "unique-msg-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The attempt's ID", "in": "path", - "name": "integ_id", + "name": "attempt_id", "required": true, "schema": { - "description": "The integ's ID", - "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "description": "The attempt's ID", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationUpdate" - } - } - }, - "required": true - }, "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -14084,79 +16342,78 @@ "HTTPBearer": [] } ], - "summary": "Update Integration", + "summary": "Delete attempt response body", "tags": [ - "Integration" + "Message Attempt" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const integrationOut = await svix.integration.update(\"app_id\", \"integ_id\", {\n name: \"Example Integration\"\n});" + "source": "await svix.messageAttempt.expungeContent(\"app_id\", \"msg_id\", \"attempt_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const integrationOut = await svix.integration.update(\"app_id\", \"integ_id\", {\n name: \"Example Integration\"\n});" + "source": "await svix.messageAttempt.expungeContent(\"app_id\", \"msg_id\", \"attempt_id\");" }, { "label": "Python", "lang": "Python", - "source": "integration_out = svix.integration.update(\"app_id\", \"integ_id\", IntegrationUpdate(\n name=\"Example Integration\"\n))" + "source": "svix.message_attempt.expunge_content(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "integration_out = await svix.integration.update(\"app_id\", \"integ_id\", IntegrationUpdate(\n name=\"Example Integration\"\n))" + "source": "await svix.message_attempt.expunge_content(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Go", "lang": "Go", - "source": "integrationOut, err := svixClient.Integration.Update(ctx, \"app_id\", \"integ_id\", &IntegrationUpdate{\n Name: \"Example Integration\",\n})" + "source": "err := svixClient.MessageAttempt.ExpungeContent(ctx, \"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val integrationOut = svix.integration.update(\"app_id\", \"integ_id\", IntegrationUpdate()\n .name(\"Example Integration\")\n)" + "source": "svix.messageAttempt.expungeContent(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Java", "lang": "Java", - "source": "IntegrationOut integrationOut = svix.getIntegration().update(\"app_id\", \"integ_id\", new IntegrationUpdate()\n .name(\"Example Integration\")\n)" + "source": "svix.getMessageAttempt().expungeContent(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "integration_out = svix.integration.update(\"app_id\", \"integ_id\", Svix::IntegrationUpdate.new({\n \"name\": \"Example Integration\"\n}))" + "source": "svix.message_attempt.expunge_content(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let integration_out = svix.integration().update(\"app_id\", \"integ_id\", IntegrationUpdate {\n name: \"Example Integration\".to_string(),\n}).await?;" + "source": "svix.message_attempt().expunge_content(\"app_id\", \"msg_id\", \"attempt_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var integrationOut = await svix.Integration.UpdateAsync(\"app_id\", \"integ_id\", new IntegrationUpdate{\n name: \"Example Integration\"\n})" + "source": "await svix.MessageAttempt.ExpungeContentAsync(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix integration update \"app_id\" \"integ_id\" '{\n \"name\": \"Example Integration\"\n}'" + "source": "svix message-attempt expunge-content \"app_id\" \"msg_id\" \"attempt_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"Example Integration\"\n }'" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/integration/{integ_id}/key": { + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/headers": { "get": { - "deprecated": true, - "description": "Get an integration's key.", - "operationId": "v1.integration.get-key", + "description": "Calculate and return headers used on a given message attempt", + "operationId": "v1.message-attempt.get-headers", "parameters": [ { "description": "The app's ID or UID", @@ -14174,13 +16431,28 @@ "style": "simple" }, { - "description": "The integ's ID", + "description": "The msg's ID or UID", "in": "path", - "name": "integ_id", + "name": "msg_id", "required": true, "schema": { - "description": "The integ's ID", - "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "description": "The msg's ID or UID", + "example": "unique-msg-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The attempt's ID", + "in": "path", + "name": "attempt_id", + "required": true, + "schema": { + "description": "The attempt's ID", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, "style": "simple" @@ -14191,7 +16463,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IntegrationKeyOut" + "$ref": "#/components/schemas/MessageAttemptHeadersOut" } } }, @@ -14273,78 +16545,78 @@ "HTTPBearer": [] } ], - "summary": "Get Integration Key", + "summary": "Get Attempt Headers", "tags": [ - "Integration" + "Message Attempt" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const integrationKeyOut = await svix.integration.getKey(\"app_id\", \"integ_id\");" + "source": "const messageAttemptHeadersOut = await svix.messageAttempt.getHeaders(\"app_id\", \"msg_id\", \"attempt_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const integrationKeyOut = await svix.integration.getKey(\"app_id\", \"integ_id\");" + "source": "const messageAttemptHeadersOut = await svix.messageAttempt.getHeaders(\"app_id\", \"msg_id\", \"attempt_id\");" }, { "label": "Python", "lang": "Python", - "source": "integration_key_out = svix.integration.get_key(\"app_id\", \"integ_id\")" + "source": "message_attempt_headers_out = svix.message_attempt.get_headers(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "integration_key_out = await svix.integration.get_key(\"app_id\", \"integ_id\")" + "source": "message_attempt_headers_out = await svix.message_attempt.get_headers(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Go", "lang": "Go", - "source": "integrationKeyOut, err := svixClient.Integration.GetKey(ctx, \"app_id\", \"integ_id\")" + "source": "messageAttemptHeadersOut, err := svixClient.MessageAttempt.GetHeaders(ctx, \"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val integrationKeyOut = svix.integration.getKey(\"app_id\", \"integ_id\")" + "source": "val messageAttemptHeadersOut = svix.messageAttempt.getHeaders(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Java", "lang": "Java", - "source": "IntegrationKeyOut integrationKeyOut = svix.getIntegration().getKey(\"app_id\", \"integ_id\")" + "source": "MessageAttemptHeadersOut messageAttemptHeadersOut = svix.getMessageAttempt().getHeaders(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "integration_key_out = svix.integration.get_key(\"app_id\", \"integ_id\")" + "source": "message_attempt_headers_out = svix.message_attempt.get_headers(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let integration_key_out = svix.integration().get_key(\"app_id\", \"integ_id\").await?;" + "source": "let message_attempt_headers_out = svix.message_attempt().get_headers(\"app_id\", \"msg_id\", \"attempt_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var integrationKeyOut = await svix.Integration.GetKeyAsync(\"app_id\", \"integ_id\")" + "source": "var messageAttemptHeadersOut = await svix.MessageAttempt.GetHeadersAsync(\"app_id\", \"msg_id\", \"attempt_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix integration get-key \"app_id\" \"integ_id\"" + "source": "svix message-attempt get-headers \"app_id\" \"msg_id\" \"attempt_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}/key' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/integration/{integ_id}/key/rotate": { - "post": { - "description": "Rotate the integration's key. The previous key will be immediately revoked.", - "operationId": "v1.integration.rotate-key", + "/api/v1/app/{app_id}/msg/{msg_id}/content": { + "delete": { + "description": "Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content.\n\nThe message can't be replayed or resent once its payload has been deleted or expired.", + "operationId": "v1.message.expunge-content", "parameters": [ { "description": "The app's ID or UID", @@ -14362,37 +16634,24 @@ "style": "simple" }, { - "description": "The integ's ID", + "description": "The msg's ID or UID", "in": "path", - "name": "integ_id", + "name": "msg_id", "required": true, "schema": { - "description": "The integ's ID", - "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", - "schema": { + "description": "The msg's ID or UID", + "example": "unique-msg-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IntegrationKeyOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -14470,200 +16729,133 @@ "HTTPBearer": [] } ], - "summary": "Rotate Integration Key", + "summary": "Delete message payload", "tags": [ - "Integration" + "Message" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const integrationKeyOut = await svix.integration.rotateKey(\"app_id\", \"integ_id\");" + "source": "await svix.message.expungeContent(\"app_id\", \"msg_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const integrationKeyOut = await svix.integration.rotateKey(\"app_id\", \"integ_id\");" + "source": "await svix.message.expungeContent(\"app_id\", \"msg_id\");" }, { "label": "Python", "lang": "Python", - "source": "integration_key_out = svix.integration.rotate_key(\"app_id\", \"integ_id\", None)" + "source": "svix.message.expunge_content(\"app_id\", \"msg_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "integration_key_out = await svix.integration.rotate_key(\"app_id\", \"integ_id\", None)" + "source": "await svix.message.expunge_content(\"app_id\", \"msg_id\")" }, { "label": "Go", "lang": "Go", - "source": "integrationKeyOut, err := svixClient.Integration.RotateKey(ctx, \"app_id\", \"integ_id\")" + "source": "err := svixClient.Message.ExpungeContent(ctx, \"app_id\", \"msg_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val integrationKeyOut = svix.integration.rotateKey(\"app_id\", \"integ_id\")" + "source": "svix.message.expungeContent(\"app_id\", \"msg_id\")" }, { "label": "Java", "lang": "Java", - "source": "IntegrationKeyOut integrationKeyOut = svix.getIntegration().rotateKey(\"app_id\", \"integ_id\")" + "source": "svix.getMessage().expungeContent(\"app_id\", \"msg_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "integration_key_out = svix.integration.rotate_key(\"app_id\", \"integ_id\")" + "source": "svix.message.expunge_content(\"app_id\", \"msg_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let integration_key_out = svix.integration().rotate_key(\"app_id\", \"integ_id\", None).await?;" + "source": "svix.message().expunge_content(\"app_id\", \"msg_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var integrationKeyOut = await svix.Integration.RotateKeyAsync(\"app_id\", \"integ_id\")" + "source": "await svix.Message.ExpungeContentAsync(\"app_id\", \"msg_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix integration rotate-key \"app_id\" \"integ_id\"" + "source": "svix message expunge-content \"app_id\" \"msg_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}/key/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/content' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/msg": { + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint": { "get": { - "description": "List all of the application's messages.\n\nThe `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results\nwithin a certain window.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", - "operationId": "v1.message.list", + "description": "List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt.\nBy default, endpoints are listed in ascending order by ID.", + "operationId": "v1.message-attempt.list-attempted-destinations", "parameters": [ - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, { "description": "Limit the number of returned items", "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the channel", - "in": "query", - "name": "channel", - "schema": { - "description": "Filter response based on the channel", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Only include items created before a certain date", - "in": "query", - "name": "before", - "schema": { - "description": "Only include items created before a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only include items created after a certain date", - "in": "query", - "name": "after", + "name": "limit", "schema": { - "description": "Only include items created after a certain date", - "format": "date-time", - "nullable": true, - "type": "string" + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" }, "style": "form" }, { - "description": "When `true` message payloads are included in the response", + "description": "The iterator returned from a prior invocation", "in": "query", - "name": "with_content", + "name": "iterator", "schema": { - "default": true, - "description": "When `true` message payloads are included in the response", - "type": "boolean" + "description": "The iterator returned from a prior invocation", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, + "type": "string" }, "style": "form" }, { - "description": "Filter messages matching the provided tag", - "in": "query", - "name": "tag", + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, "schema": { - "description": "Filter messages matching the provided tag", - "example": "project_1337", - "maxLength": 128, - "nullable": true, + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, - "style": "form" + "style": "simple" }, { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", + "description": "The msg's ID or UID", + "in": "path", + "name": "msg_id", + "required": true, "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true + "description": "The msg's ID or UID", + "example": "unique-msg-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" }, - "style": "form" + "style": "simple" } ], "responses": { @@ -14671,7 +16863,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_MessageOut_" + "$ref": "#/components/schemas/ListResponse_MessageEndpointOut_" } } }, @@ -14753,77 +16945,187 @@ "HTTPBearer": [] } ], - "summary": "List Messages", + "summary": "List Attempted Destinations", "tags": [ - "Message" + "Message Attempt" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseMessageOut = await svix.message.list(\"app_id\");" + "source": "const listResponseMessageEndpointOut = await svix.messageAttempt.listAttemptedDestinations(\"app_id\", \"msg_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseMessageOut = await svix.message.list(\"app_id\");" + "source": "const listResponseMessageEndpointOut = await svix.messageAttempt.listAttemptedDestinations(\"app_id\", \"msg_id\");" }, { "label": "Python", "lang": "Python", - "source": "list_response_message_out = svix.message.list(\"app_id\", None)" + "source": "list_response_message_endpoint_out = svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_out = await svix.message.list(\"app_id\", None)" + "source": "list_response_message_endpoint_out = await svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "listResponseMessageOut, err := svixClient.Message.List(ctx, \"app_id\", nil)" + "source": "listResponseMessageEndpointOut, err := svixClient.MessageAttempt.ListAttemptedDestinations(ctx, \"app_id\", \"msg_id\", nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseMessageOut = svix.message.list(\"app_id\")" + "source": "val listResponseMessageEndpointOut = svix.messageAttempt.listAttemptedDestinations(\"app_id\", \"msg_id\")" }, { "label": "Java", "lang": "Java", - "source": "ListResponseMessageOut listResponseMessageOut = svix.getMessage().list(\"app_id\")" + "source": "ListResponseMessageEndpointOut listResponseMessageEndpointOut = svix.getMessageAttempt().listAttemptedDestinations(\"app_id\", \"msg_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_message_out = svix.message.list(\"app_id\")" + "source": "list_response_message_endpoint_out = svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_message_out = svix.message().list(\"app_id\", None).await?;" + "source": "let list_response_message_endpoint_out = svix.message_attempt().list_attempted_destinations(\"app_id\", \"msg_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseMessageOut = await svix.Message.ListAsync(\"app_id\")" + "source": "var listResponseMessageEndpointOut = await svix.MessageAttempt.ListAttemptedDestinationsAsync(\"app_id\", \"msg_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message list \"app_id\"" + "source": "svix message-attempt list-attempted-destinations \"app_id\" \"msg_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - }, - "post": { - "description": "Creates a new message and dispatches it to all of the application's endpoints.\n\nThe `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made.\nIf a message with the same `eventId` already exists for the application, a 409 conflict error will be returned.\n\nThe `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types.\nMessages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema.\n\nThe `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.", - "operationId": "v1.message.create", + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt": { + "get": { + "deprecated": true, + "description": "DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead.\n\nList the message attempts for a particular endpoint.\n\nReturning the endpoint.\n\nThe `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "operationId": "v1.message-attempt.list-by-endpoint-deprecated", "parameters": [ + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the channel", + "in": "query", + "name": "channel", + "schema": { + "description": "Filter response based on the channel", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the tag", + "in": "query", + "name": "tag", + "schema": { + "description": "Filter response based on the tag", + "example": "project_1337", + "maxLength": 128, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the delivery status", + "in": "query", + "name": "status", + "schema": { + "$ref": "#/components/schemas/MessageStatus", + "description": "Filter response based on the delivery status", + "nullable": true + }, + "style": "form" + }, + { + "description": "Only include items created before a certain date", + "in": "query", + "name": "before", + "schema": { + "description": "Only include items created before a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Only include items created after a certain date", + "in": "query", + "name": "after", + "schema": { + "description": "Only include items created after a certain date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter response based on the event type", + "in": "query", + "name": "event_types", + "schema": { + "description": "Filter response based on the event type", + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" + }, { "description": "The app's ID or UID", "in": "path", @@ -14840,42 +17142,42 @@ "style": "simple" }, { - "description": "When `true` message payloads are included in the response", - "in": "query", - "name": "with_content", - "schema": { - "default": true, - "description": "When `true` message payloads are included in the response", - "type": "boolean" - }, - "style": "form" - }, - { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "The msg's ID or UID", + "in": "path", + "name": "msg_id", + "required": true, "schema": { + "description": "The msg's ID or UID", + "example": "unique-msg-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MessageIn" - } - } }, - "required": true - }, + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageOut" + "$ref": "#/components/schemas/ListResponse_MessageAttemptEndpointOut_" } } }, @@ -14931,16 +17233,6 @@ }, "description": "Conflict" }, - "413": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Payload too large" - }, "422": { "content": { "application/json": { @@ -14967,78 +17259,78 @@ "HTTPBearer": [] } ], - "summary": "Create Message", + "summary": "List Attempts For Endpoint", "tags": [ - "Message" + "Message Attempt" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageOut = await svix.message.create(\"app_id\", {\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n channels: [\"project_123\", \"group_2\"],\n application: null,\n tags: [\"my_tag\", \"other\"],\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: null\n});" + "source": "const listResponseMessageAttemptEndpointOut = await svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageOut = await svix.message.create(\"app_id\", {\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n channels: [\"project_123\", \"group_2\"],\n application: null,\n tags: [\"my_tag\", \"other\"],\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: null\n});" + "source": "const listResponseMessageAttemptEndpointOut = await svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "message_out = svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None,\n payload_retention_period=90,\n payload_retention_hours=None\n), None)" + "source": "list_response_message_attempt_endpoint_out = svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_out = await svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None,\n payload_retention_period=90,\n payload_retention_hours=None\n), None)" + "source": "list_response_message_attempt_endpoint_out = await svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "messageOut, err := svixClient.Message.Create(ctx, \"app_id\", &MessageIn{\n EventId: \"unique-msg-identifier\",\n EventType: \"user.signup\",\n Payload: map[string]interface{}{\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n Channels: []string{\"project_123\", \"group_2\"},\n Application: nil,\n Tags: []string{\"my_tag\", \"other\"},\n TransformationsParams: nil,\n PayloadRetentionPeriod: 90,\n PayloadRetentionHours: nil,\n})" + "source": "listResponseMessageAttemptEndpointOut, err := svixClient.MessageAttempt.ListByEndpointDeprecated(ctx, \"app_id\", \"msg_id\", \"endpoint_id\", nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageOut = svix.message.create(\"app_id\", MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(/* ... */)\n .channels(arrayOf(\"project_123\", \"group_2\"))\n .application(null)\n .tags(arrayOf(\"my_tag\", \"other\"))\n .transformationsParams(null)\n .payloadRetentionPeriod(90)\n .payloadRetentionHours(null)\n)" + "source": "val listResponseMessageAttemptEndpointOut = svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "MessageOut messageOut = svix.getMessage().create(\"app_id\", new MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(/* ... */)\n .channels(new String[]{\"project_123\", \"group_2\"})\n .application(null)\n .tags(new String[]{\"my_tag\", \"other\"})\n .transformationsParams(null)\n .payloadRetentionPeriod(90)\n .payloadRetentionHours(null)\n)" + "source": "ListResponseMessageAttemptEndpointOut listResponseMessageAttemptEndpointOut = svix.getMessageAttempt().listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_out = svix.message.create(\"app_id\", Svix::MessageIn.new({\n \"event_id\": \"unique-msg-identifier\",\n \"event_type\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"application\": nil,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformations_params\": nil,\n \"payload_retention_period\": 90,\n \"payload_retention_hours\": nil\n}))" + "source": "list_response_message_attempt_endpoint_out = svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let message_out = svix.message().create(\"app_id\", MessageIn {\n event_id: Some(\"unique-msg-identifier\".to_string()),\n event_type: \"user.signup\".to_string(),\n payload: json!({\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"}),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n application: None,\n tags: Some(vec![\"my_tag\".to_string(), \"other\".to_string()]),\n transformations_params: None,\n payload_retention_period: Some(90),\n payload_retention_hours: None,\n}, None).await?;" + "source": "let list_response_message_attempt_endpoint_out = svix.message_attempt().list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageOut = await svix.Message.CreateAsync(\"app_id\", new MessageIn{\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: /* ... */,\n channels: new string[] {\"project_123\", \"group_2\"},\n application: null,\n tags: new string[] {\"my_tag\", \"other\"},\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: null\n})" + "source": "var listResponseMessageAttemptEndpointOut = await svix.MessageAttempt.ListByEndpointDeprecatedAsync(\"app_id\", \"msg_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message create \"app_id\" '{\n \"eventId\": \"unique-msg-identifier\",\n \"eventType\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformationsParams\": null,\n \"payloadRetentionPeriod\": 90,\n \"payloadRetentionHours\": null\n}'" + "source": "svix message-attempt list-by-endpoint-deprecated \"app_id\" \"msg_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventId\": \"unique-msg-identifier\",\n \"eventType\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformationsParams\": null,\n \"payloadRetentionPeriod\": 90,\n \"payloadRetentionHours\": null\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/msg/{msg_id}": { - "get": { - "description": "Get a message by its ID or eventID.", - "operationId": "v1.message.get", + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend": { + "post": { + "description": "Resend a message to the specified endpoint.", + "operationId": "v1.message-attempt.resend", "parameters": [ { "description": "The app's ID or UID", @@ -15071,27 +17363,33 @@ "style": "simple" }, { - "description": "When `true` message payloads are included in the response", - "in": "query", - "name": "with_content", + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, "schema": { - "default": true, - "description": "When `true` message payloads are included in the response", - "type": "boolean" + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" }, - "style": "form" + "style": "simple" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MessageOut" - } - } - }, - "description": "" + "202": { + "description": "no content" }, "400": { "content": { @@ -15169,213 +17467,79 @@ "HTTPBearer": [] } ], - "summary": "Get Message", + "summary": "Resend Webhook", "tags": [ - "Message" + "Message Attempt" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageOut = await svix.message.get(\"app_id\", \"msg_id\");" + "source": "await svix.messageAttempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageOut = await svix.message.get(\"app_id\", \"msg_id\");" + "source": "await svix.messageAttempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "message_out = svix.message.get(\"app_id\", \"msg_id\")" + "source": "svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_out = await svix.message.get(\"app_id\", \"msg_id\")" + "source": "await svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "messageOut, err := svixClient.Message.Get(ctx, \"app_id\", \"msg_id\")" + "source": "err := svixClient.MessageAttempt.Resend(ctx, \"app_id\", \"msg_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageOut = svix.message.get(\"app_id\", \"msg_id\")" + "source": "svix.messageAttempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "MessageOut messageOut = svix.getMessage().get(\"app_id\", \"msg_id\")" + "source": "svix.getMessageAttempt().resend(\"app_id\", \"msg_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_out = svix.message.get(\"app_id\", \"msg_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let message_out = svix.message().get(\"app_id\", \"msg_id\").await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var messageOut = await svix.Message.GetAsync(\"app_id\", \"msg_id\")" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix message get \"app_id\" \"msg_id\"" - }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" - } - ] - } - }, - "/api/v1/app/{app_id}/msg/{msg_id}/attempt": { - "get": { - "deprecated": true, - "description": "Deprecated: Please use \"List Attempts by Endpoint\" and \"List Attempts by Msg\" instead.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n\n`msg_id`: Use a message id or a message `eventId`", - "operationId": "v1.message-attempt.list-by-msg-deprecated", - "parameters": [ - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter the attempts based on the attempted endpoint", - "in": "query", - "name": "endpoint_id", - "schema": { - "description": "Filter the attempts based on the attempted endpoint", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the channel", - "in": "query", - "name": "channel", - "schema": { - "description": "Filter response based on the channel", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the tag", - "in": "query", - "name": "tag", - "schema": { - "description": "Filter response based on the tag", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the delivery status", - "in": "query", - "name": "status", - "schema": { - "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the delivery status", - "nullable": true - }, - "style": "form" - }, - { - "description": "Only include items created before a certain date", - "in": "query", - "name": "before", - "schema": { - "description": "Only include items created before a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only include items created after a certain date", - "in": "query", - "name": "after", - "schema": { - "description": "Only include items created after a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" + "source": "svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\")" }, { - "description": "Filter response based on the HTTP status code", - "in": "query", - "name": "status_code_class", - "schema": { - "$ref": "#/components/schemas/StatusCodeClass", - "description": "Filter response based on the HTTP status code", - "nullable": true - }, - "style": "form" + "label": "Rust", + "lang": "Rust", + "source": "svix.message_attempt().resend(\"app_id\", \"msg_id\", \"endpoint_id\", None).await?;" }, { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", - "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" + "label": "C#", + "lang": "C#", + "source": "await svix.MessageAttempt.ResendAsync(\"app_id\", \"msg_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt resend \"app_id\" \"msg_id\" \"endpoint_id\"" }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/raw": { + "get": { + "description": "Get a message raw payload by its ID or eventID.", + "operationId": "v1.message.get_raw_payload", + "parameters": [ { "description": "The app's ID or UID", "in": "path", @@ -15412,7 +17576,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_MessageAttemptOut_" + "$ref": "#/components/schemas/MessageRawPayloadOut" } } }, @@ -15494,78 +17658,78 @@ "HTTPBearer": [] } ], - "summary": "List Attempts", + "summary": "Get Raw Message Payload", "tags": [ - "Message Attempt" + "Message" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\");" + "source": "const messageRawPayloadOut = await svix.message.get(\"app_id\", \"msg_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\");" + "source": "const messageRawPayloadOut = await svix.message.get(\"app_id\", \"msg_id\");" }, { "label": "Python", "lang": "Python", - "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\", None)" + "source": "message_raw_payload_out = svix.message.get(\"app_id\", \"msg_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\", None)" + "source": "message_raw_payload_out = await svix.message.get(\"app_id\", \"msg_id\")" }, { "label": "Go", "lang": "Go", - "source": "listResponseMessageAttemptOut, err := svixClient.MessageAttempt.ListByMsgDeprecated(ctx, \"app_id\", \"msg_id\", nil)" + "source": "messageRawPayloadOut, err := svixClient.Message.Get(ctx, \"app_id\", \"msg_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseMessageAttemptOut = svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\")" + "source": "val messageRawPayloadOut = svix.message.get(\"app_id\", \"msg_id\")" }, { "label": "Java", "lang": "Java", - "source": "ListResponseMessageAttemptOut listResponseMessageAttemptOut = svix.getMessageAttempt().listByMsgDeprecated(\"app_id\", \"msg_id\")" + "source": "MessageRawPayloadOut messageRawPayloadOut = svix.getMessage().get(\"app_id\", \"msg_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\")" + "source": "message_raw_payload_out = svix.message.get(\"app_id\", \"msg_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_message_attempt_out = svix.message_attempt().list_by_msg_deprecated(\"app_id\", \"msg_id\", None).await?;" + "source": "let message_raw_payload_out = svix.message().get(\"app_id\", \"msg_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseMessageAttemptOut = await svix.MessageAttempt.ListByMsgDeprecatedAsync(\"app_id\", \"msg_id\")" + "source": "var messageRawPayloadOut = await svix.Message.GetAsync(\"app_id\", \"msg_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message-attempt list-by-msg-deprecated \"app_id\" \"msg_id\"" + "source": "svix message get \"app_id\" \"msg_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/raw' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}": { + "/api/v1/app/{app_id}/sink": { "get": { - "description": "`msg_id`: Use a message id or a message `eventId`", - "operationId": "v1.message-attempt.get", + "description": "List the application's sinks.", + "operationId": "v1.sink.list", "parameters": [ { "description": "The app's ID or UID", @@ -15583,31 +17747,40 @@ "style": "simple" }, { - "description": "The msg's ID or UID", - "in": "path", - "name": "msg_id", - "required": true, + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" }, - "style": "simple" + "style": "form" }, { - "description": "The attempt's ID", - "in": "path", - "name": "attempt_id", - "required": true, + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", "schema": { - "description": "The attempt's ID", - "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "description": "The iterator returned from a prior invocation", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, "type": "string" }, - "style": "simple" + "style": "form" + }, + { + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", + "schema": { + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true + }, + "style": "form" } ], "responses": { @@ -15615,7 +17788,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageAttemptOut" + "$ref": "#/components/schemas/ListResponse_SinkOut_" } } }, @@ -15697,78 +17870,76 @@ "HTTPBearer": [] } ], - "summary": "Get Attempt", + "summary": "List Sinks", "tags": [ - "Message Attempt" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageAttemptOut = await svix.messageAttempt.get(\"app_id\", \"msg_id\", \"attempt_id\");" + "source": "const listResponseSinkOut = await svix.sink.list(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageAttemptOut = await svix.messageAttempt.get(\"app_id\", \"msg_id\", \"attempt_id\");" + "source": "const listResponseSinkOut = await svix.sink.list(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "message_attempt_out = svix.message_attempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "list_response_sink_out = svix.sink.list(\"app_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_attempt_out = await svix.message_attempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "list_response_sink_out = await svix.sink.list(\"app_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "messageAttemptOut, err := svixClient.MessageAttempt.Get(ctx, \"app_id\", \"msg_id\", \"attempt_id\")" + "source": "listResponseSinkOut, err := svixClient.Sink.List(ctx, \"app_id\", nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageAttemptOut = svix.messageAttempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "val listResponseSinkOut = svix.sink.list(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "MessageAttemptOut messageAttemptOut = svix.getMessageAttempt().get(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "ListResponseSinkOut listResponseSinkOut = svix.getSink().list(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_attempt_out = svix.message_attempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "list_response_sink_out = svix.sink.list(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let message_attempt_out = svix.message_attempt().get(\"app_id\", \"msg_id\", \"attempt_id\").await?;" + "source": "let list_response_sink_out = svix.sink().list(\"app_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageAttemptOut = await svix.MessageAttempt.GetAsync(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "var listResponseSinkOut = await svix.Sink.ListAsync(\"app_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message-attempt get \"app_id\" \"msg_id\" \"attempt_id\"" + "source": "svix sink list \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/sink' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content": { - "delete": { - "description": "Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content.", - "operationId": "v1.message-attempt.expunge-content", + }, + "post": { + "description": "Create a new sink for the application.", + "operationId": "v1.sink.create", "parameters": [ { "description": "The app's ID or UID", @@ -15786,36 +17957,35 @@ "style": "simple" }, { - "description": "The msg's ID or UID", - "in": "path", - "name": "msg_id", - "required": true, - "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The attempt's ID", - "in": "path", - "name": "attempt_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The attempt's ID", - "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SinkIn" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "no content" + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SinkOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -15893,78 +18063,78 @@ "HTTPBearer": [] } ], - "summary": "Delete attempt response body", + "summary": "Create Sink", "tags": [ - "Message Attempt" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.messageAttempt.expungeContent(\"app_id\", \"msg_id\", \"attempt_id\");" + "source": "const sinkOut = await svix.sink.create(\"app_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"]\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.messageAttempt.expungeContent(\"app_id\", \"msg_id\", \"attempt_id\");" + "source": "const sinkOut = await svix.sink.create(\"app_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"]\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.message_attempt.expunge_content(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "sink_out = svix.sink.create(\"app_id\", SinkIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.message_attempt.expunge_content(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "sink_out = await svix.sink.create(\"app_id\", SinkIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n), None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.MessageAttempt.ExpungeContent(ctx, \"app_id\", \"msg_id\", \"attempt_id\")" + "source": "sinkOut, err := svixClient.Sink.Create(ctx, \"app_id\", &SinkIn{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n Disabled: false,\n FilterTypes: []string{\"user.signup\", \"user.deleted\"},\n Channels: []string{\"project_123\", \"group_2\"},\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.messageAttempt.expungeContent(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "val sinkOut = svix.sink.create(\"app_id\", SinkIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n .disabled(false)\n .filterTypes(arrayOf(\"user.signup\", \"user.deleted\"))\n .channels(arrayOf(\"project_123\", \"group_2\"))\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getMessageAttempt().expungeContent(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "SinkOut sinkOut = svix.getSink().create(\"app_id\", new SinkIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n .disabled(false)\n .filterTypes(new String[]{\"user.signup\", \"user.deleted\"})\n .channels(new String[]{\"project_123\", \"group_2\"})\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.message_attempt.expunge_content(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "sink_out = svix.sink.create(\"app_id\", Svix::SinkIn.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n \"disabled\": false,\n \"filter_types\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.message_attempt().expunge_content(\"app_id\", \"msg_id\", \"attempt_id\").await?;" + "source": "let sink_out = svix.sink().create(\"app_id\", SinkIn {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n secret: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n disabled: Some(false),\n filter_types: Some(vec![\"user.signup\".to_string(), \"user.deleted\".to_string()]),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.MessageAttempt.ExpungeContentAsync(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "var sinkOut = await svix.Sink.CreateAsync(\"app_id\", new SinkIn{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled: false,\n filterTypes: new string[] {\"user.signup\", \"user.deleted\"},\n channels: new string[] {\"project_123\", \"group_2\"}\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix message-attempt expunge-content \"app_id\" \"msg_id\" \"attempt_id\"" + "source": "svix sink create \"app_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/sink' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n }'" } ] } }, - "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/headers": { + "/api/v1/app/{app_id}/sink/{sink_id}": { "get": { - "description": "Calculate and return headers used on a given message attempt", - "operationId": "v1.message-attempt.get-headers", + "description": "Get a sink.", + "operationId": "v1.sink.get", "parameters": [ { "description": "The app's ID or UID", @@ -15982,28 +18152,16 @@ "style": "simple" }, { - "description": "The msg's ID or UID", - "in": "path", - "name": "msg_id", - "required": true, - "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The attempt's ID", + "description": "The ep's ID or UID", "in": "path", - "name": "attempt_id", + "name": "sink_id", "required": true, "schema": { - "description": "The attempt's ID", - "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" @@ -16014,7 +18172,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageAttemptHeadersOut" + "$ref": "#/components/schemas/SinkOut" } } }, @@ -16096,102 +18254,111 @@ "HTTPBearer": [] } ], - "summary": "Get Attempt Headers", + "summary": "Get Sink", "tags": [ - "Message Attempt" + "Endpoint" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageAttemptHeadersOut = await svix.messageAttempt.getHeaders(\"app_id\", \"msg_id\", \"attempt_id\");" + "source": "const sinkOut = await svix.sink.get(\"app_id\", \"sink_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageAttemptHeadersOut = await svix.messageAttempt.getHeaders(\"app_id\", \"msg_id\", \"attempt_id\");" + "source": "const sinkOut = await svix.sink.get(\"app_id\", \"sink_id\");" }, { "label": "Python", "lang": "Python", - "source": "message_attempt_headers_out = svix.message_attempt.get_headers(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "sink_out = svix.sink.get(\"app_id\", \"sink_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_attempt_headers_out = await svix.message_attempt.get_headers(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "sink_out = await svix.sink.get(\"app_id\", \"sink_id\")" }, { "label": "Go", "lang": "Go", - "source": "messageAttemptHeadersOut, err := svixClient.MessageAttempt.GetHeaders(ctx, \"app_id\", \"msg_id\", \"attempt_id\")" + "source": "sinkOut, err := svixClient.Sink.Get(ctx, \"app_id\", \"sink_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageAttemptHeadersOut = svix.messageAttempt.getHeaders(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "val sinkOut = svix.sink.get(\"app_id\", \"sink_id\")" }, { "label": "Java", "lang": "Java", - "source": "MessageAttemptHeadersOut messageAttemptHeadersOut = svix.getMessageAttempt().getHeaders(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "SinkOut sinkOut = svix.getSink().get(\"app_id\", \"sink_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_attempt_headers_out = svix.message_attempt.get_headers(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "sink_out = svix.sink.get(\"app_id\", \"sink_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let message_attempt_headers_out = svix.message_attempt().get_headers(\"app_id\", \"msg_id\", \"attempt_id\").await?;" + "source": "let sink_out = svix.sink().get(\"app_id\", \"sink_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageAttemptHeadersOut = await svix.MessageAttempt.GetHeadersAsync(\"app_id\", \"msg_id\", \"attempt_id\")" + "source": "var sinkOut = await svix.Sink.GetAsync(\"app_id\", \"sink_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message-attempt get-headers \"app_id\" \"msg_id\" \"attempt_id\"" + "source": "svix sink get \"app_id\" \"sink_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/sink/{sink_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/msg/{msg_id}/content": { - "delete": { - "description": "Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content.\n\nThe message can't be replayed or resent once its payload has been deleted or expired.", - "operationId": "v1.message.expunge-content", + "/api/v1/app/{app_id}/stats": { + "get": { + "description": "Get basic statistics for the application", + "operationId": "v1.application.get-stats", "parameters": [ { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", + "description": "Filter the range to data starting from this date", + "in": "query", + "name": "since", "required": true, "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "description": "Filter the range to data starting from this date", + "format": "date-time", "type": "string" }, - "style": "simple" + "style": "form" }, { - "description": "The msg's ID or UID", + "description": "Filter the range to data ending by this date", + "in": "query", + "name": "until", + "required": true, + "schema": { + "description": "Filter the range to data ending by this date", + "format": "date-time", + "type": "string" + }, + "style": "form" + }, + { + "description": "The app's ID or UID", "in": "path", - "name": "msg_id", + "name": "app_id", "required": true, "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", + "description": "The app's ID or UID", + "example": "unique-app-identifier", "maxLength": 256, "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_.]+$", @@ -16201,8 +18368,15 @@ } ], "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationStats" + } + } + }, + "description": "" }, "400": { "content": { @@ -16280,104 +18454,79 @@ "HTTPBearer": [] } ], - "summary": "Delete message payload", + "summary": "Get App Stats", "tags": [ - "Message" + "Application" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.message.expungeContent(\"app_id\", \"msg_id\");" + "source": "const applicationStats = await svix.application.getStats(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.message.expungeContent(\"app_id\", \"msg_id\");" + "source": "const applicationStats = await svix.application.getStats(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "svix.message.expunge_content(\"app_id\", \"msg_id\")" + "source": "application_stats = svix.application.get_stats(\"app_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.message.expunge_content(\"app_id\", \"msg_id\")" + "source": "application_stats = await svix.application.get_stats(\"app_id\")" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Message.ExpungeContent(ctx, \"app_id\", \"msg_id\")" + "source": "applicationStats, err := svixClient.Application.GetStats(ctx, \"app_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.message.expungeContent(\"app_id\", \"msg_id\")" + "source": "val applicationStats = svix.application.getStats(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "svix.getMessage().expungeContent(\"app_id\", \"msg_id\")" + "source": "ApplicationStats applicationStats = svix.getApplication().getStats(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.message.expunge_content(\"app_id\", \"msg_id\")" + "source": "application_stats = svix.application.get_stats(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "svix.message().expunge_content(\"app_id\", \"msg_id\").await?;" + "source": "let application_stats = svix.application().get_stats(\"app_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Message.ExpungeContentAsync(\"app_id\", \"msg_id\")" + "source": "var applicationStats = await svix.Application.GetStatsAsync(\"app_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message expunge-content \"app_id\" \"msg_id\"" + "source": "svix application get-stats \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/content' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/stats' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/msg/{msg_id}/endpoint": { - "get": { - "description": "List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt.\nBy default, endpoints are listed in ascending order by ID.", - "operationId": "v1.message-attempt.list-attempted-destinations", + "/api/v1/auth/app-portal-access/{app_id}": { + "post": { + "description": "Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.", + "operationId": "v1.authentication.app-portal-access", "parameters": [ - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, - "type": "string" - }, - "style": "form" - }, { "description": "The app's ID or UID", "in": "path", @@ -16394,27 +18543,31 @@ "style": "simple" }, { - "description": "The msg's ID or UID", - "in": "path", - "name": "msg_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AppPortalAccessIn" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_MessageEndpointOut_" + "$ref": "#/components/schemas/AppPortalAccessOut" } } }, @@ -16496,187 +18649,79 @@ "HTTPBearer": [] } ], - "summary": "List Attempted Destinations", + "summary": "Get Consumer App Portal Access", "tags": [ - "Message Attempt" + "Authentication" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseMessageEndpointOut = await svix.messageAttempt.listAttemptedDestinations(\"app_id\", \"msg_id\");" + "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null,\n application: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseMessageEndpointOut = await svix.messageAttempt.listAttemptedDestinations(\"app_id\", \"msg_id\");" + "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null,\n application: null\n});" }, { "label": "Python", "lang": "Python", - "source": "list_response_message_endpoint_out = svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\", None)" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "list_response_message_endpoint_out = await svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\", None)" - }, - { - "label": "Go", - "lang": "Go", - "source": "listResponseMessageEndpointOut, err := svixClient.MessageAttempt.ListAttemptedDestinations(ctx, \"app_id\", \"msg_id\", nil)" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val listResponseMessageEndpointOut = svix.messageAttempt.listAttemptedDestinations(\"app_id\", \"msg_id\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "ListResponseMessageEndpointOut listResponseMessageEndpointOut = svix.getMessageAttempt().listAttemptedDestinations(\"app_id\", \"msg_id\")" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "list_response_message_endpoint_out = svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let list_response_message_endpoint_out = svix.message_attempt().list_attempted_destinations(\"app_id\", \"msg_id\", None).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var listResponseMessageEndpointOut = await svix.MessageAttempt.ListAttemptedDestinationsAsync(\"app_id\", \"msg_id\")" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix message-attempt list-attempted-destinations \"app_id\" \"msg_id\"" - }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" - } - ] - } - }, - "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt": { - "get": { - "deprecated": true, - "description": "DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead.\n\nList the message attempts for a particular endpoint.\n\nReturning the endpoint.\n\nThe `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", - "operationId": "v1.message-attempt.list-by-endpoint-deprecated", - "parameters": [ - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" + "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None,\n application=None\n), None)" }, { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, - "type": "string" - }, - "style": "form" + "label": "Python (Async)", + "lang": "Python", + "source": "app_portal_access_out = await svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None,\n application=None\n), None)" }, { - "description": "Filter response based on the channel", - "in": "query", - "name": "channel", - "schema": { - "description": "Filter response based on the channel", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", - "type": "string" - }, - "style": "form" + "label": "Go", + "lang": "Go", + "source": "appPortalAccessOut, err := svixClient.Authentication.AppPortalAccess(ctx, \"app_id\", &AppPortalAccessIn{\n FeatureFlags: []interface{}{},\n Expiry: nil,\n ReadOnly: nil,\n Application: nil,\n})" }, { - "description": "Filter response based on the tag", - "in": "query", - "name": "tag", - "schema": { - "description": "Filter response based on the tag", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "form" + "label": "Kotlin", + "lang": "Kotlin", + "source": "val appPortalAccessOut = svix.authentication.appPortalAccess(\"app_id\", AppPortalAccessIn()\n .featureFlags(arrayOf())\n .expiry(null)\n .readOnly(null)\n .application(null)\n)" }, { - "description": "Filter response based on the delivery status", - "in": "query", - "name": "status", - "schema": { - "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the delivery status", - "nullable": true - }, - "style": "form" + "label": "Java", + "lang": "Java", + "source": "AppPortalAccessOut appPortalAccessOut = svix.getAuthentication().appPortalAccess(\"app_id\", new AppPortalAccessIn()\n .featureFlags(new Object[]{})\n .expiry(null)\n .readOnly(null)\n .application(null)\n)" }, { - "description": "Only include items created before a certain date", - "in": "query", - "name": "before", - "schema": { - "description": "Only include items created before a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" + "label": "Ruby", + "lang": "Ruby", + "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", Svix::AppPortalAccessIn.new({\n \"feature_flags\": [],\n \"expiry\": nil,\n \"read_only\": nil,\n \"application\": nil\n}))" }, { - "description": "Only include items created after a certain date", - "in": "query", - "name": "after", - "schema": { - "description": "Only include items created after a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" + "label": "Rust", + "lang": "Rust", + "source": "let app_portal_access_out = svix.authentication().app_portal_access(\"app_id\", AppPortalAccessIn {\n feature_flags: Some(vec![]),\n expiry: None,\n read_only: None,\n application: None,\n}, None).await?;" }, { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", - "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" + "label": "C#", + "lang": "C#", + "source": "var appPortalAccessOut = await svix.Authentication.AppPortalAccessAsync(\"app_id\", new AppPortalAccessIn{\n featureFlags: new Object[] {},\n expiry: null,\n readOnly: null,\n application: null\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix authentication app-portal-access \"app_id\" '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null,\n \"application\": null\n}'" }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app-portal-access/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null,\n \"application\": null\n }'" + } + ] + } + }, + "/api/v1/auth/app/{app_id}/create-message-token": { + "post": { + "description": "Create a new access token that only allows creating messages inside this application.", + "operationId": "v1.authentication.create-message-token", + "parameters": [ { "description": "The app's ID or UID", "in": "path", @@ -16693,42 +18738,31 @@ "style": "simple" }, { - "description": "The msg's ID or UID", - "in": "path", - "name": "msg_id", - "required": true, - "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The ep's ID or UID", - "in": "path", - "name": "endpoint_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMessageTokenIn" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_MessageAttemptEndpointOut_" + "$ref": "#/components/schemas/AuthTokenOut" } } }, @@ -16810,78 +18844,78 @@ "HTTPBearer": [] } ], - "summary": "List Attempts For Endpoint", + "summary": "Create Cmg Token", "tags": [ - "Message Attempt" + "Authentication" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseMessageAttemptEndpointOut = await svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\");" + "source": "const authTokenOut = await svix.authentication.createMessageToken(\"app_id\", {\n expiry: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseMessageAttemptEndpointOut = await svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\");" + "source": "const authTokenOut = await svix.authentication.createMessageToken(\"app_id\", {\n expiry: null\n});" }, { "label": "Python", "lang": "Python", - "source": "list_response_message_attempt_endpoint_out = svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + "source": "auth_token_out = svix.authentication.create_message_token(\"app_id\", CreateMessageTokenIn(\n expiry=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_attempt_endpoint_out = await svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + "source": "auth_token_out = await svix.authentication.create_message_token(\"app_id\", CreateMessageTokenIn(\n expiry=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "listResponseMessageAttemptEndpointOut, err := svixClient.MessageAttempt.ListByEndpointDeprecated(ctx, \"app_id\", \"msg_id\", \"endpoint_id\", nil)" + "source": "authTokenOut, err := svixClient.Authentication.CreateMessageToken(ctx, \"app_id\", &CreateMessageTokenIn{\n Expiry: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseMessageAttemptEndpointOut = svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" + "source": "val authTokenOut = svix.authentication.createMessageToken(\"app_id\", CreateMessageTokenIn()\n .expiry(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "ListResponseMessageAttemptEndpointOut listResponseMessageAttemptEndpointOut = svix.getMessageAttempt().listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" + "source": "AuthTokenOut authTokenOut = svix.getAuthentication().createMessageToken(\"app_id\", new CreateMessageTokenIn()\n .expiry(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_message_attempt_endpoint_out = svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" + "source": "auth_token_out = svix.authentication.create_message_token(\"app_id\", Svix::CreateMessageTokenIn.new({\n \"expiry\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_message_attempt_endpoint_out = svix.message_attempt().list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None).await?;" + "source": "let auth_token_out = svix.authentication().create_message_token(\"app_id\", CreateMessageTokenIn {\n expiry: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseMessageAttemptEndpointOut = await svix.MessageAttempt.ListByEndpointDeprecatedAsync(\"app_id\", \"msg_id\", \"endpoint_id\")" + "source": "var authTokenOut = await svix.Authentication.CreateMessageTokenAsync(\"app_id\", new CreateMessageTokenIn{\n expiry: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix message-attempt list-by-endpoint-deprecated \"app_id\" \"msg_id\" \"endpoint_id\"" + "source": "svix authentication create-message-token \"app_id\" '{\n \"expiry\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app/{app_id}/create-message-token' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"expiry\": null\n }'" } ] } }, - "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend": { + "/api/v1/auth/app/{app_id}/expire-all": { "post": { - "description": "Resend a message to the specified endpoint.", - "operationId": "v1.message-attempt.resend", + "description": "Expire all of the tokens associated with a specific Application", + "operationId": "v1.authentication.expire-all", "parameters": [ { "description": "The app's ID or UID", @@ -16898,36 +18932,6 @@ }, "style": "simple" }, - { - "description": "The msg's ID or UID", - "in": "path", - "name": "msg_id", - "required": true, - "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The ep's ID or UID", - "in": "path", - "name": "endpoint_id", - "required": true, - "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, { "description": "The request's idempotency key", "in": "header", @@ -16938,8 +18942,18 @@ "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationTokenExpireIn" + } + } + }, + "required": true + }, "responses": { - "202": { + "204": { "description": "no content" }, "400": { @@ -17018,78 +19032,79 @@ "HTTPBearer": [] } ], - "summary": "Resend Webhook", + "summary": "Expire All", "tags": [ - "Message Attempt" + "Authentication" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.messageAttempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\");" + "source": "await svix.authentication.expireAll(\"app_id\", {\n expiry: 60\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.messageAttempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\");" + "source": "await svix.authentication.expireAll(\"app_id\", {\n expiry: 60\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + "source": "svix.authentication.expire_all(\"app_id\", ApplicationTokenExpireIn(\n expiry=60\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + "source": "await svix.authentication.expire_all(\"app_id\", ApplicationTokenExpireIn(\n expiry=60\n), None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.MessageAttempt.Resend(ctx, \"app_id\", \"msg_id\", \"endpoint_id\")" + "source": "err := svixClient.Authentication.ExpireAll(ctx, \"app_id\", &ApplicationTokenExpireIn{\n Expiry: 60,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.messageAttempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\")" + "source": "svix.authentication.expireAll(\"app_id\", ApplicationTokenExpireIn()\n .expiry(60)\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getMessageAttempt().resend(\"app_id\", \"msg_id\", \"endpoint_id\")" + "source": "svix.getAuthentication().expireAll(\"app_id\", new ApplicationTokenExpireIn()\n .expiry(60)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\")" + "source": "svix.authentication.expire_all(\"app_id\", Svix::ApplicationTokenExpireIn.new({\n \"expiry\": 60\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.message_attempt().resend(\"app_id\", \"msg_id\", \"endpoint_id\", None).await?;" + "source": "svix.authentication().expire_all(\"app_id\", ApplicationTokenExpireIn {\n expiry: Some(60),\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.MessageAttempt.ResendAsync(\"app_id\", \"msg_id\", \"endpoint_id\")" + "source": "await svix.Authentication.ExpireAllAsync(\"app_id\", new ApplicationTokenExpireIn{\n expiry: 60\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix message-attempt resend \"app_id\" \"msg_id\" \"endpoint_id\"" + "source": "svix authentication expire-all \"app_id\" '{\n \"expiry\": 60\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app/{app_id}/expire-all' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"expiry\": 60\n }'" } ] } }, - "/api/v1/app/{app_id}/msg/{msg_id}/raw": { - "get": { - "description": "Get a message raw payload by its ID or eventID.", - "operationId": "v1.message.get_raw_payload", + "/api/v1/auth/dashboard-access/{app_id}": { + "post": { + "deprecated": true, + "description": "DEPRECATED: Please use `app-portal-access` instead.\n\nUse this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.", + "operationId": "v1.authentication.dashboard-access", "parameters": [ { "description": "The app's ID or UID", @@ -17107,16 +19122,10 @@ "style": "simple" }, { - "description": "The msg's ID or UID", - "in": "path", - "name": "msg_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" @@ -17127,7 +19136,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageRawPayloadOut" + "$ref": "#/components/schemas/DashboardAccessOut" } } }, @@ -17209,141 +19218,92 @@ "HTTPBearer": [] } ], - "summary": "Get Raw Message Payload", + "summary": "Dashboard Access", "tags": [ - "Message" + "Authentication" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageRawPayloadOut = await svix.message.get(\"app_id\", \"msg_id\");" + "source": "const dashboardAccessOut = await svix.authentication.dashboardAccess(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageRawPayloadOut = await svix.message.get(\"app_id\", \"msg_id\");" + "source": "const dashboardAccessOut = await svix.authentication.dashboardAccess(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "message_raw_payload_out = svix.message.get(\"app_id\", \"msg_id\")" + "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_raw_payload_out = await svix.message.get(\"app_id\", \"msg_id\")" + "source": "dashboard_access_out = await svix.authentication.dashboard_access(\"app_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "messageRawPayloadOut, err := svixClient.Message.Get(ctx, \"app_id\", \"msg_id\")" + "source": "dashboardAccessOut, err := svixClient.Authentication.DashboardAccess(ctx, \"app_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageRawPayloadOut = svix.message.get(\"app_id\", \"msg_id\")" + "source": "val dashboardAccessOut = svix.authentication.dashboardAccess(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "MessageRawPayloadOut messageRawPayloadOut = svix.getMessage().get(\"app_id\", \"msg_id\")" + "source": "DashboardAccessOut dashboardAccessOut = svix.getAuthentication().dashboardAccess(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_raw_payload_out = svix.message.get(\"app_id\", \"msg_id\")" + "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let message_raw_payload_out = svix.message().get(\"app_id\", \"msg_id\").await?;" + "source": "let dashboard_access_out = svix.authentication().dashboard_access(\"app_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageRawPayloadOut = await svix.Message.GetAsync(\"app_id\", \"msg_id\")" + "source": "var dashboardAccessOut = await svix.Authentication.DashboardAccessAsync(\"app_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message get \"app_id\" \"msg_id\"" + "source": "svix authentication dashboard-access \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/raw' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/dashboard-access/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/sink": { - "get": { - "description": "List the application's sinks.", - "operationId": "v1.sink.list", + "/api/v1/auth/logout": { + "post": { + "description": "Logout an app token.\n\nTrying to log out other tokens will fail.", + "operationId": "v1.authentication.logout", "parameters": [ { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" - }, - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "The sorting order of the returned items", - "in": "query", - "name": "order", - "schema": { - "$ref": "#/components/schemas/Ordering", - "description": "The sorting order of the returned items", - "nullable": true - }, - "style": "form" } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListResponse_SinkOut_" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -17421,92 +19381,79 @@ "HTTPBearer": [] } ], - "summary": "List Sinks", + "summary": "Logout", "tags": [ - "Endpoint" + "Authentication" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseSinkOut = await svix.sink.list(\"app_id\");" + "source": "await svix.authentication.logout();" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseSinkOut = await svix.sink.list(\"app_id\");" + "source": "await svix.authentication.logout();" }, { "label": "Python", "lang": "Python", - "source": "list_response_sink_out = svix.sink.list(\"app_id\", None)" + "source": "svix.authentication.logout(None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_sink_out = await svix.sink.list(\"app_id\", None)" + "source": "await svix.authentication.logout(None)" }, { "label": "Go", "lang": "Go", - "source": "listResponseSinkOut, err := svixClient.Sink.List(ctx, \"app_id\", nil)" + "source": "err := svixClient.Authentication.Logout(ctx)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseSinkOut = svix.sink.list(\"app_id\")" + "source": "svix.authentication.logout()" }, { "label": "Java", "lang": "Java", - "source": "ListResponseSinkOut listResponseSinkOut = svix.getSink().list(\"app_id\")" + "source": "svix.getAuthentication().logout()" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_sink_out = svix.sink.list(\"app_id\")" + "source": "svix.authentication.logout()" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_sink_out = svix.sink().list(\"app_id\", None).await?;" + "source": "svix.authentication().logout(None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseSinkOut = await svix.Sink.ListAsync(\"app_id\")" + "source": "await svix.Authentication.LogoutAsync()" }, { "label": "CLI", "lang": "Shell", - "source": "svix sink list \"app_id\"" + "source": "svix authentication logout " }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/sink' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/logout' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - }, + } + }, + "/api/v1/auth/one-time-token": { "post": { - "description": "Create a new sink for the application.", - "operationId": "v1.sink.create", + "description": "This is a one time token", + "operationId": "v1.authentication.exchange-one-time-token", "parameters": [ - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, { "description": "The request's idempotency key", "in": "header", @@ -17521,18 +19468,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SinkIn" + "$ref": "#/components/schemas/OneTimeTokenIn" } } }, "required": true }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SinkOut" + "$ref": "#/components/schemas/OneTimeTokenOut" } } }, @@ -17614,108 +19561,135 @@ "HTTPBearer": [] } ], - "summary": "Create Sink", + "summary": "Exchange One Time Token", "tags": [ - "Endpoint" + "Authentication" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const sinkOut = await svix.sink.create(\"app_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"]\n});" + "source": "const oneTimeTokenOut = await svix.authentication.exchangeOneTimeToken(\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const sinkOut = await svix.sink.create(\"app_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"]\n});" + "source": "const oneTimeTokenOut = await svix.authentication.exchangeOneTimeToken(\n});" }, { "label": "Python", "lang": "Python", - "source": "sink_out = svix.sink.create(\"app_id\", SinkIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n), None)" + "source": "one_time_token_out = svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "sink_out = await svix.sink.create(\"app_id\", SinkIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n), None)" + "source": "one_time_token_out = await svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), None)" }, { "label": "Go", "lang": "Go", - "source": "sinkOut, err := svixClient.Sink.Create(ctx, \"app_id\", &SinkIn{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n Disabled: false,\n FilterTypes: []string{\"user.signup\", \"user.deleted\"},\n Channels: []string{\"project_123\", \"group_2\"},\n})" + "source": "oneTimeTokenOut, err := svixClient.Authentication.ExchangeOneTimeToken(ctx, &OneTimeTokenIn{\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val sinkOut = svix.sink.create(\"app_id\", SinkIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n .disabled(false)\n .filterTypes(arrayOf(\"user.signup\", \"user.deleted\"))\n .channels(arrayOf(\"project_123\", \"group_2\"))\n)" + "source": "val oneTimeTokenOut = svix.authentication.exchangeOneTimeToken(OneTimeTokenIn()\n)" }, { "label": "Java", "lang": "Java", - "source": "SinkOut sinkOut = svix.getSink().create(\"app_id\", new SinkIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n .disabled(false)\n .filterTypes(new String[]{\"user.signup\", \"user.deleted\"})\n .channels(new String[]{\"project_123\", \"group_2\"})\n)" + "source": "OneTimeTokenOut oneTimeTokenOut = svix.getAuthentication().exchangeOneTimeToken(new OneTimeTokenIn()\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "sink_out = svix.sink.create(\"app_id\", Svix::SinkIn.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n \"disabled\": false,\n \"filter_types\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n}))" + "source": "one_time_token_out = svix.authentication.exchange_one_time_token(Svix::OneTimeTokenIn.new(\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let sink_out = svix.sink().create(\"app_id\", SinkIn {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n secret: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n disabled: Some(false),\n filter_types: Some(vec![\"user.signup\".to_string(), \"user.deleted\".to_string()]),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n}, None).await?;" + "source": "let one_time_token_out = svix.authentication().exchange_one_time_token(OneTimeTokenIn {\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var sinkOut = await svix.Sink.CreateAsync(\"app_id\", new SinkIn{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled: false,\n filterTypes: new string[] {\"user.signup\", \"user.deleted\"},\n channels: new string[] {\"project_123\", \"group_2\"}\n})" + "source": "var oneTimeTokenOut = await svix.Authentication.ExchangeOneTimeTokenAsync(new OneTimeTokenIn\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix sink create \"app_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n}'" + "source": "svix authentication exchange-one-time-token '\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/sink' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/one-time-token' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '\n }'" } ] } }, - "/api/v1/app/{app_id}/sink/{sink_id}": { + "/api/v1/background-task": { "get": { - "description": "Get a sink.", - "operationId": "v1.sink.get", + "description": "List background tasks executed in the past 90 days.", + "operationId": "list_background_tasks", "parameters": [ { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, + "description": "Filter the response based on the status", + "in": "query", + "name": "status", + "schema": { + "$ref": "#/components/schemas/BackgroundTaskStatus", + "description": "Filter the response based on the status", + "nullable": true + }, + "style": "form" + }, + { + "description": "Filter the response based on the type", + "in": "query", + "name": "task", + "schema": { + "$ref": "#/components/schemas/BackgroundTaskType", + "description": "Filter the response based on the type", + "nullable": true + }, + "style": "form" + }, + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "description": "The iterator returned from a prior invocation", + "nullable": true, "type": "string" }, - "style": "simple" + "style": "form" }, { - "description": "The ep's ID or UID", - "in": "path", - "name": "sink_id", - "required": true, + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true }, - "style": "simple" + "style": "form" } ], "responses": { @@ -17723,7 +19697,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SinkOut" + "$ref": "#/components/schemas/ListResponse_BackgroundTaskOut_" } } }, @@ -17805,114 +19779,22 @@ "HTTPBearer": [] } ], - "summary": "Get Sink", + "summary": "List Background Tasks", "tags": [ - "Endpoint" - ], - "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const sinkOut = await svix.sink.get(\"app_id\", \"sink_id\");" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const sinkOut = await svix.sink.get(\"app_id\", \"sink_id\");" - }, - { - "label": "Python", - "lang": "Python", - "source": "sink_out = svix.sink.get(\"app_id\", \"sink_id\")" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "sink_out = await svix.sink.get(\"app_id\", \"sink_id\")" - }, - { - "label": "Go", - "lang": "Go", - "source": "sinkOut, err := svixClient.Sink.Get(ctx, \"app_id\", \"sink_id\")" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val sinkOut = svix.sink.get(\"app_id\", \"sink_id\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "SinkOut sinkOut = svix.getSink().get(\"app_id\", \"sink_id\")" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "sink_out = svix.sink.get(\"app_id\", \"sink_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let sink_out = svix.sink().get(\"app_id\", \"sink_id\").await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var sinkOut = await svix.Sink.GetAsync(\"app_id\", \"sink_id\")" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix sink get \"app_id\" \"sink_id\"" - }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/sink/{sink_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" - } + "Background Tasks" ] } }, - "/api/v1/app/{app_id}/stats": { + "/api/v1/background-task/{task_id}": { "get": { - "description": "Get basic statistics for the application", - "operationId": "v1.application.get-stats", + "description": "Get a background task by ID.", + "operationId": "get_background_task", "parameters": [ { - "description": "Filter the range to data starting from this date", - "in": "query", - "name": "since", - "required": true, - "schema": { - "description": "Filter the range to data starting from this date", - "format": "date-time", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter the range to data ending by this date", - "in": "query", - "name": "until", - "required": true, - "schema": { - "description": "Filter the range to data ending by this date", - "format": "date-time", - "type": "string" - }, - "style": "form" - }, - { - "description": "The app's ID or UID", "in": "path", - "name": "app_id", + "name": "task_id", "required": true, "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" @@ -17923,7 +19805,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationStats" + "$ref": "#/components/schemas/BackgroundTaskOut" } } }, @@ -18005,120 +19887,22 @@ "HTTPBearer": [] } ], - "summary": "Get App Stats", + "summary": "Get Background Task", "tags": [ - "Application" - ], - "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const applicationStats = await svix.application.getStats(\"app_id\");" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const applicationStats = await svix.application.getStats(\"app_id\");" - }, - { - "label": "Python", - "lang": "Python", - "source": "application_stats = svix.application.get_stats(\"app_id\")" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "application_stats = await svix.application.get_stats(\"app_id\")" - }, - { - "label": "Go", - "lang": "Go", - "source": "applicationStats, err := svixClient.Application.GetStats(ctx, \"app_id\")" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val applicationStats = svix.application.getStats(\"app_id\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "ApplicationStats applicationStats = svix.getApplication().getStats(\"app_id\")" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "application_stats = svix.application.get_stats(\"app_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let application_stats = svix.application().get_stats(\"app_id\").await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var applicationStats = await svix.Application.GetStatsAsync(\"app_id\")" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix application get-stats \"app_id\"" - }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/stats' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" - } + "Background Tasks" ] } }, - "/api/v1/auth/app-portal-access/{app_id}": { - "post": { - "description": "Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.", - "operationId": "v1.authentication.app-portal-access", - "parameters": [ - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppPortalAccessIn" - } - } - }, - "required": true - }, + "/api/v1/environment/export": { + "get": { + "description": "Download a JSON file containing all org-settings and event types", + "operationId": "v1.environment.export.get", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AppPortalAccessOut" + "$ref": "#/components/schemas/EnvironmentOut" } } }, @@ -18200,94 +19984,77 @@ "HTTPBearer": [] } ], - "summary": "Get Consumer App Portal Access", + "summary": "Export Environment Configuration", "tags": [ - "Authentication" + "Environment" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null,\n application: null\n});" + "source": "const environmentOut = await svix.environment.export();" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null,\n application: null\n});" + "source": "const environmentOut = await svix.environment.export();" }, { "label": "Python", "lang": "Python", - "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None,\n application=None\n), None)" + "source": "environment_out = svix.environment.export()" }, { "label": "Python (Async)", "lang": "Python", - "source": "app_portal_access_out = await svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None,\n application=None\n), None)" + "source": "environment_out = await svix.environment.export()" }, { "label": "Go", "lang": "Go", - "source": "appPortalAccessOut, err := svixClient.Authentication.AppPortalAccess(ctx, \"app_id\", &AppPortalAccessIn{\n FeatureFlags: []interface{}{},\n Expiry: nil,\n ReadOnly: nil,\n Application: nil,\n})" + "source": "environmentOut, err := svixClient.Environment.Export(ctx)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val appPortalAccessOut = svix.authentication.appPortalAccess(\"app_id\", AppPortalAccessIn()\n .featureFlags(arrayOf())\n .expiry(null)\n .readOnly(null)\n .application(null)\n)" + "source": "val environmentOut = svix.environment.export()" }, { "label": "Java", "lang": "Java", - "source": "AppPortalAccessOut appPortalAccessOut = svix.getAuthentication().appPortalAccess(\"app_id\", new AppPortalAccessIn()\n .featureFlags(new Object[]{})\n .expiry(null)\n .readOnly(null)\n .application(null)\n)" + "source": "EnvironmentOut environmentOut = svix.getEnvironment().export()" }, { "label": "Ruby", "lang": "Ruby", - "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", Svix::AppPortalAccessIn.new({\n \"feature_flags\": [],\n \"expiry\": nil,\n \"read_only\": nil,\n \"application\": nil\n}))" + "source": "environment_out = svix.environment.export()" }, { "label": "Rust", "lang": "Rust", - "source": "let app_portal_access_out = svix.authentication().app_portal_access(\"app_id\", AppPortalAccessIn {\n feature_flags: Some(vec![]),\n expiry: None,\n read_only: None,\n application: None,\n}, None).await?;" + "source": "let environment_out = svix.environment().export().await?;" }, { "label": "C#", "lang": "C#", - "source": "var appPortalAccessOut = await svix.Authentication.AppPortalAccessAsync(\"app_id\", new AppPortalAccessIn{\n featureFlags: new Object[] {},\n expiry: null,\n readOnly: null,\n application: null\n})" + "source": "var environmentOut = await svix.Environment.ExportAsync()" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication app-portal-access \"app_id\" '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null,\n \"application\": null\n}'" + "source": "svix environment export " }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app-portal-access/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null,\n \"application\": null\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/environment/export' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/auth/app/{app_id}/create-message-token": { + }, "post": { - "description": "Create a new access token that only allows creating messages inside this application.", - "operationId": "v1.authentication.create-message-token", + "description": "Download a JSON file containing all org-settings and event types", + "operationId": "v1.environment.export", "parameters": [ - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, { "description": "The request's idempotency key", "in": "header", @@ -18298,22 +20065,12 @@ "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateMessageTokenIn" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AuthTokenOut" + "$ref": "#/components/schemas/EnvironmentOut" } } }, @@ -18395,94 +20152,79 @@ "HTTPBearer": [] } ], - "summary": "Create Cmg Token", + "summary": "Export Environment Configuration", "tags": [ - "Authentication" + "Environment" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const authTokenOut = await svix.authentication.createMessageToken(\"app_id\", {\n expiry: null\n});" + "source": "const environmentOut = await svix.environment.export();" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const authTokenOut = await svix.authentication.createMessageToken(\"app_id\", {\n expiry: null\n});" + "source": "const environmentOut = await svix.environment.export();" }, { "label": "Python", "lang": "Python", - "source": "auth_token_out = svix.authentication.create_message_token(\"app_id\", CreateMessageTokenIn(\n expiry=None\n), None)" + "source": "environment_out = svix.environment.export(None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "auth_token_out = await svix.authentication.create_message_token(\"app_id\", CreateMessageTokenIn(\n expiry=None\n), None)" + "source": "environment_out = await svix.environment.export(None)" }, { "label": "Go", "lang": "Go", - "source": "authTokenOut, err := svixClient.Authentication.CreateMessageToken(ctx, \"app_id\", &CreateMessageTokenIn{\n Expiry: nil,\n})" + "source": "environmentOut, err := svixClient.Environment.Export(ctx)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val authTokenOut = svix.authentication.createMessageToken(\"app_id\", CreateMessageTokenIn()\n .expiry(null)\n)" + "source": "val environmentOut = svix.environment.export()" }, { "label": "Java", "lang": "Java", - "source": "AuthTokenOut authTokenOut = svix.getAuthentication().createMessageToken(\"app_id\", new CreateMessageTokenIn()\n .expiry(null)\n)" + "source": "EnvironmentOut environmentOut = svix.getEnvironment().export()" }, { "label": "Ruby", "lang": "Ruby", - "source": "auth_token_out = svix.authentication.create_message_token(\"app_id\", Svix::CreateMessageTokenIn.new({\n \"expiry\": nil\n}))" + "source": "environment_out = svix.environment.export()" }, { "label": "Rust", "lang": "Rust", - "source": "let auth_token_out = svix.authentication().create_message_token(\"app_id\", CreateMessageTokenIn {\n expiry: None,\n}, None).await?;" + "source": "let environment_out = svix.environment().export(None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var authTokenOut = await svix.Authentication.CreateMessageTokenAsync(\"app_id\", new CreateMessageTokenIn{\n expiry: null\n})" + "source": "var environmentOut = await svix.Environment.ExportAsync()" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication create-message-token \"app_id\" '{\n \"expiry\": null\n}'" + "source": "svix environment export " }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app/{app_id}/create-message-token' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"expiry\": null\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/environment/export' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/auth/app/{app_id}/expire-all": { + "/api/v1/environment/import": { "post": { - "description": "Expire all of the tokens associated with a specific Application", - "operationId": "v1.authentication.expire-all", + "description": "Import a configuration into the active organization.\nIt doesn't delete anything, only adds/updates what was passed to it.", + "operationId": "v1.environment.import", "parameters": [ - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, { "description": "The request's idempotency key", "in": "header", @@ -18497,7 +20239,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApplicationTokenExpireIn" + "$ref": "#/components/schemas/EnvironmentIn" } } }, @@ -18583,111 +20325,84 @@ "HTTPBearer": [] } ], - "summary": "Expire All", + "summary": "Import Environment Configuration", "tags": [ - "Authentication" + "Environment" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.authentication.expireAll(\"app_id\", {\n expiry: 60\n});" + "source": "await svix.environment.import({\n eventTypes: null,\n settings: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.authentication.expireAll(\"app_id\", {\n expiry: 60\n});" + "source": "await svix.environment.import({\n eventTypes: null,\n settings: null\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.authentication.expire_all(\"app_id\", ApplicationTokenExpireIn(\n expiry=60\n), None)" + "source": "svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.authentication.expire_all(\"app_id\", ApplicationTokenExpireIn(\n expiry=60\n), None)" + "source": "await svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Authentication.ExpireAll(ctx, \"app_id\", &ApplicationTokenExpireIn{\n Expiry: 60,\n})" + "source": "err := svixClient.Environment.Import(ctx, &EnvironmentIn{\n EventTypes: nil,\n Settings: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.authentication.expireAll(\"app_id\", ApplicationTokenExpireIn()\n .expiry(60)\n)" + "source": "svix.environment.import(EnvironmentIn()\n .eventTypes(null)\n .settings(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getAuthentication().expireAll(\"app_id\", new ApplicationTokenExpireIn()\n .expiry(60)\n)" + "source": "svix.getEnvironment().import(new EnvironmentIn()\n .eventTypes(null)\n .settings(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.authentication.expire_all(\"app_id\", Svix::ApplicationTokenExpireIn.new({\n \"expiry\": 60\n}))" + "source": "svix.environment.import(Svix::EnvironmentIn.new({\n \"event_types\": nil,\n \"settings\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.authentication().expire_all(\"app_id\", ApplicationTokenExpireIn {\n expiry: Some(60),\n}, None).await?;" + "source": "svix.environment().import(EnvironmentIn {\n event_types: None,\n settings: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Authentication.ExpireAllAsync(\"app_id\", new ApplicationTokenExpireIn{\n expiry: 60\n})" + "source": "await svix.Environment.ImportAsync(new EnvironmentIn{\n eventTypes: null,\n settings: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication expire-all \"app_id\" '{\n \"expiry\": 60\n}'" + "source": "svix environment import '{\n \"eventTypes\": null,\n \"settings\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app/{app_id}/expire-all' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"expiry\": 60\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/environment/import' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventTypes\": null,\n \"settings\": null\n }'" } ] } }, - "/api/v1/auth/dashboard-access/{app_id}": { - "post": { - "deprecated": true, - "description": "DEPRECATED: Please use `app-portal-access` instead.\n\nUse this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.", - "operationId": "v1.authentication.dashboard-access", - "parameters": [ - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", - "schema": { - "type": "string" - }, - "style": "simple" - } - ], + "/api/v1/environment/settings": { + "get": { + "description": "Get the environment's settings", + "operationId": "v1.environment.get-settings", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DashboardAccessOut" + "$ref": "#/components/schemas/EnvironmentSettingsOut" } } }, @@ -18769,92 +20484,150 @@ "HTTPBearer": [] } ], - "summary": "Dashboard Access", + "summary": "Get Org Settings", "tags": [ - "Authentication" + "Environment-Settings" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const dashboardAccessOut = await svix.authentication.dashboardAccess(\"app_id\");" + "source": "const environmentSettingsOut = await svix.environment.getSettings();" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const dashboardAccessOut = await svix.authentication.dashboardAccess(\"app_id\");" + "source": "const environmentSettingsOut = await svix.environment.getSettings();" }, { "label": "Python", "lang": "Python", - "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\", None)" + "source": "environment_settings_out = svix.environment.get_settings()" }, { "label": "Python (Async)", "lang": "Python", - "source": "dashboard_access_out = await svix.authentication.dashboard_access(\"app_id\", None)" + "source": "environment_settings_out = await svix.environment.get_settings()" }, { "label": "Go", "lang": "Go", - "source": "dashboardAccessOut, err := svixClient.Authentication.DashboardAccess(ctx, \"app_id\")" + "source": "environmentSettingsOut, err := svixClient.Environment.GetSettings(ctx)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val dashboardAccessOut = svix.authentication.dashboardAccess(\"app_id\")" + "source": "val environmentSettingsOut = svix.environment.getSettings()" }, { "label": "Java", "lang": "Java", - "source": "DashboardAccessOut dashboardAccessOut = svix.getAuthentication().dashboardAccess(\"app_id\")" + "source": "EnvironmentSettingsOut environmentSettingsOut = svix.getEnvironment().getSettings()" }, { "label": "Ruby", "lang": "Ruby", - "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\")" + "source": "environment_settings_out = svix.environment.get_settings()" }, { "label": "Rust", "lang": "Rust", - "source": "let dashboard_access_out = svix.authentication().dashboard_access(\"app_id\", None).await?;" + "source": "let environment_settings_out = svix.environment().get_settings().await?;" }, { "label": "C#", "lang": "C#", - "source": "var dashboardAccessOut = await svix.Authentication.DashboardAccessAsync(\"app_id\")" + "source": "var environmentSettingsOut = await svix.Environment.GetSettingsAsync()" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication dashboard-access \"app_id\"" + "source": "svix environment get-settings " }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/dashboard-access/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/environment/settings' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/auth/logout": { - "post": { - "description": "Logout an app token.\n\nTrying to log out other tokens will fail.", - "operationId": "v1.authentication.logout", + "/api/v1/event-type": { + "get": { + "description": "Return the list of event types.", + "operationId": "v1.event-type.list", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "user.signup", + "maxLength": 256, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "form" + }, + { + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", + "schema": { + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true + }, + "style": "form" + }, + { + "description": "When `true` archived (deleted but not expunged) items are included in the response", + "in": "query", + "name": "include_archived", + "schema": { + "default": false, + "description": "When `true` archived (deleted but not expunged) items are included in the response", + "type": "boolean" + }, + "style": "form" + }, + { + "description": "When `true` the full item (including the schema) is included in the response", + "in": "query", + "name": "with_content", "schema": { - "type": "string" + "default": false, + "description": "When `true` the full item (including the schema) is included in the response", + "type": "boolean" }, - "style": "simple" + "style": "form" } ], "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_EventTypeOut_" + } + } + }, + "description": "" }, "400": { "content": { @@ -18932,78 +20705,76 @@ "HTTPBearer": [] } ], - "summary": "Logout", + "summary": "List Event Types", "tags": [ - "Authentication" + "Event Type" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.authentication.logout();" + "source": "const listResponseEventTypeOut = await svix.eventType.list();" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.authentication.logout();" + "source": "const listResponseEventTypeOut = await svix.eventType.list();" }, { "label": "Python", "lang": "Python", - "source": "svix.authentication.logout(None)" + "source": "list_response_event_type_out = svix.event_type.list(None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.authentication.logout(None)" + "source": "list_response_event_type_out = await svix.event_type.list(None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Authentication.Logout(ctx)" + "source": "listResponseEventTypeOut, err := svixClient.EventType.List(ctx, nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.authentication.logout()" + "source": "val listResponseEventTypeOut = svix.eventType.list()" }, { "label": "Java", "lang": "Java", - "source": "svix.getAuthentication().logout()" + "source": "ListResponseEventTypeOut listResponseEventTypeOut = svix.getEventType().list()" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.authentication.logout()" + "source": "list_response_event_type_out = svix.event_type.list()" }, { "label": "Rust", "lang": "Rust", - "source": "svix.authentication().logout(None).await?;" + "source": "let list_response_event_type_out = svix.event_type().list(None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Authentication.LogoutAsync()" + "source": "var listResponseEventTypeOut = await svix.EventType.ListAsync()" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication logout " + "source": "svix event-type list " }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/logout' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/event-type' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/auth/one-time-token": { + }, "post": { - "description": "This is a one time token", - "operationId": "v1.authentication.exchange-one-time-token", + "description": "Create new or unarchive existing event type.\n\nUnarchiving an event type will allow endpoints to filter on it and messages to be sent with it.\nEndpoints filtering on the event type before archival will continue to filter on it.\nThis operation does not preserve the description and schemas.", + "operationId": "v1.event-type.create", "parameters": [ { "description": "The request's idempotency key", @@ -19019,18 +20790,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OneTimeTokenIn" + "$ref": "#/components/schemas/EventTypeIn" } } }, "required": true }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OneTimeTokenOut" + "$ref": "#/components/schemas/EventTypeOut" } } }, @@ -19112,143 +20883,95 @@ "HTTPBearer": [] } ], - "summary": "Exchange One Time Token", + "summary": "Create Event Type", "tags": [ - "Authentication" + "Event Type" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const oneTimeTokenOut = await svix.authentication.exchangeOneTimeToken(\n});" + "source": "const eventTypeOut = await svix.eventType.create({\n name: \"user.signup\",\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const oneTimeTokenOut = await svix.authentication.exchangeOneTimeToken(\n});" + "source": "const eventTypeOut = await svix.eventType.create({\n name: \"user.signup\",\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" }, { "label": "Python", "lang": "Python", - "source": "one_time_token_out = svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), None)" + "source": "event_type_out = svix.event_type.create(EventTypeIn(\n name=\"user.signup\",\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "one_time_token_out = await svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), None)" + "source": "event_type_out = await svix.event_type.create(EventTypeIn(\n name=\"user.signup\",\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n), None)" }, { "label": "Go", "lang": "Go", - "source": "oneTimeTokenOut, err := svixClient.Authentication.ExchangeOneTimeToken(ctx, &OneTimeTokenIn{\n})" + "source": "eventTypeOut, err := svixClient.EventType.Create(ctx, &EventTypeIn{\n Name: \"user.signup\",\n Description: \"A user has signed up\",\n Archived: false,\n Schemas: map[interface{}]interface{}{\"1\": map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n FeatureFlag: \"cool-new-feature\",\n GroupName: \"user\",\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val oneTimeTokenOut = svix.authentication.exchangeOneTimeToken(OneTimeTokenIn()\n)" + "source": "val eventTypeOut = svix.eventType.create(EventTypeIn()\n .name(\"user.signup\")\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" }, { "label": "Java", "lang": "Java", - "source": "OneTimeTokenOut oneTimeTokenOut = svix.getAuthentication().exchangeOneTimeToken(new OneTimeTokenIn()\n)" + "source": "EventTypeOut eventTypeOut = svix.getEventType().create(new EventTypeIn()\n .name(\"user.signup\")\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "one_time_token_out = svix.authentication.exchange_one_time_token(Svix::OneTimeTokenIn.new(\n}))" + "source": "event_type_out = svix.event_type.create(Svix::EventTypeIn.new({\n \"name\": \"user.signup\",\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"feature_flag\": \"cool-new-feature\",\n \"group_name\": \"user\"\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let one_time_token_out = svix.authentication().exchange_one_time_token(OneTimeTokenIn {\n}, None).await?;" + "source": "let event_type_out = svix.event_type().create(EventTypeIn {\n name: \"user.signup\".to_string(),\n description: \"A user has signed up\".to_string(),\n archived: Some(false),\n schemas: Some(json!({\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}})),\n feature_flag: Some(\"cool-new-feature\".to_string()),\n group_name: Some(\"user\".to_string()),\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var oneTimeTokenOut = await svix.Authentication.ExchangeOneTimeTokenAsync(new OneTimeTokenIn\n})" + "source": "var eventTypeOut = await svix.EventType.CreateAsync(new EventTypeIn{\n name: \"user.signup\",\n description: \"A user has signed up\",\n archived: false,\n schemas: /* ... */,\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication exchange-one-time-token '\n}'" + "source": "svix event-type create '{\n \"name\": \"user.signup\",\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/one-time-token' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/event-type' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"user.signup\",\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n }'" } ] } }, - "/api/v1/background-task": { - "get": { - "description": "List background tasks executed in the past 90 days.", - "operationId": "list_background_tasks", + "/api/v1/event-type/export/openapi": { + "post": { + "description": "Exports event type definitions based on the OpenAPI schemas associated\nwith each existing event type", + "operationId": "v1.event-type.export-openapi", "parameters": [ { - "description": "Filter the response based on the status", - "in": "query", - "name": "status", - "schema": { - "$ref": "#/components/schemas/BackgroundTaskStatus", - "description": "Filter the response based on the status", - "nullable": true - }, - "style": "form" - }, - { - "description": "Filter the response based on the type", - "in": "query", - "name": "task", - "schema": { - "$ref": "#/components/schemas/BackgroundTaskType", - "description": "Filter the response based on the type", - "nullable": true - }, - "style": "form" - }, - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The iterator returned from a prior invocation", - "nullable": true, "type": "string" }, - "style": "form" - }, - { - "description": "The sorting order of the returned items", - "in": "query", - "name": "order", - "schema": { - "$ref": "#/components/schemas/Ordering", - "description": "The sorting order of the returned items", - "nullable": true - }, - "style": "form" + "style": "simple" } ], "responses": { - "200": { + "202": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_BackgroundTaskOut_" + "$ref": "#/components/schemas/ExportEventTypeOut" } } }, @@ -19330,130 +21053,106 @@ "HTTPBearer": [] } ], - "summary": "List Background Tasks", + "summary": "Event Type Export From Openapi", "tags": [ - "Background Tasks" - ] - } - }, - "/api/v1/background-task/{task_id}": { - "get": { - "description": "Get a background task by ID.", - "operationId": "get_background_task", - "parameters": [ - { - "in": "path", - "name": "task_id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } + "Event Type" ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BackgroundTaskOut" - } - } - }, - "description": "" + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const exportEventTypeOut = await svix.eventType.exportOpenapi();" }, - "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Bad request" + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const exportEventTypeOut = await svix.eventType.exportOpenapi();" }, - "401": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Unauthorized" + { + "label": "Python", + "lang": "Python", + "source": "export_event_type_out = svix.event_type.export_openapi(None)" }, - "403": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Forbidden" + { + "label": "Python (Async)", + "lang": "Python", + "source": "export_event_type_out = await svix.event_type.export_openapi(None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "exportEventTypeOut, err := svixClient.EventType.ExportOpenapi(ctx)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val exportEventTypeOut = svix.eventType.exportOpenapi()" + }, + { + "label": "Java", + "lang": "Java", + "source": "ExportEventTypeOut exportEventTypeOut = svix.getEventType().exportOpenapi()" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "export_event_type_out = svix.event_type.export_openapi()" }, - "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Not Found" + { + "label": "Rust", + "lang": "Rust", + "source": "let export_event_type_out = svix.event_type().export_openapi(None).await?;" }, - "409": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Conflict" + { + "label": "C#", + "lang": "C#", + "source": "var exportEventTypeOut = await svix.EventType.ExportOpenapiAsync()" }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" + { + "label": "CLI", + "lang": "Shell", + "source": "svix event-type export-openapi " }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Too Many Requests" - } - }, - "security": [ { - "HTTPBearer": [] + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/event-type/export/openapi' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } - ], - "summary": "Get Background Task", - "tags": [ - "Background Tasks" ] } }, - "/api/v1/environment/export": { - "get": { - "description": "Download a JSON file containing all org-settings and event types", - "operationId": "v1.environment.export.get", + "/api/v1/event-type/import/openapi": { + "post": { + "description": "Given an OpenAPI spec, create new or update existing event types.\nIf an existing `archived` event type is updated, it will be unarchived.\n\nThe importer will convert all webhooks found in the either the `webhooks` or `x-webhooks`\ntop-level.", + "operationId": "v1.event-type.import-openapi", + "parameters": [ + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeImportOpenApiIn" + } + } + }, + "description": "Import a list of event types from webhooks defined in an OpenAPI spec.\n\nThe OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**.", + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentOut" + "$ref": "#/components/schemas/EventTypeImportOpenApiOut" } } }, @@ -19535,76 +21234,78 @@ "HTTPBearer": [] } ], - "summary": "Export Environment Configuration", + "summary": "Event Type Import From Openapi", "tags": [ - "Environment" + "Event Type" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const environmentOut = await svix.environment.export();" + "source": "const eventTypeImportOpenApiOut = await svix.eventType.importOpenapi({\n spec: {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n specRaw: {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const environmentOut = await svix.environment.export();" + "source": "const eventTypeImportOpenApiOut = await svix.eventType.importOpenapi({\n spec: {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n specRaw: {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n});" }, { "label": "Python", "lang": "Python", - "source": "environment_out = svix.environment.export()" + "source": "event_type_import_open_api_out = svix.event_type.import_openapi(EventTypeImportOpenApiIn(\n spec={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n spec_raw={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "environment_out = await svix.environment.export()" + "source": "event_type_import_open_api_out = await svix.event_type.import_openapi(EventTypeImportOpenApiIn(\n spec={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n spec_raw={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n), None)" }, { "label": "Go", "lang": "Go", - "source": "environmentOut, err := svixClient.Environment.Export(ctx)" + "source": "eventTypeImportOpenApiOut, err := svixClient.EventType.ImportOpenapi(ctx, &EventTypeImportOpenApiIn{\n Spec: map[interface{}]interface{}{\"info\": map[string]interface{}{\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": map[interface{}]interface{}{\"pet.new\": map[interface{}]interface{}{\"post\": map[interface{}]interface{}{\"requestBody\": map[interface{}]interface{}{\"content\": map[interface{}]interface{}{\"application/json\": map[interface{}]interface{}{\"schema\": map[interface{}]interface{}{\"properties\": map[interface{}]interface{}{\"id\": map[string]interface{}{\"format\": \"int64\", \"type\": \"integer\"}, \"name\": map[string]interface{}{\"type\": \"string\"}, \"tag\": map[string]interface{}{\"type\": \"string\"}}, \"required\": []string{\"id\", \"name\"}}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": map[interface{}]interface{}{\"200\": map[string]interface{}{\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n SpecRaw: map[interface{}]interface{}{\"info\": map[string]interface{}{\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": map[interface{}]interface{}{\"pet.new\": map[interface{}]interface{}{\"post\": map[interface{}]interface{}{\"requestBody\": map[interface{}]interface{}{\"content\": map[interface{}]interface{}{\"application/json\": map[interface{}]interface{}{\"schema\": map[interface{}]interface{}{\"properties\": map[interface{}]interface{}{\"id\": map[string]interface{}{\"format\": \"int64\", \"type\": \"integer\"}, \"name\": map[string]interface{}{\"type\": \"string\"}, \"tag\": map[string]interface{}{\"type\": \"string\"}}, \"required\": []string{\"id\", \"name\"}}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": map[interface{}]interface{}{\"200\": map[string]interface{}{\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val environmentOut = svix.environment.export()" + "source": "val eventTypeImportOpenApiOut = svix.eventType.importOpenapi(EventTypeImportOpenApiIn()\n .spec(/* ... */)\n .specRaw(/* ... */)\n)" }, { "label": "Java", "lang": "Java", - "source": "EnvironmentOut environmentOut = svix.getEnvironment().export()" + "source": "EventTypeImportOpenApiOut eventTypeImportOpenApiOut = svix.getEventType().importOpenapi(new EventTypeImportOpenApiIn()\n .spec(/* ... */)\n .specRaw(/* ... */)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "environment_out = svix.environment.export()" + "source": "event_type_import_open_api_out = svix.event_type.import_openapi(Svix::EventTypeImportOpenApiIn.new({\n \"spec\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n \"spec_raw\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let environment_out = svix.environment().export().await?;" + "source": "let event_type_import_open_api_out = svix.event_type().import_openapi(EventTypeImportOpenApiIn {\n spec: Some(json!({\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}})),\n spec_raw: Some(json!({\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}})),\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var environmentOut = await svix.Environment.ExportAsync()" + "source": "var eventTypeImportOpenApiOut = await svix.EventType.ImportOpenapiAsync(new EventTypeImportOpenApiIn{\n spec: /* ... */,\n specRaw: /* ... */\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix environment export " + "source": "svix event-type import-openapi '{\n \"spec\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n \"specRaw\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/environment/export' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/event-type/import/openapi' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"spec\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n \"specRaw\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n }'" } ] - }, + } + }, + "/api/v1/event-type/schema/generate-example": { "post": { - "description": "Download a JSON file containing all org-settings and event types", - "operationId": "v1.environment.export", + "description": "Generates a fake example from the given JSONSchema", + "operationId": "v1.event-type.generate-example", "parameters": [ { "description": "The request's idempotency key", @@ -19616,12 +21317,22 @@ "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeSchemaIn" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentOut" + "$ref": "#/components/schemas/EventTypeExampleOut" } } }, @@ -19703,99 +21414,105 @@ "HTTPBearer": [] } ], - "summary": "Export Environment Configuration", + "summary": "Generate Schema Example", "tags": [ - "Environment" + "Event Type" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const environmentOut = await svix.environment.export();" + "source": "const eventTypeExampleOut = await svix.eventType.generateExample({\n schema: {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const environmentOut = await svix.environment.export();" + "source": "const eventTypeExampleOut = await svix.eventType.generateExample({\n schema: {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\n});" }, { "label": "Python", "lang": "Python", - "source": "environment_out = svix.environment.export(None)" + "source": "event_type_example_out = svix.event_type.generate_example(EventTypeSchemaIn(\n schema={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "environment_out = await svix.environment.export(None)" + "source": "event_type_example_out = await svix.event_type.generate_example(EventTypeSchemaIn(\n schema={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}\n), None)" }, { "label": "Go", "lang": "Go", - "source": "environmentOut, err := svixClient.Environment.Export(ctx)" + "source": "eventTypeExampleOut, err := svixClient.EventType.GenerateExample(ctx, &EventTypeSchemaIn{\n Schema: map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val environmentOut = svix.environment.export()" + "source": "val eventTypeExampleOut = svix.eventType.generateExample(EventTypeSchemaIn()\n .schema(/* ... */)\n)" }, { "label": "Java", "lang": "Java", - "source": "EnvironmentOut environmentOut = svix.getEnvironment().export()" + "source": "EventTypeExampleOut eventTypeExampleOut = svix.getEventType().generateExample(new EventTypeSchemaIn()\n .schema(/* ... */)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "environment_out = svix.environment.export()" + "source": "event_type_example_out = svix.event_type.generate_example(Svix::EventTypeSchemaIn.new({\n \"schema\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let environment_out = svix.environment().export(None).await?;" + "source": "let event_type_example_out = svix.event_type().generate_example(EventTypeSchemaIn {\n schema: json!({\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}),\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var environmentOut = await svix.Environment.ExportAsync()" + "source": "var eventTypeExampleOut = await svix.EventType.GenerateExampleAsync(new EventTypeSchemaIn{\n schema: /* ... */\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix environment export " + "source": "svix event-type generate-example '{\n \"schema\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/environment/export' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/event-type/schema/generate-example' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"schema\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\n }'" } ] } }, - "/api/v1/environment/import": { - "post": { - "description": "Import a configuration into the active organization.\nIt doesn't delete anything, only adds/updates what was passed to it.", - "operationId": "v1.environment.import", + "/api/v1/event-type/{event_type_name}": { + "delete": { + "description": "Archive an event type.\n\nEndpoints already configured to filter on an event type will continue to do so after archival.\nHowever, new messages can not be sent with it and endpoints can not filter on it.\nAn event type can be unarchived with the\n[create operation](#operation/create_event_type_api_v1_event_type__post).", + "operationId": "v1.event-type.delete", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "The event type's name", + "in": "path", + "name": "event_type_name", + "required": true, "schema": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" + }, + { + "description": "By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely.", + "in": "query", + "name": "expunge", + "schema": { + "default": false, + "description": "By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely.", + "type": "boolean" + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EnvironmentIn" - } - } - }, - "required": true - }, "responses": { "204": { "description": "no content" @@ -19876,84 +21593,98 @@ "HTTPBearer": [] } ], - "summary": "Import Environment Configuration", + "summary": "Delete Event Type", "tags": [ - "Environment" + "Event Type" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.environment.import({\n eventTypes: null,\n settings: null\n});" + "source": "await svix.eventType.delete(\"event_type_name\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.environment.import({\n eventTypes: null,\n settings: null\n});" + "source": "await svix.eventType.delete(\"event_type_name\");" }, { "label": "Python", "lang": "Python", - "source": "svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None\n), None)" + "source": "svix.event_type.delete(\"event_type_name\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None\n), None)" + "source": "await svix.event_type.delete(\"event_type_name\")" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Environment.Import(ctx, &EnvironmentIn{\n EventTypes: nil,\n Settings: nil,\n})" + "source": "err := svixClient.EventType.Delete(ctx, \"event_type_name\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.environment.import(EnvironmentIn()\n .eventTypes(null)\n .settings(null)\n)" + "source": "svix.eventType.delete(\"event_type_name\")" }, { "label": "Java", "lang": "Java", - "source": "svix.getEnvironment().import(new EnvironmentIn()\n .eventTypes(null)\n .settings(null)\n)" + "source": "svix.getEventType().delete(\"event_type_name\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.environment.import(Svix::EnvironmentIn.new({\n \"event_types\": nil,\n \"settings\": nil\n}))" + "source": "svix.event_type.delete(\"event_type_name\")" }, { "label": "Rust", "lang": "Rust", - "source": "svix.environment().import(EnvironmentIn {\n event_types: None,\n settings: None,\n}, None).await?;" + "source": "svix.event_type().delete(\"event_type_name\").await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Environment.ImportAsync(new EnvironmentIn{\n eventTypes: null,\n settings: null\n})" + "source": "await svix.EventType.DeleteAsync(\"event_type_name\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix environment import '{\n \"eventTypes\": null,\n \"settings\": null\n}'" + "source": "svix event-type delete \"event_type_name\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/environment/import' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventTypes\": null,\n \"settings\": null\n }'" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "get": { + "description": "Get an event type.", + "operationId": "v1.event-type.get", + "parameters": [ + { + "description": "The event type's name", + "in": "path", + "name": "event_type_name", + "required": true, + "schema": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" } - ] - } - }, - "/api/v1/environment/settings": { - "get": { - "description": "Get the environment's settings", - "operationId": "v1.environment.get-settings", + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentSettingsOut" + "$ref": "#/components/schemas/EventTypeOut" } } }, @@ -20035,146 +21766,108 @@ "HTTPBearer": [] } ], - "summary": "Get Org Settings", + "summary": "Get Event Type", "tags": [ - "Environment-Settings" + "Event Type" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const environmentSettingsOut = await svix.environment.getSettings();" + "source": "const eventTypeOut = await svix.eventType.get(\"event_type_name\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const environmentSettingsOut = await svix.environment.getSettings();" + "source": "const eventTypeOut = await svix.eventType.get(\"event_type_name\");" }, { "label": "Python", "lang": "Python", - "source": "environment_settings_out = svix.environment.get_settings()" + "source": "event_type_out = svix.event_type.get(\"event_type_name\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "environment_settings_out = await svix.environment.get_settings()" + "source": "event_type_out = await svix.event_type.get(\"event_type_name\")" }, { "label": "Go", "lang": "Go", - "source": "environmentSettingsOut, err := svixClient.Environment.GetSettings(ctx)" + "source": "eventTypeOut, err := svixClient.EventType.Get(ctx, \"event_type_name\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val environmentSettingsOut = svix.environment.getSettings()" + "source": "val eventTypeOut = svix.eventType.get(\"event_type_name\")" }, { "label": "Java", "lang": "Java", - "source": "EnvironmentSettingsOut environmentSettingsOut = svix.getEnvironment().getSettings()" + "source": "EventTypeOut eventTypeOut = svix.getEventType().get(\"event_type_name\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "environment_settings_out = svix.environment.get_settings()" + "source": "event_type_out = svix.event_type.get(\"event_type_name\")" }, { "label": "Rust", "lang": "Rust", - "source": "let environment_settings_out = svix.environment().get_settings().await?;" + "source": "let event_type_out = svix.event_type().get(\"event_type_name\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var environmentSettingsOut = await svix.Environment.GetSettingsAsync()" + "source": "var eventTypeOut = await svix.EventType.GetAsync(\"event_type_name\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix environment get-settings " + "source": "svix event-type get \"event_type_name\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/environment/settings' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/event-type": { - "get": { - "description": "Return the list of event types.", - "operationId": "v1.event-type.list", + }, + "patch": { + "description": "Partially update an event type.", + "operationId": "v1.event-type.patch", "parameters": [ { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", + "description": "The event type's name", + "in": "path", + "name": "event_type_name", + "required": true, "schema": { - "description": "The iterator returned from a prior invocation", + "description": "The event type's name", "example": "user.signup", "maxLength": 256, - "nullable": true, "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, - "style": "form" - }, - { - "description": "The sorting order of the returned items", - "in": "query", - "name": "order", - "schema": { - "$ref": "#/components/schemas/Ordering", - "description": "The sorting order of the returned items", - "nullable": true - }, - "style": "form" - }, - { - "description": "When `true` archived (deleted but not expunged) items are included in the response", - "in": "query", - "name": "include_archived", - "schema": { - "default": false, - "description": "When `true` archived (deleted but not expunged) items are included in the response", - "type": "boolean" - }, - "style": "form" - }, - { - "description": "When `true` the full item (including the schema) is included in the response", - "in": "query", - "name": "with_content", - "schema": { - "default": false, - "description": "When `true` the full item (including the schema) is included in the response", - "type": "boolean" - }, - "style": "form" + "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypePatch" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_EventTypeOut_" + "$ref": "#/components/schemas/EventTypeOut" } } }, @@ -20256,7 +21949,7 @@ "HTTPBearer": [] } ], - "summary": "List Event Types", + "summary": "Patch Event Type", "tags": [ "Event Type" ], @@ -20264,74 +21957,79 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseEventTypeOut = await svix.eventType.list();" + "source": "const eventTypeOut = await svix.eventType.patch(\"event_type_name\", {\n schemas: {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseEventTypeOut = await svix.eventType.list();" + "source": "const eventTypeOut = await svix.eventType.patch(\"event_type_name\", {\n schemas: {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" }, { "label": "Python", "lang": "Python", - "source": "list_response_event_type_out = svix.event_type.list(None)" + "source": "event_type_out = svix.event_type.patch(\"event_type_name\", EventTypePatch(\n schemas={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_event_type_out = await svix.event_type.list(None)" + "source": "event_type_out = await svix.event_type.patch(\"event_type_name\", EventTypePatch(\n schemas={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n))" }, { "label": "Go", "lang": "Go", - "source": "listResponseEventTypeOut, err := svixClient.EventType.List(ctx, nil)" + "source": "eventTypeOut, err := svixClient.EventType.Patch(ctx, \"event_type_name\", &EventTypePatch{\n Schemas: map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n FeatureFlag: \"cool-new-feature\",\n GroupName: \"user\",\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseEventTypeOut = svix.eventType.list()" + "source": "val eventTypeOut = svix.eventType.patch(\"event_type_name\", EventTypePatch()\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" }, { "label": "Java", "lang": "Java", - "source": "ListResponseEventTypeOut listResponseEventTypeOut = svix.getEventType().list()" + "source": "EventTypeOut eventTypeOut = svix.getEventType().patch(\"event_type_name\", new EventTypePatch()\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_event_type_out = svix.event_type.list()" + "source": "event_type_out = svix.event_type.patch(\"event_type_name\", Svix::EventTypePatch.new({\n \"schemas\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n \"feature_flag\": \"cool-new-feature\",\n \"group_name\": \"user\"\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_event_type_out = svix.event_type().list(None).await?;" + "source": "let event_type_out = svix.event_type().patch(\"event_type_name\", EventTypePatch {\n schemas: Some(json!({\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"})),\n feature_flag: Some(\"cool-new-feature\".to_string()),\n group_name: Some(\"user\".to_string()),\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseEventTypeOut = await svix.EventType.ListAsync()" + "source": "var eventTypeOut = await svix.EventType.PatchAsync(\"event_type_name\", new EventTypePatch{\n schemas: /* ... */,\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix event-type list " + "source": "svix event-type patch \"event_type_name\" '{\n \"schemas\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/event-type' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"schemas\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n }'" } ] }, - "post": { - "description": "Create new or unarchive existing event type.\n\nUnarchiving an event type will allow endpoints to filter on it and messages to be sent with it.\nEndpoints filtering on the event type before archival will continue to filter on it.\nThis operation does not preserve the description and schemas.", - "operationId": "v1.event-type.create", + "put": { + "description": "Update an event type.", + "operationId": "v1.event-type.update", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "The event type's name", + "in": "path", + "name": "event_type_name", + "required": true, "schema": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" @@ -20341,13 +22039,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EventTypeIn" + "$ref": "#/components/schemas/EventTypeUpdate" } } }, "required": true }, "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeOut" + } + } + }, + "description": "" + }, "201": { "content": { "application/json": { @@ -20434,7 +22142,7 @@ "HTTPBearer": [] } ], - "summary": "Create Event Type", + "summary": "Update Event Type", "tags": [ "Event Type" ], @@ -20442,87 +22150,92 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const eventTypeOut = await svix.eventType.create({\n name: \"user.signup\",\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" + "source": "const eventTypeOut = await svix.eventType.update(\"event_type_name\", {\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const eventTypeOut = await svix.eventType.create({\n name: \"user.signup\",\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" + "source": "const eventTypeOut = await svix.eventType.update(\"event_type_name\", {\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" }, { "label": "Python", "lang": "Python", - "source": "event_type_out = svix.event_type.create(EventTypeIn(\n name=\"user.signup\",\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n), None)" + "source": "event_type_out = svix.event_type.update(\"event_type_name\", EventTypeUpdate(\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "event_type_out = await svix.event_type.create(EventTypeIn(\n name=\"user.signup\",\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n), None)" + "source": "event_type_out = await svix.event_type.update(\"event_type_name\", EventTypeUpdate(\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n))" }, { "label": "Go", "lang": "Go", - "source": "eventTypeOut, err := svixClient.EventType.Create(ctx, &EventTypeIn{\n Name: \"user.signup\",\n Description: \"A user has signed up\",\n Archived: false,\n Schemas: map[interface{}]interface{}{\"1\": map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n FeatureFlag: \"cool-new-feature\",\n GroupName: \"user\",\n})" + "source": "eventTypeOut, err := svixClient.EventType.Update(ctx, \"event_type_name\", &EventTypeUpdate{\n Description: \"A user has signed up\",\n Archived: false,\n Schemas: map[interface{}]interface{}{\"1\": map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n FeatureFlag: \"cool-new-feature\",\n GroupName: \"user\",\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val eventTypeOut = svix.eventType.create(EventTypeIn()\n .name(\"user.signup\")\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" + "source": "val eventTypeOut = svix.eventType.update(\"event_type_name\", EventTypeUpdate()\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" }, { "label": "Java", "lang": "Java", - "source": "EventTypeOut eventTypeOut = svix.getEventType().create(new EventTypeIn()\n .name(\"user.signup\")\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" + "source": "EventTypeOut eventTypeOut = svix.getEventType().update(\"event_type_name\", new EventTypeUpdate()\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "event_type_out = svix.event_type.create(Svix::EventTypeIn.new({\n \"name\": \"user.signup\",\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"feature_flag\": \"cool-new-feature\",\n \"group_name\": \"user\"\n}))" + "source": "event_type_out = svix.event_type.update(\"event_type_name\", Svix::EventTypeUpdate.new({\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"feature_flag\": \"cool-new-feature\",\n \"group_name\": \"user\"\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let event_type_out = svix.event_type().create(EventTypeIn {\n name: \"user.signup\".to_string(),\n description: \"A user has signed up\".to_string(),\n archived: Some(false),\n schemas: Some(json!({\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}})),\n feature_flag: Some(\"cool-new-feature\".to_string()),\n group_name: Some(\"user\".to_string()),\n}, None).await?;" + "source": "let event_type_out = svix.event_type().update(\"event_type_name\", EventTypeUpdate {\n description: \"A user has signed up\".to_string(),\n archived: Some(false),\n schemas: Some(json!({\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}})),\n feature_flag: Some(\"cool-new-feature\".to_string()),\n group_name: Some(\"user\".to_string()),\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var eventTypeOut = await svix.EventType.CreateAsync(new EventTypeIn{\n name: \"user.signup\",\n description: \"A user has signed up\",\n archived: false,\n schemas: /* ... */,\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n})" + "source": "var eventTypeOut = await svix.EventType.UpdateAsync(\"event_type_name\", new EventTypeUpdate{\n description: \"A user has signed up\",\n archived: false,\n schemas: /* ... */,\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix event-type create '{\n \"name\": \"user.signup\",\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n}'" + "source": "svix event-type update \"event_type_name\" '{\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/event-type' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"user.signup\",\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n }'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n }'" } ] } }, - "/api/v1/event-type/export/openapi": { - "post": { - "description": "Exports event type definitions based on the OpenAPI schemas associated\nwith each existing event type", - "operationId": "v1.event-type.export-openapi", + "/api/v1/event-type/{event_type_name}/retry-schedule": { + "get": { + "description": "Gets the retry schedule for messages using the given event type", + "operationId": "v1.event-type.get-retry-schedule", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "The event type's name", + "in": "path", + "name": "event_type_name", + "required": true, "schema": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" } ], "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExportEventTypeOut" + "$ref": "#/components/schemas/RetryScheduleInOut" } } }, @@ -20604,7 +22317,7 @@ "HTTPBearer": [] } ], - "summary": "Event Type Export From Openapi", + "summary": "Get Retry Schedule", "tags": [ "Event Type" ], @@ -20612,76 +22325,79 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const exportEventTypeOut = await svix.eventType.exportOpenapi();" + "source": "const retryScheduleInOut = await svix.eventType.getRetrySchedule(\"event_type_name\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const exportEventTypeOut = await svix.eventType.exportOpenapi();" + "source": "const retryScheduleInOut = await svix.eventType.getRetrySchedule(\"event_type_name\");" }, { "label": "Python", "lang": "Python", - "source": "export_event_type_out = svix.event_type.export_openapi(None)" + "source": "retry_schedule_in_out = svix.event_type.get_retry_schedule(\"event_type_name\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "export_event_type_out = await svix.event_type.export_openapi(None)" + "source": "retry_schedule_in_out = await svix.event_type.get_retry_schedule(\"event_type_name\")" }, { "label": "Go", "lang": "Go", - "source": "exportEventTypeOut, err := svixClient.EventType.ExportOpenapi(ctx)" + "source": "retryScheduleInOut, err := svixClient.EventType.GetRetrySchedule(ctx, \"event_type_name\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val exportEventTypeOut = svix.eventType.exportOpenapi()" + "source": "val retryScheduleInOut = svix.eventType.getRetrySchedule(\"event_type_name\")" }, { "label": "Java", "lang": "Java", - "source": "ExportEventTypeOut exportEventTypeOut = svix.getEventType().exportOpenapi()" + "source": "RetryScheduleInOut retryScheduleInOut = svix.getEventType().getRetrySchedule(\"event_type_name\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "export_event_type_out = svix.event_type.export_openapi()" + "source": "retry_schedule_in_out = svix.event_type.get_retry_schedule(\"event_type_name\")" }, { "label": "Rust", "lang": "Rust", - "source": "let export_event_type_out = svix.event_type().export_openapi(None).await?;" + "source": "let retry_schedule_in_out = svix.event_type().get_retry_schedule(\"event_type_name\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var exportEventTypeOut = await svix.EventType.ExportOpenapiAsync()" + "source": "var retryScheduleInOut = await svix.EventType.GetRetryScheduleAsync(\"event_type_name\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix event-type export-openapi " + "source": "svix event-type get-retry-schedule \"event_type_name\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/event-type/export/openapi' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}/retry-schedule' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/event-type/import/openapi": { - "post": { - "description": "Given an OpenAPI spec, create new or update existing event types.\nIf an existing `archived` event type is updated, it will be unarchived.\n\nThe importer will convert all webhooks found in the either the `webhooks` or `x-webhooks`\ntop-level.", - "operationId": "v1.event-type.import-openapi", + }, + "put": { + "description": "Sets a retry schedule for all messages using the given event type", + "operationId": "v1.event-type.update-retry-schedule", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "The event type's name", + "in": "path", + "name": "event_type_name", + "required": true, "schema": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" @@ -20691,11 +22407,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EventTypeImportOpenApiIn" + "$ref": "#/components/schemas/RetryScheduleInOut" } } }, - "description": "Import a list of event types from webhooks defined in an OpenAPI spec.\n\nThe OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**.", "required": true }, "responses": { @@ -20703,7 +22418,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EventTypeImportOpenApiOut" + "$ref": "#/components/schemas/RetryScheduleInOut" } } }, @@ -20785,7 +22500,7 @@ "HTTPBearer": [] } ], - "summary": "Event Type Import From Openapi", + "summary": "Update Retry Schedule", "tags": [ "Event Type" ], @@ -20793,97 +22508,149 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const eventTypeImportOpenApiOut = await svix.eventType.importOpenapi({\n spec: {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n specRaw: {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n});" + "source": "const retryScheduleInOut = await svix.eventType.updateRetrySchedule(\"event_type_name\", {\n retrySchedule: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const eventTypeImportOpenApiOut = await svix.eventType.importOpenapi({\n spec: {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n specRaw: {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n});" + "source": "const retryScheduleInOut = await svix.eventType.updateRetrySchedule(\"event_type_name\", {\n retrySchedule: null\n});" }, { "label": "Python", "lang": "Python", - "source": "event_type_import_open_api_out = svix.event_type.import_openapi(EventTypeImportOpenApiIn(\n spec={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n spec_raw={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n), None)" + "source": "retry_schedule_in_out = svix.event_type.update_retry_schedule(\"event_type_name\", RetryScheduleInOut(\n retry_schedule=None\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "event_type_import_open_api_out = await svix.event_type.import_openapi(EventTypeImportOpenApiIn(\n spec={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n spec_raw={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n), None)" + "source": "retry_schedule_in_out = await svix.event_type.update_retry_schedule(\"event_type_name\", RetryScheduleInOut(\n retry_schedule=None\n))" }, { "label": "Go", "lang": "Go", - "source": "eventTypeImportOpenApiOut, err := svixClient.EventType.ImportOpenapi(ctx, &EventTypeImportOpenApiIn{\n Spec: map[interface{}]interface{}{\"info\": map[string]interface{}{\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": map[interface{}]interface{}{\"pet.new\": map[interface{}]interface{}{\"post\": map[interface{}]interface{}{\"requestBody\": map[interface{}]interface{}{\"content\": map[interface{}]interface{}{\"application/json\": map[interface{}]interface{}{\"schema\": map[interface{}]interface{}{\"properties\": map[interface{}]interface{}{\"id\": map[string]interface{}{\"format\": \"int64\", \"type\": \"integer\"}, \"name\": map[string]interface{}{\"type\": \"string\"}, \"tag\": map[string]interface{}{\"type\": \"string\"}}, \"required\": []string{\"id\", \"name\"}}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": map[interface{}]interface{}{\"200\": map[string]interface{}{\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n SpecRaw: map[interface{}]interface{}{\"info\": map[string]interface{}{\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": map[interface{}]interface{}{\"pet.new\": map[interface{}]interface{}{\"post\": map[interface{}]interface{}{\"requestBody\": map[interface{}]interface{}{\"content\": map[interface{}]interface{}{\"application/json\": map[interface{}]interface{}{\"schema\": map[interface{}]interface{}{\"properties\": map[interface{}]interface{}{\"id\": map[string]interface{}{\"format\": \"int64\", \"type\": \"integer\"}, \"name\": map[string]interface{}{\"type\": \"string\"}, \"tag\": map[string]interface{}{\"type\": \"string\"}}, \"required\": []string{\"id\", \"name\"}}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": map[interface{}]interface{}{\"200\": map[string]interface{}{\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n})" + "source": "retryScheduleInOut, err := svixClient.EventType.UpdateRetrySchedule(ctx, \"event_type_name\", &RetryScheduleInOut{\n RetrySchedule: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val eventTypeImportOpenApiOut = svix.eventType.importOpenapi(EventTypeImportOpenApiIn()\n .spec(/* ... */)\n .specRaw(/* ... */)\n)" + "source": "val retryScheduleInOut = svix.eventType.updateRetrySchedule(\"event_type_name\", RetryScheduleInOut()\n .retrySchedule(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "EventTypeImportOpenApiOut eventTypeImportOpenApiOut = svix.getEventType().importOpenapi(new EventTypeImportOpenApiIn()\n .spec(/* ... */)\n .specRaw(/* ... */)\n)" + "source": "RetryScheduleInOut retryScheduleInOut = svix.getEventType().updateRetrySchedule(\"event_type_name\", new RetryScheduleInOut()\n .retrySchedule(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "event_type_import_open_api_out = svix.event_type.import_openapi(Svix::EventTypeImportOpenApiIn.new({\n \"spec\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n \"spec_raw\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n}))" + "source": "retry_schedule_in_out = svix.event_type.update_retry_schedule(\"event_type_name\", Svix::RetryScheduleInOut.new({\n \"retry_schedule\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let event_type_import_open_api_out = svix.event_type().import_openapi(EventTypeImportOpenApiIn {\n spec: Some(json!({\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}})),\n spec_raw: Some(json!({\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}})),\n}, None).await?;" + "source": "let retry_schedule_in_out = svix.event_type().update_retry_schedule(\"event_type_name\", RetryScheduleInOut {\n retry_schedule: None,\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var eventTypeImportOpenApiOut = await svix.EventType.ImportOpenapiAsync(new EventTypeImportOpenApiIn{\n spec: /* ... */,\n specRaw: /* ... */\n})" + "source": "var retryScheduleInOut = await svix.EventType.UpdateRetryScheduleAsync(\"event_type_name\", new RetryScheduleInOut{\n retrySchedule: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix event-type import-openapi '{\n \"spec\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n \"specRaw\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n}'" + "source": "svix event-type update-retry-schedule \"event_type_name\" '{\n \"retrySchedule\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/event-type/import/openapi' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"spec\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n \"specRaw\": {\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n }'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}/retry-schedule' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"retrySchedule\": null\n }'" } ] } }, - "/api/v1/event-type/schema/generate-example": { - "post": { - "description": "Generates a fake example from the given JSONSchema", - "operationId": "v1.event-type.generate-example", + "/api/v1/events": { + "get": { + "description": "Reads the stream of operational webhook events for this environment", + "operationId": "v1.events", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", "schema": { + "description": "The iterator returned from a prior invocation", + "nullable": true, "type": "string" }, - "style": "simple" + "style": "form" + }, + { + "description": "Filter response based on the event type", + "in": "query", + "name": "event_types", + "schema": { + "description": "Filter response based on the event type", + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" + }, + { + "description": "Filter response based on the event type", + "in": "query", + "name": "channels", + "schema": { + "description": "Filter response based on the event type", + "items": { + "example": "project_1337", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" + }, + { + "in": "query", + "name": "after", + "schema": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EventTypeSchemaIn" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EventTypeExampleOut" + "$ref": "#/components/schemas/MessageEventsOut" } } }, @@ -20965,108 +22732,201 @@ "HTTPBearer": [] } ], - "summary": "Generate Schema Example", + "summary": "Events", "tags": [ - "Event Type" + "Events" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const eventTypeExampleOut = await svix.eventType.generateExample({\n schema: {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\n});" + "source": "const messageEventsOut = await svix.even.s();" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const eventTypeExampleOut = await svix.eventType.generateExample({\n schema: {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\n});" + "source": "const messageEventsOut = await svix.even.s();" }, { "label": "Python", "lang": "Python", - "source": "event_type_example_out = svix.event_type.generate_example(EventTypeSchemaIn(\n schema={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}\n), None)" + "source": "message_events_out = svix.even.s()" }, { "label": "Python (Async)", "lang": "Python", - "source": "event_type_example_out = await svix.event_type.generate_example(EventTypeSchemaIn(\n schema={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}\n), None)" + "source": "message_events_out = await svix.even.s()" }, { "label": "Go", "lang": "Go", - "source": "eventTypeExampleOut, err := svixClient.EventType.GenerateExample(ctx, &EventTypeSchemaIn{\n Schema: map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n})" + "source": "messageEventsOut, err := svixClient.Even.S(ctx)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val eventTypeExampleOut = svix.eventType.generateExample(EventTypeSchemaIn()\n .schema(/* ... */)\n)" + "source": "val messageEventsOut = svix.even.s()" }, { "label": "Java", "lang": "Java", - "source": "EventTypeExampleOut eventTypeExampleOut = svix.getEventType().generateExample(new EventTypeSchemaIn()\n .schema(/* ... */)\n)" + "source": "MessageEventsOut messageEventsOut = svix.getEven().s()" }, { "label": "Ruby", "lang": "Ruby", - "source": "event_type_example_out = svix.event_type.generate_example(Svix::EventTypeSchemaIn.new({\n \"schema\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\n}))" + "source": "message_events_out = svix.even.s()" }, { "label": "Rust", "lang": "Rust", - "source": "let event_type_example_out = svix.event_type().generate_example(EventTypeSchemaIn {\n schema: json!({\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}),\n}, None).await?;" + "source": "let message_events_out = svix.even().s().await?;" }, { "label": "C#", "lang": "C#", - "source": "var eventTypeExampleOut = await svix.EventType.GenerateExampleAsync(new EventTypeSchemaIn{\n schema: /* ... */\n})" + "source": "var messageEventsOut = await svix.Even.SAsync()" }, { "label": "CLI", "lang": "Shell", - "source": "svix event-type generate-example '{\n \"schema\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\n}'" + "source": "svix even s " }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/event-type/schema/generate-example' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"schema\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/event-type/{event_type_name}": { - "delete": { - "description": "Archive an event type.\n\nEndpoints already configured to filter on an event type will continue to do so after archival.\nHowever, new messages can not be sent with it and endpoints can not filter on it.\nAn event type can be unarchived with the\n[create operation](#operation/create_event_type_api_v1_event_type__post).", - "operationId": "v1.event-type.delete", + "/api/v1/health": { + "get": { + "description": "Verify the API server is up and running.", + "operationId": "v1.health.get", + "responses": { + "204": { + "description": "no content" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "summary": "Health", + "tags": [ + "Health" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/health' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/msg/broadcast": { + "post": { + "description": "Creates a background task to send the same message to each application in your organization", + "operationId": "create_broadcast_message", "parameters": [ { - "description": "The event type's name", - "in": "path", - "name": "event_type_name", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" - }, - { - "description": "By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely.", - "in": "query", - "name": "expunge", - "schema": { - "default": false, - "description": "By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely.", - "type": "boolean" - }, - "style": "form" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageBroadcastIn" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "no content" + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageBroadcastOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -21144,86 +23004,51 @@ "HTTPBearer": [] } ], - "summary": "Delete Event Type", + "summary": "Create Broadcast Message", "tags": [ - "Event Type" - ], - "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "await svix.eventType.delete(\"event_type_name\");" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "await svix.eventType.delete(\"event_type_name\");" - }, - { - "label": "Python", - "lang": "Python", - "source": "svix.event_type.delete(\"event_type_name\")" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "await svix.event_type.delete(\"event_type_name\")" - }, - { - "label": "Go", - "lang": "Go", - "source": "err := svixClient.EventType.Delete(ctx, \"event_type_name\")" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "svix.eventType.delete(\"event_type_name\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "svix.getEventType().delete(\"event_type_name\")" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "svix.event_type.delete(\"event_type_name\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "svix.event_type().delete(\"event_type_name\").await?;" - }, + "Broadcast" + ] + } + }, + "/api/v1/stats/app/{app_id}/attempt": { + "get": { + "description": "Returns application-level statistics on message attempts", + "operationId": "v1.stats.app-attempts", + "parameters": [ { - "label": "C#", - "lang": "C#", - "source": "await svix.EventType.DeleteAsync(\"event_type_name\")" + "description": "Filter the range to data starting from this date", + "in": "query", + "name": "startDate", + "schema": { + "description": "Filter the range to data starting from this date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" }, { - "label": "CLI", - "lang": "Shell", - "source": "svix event-type delete \"event_type_name\"" + "description": "Filter the range to data ending by this date", + "in": "query", + "name": "endDate", + "schema": { + "description": "Filter the range to data ending by this date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" }, { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" - } - ] - }, - "get": { - "description": "Get an event type.", - "operationId": "v1.event-type.get", - "parameters": [ - { - "description": "The event type's name", + "description": "The app's ID or UID", "in": "path", - "name": "event_type_name", + "name": "app_id", "required": true, "schema": { - "description": "The event type's name", - "example": "user.signup", + "description": "The app's ID or UID", + "example": "unique-app-identifier", "maxLength": 256, + "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, @@ -21235,7 +23060,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EventTypeOut" + "$ref": "#/components/schemas/AttemptStatisticsResponse" } } }, @@ -21317,108 +23142,140 @@ "HTTPBearer": [] } ], - "summary": "Get Event Type", + "summary": "Get App Attempt Stats", "tags": [ - "Event Type" + "Statistics" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const eventTypeOut = await svix.eventType.get(\"event_type_name\");" + "source": "const attemptStatisticsResponse = await svix.stats.appAttempts(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const eventTypeOut = await svix.eventType.get(\"event_type_name\");" + "source": "const attemptStatisticsResponse = await svix.stats.appAttempts(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "event_type_out = svix.event_type.get(\"event_type_name\")" + "source": "attempt_statistics_response = svix.stats.app_attempts(\"app_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "event_type_out = await svix.event_type.get(\"event_type_name\")" + "source": "attempt_statistics_response = await svix.stats.app_attempts(\"app_id\")" }, { "label": "Go", "lang": "Go", - "source": "eventTypeOut, err := svixClient.EventType.Get(ctx, \"event_type_name\")" + "source": "attemptStatisticsResponse, err := svixClient.Stats.AppAttempts(ctx, \"app_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val eventTypeOut = svix.eventType.get(\"event_type_name\")" + "source": "val attemptStatisticsResponse = svix.stats.appAttempts(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "EventTypeOut eventTypeOut = svix.getEventType().get(\"event_type_name\")" + "source": "AttemptStatisticsResponse attemptStatisticsResponse = svix.getStats().appAttempts(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "event_type_out = svix.event_type.get(\"event_type_name\")" + "source": "attempt_statistics_response = svix.stats.app_attempts(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let event_type_out = svix.event_type().get(\"event_type_name\").await?;" + "source": "let attempt_statistics_response = svix.stats().app_attempts(\"app_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var eventTypeOut = await svix.EventType.GetAsync(\"event_type_name\")" + "source": "var attemptStatisticsResponse = await svix.Stats.AppAttemptsAsync(\"app_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix event-type get \"event_type_name\"" + "source": "svix stats app-attempts \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stats/app/{app_id}/attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - }, - "patch": { - "description": "Partially update an event type.", - "operationId": "v1.event-type.patch", + } + }, + "/api/v1/stats/app/{app_id}/ep/{endpoint_id}/attempt": { + "get": { + "description": "Returns endpoint-level statistics on message attempts", + "operationId": "v1.stats.endpoint-attempts", "parameters": [ { - "description": "The event type's name", + "description": "Filter the range to data starting from this date", + "in": "query", + "name": "startDate", + "schema": { + "description": "Filter the range to data starting from this date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter the range to data ending by this date", + "in": "query", + "name": "endDate", + "schema": { + "description": "Filter the range to data ending by this date", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "The app's ID or UID", "in": "path", - "name": "event_type_name", + "name": "app_id", "required": true, "schema": { - "description": "The event type's name", - "example": "user.signup", + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", "maxLength": 256, + "minLength": 1, "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EventTypePatch" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EventTypeOut" + "$ref": "#/components/schemas/AttemptStatisticsResponse" } } }, @@ -21500,87 +23357,84 @@ "HTTPBearer": [] } ], - "summary": "Patch Event Type", + "summary": "Get Ep Stats", "tags": [ - "Event Type" + "Statistics" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const eventTypeOut = await svix.eventType.patch(\"event_type_name\", {\n schemas: {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" + "source": "const attemptStatisticsResponse = await svix.stats.endpointAttempts(\"app_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const eventTypeOut = await svix.eventType.patch(\"event_type_name\", {\n schemas: {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" + "source": "const attemptStatisticsResponse = await svix.stats.endpointAttempts(\"app_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "event_type_out = svix.event_type.patch(\"event_type_name\", EventTypePatch(\n schemas={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n))" + "source": "attempt_statistics_response = svix.stats.endpoint_attempts(\"app_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "event_type_out = await svix.event_type.patch(\"event_type_name\", EventTypePatch(\n schemas={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n))" + "source": "attempt_statistics_response = await svix.stats.endpoint_attempts(\"app_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "eventTypeOut, err := svixClient.EventType.Patch(ctx, \"event_type_name\", &EventTypePatch{\n Schemas: map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n FeatureFlag: \"cool-new-feature\",\n GroupName: \"user\",\n})" + "source": "attemptStatisticsResponse, err := svixClient.Stats.EndpointAttempts(ctx, \"app_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val eventTypeOut = svix.eventType.patch(\"event_type_name\", EventTypePatch()\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" + "source": "val attemptStatisticsResponse = svix.stats.endpointAttempts(\"app_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "EventTypeOut eventTypeOut = svix.getEventType().patch(\"event_type_name\", new EventTypePatch()\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" + "source": "AttemptStatisticsResponse attemptStatisticsResponse = svix.getStats().endpointAttempts(\"app_id\", \"endpoint_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "event_type_out = svix.event_type.patch(\"event_type_name\", Svix::EventTypePatch.new({\n \"schemas\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n \"feature_flag\": \"cool-new-feature\",\n \"group_name\": \"user\"\n}))" + "source": "attempt_statistics_response = svix.stats.endpoint_attempts(\"app_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let event_type_out = svix.event_type().patch(\"event_type_name\", EventTypePatch {\n schemas: Some(json!({\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"})),\n feature_flag: Some(\"cool-new-feature\".to_string()),\n group_name: Some(\"user\".to_string()),\n}).await?;" + "source": "let attempt_statistics_response = svix.stats().endpoint_attempts(\"app_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var eventTypeOut = await svix.EventType.PatchAsync(\"event_type_name\", new EventTypePatch{\n schemas: /* ... */,\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n})" + "source": "var attemptStatisticsResponse = await svix.Stats.EndpointAttemptsAsync(\"app_id\", \"endpoint_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix event-type patch \"event_type_name\" '{\n \"schemas\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n}'" + "source": "svix stats endpoint-attempts \"app_id\" \"endpoint_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"schemas\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stats/app/{app_id}/ep/{endpoint_id}/attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - }, - "put": { - "description": "Update an event type.", - "operationId": "v1.event-type.update", + } + }, + "/api/v1/stats/usage/app": { + "post": { + "description": "Creates a background task to calculate the message destinations for all applications in the environment.\n\nNote that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to\nretrieve the results of the operation.", + "operationId": "v1.statistics.aggregate-app-stats", "parameters": [ { - "description": "The event type's name", - "in": "path", - "name": "event_type_name", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" @@ -21590,28 +23444,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EventTypeUpdate" + "$ref": "#/components/schemas/AppUsageStatsIn" } } }, "required": true }, "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EventTypeOut" - } - } - }, - "description": "" - }, - "201": { + "202": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EventTypeOut" + "$ref": "#/components/schemas/AppUsageStatsOut" } } }, @@ -21693,100 +23537,84 @@ "HTTPBearer": [] } ], - "summary": "Update Event Type", + "summary": "Aggregate App Stats", "tags": [ - "Event Type" + "Statistics" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const eventTypeOut = await svix.eventType.update(\"event_type_name\", {\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" + "source": "const appUsageStatsOut = await svix.statistics.aggregateAppStats({\n appIds: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const eventTypeOut = await svix.eventType.update(\"event_type_name\", {\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n});" + "source": "const appUsageStatsOut = await svix.statistics.aggregateAppStats({\n appIds: null\n});" }, { "label": "Python", "lang": "Python", - "source": "event_type_out = svix.event_type.update(\"event_type_name\", EventTypeUpdate(\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n))" + "source": "app_usage_stats_out = svix.statistics.aggregate_app_stats(AppUsageStatsIn(\n app_ids=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "event_type_out = await svix.event_type.update(\"event_type_name\", EventTypeUpdate(\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n))" + "source": "app_usage_stats_out = await svix.statistics.aggregate_app_stats(AppUsageStatsIn(\n app_ids=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "eventTypeOut, err := svixClient.EventType.Update(ctx, \"event_type_name\", &EventTypeUpdate{\n Description: \"A user has signed up\",\n Archived: false,\n Schemas: map[interface{}]interface{}{\"1\": map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n FeatureFlag: \"cool-new-feature\",\n GroupName: \"user\",\n})" + "source": "appUsageStatsOut, err := svixClient.Statistics.AggregateAppStats(ctx, &AppUsageStatsIn{\n AppIds: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val eventTypeOut = svix.eventType.update(\"event_type_name\", EventTypeUpdate()\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" + "source": "val appUsageStatsOut = svix.statistics.aggregateAppStats(AppUsageStatsIn()\n .appIds(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "EventTypeOut eventTypeOut = svix.getEventType().update(\"event_type_name\", new EventTypeUpdate()\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(/* ... */)\n .featureFlag(\"cool-new-feature\")\n .groupName(\"user\")\n)" + "source": "AppUsageStatsOut appUsageStatsOut = svix.getStatistics().aggregateAppStats(new AppUsageStatsIn()\n .appIds(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "event_type_out = svix.event_type.update(\"event_type_name\", Svix::EventTypeUpdate.new({\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"feature_flag\": \"cool-new-feature\",\n \"group_name\": \"user\"\n}))" + "source": "app_usage_stats_out = svix.statistics.aggregate_app_stats(Svix::AppUsageStatsIn.new({\n \"app_ids\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let event_type_out = svix.event_type().update(\"event_type_name\", EventTypeUpdate {\n description: \"A user has signed up\".to_string(),\n archived: Some(false),\n schemas: Some(json!({\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}})),\n feature_flag: Some(\"cool-new-feature\".to_string()),\n group_name: Some(\"user\".to_string()),\n}).await?;" + "source": "let app_usage_stats_out = svix.statistics().aggregate_app_stats(AppUsageStatsIn {\n app_ids: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var eventTypeOut = await svix.EventType.UpdateAsync(\"event_type_name\", new EventTypeUpdate{\n description: \"A user has signed up\",\n archived: false,\n schemas: /* ... */,\n featureFlag: \"cool-new-feature\",\n groupName: \"user\"\n})" + "source": "var appUsageStatsOut = await svix.Statistics.AggregateAppStatsAsync(new AppUsageStatsIn{\n appIds: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix event-type update \"event_type_name\" '{\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n}'" + "source": "svix statistics aggregate-app-stats '{\n \"appIds\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\",\n \"groupName\": \"user\"\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/stats/usage/app' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"appIds\": null\n }'" } ] } }, - "/api/v1/event-type/{event_type_name}/retry-schedule": { - "get": { - "description": "Gets the retry schedule for messages using the given event type", - "operationId": "v1.event-type.get-retry-schedule", - "parameters": [ - { - "description": "The event type's name", - "in": "path", - "name": "event_type_name", - "required": true, - "schema": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - } - ], + "/api/v1/stats/usage/event-types": { + "put": { + "description": "Creates a background task to calculate the listed event types for all apps in the organization.\n\nNote that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to\nretrieve the results of the operation.", + "operationId": "v1.statistics.aggregate-event-types", "responses": { - "200": { + "202": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RetryScheduleInOut" + "$ref": "#/components/schemas/AggregateEventTypesOut" } } }, @@ -21868,108 +23696,121 @@ "HTTPBearer": [] } ], - "summary": "Get Retry Schedule", + "summary": "Aggregate Event Types", "tags": [ - "Event Type" + "Statistics" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const retryScheduleInOut = await svix.eventType.getRetrySchedule(\"event_type_name\");" + "source": "const aggregateEventTypesOut = await svix.statistics.aggregateEventTypes();" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const retryScheduleInOut = await svix.eventType.getRetrySchedule(\"event_type_name\");" + "source": "const aggregateEventTypesOut = await svix.statistics.aggregateEventTypes();" }, { "label": "Python", "lang": "Python", - "source": "retry_schedule_in_out = svix.event_type.get_retry_schedule(\"event_type_name\")" + "source": "aggregate_event_types_out = svix.statistics.aggregate_event_types()" }, { "label": "Python (Async)", "lang": "Python", - "source": "retry_schedule_in_out = await svix.event_type.get_retry_schedule(\"event_type_name\")" + "source": "aggregate_event_types_out = await svix.statistics.aggregate_event_types()" }, { "label": "Go", "lang": "Go", - "source": "retryScheduleInOut, err := svixClient.EventType.GetRetrySchedule(ctx, \"event_type_name\")" + "source": "aggregateEventTypesOut, err := svixClient.Statistics.AggregateEventTypes(ctx)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val retryScheduleInOut = svix.eventType.getRetrySchedule(\"event_type_name\")" + "source": "val aggregateEventTypesOut = svix.statistics.aggregateEventTypes()" }, { "label": "Java", "lang": "Java", - "source": "RetryScheduleInOut retryScheduleInOut = svix.getEventType().getRetrySchedule(\"event_type_name\")" + "source": "AggregateEventTypesOut aggregateEventTypesOut = svix.getStatistics().aggregateEventTypes()" }, { "label": "Ruby", "lang": "Ruby", - "source": "retry_schedule_in_out = svix.event_type.get_retry_schedule(\"event_type_name\")" + "source": "aggregate_event_types_out = svix.statistics.aggregate_event_types()" }, { "label": "Rust", "lang": "Rust", - "source": "let retry_schedule_in_out = svix.event_type().get_retry_schedule(\"event_type_name\").await?;" + "source": "let aggregate_event_types_out = svix.statistics().aggregate_event_types().await?;" }, { "label": "C#", "lang": "C#", - "source": "var retryScheduleInOut = await svix.EventType.GetRetryScheduleAsync(\"event_type_name\")" + "source": "var aggregateEventTypesOut = await svix.Statistics.AggregateEventTypesAsync()" }, { "label": "CLI", "lang": "Shell", - "source": "svix event-type get-retry-schedule \"event_type_name\"" + "source": "svix statistics aggregate-event-types " }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}/retry-schedule' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/stats/usage/event-types' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - }, - "put": { - "description": "Sets a retry schedule for all messages using the given event type", - "operationId": "v1.event-type.update-retry-schedule", + } + }, + "/api/v1/stream": { + "get": { + "description": "List of all the organization's streams.", + "operationId": "v1.stream.list", "parameters": [ { - "description": "The event type's name", - "in": "path", - "name": "event_type_name", - "required": true, + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", "schema": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "nullable": true, "type": "string" }, - "style": "simple" + "style": "form" + }, + { + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", + "schema": { + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RetryScheduleInOut" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RetryScheduleInOut" + "$ref": "#/components/schemas/ListResponse_StreamOut_" } } }, @@ -22051,157 +23892,113 @@ "HTTPBearer": [] } ], - "summary": "Update Retry Schedule", + "summary": "List Streams", "tags": [ - "Event Type" + "Stream" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const retryScheduleInOut = await svix.eventType.updateRetrySchedule(\"event_type_name\", {\n retrySchedule: null\n});" + "source": "const listResponseStreamOut = await svix.stream.list();" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const retryScheduleInOut = await svix.eventType.updateRetrySchedule(\"event_type_name\", {\n retrySchedule: null\n});" + "source": "const listResponseStreamOut = await svix.stream.list();" }, { "label": "Python", "lang": "Python", - "source": "retry_schedule_in_out = svix.event_type.update_retry_schedule(\"event_type_name\", RetryScheduleInOut(\n retry_schedule=None\n))" + "source": "list_response_stream_out = svix.stream.list(None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "retry_schedule_in_out = await svix.event_type.update_retry_schedule(\"event_type_name\", RetryScheduleInOut(\n retry_schedule=None\n))" + "source": "list_response_stream_out = await svix.stream.list(None)" }, { "label": "Go", "lang": "Go", - "source": "retryScheduleInOut, err := svixClient.EventType.UpdateRetrySchedule(ctx, \"event_type_name\", &RetryScheduleInOut{\n RetrySchedule: nil,\n})" + "source": "listResponseStreamOut, err := svixClient.Stream.List(ctx, nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val retryScheduleInOut = svix.eventType.updateRetrySchedule(\"event_type_name\", RetryScheduleInOut()\n .retrySchedule(null)\n)" + "source": "val listResponseStreamOut = svix.stream.list()" }, { "label": "Java", "lang": "Java", - "source": "RetryScheduleInOut retryScheduleInOut = svix.getEventType().updateRetrySchedule(\"event_type_name\", new RetryScheduleInOut()\n .retrySchedule(null)\n)" + "source": "ListResponseStreamOut listResponseStreamOut = svix.getStream().list()" }, { "label": "Ruby", - "lang": "Ruby", - "source": "retry_schedule_in_out = svix.event_type.update_retry_schedule(\"event_type_name\", Svix::RetryScheduleInOut.new({\n \"retry_schedule\": nil\n}))" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let retry_schedule_in_out = svix.event_type().update_retry_schedule(\"event_type_name\", RetryScheduleInOut {\n retry_schedule: None,\n}).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var retryScheduleInOut = await svix.EventType.UpdateRetryScheduleAsync(\"event_type_name\", new RetryScheduleInOut{\n retrySchedule: null\n})" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix event-type update-retry-schedule \"event_type_name\" '{\n \"retrySchedule\": null\n}'" - }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}/retry-schedule' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"retrySchedule\": null\n }'" - } - ] - } - }, - "/api/v1/events": { - "get": { - "description": "Reads the stream of operational webhook events for this environment", - "operationId": "v1.events", - "parameters": [ - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" + "lang": "Ruby", + "source": "list_response_stream_out = svix.stream.list()" }, { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "nullable": true, - "type": "string" - }, - "style": "form" + "label": "Rust", + "lang": "Rust", + "source": "let list_response_stream_out = svix.stream().list(None).await?;" }, { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", - "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" + "label": "C#", + "lang": "C#", + "source": "var listResponseStreamOut = await svix.Stream.ListAsync()" }, { - "description": "Filter response based on the event type", - "in": "query", - "name": "channels", - "schema": { - "description": "Filter response based on the event type", - "items": { - "example": "project_1337", - "maxLength": 128, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" + "label": "CLI", + "lang": "Shell", + "source": "svix stream list " }, { - "in": "query", - "name": "after", + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stream' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "post": { + "description": "Creates a new stream.", + "operationId": "v1.stream.create", + "parameters": [ + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "format": "date-time", - "nullable": true, "type": "string" }, - "style": "form" + "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamIn" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageEventsOut" + "$ref": "#/components/schemas/StreamOut" + } + } + }, + "description": "" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamOut" } } }, @@ -22283,78 +24080,89 @@ "HTTPBearer": [] } ], - "summary": "Events", + "summary": "Create Stream", "tags": [ - "Events" + "Stream" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageEventsOut = await svix.even.s();" + "source": "const streamOut = await svix.stream.create({\n uid: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageEventsOut = await svix.even.s();" + "source": "const streamOut = await svix.stream.create({\n uid: null\n});" }, { "label": "Python", "lang": "Python", - "source": "message_events_out = svix.even.s()" + "source": "stream_out = svix.stream.create(StreamIn(\n uid=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_events_out = await svix.even.s()" + "source": "stream_out = await svix.stream.create(StreamIn(\n uid=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "messageEventsOut, err := svixClient.Even.S(ctx)" + "source": "streamOut, err := svixClient.Stream.Create(ctx, &StreamIn{\n Uid: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageEventsOut = svix.even.s()" + "source": "val streamOut = svix.stream.create(StreamIn()\n .uid(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "MessageEventsOut messageEventsOut = svix.getEven().s()" + "source": "StreamOut streamOut = svix.getStream().create(new StreamIn()\n .uid(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_events_out = svix.even.s()" + "source": "stream_out = svix.stream.create(Svix::StreamIn.new({\n \"uid\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let message_events_out = svix.even().s().await?;" + "source": "let stream_out = svix.stream().create(StreamIn {\n uid: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageEventsOut = await svix.Even.SAsync()" + "source": "var streamOut = await svix.Stream.CreateAsync(new StreamIn{\n uid: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix even s " + "source": "svix stream create '{\n \"uid\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/stream' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"uid\": null\n }'" } ] } }, - "/api/v1/health": { - "get": { - "description": "Verify the API server is up and running.", - "operationId": "v1.health.get", + "/api/v1/stream/{stream_id}": { + "delete": { + "description": "Delete a stream.", + "operationId": "v1.stream.delete", + "parameters": [ + { + "in": "path", + "name": "stream_id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], "responses": { "204": { "description": "no content" @@ -22430,50 +24238,98 @@ "description": "Too Many Requests" } }, - "summary": "Health", + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Delete Stream", "tags": [ - "Health" + "Stream" ], "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.stream.delete(\"stream_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.stream.delete(\"stream_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.stream.delete(\"stream_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.stream.delete(\"stream_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Stream.Delete(ctx, \"stream_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.stream.delete(\"stream_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getStream().delete(\"stream_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.stream.delete(\"stream_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.stream().delete(\"stream_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Stream.DeleteAsync(\"stream_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix stream delete \"stream_id\"" + }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/health' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/msg/broadcast": { - "post": { - "description": "Creates a background task to send the same message to each application in your organization", - "operationId": "create_broadcast_message", + }, + "get": { + "description": "Get a stream by id or uid.", + "operationId": "v1.stream.get", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "in": "path", + "name": "stream_id", + "required": true, "schema": { "type": "string" }, "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MessageBroadcastIn" - } - } - }, - "required": true - }, "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageBroadcastOut" + "$ref": "#/components/schemas/StreamOut" } } }, @@ -22555,63 +24411,103 @@ "HTTPBearer": [] } ], - "summary": "Create Broadcast Message", + "summary": "Get Stream", "tags": [ - "Broadcast" - ] - } - }, - "/api/v1/stats/app/{app_id}/attempt": { - "get": { - "description": "Returns application-level statistics on message attempts", - "operationId": "v1.stats.app-attempts", - "parameters": [ + "Stream" + ], + "x-codeSamples": [ { - "description": "Filter the range to data starting from this date", - "in": "query", - "name": "startDate", - "schema": { - "description": "Filter the range to data starting from this date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" + "label": "JavaScript", + "lang": "JavaScript", + "source": "const streamOut = await svix.stream.get(\"stream_id\");" }, { - "description": "Filter the range to data ending by this date", - "in": "query", - "name": "endDate", - "schema": { - "description": "Filter the range to data ending by this date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" + "label": "TypeScript", + "lang": "JavaScript", + "source": "const streamOut = await svix.stream.get(\"stream_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "stream_out = svix.stream.get(\"stream_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "stream_out = await svix.stream.get(\"stream_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "streamOut, err := svixClient.Stream.Get(ctx, \"stream_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val streamOut = svix.stream.get(\"stream_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "StreamOut streamOut = svix.getStream().get(\"stream_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "stream_out = svix.stream.get(\"stream_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let stream_out = svix.stream().get(\"stream_id\").await?;" }, { - "description": "The app's ID or UID", + "label": "C#", + "lang": "C#", + "source": "var streamOut = await svix.Stream.GetAsync(\"stream_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix stream get \"stream_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "patch": { + "description": "Partially update a stream.", + "operationId": "v1.stream.patch", + "parameters": [ + { "in": "path", - "name": "app_id", + "name": "stream_id", "required": true, "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamPatch" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AttemptStatisticsResponse" + "$ref": "#/components/schemas/StreamOut" } } }, @@ -22693,140 +24589,113 @@ "HTTPBearer": [] } ], - "summary": "Get App Attempt Stats", + "summary": "Patch Stream", "tags": [ - "Statistics" + "Stream" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const attemptStatisticsResponse = await svix.stats.appAttempts(\"app_id\");" + "source": "const streamOut = await svix.stream.patch(\"stream_id\", {\n uid: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const attemptStatisticsResponse = await svix.stats.appAttempts(\"app_id\");" + "source": "const streamOut = await svix.stream.patch(\"stream_id\", {\n uid: null\n});" }, { "label": "Python", "lang": "Python", - "source": "attempt_statistics_response = svix.stats.app_attempts(\"app_id\")" + "source": "stream_out = svix.stream.patch(\"stream_id\", StreamPatch(\n uid=None\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "attempt_statistics_response = await svix.stats.app_attempts(\"app_id\")" + "source": "stream_out = await svix.stream.patch(\"stream_id\", StreamPatch(\n uid=None\n))" }, { "label": "Go", "lang": "Go", - "source": "attemptStatisticsResponse, err := svixClient.Stats.AppAttempts(ctx, \"app_id\")" + "source": "streamOut, err := svixClient.Stream.Patch(ctx, \"stream_id\", &StreamPatch{\n Uid: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val attemptStatisticsResponse = svix.stats.appAttempts(\"app_id\")" + "source": "val streamOut = svix.stream.patch(\"stream_id\", StreamPatch()\n .uid(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "AttemptStatisticsResponse attemptStatisticsResponse = svix.getStats().appAttempts(\"app_id\")" + "source": "StreamOut streamOut = svix.getStream().patch(\"stream_id\", new StreamPatch()\n .uid(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "attempt_statistics_response = svix.stats.app_attempts(\"app_id\")" + "source": "stream_out = svix.stream.patch(\"stream_id\", Svix::StreamPatch.new({\n \"uid\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let attempt_statistics_response = svix.stats().app_attempts(\"app_id\").await?;" + "source": "let stream_out = svix.stream().patch(\"stream_id\", StreamPatch {\n uid: None,\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var attemptStatisticsResponse = await svix.Stats.AppAttemptsAsync(\"app_id\")" + "source": "var streamOut = await svix.Stream.PatchAsync(\"stream_id\", new StreamPatch{\n uid: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix stats app-attempts \"app_id\"" + "source": "svix stream patch \"stream_id\" '{\n \"uid\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stats/app/{app_id}/attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"uid\": null\n }'" } ] - } - }, - "/api/v1/stats/app/{app_id}/ep/{endpoint_id}/attempt": { - "get": { - "description": "Returns endpoint-level statistics on message attempts", - "operationId": "v1.stats.endpoint-attempts", + }, + "put": { + "description": "Update a stream.", + "operationId": "v1.stream.update", "parameters": [ { - "description": "Filter the range to data starting from this date", - "in": "query", - "name": "startDate", - "schema": { - "description": "Filter the range to data starting from this date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter the range to data ending by this date", - "in": "query", - "name": "endDate", - "schema": { - "description": "Filter the range to data ending by this date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The ep's ID or UID", "in": "path", - "name": "endpoint_id", + "name": "stream_id", "required": true, "schema": { - "description": "The ep's ID or UID", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamIn" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AttemptStatisticsResponse" + "$ref": "#/components/schemas/StreamOut" + } + } + }, + "description": "" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamOut" } } }, @@ -22908,105 +24777,129 @@ "HTTPBearer": [] } ], - "summary": "Get Ep Stats", + "summary": "Update Stream", "tags": [ - "Statistics" + "Stream" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const attemptStatisticsResponse = await svix.stats.endpointAttempts(\"app_id\", \"endpoint_id\");" + "source": "const streamOut = await svix.stream.update(\"stream_id\", {\n uid: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const attemptStatisticsResponse = await svix.stats.endpointAttempts(\"app_id\", \"endpoint_id\");" + "source": "const streamOut = await svix.stream.update(\"stream_id\", {\n uid: null\n});" }, { "label": "Python", "lang": "Python", - "source": "attempt_statistics_response = svix.stats.endpoint_attempts(\"app_id\", \"endpoint_id\")" + "source": "stream_out = svix.stream.update(\"stream_id\", StreamIn(\n uid=None\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "attempt_statistics_response = await svix.stats.endpoint_attempts(\"app_id\", \"endpoint_id\")" + "source": "stream_out = await svix.stream.update(\"stream_id\", StreamIn(\n uid=None\n))" }, { "label": "Go", "lang": "Go", - "source": "attemptStatisticsResponse, err := svixClient.Stats.EndpointAttempts(ctx, \"app_id\", \"endpoint_id\")" + "source": "streamOut, err := svixClient.Stream.Update(ctx, \"stream_id\", &StreamIn{\n Uid: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val attemptStatisticsResponse = svix.stats.endpointAttempts(\"app_id\", \"endpoint_id\")" + "source": "val streamOut = svix.stream.update(\"stream_id\", StreamIn()\n .uid(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "AttemptStatisticsResponse attemptStatisticsResponse = svix.getStats().endpointAttempts(\"app_id\", \"endpoint_id\")" + "source": "StreamOut streamOut = svix.getStream().update(\"stream_id\", new StreamIn()\n .uid(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "attempt_statistics_response = svix.stats.endpoint_attempts(\"app_id\", \"endpoint_id\")" + "source": "stream_out = svix.stream.update(\"stream_id\", Svix::StreamIn.new({\n \"uid\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let attempt_statistics_response = svix.stats().endpoint_attempts(\"app_id\", \"endpoint_id\").await?;" + "source": "let stream_out = svix.stream().update(\"stream_id\", StreamIn {\n uid: None,\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var attemptStatisticsResponse = await svix.Stats.EndpointAttemptsAsync(\"app_id\", \"endpoint_id\")" + "source": "var streamOut = await svix.Stream.UpdateAsync(\"stream_id\", new StreamIn{\n uid: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix stats endpoint-attempts \"app_id\" \"endpoint_id\"" + "source": "svix stream update \"stream_id\" '{\n \"uid\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stats/app/{app_id}/ep/{endpoint_id}/attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"uid\": null\n }'" } ] } }, - "/api/v1/stats/usage/app": { - "post": { - "description": "Creates a background task to calculate the message destinations for all applications in the environment.\n\nNote that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to\nretrieve the results of the operation.", - "operationId": "v1.statistics.aggregate-app-stats", + "/api/v1/stream/{stream_id}/events": { + "get": { + "description": "Iterate over a stream of events.", + "operationId": "v1.stream.events-get", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "in": "path", + "name": "stream_id", + "required": true, "schema": { "type": "string" }, "style": "simple" + }, + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "after", + "schema": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AppUsageStatsIn" - } - } - }, - "required": true - }, "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AppUsageStatsOut" + "$ref": "#/components/schemas/EventStreamOut" } } }, @@ -23088,84 +24981,112 @@ "HTTPBearer": [] } ], - "summary": "Aggregate App Stats", + "summary": "Stream Events", "tags": [ - "Statistics" + "Sink" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const appUsageStatsOut = await svix.statistics.aggregateAppStats({\n appIds: null\n});" + "source": "const eventStreamOut = await svix.stream.eventsGet(\"stream_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const appUsageStatsOut = await svix.statistics.aggregateAppStats({\n appIds: null\n});" + "source": "const eventStreamOut = await svix.stream.eventsGet(\"stream_id\");" }, { "label": "Python", "lang": "Python", - "source": "app_usage_stats_out = svix.statistics.aggregate_app_stats(AppUsageStatsIn(\n app_ids=None\n), None)" + "source": "event_stream_out = svix.stream.events_get(\"stream_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "app_usage_stats_out = await svix.statistics.aggregate_app_stats(AppUsageStatsIn(\n app_ids=None\n), None)" + "source": "event_stream_out = await svix.stream.events_get(\"stream_id\")" }, { "label": "Go", "lang": "Go", - "source": "appUsageStatsOut, err := svixClient.Statistics.AggregateAppStats(ctx, &AppUsageStatsIn{\n AppIds: nil,\n})" + "source": "eventStreamOut, err := svixClient.Stream.EventsGet(ctx, \"stream_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val appUsageStatsOut = svix.statistics.aggregateAppStats(AppUsageStatsIn()\n .appIds(null)\n)" + "source": "val eventStreamOut = svix.stream.eventsGet(\"stream_id\")" }, { "label": "Java", "lang": "Java", - "source": "AppUsageStatsOut appUsageStatsOut = svix.getStatistics().aggregateAppStats(new AppUsageStatsIn()\n .appIds(null)\n)" + "source": "EventStreamOut eventStreamOut = svix.getStream().eventsGet(\"stream_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "app_usage_stats_out = svix.statistics.aggregate_app_stats(Svix::AppUsageStatsIn.new({\n \"app_ids\": nil\n}))" + "source": "event_stream_out = svix.stream.events_get(\"stream_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let app_usage_stats_out = svix.statistics().aggregate_app_stats(AppUsageStatsIn {\n app_ids: None,\n}, None).await?;" + "source": "let event_stream_out = svix.stream().events_get(\"stream_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var appUsageStatsOut = await svix.Statistics.AggregateAppStatsAsync(new AppUsageStatsIn{\n appIds: null\n})" + "source": "var eventStreamOut = await svix.Stream.EventsGetAsync(\"stream_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix statistics aggregate-app-stats '{\n \"appIds\": null\n}'" + "source": "svix stream events-get \"stream_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/stats/usage/app' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"appIds\": null\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - } - }, - "/api/v1/stats/usage/event-types": { - "put": { - "description": "Creates a background task to calculate the listed event types for all apps in the organization.\n\nNote that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to\nretrieve the results of the operation.", - "operationId": "v1.statistics.aggregate-event-types", + }, + "post": { + "description": "Creates streaming events.", + "operationId": "v1.stream.create-events", + "parameters": [ + { + "in": "path", + "name": "stream_id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateStreamIn" + } + } + }, + "required": true + }, "responses": { "202": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AggregateEventTypesOut" + "$ref": "#/components/schemas/CreateStreamOut" } } }, @@ -23247,70 +25168,70 @@ "HTTPBearer": [] } ], - "summary": "Aggregate Event Types", + "summary": "Append To Stream", "tags": [ - "Statistics" + "Sink" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const aggregateEventTypesOut = await svix.statistics.aggregateEventTypes();" + "source": "const createStreamOut = await svix.stream.createEvents(\"stream_id\", \n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const aggregateEventTypesOut = await svix.statistics.aggregateEventTypes();" + "source": "const createStreamOut = await svix.stream.createEvents(\"stream_id\", \n});" }, { "label": "Python", "lang": "Python", - "source": "aggregate_event_types_out = svix.statistics.aggregate_event_types()" + "source": "create_stream_out = svix.stream.create_events(\"stream_id\", CreateStreamIn\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "aggregate_event_types_out = await svix.statistics.aggregate_event_types()" + "source": "create_stream_out = await svix.stream.create_events(\"stream_id\", CreateStreamIn\n), None)" }, { "label": "Go", "lang": "Go", - "source": "aggregateEventTypesOut, err := svixClient.Statistics.AggregateEventTypes(ctx)" + "source": "createStreamOut, err := svixClient.Stream.CreateEvents(ctx, \"stream_id\", &CreateStreamIn{\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val aggregateEventTypesOut = svix.statistics.aggregateEventTypes()" + "source": "val createStreamOut = svix.stream.createEvents(\"stream_id\", CreateStreamIn()\n)" }, { "label": "Java", "lang": "Java", - "source": "AggregateEventTypesOut aggregateEventTypesOut = svix.getStatistics().aggregateEventTypes()" + "source": "CreateStreamOut createStreamOut = svix.getStream().createEvents(\"stream_id\", new CreateStreamIn()\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "aggregate_event_types_out = svix.statistics.aggregate_event_types()" + "source": "create_stream_out = svix.stream.create_events(\"stream_id\", Svix::CreateStreamIn.new(\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let aggregate_event_types_out = svix.statistics().aggregate_event_types().await?;" + "source": "let create_stream_out = svix.stream().create_events(\"stream_id\", CreateStreamIn {\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var aggregateEventTypesOut = await svix.Statistics.AggregateEventTypesAsync()" + "source": "var createStreamOut = await svix.Stream.CreateEventsAsync(\"stream_id\", new CreateStreamIn\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix statistics aggregate-event-types " + "source": "svix stream create-events \"stream_id\" '\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/stats/usage/event-types' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '\n }'" } ] } diff --git a/rust/src/api.rs b/rust/src/api.rs index 24dcd6482..06fda4a9d 100644 --- a/rust/src/api.rs +++ b/rust/src/api.rs @@ -18,6 +18,17 @@ pub use crate::models::*; const CRATE_VERSION: &str = env!("CARGO_PKG_VERSION"); +#[cfg(feature = "svix_beta")] +pub mod raw_stream_api { + pub use crate::{ + apis::stream_api::*, + models::{ + stream_in::*, stream_out::*, stream_patch::*, stream_sink_in::*, stream_sink_out::*, + stream_sink_patch::*, + }, + }; +} + pub struct SvixOptions { pub debug: bool, pub server_url: Option, @@ -131,6 +142,11 @@ impl Svix { pub fn statistics(&self) -> Statistics<'_> { Statistics::new(&self.cfg) } + + #[cfg(feature = "svix_beta")] + pub fn cfg(&self) -> &Configuration { + &self.cfg + } } #[derive(Default)] diff --git a/rust/src/lib.rs b/rust/src/lib.rs index f9880c611..308d0a604 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -31,7 +31,7 @@ mod apis; #[allow(dead_code, clippy::all)] mod models; -struct Configuration { +pub struct Configuration { pub base_path: String, pub user_agent: Option, pub client: HyperClient>,