From b107994d2e8fb78fbbbf9fe292b484b3d623bcc8 Mon Sep 17 00:00:00 2001
From: Daniel Lyne <100604337+svix-daniel@users.noreply.github.com>
Date: Thu, 6 Apr 2023 16:07:48 -0400
Subject: [PATCH] Update openapi.json (#883)
This change simply includes the latest changes to our API and includes
the `.go` files generated by `generate_openapi.sh`
---
go/internal/openapi/api_authentication.go | 179 ++++++++++++++++
go/internal/openapi/api_message.go | 2 +
go/internal/openapi/api_message_attempt.go | 2 +-
.../openapi/model_one_time_token_in.go | 108 ++++++++++
.../openapi/model_one_time_token_out.go | 108 ++++++++++
openapi.json | 196 +++++++++++++++++-
6 files changed, 593 insertions(+), 2 deletions(-)
create mode 100644 go/internal/openapi/model_one_time_token_in.go
create mode 100644 go/internal/openapi/model_one_time_token_out.go
diff --git a/go/internal/openapi/api_authentication.go b/go/internal/openapi/api_authentication.go
index 295fc4d3e..8f45cfec0 100644
--- a/go/internal/openapi/api_authentication.go
+++ b/go/internal/openapi/api_authentication.go
@@ -27,6 +27,185 @@ var (
// AuthenticationApiService AuthenticationApi service
type AuthenticationApiService service
+type ApiExchangeOneTimeTokenApiV1AuthOneTimeTokenPostRequest struct {
+ ctx _context.Context
+ ApiService *AuthenticationApiService
+ oneTimeTokenIn *OneTimeTokenIn
+ idempotencyKey *string
+}
+
+func (r ApiExchangeOneTimeTokenApiV1AuthOneTimeTokenPostRequest) OneTimeTokenIn(oneTimeTokenIn OneTimeTokenIn) ApiExchangeOneTimeTokenApiV1AuthOneTimeTokenPostRequest {
+ r.oneTimeTokenIn = &oneTimeTokenIn
+ return r
+}
+func (r ApiExchangeOneTimeTokenApiV1AuthOneTimeTokenPostRequest) IdempotencyKey(idempotencyKey string) ApiExchangeOneTimeTokenApiV1AuthOneTimeTokenPostRequest {
+ r.idempotencyKey = &idempotencyKey
+ return r
+}
+
+func (r ApiExchangeOneTimeTokenApiV1AuthOneTimeTokenPostRequest) Execute() (OneTimeTokenOut, *_nethttp.Response, error) {
+ return r.ApiService.ExchangeOneTimeTokenApiV1AuthOneTimeTokenPostExecute(r)
+}
+
+/*
+ * ExchangeOneTimeTokenApiV1AuthOneTimeTokenPost Exchange One Time Token
+ * Exchange a one-time-token for an application token.
+ * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
+ * @return ApiExchangeOneTimeTokenApiV1AuthOneTimeTokenPostRequest
+ */
+func (a *AuthenticationApiService) ExchangeOneTimeTokenApiV1AuthOneTimeTokenPost(ctx _context.Context) ApiExchangeOneTimeTokenApiV1AuthOneTimeTokenPostRequest {
+ return ApiExchangeOneTimeTokenApiV1AuthOneTimeTokenPostRequest{
+ ApiService: a,
+ ctx: ctx,
+ }
+}
+
+/*
+ * Execute executes the request
+ * @return OneTimeTokenOut
+ */
+func (a *AuthenticationApiService) ExchangeOneTimeTokenApiV1AuthOneTimeTokenPostExecute(r ApiExchangeOneTimeTokenApiV1AuthOneTimeTokenPostRequest) (OneTimeTokenOut, *_nethttp.Response, error) {
+ var (
+ localVarHTTPMethod = _nethttp.MethodPost
+ localVarPostBody interface{}
+ localVarFormFileName string
+ localVarFileName string
+ localVarFileBytes []byte
+ localVarReturnValue OneTimeTokenOut
+ )
+
+ localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.ExchangeOneTimeTokenApiV1AuthOneTimeTokenPost")
+ if err != nil {
+ return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}
+ }
+
+ localVarPath := localBasePath + "/api/v1/auth/one-time-token/"
+
+ localVarHeaderParams := make(map[string]string)
+ localVarQueryParams := _neturl.Values{}
+ localVarFormParams := _neturl.Values{}
+ if r.oneTimeTokenIn == nil {
+ return localVarReturnValue, nil, reportError("oneTimeTokenIn 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.oneTimeTokenIn
+ 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 == 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 ApiExpireAllApiV1AuthAppAppIdExpireAllPostRequest struct {
ctx _context.Context
ApiService *AuthenticationApiService
diff --git a/go/internal/openapi/api_message.go b/go/internal/openapi/api_message.go
index bbff05f27..9b657305d 100644
--- a/go/internal/openapi/api_message.go
+++ b/go/internal/openapi/api_message.go
@@ -66,6 +66,8 @@ The `eventType` indicates the type and schema of the event. All messages of a ce
Messages 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.
The `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.
+
+The optional `application` property will be used to create an application if the application referenced in the path does not exist. If it does then this property is ignored.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param appId
* @return ApiCreateMessageApiV1AppAppIdMsgPostRequest
diff --git a/go/internal/openapi/api_message_attempt.go b/go/internal/openapi/api_message_attempt.go
index 77f0f6816..059590147 100644
--- a/go/internal/openapi/api_message_attempt.go
+++ b/go/internal/openapi/api_message_attempt.go
@@ -49,7 +49,7 @@ func (r ApiExpungeAttemptContentApiV1AppAppIdMsgMsgIdAttemptAttemptIdContentDele
/*
* ExpungeAttemptContentApiV1AppAppIdMsgMsgIdAttemptAttemptIdContentDelete Delete attempt response body
- * Deletes the given attempt's repsonse body. Useful when an endpoint accidentally returned sensitive content.
+ * Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param attemptId
* @param msgId
diff --git a/go/internal/openapi/model_one_time_token_in.go b/go/internal/openapi/model_one_time_token_in.go
new file mode 100644
index 000000000..28316e2a8
--- /dev/null
+++ b/go/internal/openapi/model_one_time_token_in.go
@@ -0,0 +1,108 @@
+/*
+ * Svix API
+ *
+ * Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * API version: 1.4
+ */
+
+// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
+
+package openapi
+
+import (
+ "encoding/json"
+)
+
+// OneTimeTokenIn struct for OneTimeTokenIn
+type OneTimeTokenIn struct {
+ OneTimeToken string `json:"oneTimeToken"`
+}
+
+// NewOneTimeTokenIn instantiates a new OneTimeTokenIn 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 NewOneTimeTokenIn(oneTimeToken string) *OneTimeTokenIn {
+ this := OneTimeTokenIn{}
+ this.OneTimeToken = oneTimeToken
+ return &this
+}
+
+// NewOneTimeTokenInWithDefaults instantiates a new OneTimeTokenIn 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 NewOneTimeTokenInWithDefaults() *OneTimeTokenIn {
+ this := OneTimeTokenIn{}
+ return &this
+}
+
+// GetOneTimeToken returns the OneTimeToken field value
+func (o *OneTimeTokenIn) GetOneTimeToken() string {
+ if o == nil {
+ var ret string
+ return ret
+ }
+
+ return o.OneTimeToken
+}
+
+// GetOneTimeTokenOk returns a tuple with the OneTimeToken field value
+// and a boolean to check if the value has been set.
+func (o *OneTimeTokenIn) GetOneTimeTokenOk() (*string, bool) {
+ if o == nil {
+ return nil, false
+ }
+ return &o.OneTimeToken, true
+}
+
+// SetOneTimeToken sets field value
+func (o *OneTimeTokenIn) SetOneTimeToken(v string) {
+ o.OneTimeToken = v
+}
+
+func (o OneTimeTokenIn) MarshalJSON() ([]byte, error) {
+ toSerialize := map[string]interface{}{}
+ if true {
+ toSerialize["oneTimeToken"] = o.OneTimeToken
+ }
+ return json.Marshal(toSerialize)
+}
+
+type NullableOneTimeTokenIn struct {
+ value *OneTimeTokenIn
+ isSet bool
+}
+
+func (v NullableOneTimeTokenIn) Get() *OneTimeTokenIn {
+ return v.value
+}
+
+func (v *NullableOneTimeTokenIn) Set(val *OneTimeTokenIn) {
+ v.value = val
+ v.isSet = true
+}
+
+func (v NullableOneTimeTokenIn) IsSet() bool {
+ return v.isSet
+}
+
+func (v *NullableOneTimeTokenIn) Unset() {
+ v.value = nil
+ v.isSet = false
+}
+
+func NewNullableOneTimeTokenIn(val *OneTimeTokenIn) *NullableOneTimeTokenIn {
+ return &NullableOneTimeTokenIn{value: val, isSet: true}
+}
+
+func (v NullableOneTimeTokenIn) MarshalJSON() ([]byte, error) {
+ return json.Marshal(v.value)
+}
+
+func (v *NullableOneTimeTokenIn) UnmarshalJSON(src []byte) error {
+ v.isSet = true
+ return json.Unmarshal(src, &v.value)
+}
+
+
diff --git a/go/internal/openapi/model_one_time_token_out.go b/go/internal/openapi/model_one_time_token_out.go
new file mode 100644
index 000000000..74181ee9a
--- /dev/null
+++ b/go/internal/openapi/model_one_time_token_out.go
@@ -0,0 +1,108 @@
+/*
+ * Svix API
+ *
+ * Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * API version: 1.4
+ */
+
+// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
+
+package openapi
+
+import (
+ "encoding/json"
+)
+
+// OneTimeTokenOut struct for OneTimeTokenOut
+type OneTimeTokenOut struct {
+ Token string `json:"token"`
+}
+
+// NewOneTimeTokenOut instantiates a new OneTimeTokenOut 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 NewOneTimeTokenOut(token string) *OneTimeTokenOut {
+ this := OneTimeTokenOut{}
+ this.Token = token
+ return &this
+}
+
+// NewOneTimeTokenOutWithDefaults instantiates a new OneTimeTokenOut 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 NewOneTimeTokenOutWithDefaults() *OneTimeTokenOut {
+ this := OneTimeTokenOut{}
+ return &this
+}
+
+// GetToken returns the Token field value
+func (o *OneTimeTokenOut) GetToken() string {
+ if o == nil {
+ var ret string
+ return ret
+ }
+
+ return o.Token
+}
+
+// GetTokenOk returns a tuple with the Token field value
+// and a boolean to check if the value has been set.
+func (o *OneTimeTokenOut) GetTokenOk() (*string, bool) {
+ if o == nil {
+ return nil, false
+ }
+ return &o.Token, true
+}
+
+// SetToken sets field value
+func (o *OneTimeTokenOut) SetToken(v string) {
+ o.Token = v
+}
+
+func (o OneTimeTokenOut) MarshalJSON() ([]byte, error) {
+ toSerialize := map[string]interface{}{}
+ if true {
+ toSerialize["token"] = o.Token
+ }
+ return json.Marshal(toSerialize)
+}
+
+type NullableOneTimeTokenOut struct {
+ value *OneTimeTokenOut
+ isSet bool
+}
+
+func (v NullableOneTimeTokenOut) Get() *OneTimeTokenOut {
+ return v.value
+}
+
+func (v *NullableOneTimeTokenOut) Set(val *OneTimeTokenOut) {
+ v.value = val
+ v.isSet = true
+}
+
+func (v NullableOneTimeTokenOut) IsSet() bool {
+ return v.isSet
+}
+
+func (v *NullableOneTimeTokenOut) Unset() {
+ v.value = nil
+ v.isSet = false
+}
+
+func NewNullableOneTimeTokenOut(val *OneTimeTokenOut) *NullableOneTimeTokenOut {
+ return &NullableOneTimeTokenOut{value: val, isSet: true}
+}
+
+func (v NullableOneTimeTokenOut) MarshalJSON() ([]byte, error) {
+ return json.Marshal(v.value)
+}
+
+func (v *NullableOneTimeTokenOut) UnmarshalJSON(src []byte) error {
+ v.isSet = true
+ return json.Unmarshal(src, &v.value)
+}
+
+
diff --git a/openapi.json b/openapi.json
index eb7070d92..8beddc9ff 100644
--- a/openapi.json
+++ b/openapi.json
@@ -2753,6 +2753,32 @@
"Sending"
]
},
+ "OneTimeTokenIn": {
+ "properties": {
+ "oneTimeToken": {
+ "title": "Onetimetoken",
+ "type": "string"
+ }
+ },
+ "required": [
+ "oneTimeToken"
+ ],
+ "title": "OneTimeTokenIn",
+ "type": "object"
+ },
+ "OneTimeTokenOut": {
+ "properties": {
+ "token": {
+ "title": "Token",
+ "type": "string"
+ }
+ },
+ "required": [
+ "token"
+ ],
+ "title": "OneTimeTokenOut",
+ "type": "object"
+ },
"Ordering": {
"description": "Defines the ordering in a listing of results.",
"enum": [
@@ -12725,6 +12751,174 @@
]
}
},
+ "/api/v1/auth/one-time-token/": {
+ "post": {
+ "description": "Exchange a one-time-token for an application token.",
+ "operationId": "exchange_one_time_token_api_v1_auth_one_time_token__post",
+ "parameters": [
+ {
+ "description": "The request's idempotency key",
+ "in": "header",
+ "name": "idempotency-key",
+ "required": false,
+ "schema": {
+ "description": "The request's idempotency key",
+ "nullable": true,
+ "title": "Idempotency-Key",
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OneTimeTokenIn"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OneTimeTokenOut"
+ }
+ }
+ },
+ "description": "Successful Response"
+ },
+ "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": "Exchange One Time Token",
+ "tags": [
+ "Authentication"
+ ],
+ "x-codeSamples": [
+ {
+ "label": "JavaScript",
+ "lang": "JavaScript",
+ "source": "const oneTimeTokenOut = await svix.authentication.exchange({\n oneTimeToken: None\n});"
+ },
+ {
+ "label": "TypeScript",
+ "lang": "JavaScript",
+ "source": "const oneTimeTokenOut = await svix.authentication.exchange({\n oneTimeToken: None\n});"
+ },
+ {
+ "label": "Python",
+ "lang": "Python",
+ "source": "one_time_token_out = svix.authentication.exchange(OneTimeTokenIn(\n one_time_token=None\n))"
+ },
+ {
+ "label": "Python (Async)",
+ "lang": "Python",
+ "source": "one_time_token_out = await svix.authentication.exchange(OneTimeTokenIn(\n one_time_token=None\n))"
+ },
+ {
+ "label": "Go",
+ "lang": "Go",
+ "source": "oneTimeTokenOut, err := svixClient.Authentication.Exchange(&svix.OneTimeTokenIn{\n OneTimeToken: None\n})"
+ },
+ {
+ "label": "Kotlin",
+ "lang": "Kotlin",
+ "source": "val oneTimeTokenOut = svix.authentication.exchange(OneTimeTokenIn()\n .oneTimeToken(None)\n)"
+ },
+ {
+ "label": "Java",
+ "lang": "Java",
+ "source": "OneTimeTokenOut oneTimeTokenOut = svix.getAuthentication().exchange(new OneTimeTokenIn()\n .oneTimeToken(None)\n)"
+ },
+ {
+ "label": "Ruby",
+ "lang": "Ruby",
+ "source": "one_time_token_out = svix.authentication.exchange(Svix::OneTimeTokenIn.new({\n \"one_time_token\": null\n}))"
+ },
+ {
+ "label": "Rust",
+ "lang": "Rust",
+ "source": "let one_time_token_out = svix.authentication().exchange(OneTimeTokenIn {\n one_time_token: None\n}).await?;"
+ },
+ {
+ "label": "C#",
+ "lang": "C#",
+ "source": "var oneTimeTokenOut = await svix.Authentication.ExchangeAsync(new OneTimeTokenIn{\n oneTimeToken: None\n})"
+ },
+ {
+ "label": "CLI",
+ "lang": "Shell",
+ "source": "svix authentication exchange '{\n \"oneTimeToken\": null\n}'"
+ },
+ {
+ "label": "cURL",
+ "lang": "Shell",
+ "source": "curl -X 'POST' \\\n 'https://api.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 \"oneTimeToken\": null\n}'"
+ }
+ ]
+ }
+ },
"/api/v1/environment/export/": {
"post": {
"description": "Download a JSON file containing all org-settings and event types",
@@ -14716,4 +14910,4 @@
}
}
}
-}
\ No newline at end of file
+}