From 8bcfa30eaabab122ce6d26bbf9748569fc1a2a31 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Tue, 23 Jan 2024 17:57:36 -0500 Subject: [PATCH] Bump openapi spec and regenerate libs (with manual change) The openapi.json file required a manual change to the 'inbound' schema to build. --- go/internal/openapi/api_event_type.go | 366 ++++++++++++++++++++ go/internal/openapi/model_message_in.go | 38 +++ openapi.json | 421 +++++++++++++++++++++++- 3 files changed, 813 insertions(+), 12 deletions(-) diff --git a/go/internal/openapi/api_event_type.go b/go/internal/openapi/api_event_type.go index 771ce7b5e..ed4e50a76 100644 --- a/go/internal/openapi/api_event_type.go +++ b/go/internal/openapi/api_event_type.go @@ -947,6 +947,184 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) return localVarReturnValue, localVarHTTPResponse, nil } +type ApiV1EventTypeGetRetryScheduleRequest struct { + ctx _context.Context + ApiService *EventTypeApiService + eventTypeName string +} + + +func (r ApiV1EventTypeGetRetryScheduleRequest) Execute() (RetryScheduleInOut, *_nethttp.Response, error) { + return r.ApiService.V1EventTypeGetRetryScheduleExecute(r) +} + +/* + * V1EventTypeGetRetrySchedule Get Retry Schedule + * Gets the retry schedule for messages using the given event type + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param eventTypeName The event type's name + * @return ApiV1EventTypeGetRetryScheduleRequest + */ +func (a *EventTypeApiService) V1EventTypeGetRetrySchedule(ctx _context.Context, eventTypeName string) ApiV1EventTypeGetRetryScheduleRequest { + return ApiV1EventTypeGetRetryScheduleRequest{ + ApiService: a, + ctx: ctx, + eventTypeName: eventTypeName, + } +} + +/* + * Execute executes the request + * @return RetryScheduleInOut + */ +func (a *EventTypeApiService) V1EventTypeGetRetryScheduleExecute(r ApiV1EventTypeGetRetryScheduleRequest) (RetryScheduleInOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue RetryScheduleInOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypeGetRetrySchedule") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/event-type/{event_type_name}/retry-schedule/" + localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", _neturl.PathEscape(parameterToString(r.eventTypeName, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if strlen(r.eventTypeName) > 256 { + return localVarReturnValue, nil, reportError("eventTypeName must have less than 256 elements") + } + + // 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 ApiV1EventTypeImportOpenapiRequest struct { ctx _context.Context ApiService *EventTypeApiService @@ -1726,3 +1904,191 @@ func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateReq return localVarReturnValue, localVarHTTPResponse, nil } + +type ApiV1EventTypeUpdateRetryScheduleRequest struct { + ctx _context.Context + ApiService *EventTypeApiService + eventTypeName string + retryScheduleInOut *RetryScheduleInOut +} + +func (r ApiV1EventTypeUpdateRetryScheduleRequest) RetryScheduleInOut(retryScheduleInOut RetryScheduleInOut) ApiV1EventTypeUpdateRetryScheduleRequest { + r.retryScheduleInOut = &retryScheduleInOut + return r +} + +func (r ApiV1EventTypeUpdateRetryScheduleRequest) Execute() (RetryScheduleInOut, *_nethttp.Response, error) { + return r.ApiService.V1EventTypeUpdateRetryScheduleExecute(r) +} + +/* + * V1EventTypeUpdateRetrySchedule Update Retry Schedule + * Sets a retry schedule for all messages using the given event type + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param eventTypeName The event type's name + * @return ApiV1EventTypeUpdateRetryScheduleRequest + */ +func (a *EventTypeApiService) V1EventTypeUpdateRetrySchedule(ctx _context.Context, eventTypeName string) ApiV1EventTypeUpdateRetryScheduleRequest { + return ApiV1EventTypeUpdateRetryScheduleRequest{ + ApiService: a, + ctx: ctx, + eventTypeName: eventTypeName, + } +} + +/* + * Execute executes the request + * @return RetryScheduleInOut + */ +func (a *EventTypeApiService) V1EventTypeUpdateRetryScheduleExecute(r ApiV1EventTypeUpdateRetryScheduleRequest) (RetryScheduleInOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue RetryScheduleInOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypeUpdateRetrySchedule") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/event-type/{event_type_name}/retry-schedule/" + localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", _neturl.PathEscape(parameterToString(r.eventTypeName, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if strlen(r.eventTypeName) > 256 { + return localVarReturnValue, nil, reportError("eventTypeName must have less than 256 elements") + } + if r.retryScheduleInOut == nil { + return localVarReturnValue, nil, reportError("retryScheduleInOut 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.retryScheduleInOut + 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/model_message_in.go b/go/internal/openapi/model_message_in.go index 899958d9d..e819f6e9a 100644 --- a/go/internal/openapi/model_message_in.go +++ b/go/internal/openapi/model_message_in.go @@ -27,6 +27,8 @@ type MessageIn struct { PayloadRetentionPeriod *int64 `json:"payloadRetentionPeriod,omitempty"` // List of free-form tags that can be filtered by when listing messages Tags []string `json:"tags,omitempty"` + // Extra parameters to pass to Transformations (for future use) + TransformationsParams map[string]interface{} `json:"transformationsParams,omitempty"` } // NewMessageIn instantiates a new MessageIn object @@ -272,6 +274,39 @@ func (o *MessageIn) SetTags(v []string) { o.Tags = v } +// GetTransformationsParams returns the TransformationsParams field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *MessageIn) GetTransformationsParams() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.TransformationsParams +} + +// GetTransformationsParamsOk returns a tuple with the TransformationsParams 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 *MessageIn) GetTransformationsParamsOk() (*map[string]interface{}, bool) { + if o == nil || o.TransformationsParams == nil { + return nil, false + } + return &o.TransformationsParams, true +} + +// HasTransformationsParams returns a boolean if a field has been set. +func (o *MessageIn) HasTransformationsParams() bool { + if o != nil && o.TransformationsParams != nil { + return true + } + + return false +} + +// SetTransformationsParams gets a reference to the given map[string]interface{} and assigns it to the TransformationsParams field. +func (o *MessageIn) SetTransformationsParams(v map[string]interface{}) { + o.TransformationsParams = v +} + func (o MessageIn) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Application != nil { @@ -295,6 +330,9 @@ func (o MessageIn) MarshalJSON() ([]byte, error) { if o.Tags != nil { toSerialize["tags"] = o.Tags } + if o.TransformationsParams != nil { + toSerialize["transformationsParams"] = o.TransformationsParams + } return json.Marshal(toSerialize) } diff --git a/openapi.json b/openapi.json index 99a3cf1b0..809923d0c 100644 --- a/openapi.json +++ b/openapi.json @@ -491,6 +491,25 @@ ], "type": "object" }, + "Duration": { + "properties": { + "nanos": { + "format": "uint32", + "minimum": 0, + "type": "integer" + }, + "secs": { + "format": "uint64", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "nanos", + "secs" + ], + "type": "object" + }, "EndpointCreatedEvent": { "description": "Sent when an endpoint is created.", "properties": { @@ -3092,6 +3111,11 @@ "nullable": true, "type": "array", "uniqueItems": true + }, + "transformationsParams": { + "description": "Extra parameters to pass to Transformations (for future use)", + "nullable": true, + "type": "object" } }, "required": [ @@ -3348,6 +3372,21 @@ ], "type": "object" }, + "RetrySchedule": { + "items": { + "$ref": "#/components/schemas/Duration" + }, + "type": "array" + }, + "RetryScheduleInOut": { + "properties": { + "retrySchedule": { + "$ref": "#/components/schemas/RetrySchedule", + "nullable": true + } + }, + "type": "object" + }, "RotatedUrlOut": { "properties": { "url": { @@ -12355,62 +12394,62 @@ { "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 payloadRetentionPeriod: 90,\n application: null,\n tags: [\"my_tag\", \"other\"]\n});" + "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 payloadRetentionPeriod: 90,\n application: null,\n tags: [\"my_tag\", \"other\"],\n transformationsParams: null\n});" }, { "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 payloadRetentionPeriod: 90,\n application: null,\n tags: [\"my_tag\", \"other\"]\n});" + "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 payloadRetentionPeriod: 90,\n application: null,\n tags: [\"my_tag\", \"other\"],\n transformationsParams: null\n});" }, { "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 payload_retention_period=90,\n application=None,\n tags=[\"my_tag\", \"other\"]\n), 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 payload_retention_period=90,\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None\n), 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 payload_retention_period=90,\n application=None,\n tags=[\"my_tag\", \"other\"]\n), 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 payload_retention_period=90,\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None\n), 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 PayloadRetentionPeriod: 90,\n Application: nil,\n Tags: []string{\"my_tag\", \"other\"},\n})" + "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 PayloadRetentionPeriod: 90,\n Application: nil,\n Tags: []string{\"my_tag\", \"other\"},\n TransformationsParams: nil,\n})" }, { "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 .payloadRetentionPeriod(90)\n .application(null)\n .tags(arrayOf(\"my_tag\", \"other\"))\n)" + "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 .payloadRetentionPeriod(90)\n .application(null)\n .tags(arrayOf(\"my_tag\", \"other\"))\n .transformationsParams(null)\n)" }, { "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 .payloadRetentionPeriod(90)\n .application(null)\n .tags(new String[]{\"my_tag\", \"other\"})\n)" + "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 .payloadRetentionPeriod(90)\n .application(null)\n .tags(new String[]{\"my_tag\", \"other\"})\n .transformationsParams(null)\n)" }, { "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 \"payload_retention_period\": 90,\n \"application\": nil,\n \"tags\": [\"my_tag\", \"other\"]\n}))" + "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 \"payload_retention_period\": 90,\n \"application\": nil,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformations_params\": nil\n}))" }, { "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 payload_retention_period: Some(90),\n application: None,\n tags: Some(vec![\"my_tag\".to_string(), \"other\".to_string()]),\n}, 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 payload_retention_period: Some(90),\n application: None,\n tags: Some(vec![\"my_tag\".to_string(), \"other\".to_string()]),\n transformations_params: None,\n}, 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 payloadRetentionPeriod: 90,\n application: null,\n tags: new string[] {\"my_tag\", \"other\"}\n})" + "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 payloadRetentionPeriod: 90,\n application: null,\n tags: new string[] {\"my_tag\", \"other\"},\n transformationsParams: null\n})" }, { "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 \"payloadRetentionPeriod\": 90,\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"]\n}'" + "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 \"payloadRetentionPeriod\": 90,\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformationsParams\": null\n}'" }, { "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 \"payloadRetentionPeriod\": 90,\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"]\n }'" + "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 \"payloadRetentionPeriod\": 90,\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformationsParams\": null\n }'" } ] } @@ -18322,6 +18361,364 @@ ] } }, + "/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" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetryScheduleInOut" + } + } + }, + "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 Retry Schedule", + "tags": [ + "Event Type" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const retryScheduleInOut = await svix.eventType.getRetrySchedule(\"event_type_name\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const retryScheduleInOut = await svix.eventType.getRetrySchedule(\"event_type_name\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "retry_schedule_in_out = svix.event_type.get_retry_schedule(\"event_type_name\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "retry_schedule_in_out = await svix.event_type.get_retry_schedule(\"event_type_name\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "retryScheduleInOut, err := svixClient.EventType.GetRetrySchedule(ctx, \"event_type_name\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val retryScheduleInOut = svix.eventType.getRetrySchedule(\"event_type_name\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "RetryScheduleInOut retryScheduleInOut = svix.getEventType().getRetrySchedule(\"event_type_name\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "retry_schedule_in_out = svix.event_type.get_retry_schedule(\"event_type_name\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let retry_schedule_in_out = svix.event_type().get_retry_schedule(\"event_type_name\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var retryScheduleInOut = await svix.EventType.GetRetryScheduleAsync(\"event_type_name\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix event-type get-retry-schedule \"event_type_name\"" + }, + { + "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'" + } + ] + }, + "put": { + "description": "Sets a retry schedule for all messages using the given event type", + "operationId": "v1.event-type.update-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" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetryScheduleInOut" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetryScheduleInOut" + } + } + }, + "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 Retry Schedule", + "tags": [ + "Event Type" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const retryScheduleInOut = await svix.eventType.updateRetrySchedule(\"event_type_name\", {\n retrySchedule: null\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const retryScheduleInOut = await svix.eventType.updateRetrySchedule(\"event_type_name\", {\n retrySchedule: null\n});" + }, + { + "label": "Python", + "lang": "Python", + "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": "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": "retryScheduleInOut, err := svixClient.EventType.UpdateRetrySchedule(ctx, \"event_type_name\", &RetryScheduleInOut{\n RetrySchedule: nil,\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val retryScheduleInOut = svix.eventType.updateRetrySchedule(\"event_type_name\", RetryScheduleInOut()\n .retrySchedule(null)\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "RetryScheduleInOut retryScheduleInOut = svix.getEventType().updateRetrySchedule(\"event_type_name\", new RetryScheduleInOut()\n .retrySchedule(null)\n)" + }, + { + "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/health/": { "get": { "description": "Verify the API server is up and running.",