From 5693d55ce71c3aa68830f93ae508661809e3391e Mon Sep 17 00:00:00 2001 From: Frank Chiarulli Jr Date: Tue, 1 Mar 2022 15:13:51 -0500 Subject: [PATCH 1/7] Libs: Bump OpenAPI Spec --- go/internal/openapi/api_message_attempt.go | 16 ++ ...el_message_attempt_exhausted_event_data.go | 12 +- .../model_message_attempt_failed_data.go | 167 +++++++++++++ .../model_message_attempt_failing_event.go | 148 +++++++++++ ...odel_message_attempt_failing_event_data.go | 232 ++++++++++++++++++ .../openapi/model_status_code_class.go | 118 +++++++++ go/internal/openapi/model_webhook_types.go | 31 ++- openapi.json | 147 ++++++++++- 8 files changed, 860 insertions(+), 11 deletions(-) create mode 100644 go/internal/openapi/model_message_attempt_failed_data.go create mode 100644 go/internal/openapi/model_message_attempt_failing_event.go create mode 100644 go/internal/openapi/model_message_attempt_failing_event_data.go create mode 100644 go/internal/openapi/model_status_code_class.go diff --git a/go/internal/openapi/api_message_attempt.go b/go/internal/openapi/api_message_attempt.go index fc6e0d763..fafcc9b92 100644 --- a/go/internal/openapi/api_message_attempt.go +++ b/go/internal/openapi/api_message_attempt.go @@ -889,6 +889,7 @@ type ApiListAttemptsByEndpointApiV1AppAppIdAttemptEndpointEndpointIdGetRequest s iterator *string limit *int32 status *MessageStatus + statusCodeClass *StatusCodeClass eventTypes *[]string channel *string before *time.Time @@ -908,6 +909,10 @@ func (r ApiListAttemptsByEndpointApiV1AppAppIdAttemptEndpointEndpointIdGetReques r.status = &status return r } +func (r ApiListAttemptsByEndpointApiV1AppAppIdAttemptEndpointEndpointIdGetRequest) StatusCodeClass(statusCodeClass StatusCodeClass) ApiListAttemptsByEndpointApiV1AppAppIdAttemptEndpointEndpointIdGetRequest { + r.statusCodeClass = &statusCodeClass + return r +} func (r ApiListAttemptsByEndpointApiV1AppAppIdAttemptEndpointEndpointIdGetRequest) EventTypes(eventTypes []string) ApiListAttemptsByEndpointApiV1AppAppIdAttemptEndpointEndpointIdGetRequest { r.eventTypes = &eventTypes return r @@ -998,6 +1003,9 @@ func (a *MessageAttemptApiService) ListAttemptsByEndpointApiV1AppAppIdAttemptEnd if r.status != nil { localVarQueryParams.Add("status", parameterToString(*r.status, "")) } + if r.statusCodeClass != nil { + localVarQueryParams.Add("status_code_class", parameterToString(*r.statusCodeClass, "")) + } if r.eventTypes != nil { t := *r.eventTypes if reflect.TypeOf(t).Kind() == reflect.Slice { @@ -1133,6 +1141,7 @@ type ApiListAttemptsByMsgApiV1AppAppIdAttemptMsgMsgIdGetRequest struct { iterator *string limit *int32 status *MessageStatus + statusCodeClass *StatusCodeClass eventTypes *[]string channel *string before *time.Time @@ -1156,6 +1165,10 @@ func (r ApiListAttemptsByMsgApiV1AppAppIdAttemptMsgMsgIdGetRequest) Status(statu r.status = &status return r } +func (r ApiListAttemptsByMsgApiV1AppAppIdAttemptMsgMsgIdGetRequest) StatusCodeClass(statusCodeClass StatusCodeClass) ApiListAttemptsByMsgApiV1AppAppIdAttemptMsgMsgIdGetRequest { + r.statusCodeClass = &statusCodeClass + return r +} func (r ApiListAttemptsByMsgApiV1AppAppIdAttemptMsgMsgIdGetRequest) EventTypes(eventTypes []string) ApiListAttemptsByMsgApiV1AppAppIdAttemptMsgMsgIdGetRequest { r.eventTypes = &eventTypes return r @@ -1249,6 +1262,9 @@ func (a *MessageAttemptApiService) ListAttemptsByMsgApiV1AppAppIdAttemptMsgMsgId if r.status != nil { localVarQueryParams.Add("status", parameterToString(*r.status, "")) } + if r.statusCodeClass != nil { + localVarQueryParams.Add("status_code_class", parameterToString(*r.statusCodeClass, "")) + } if r.eventTypes != nil { t := *r.eventTypes if reflect.TypeOf(t).Kind() == reflect.Slice { diff --git a/go/internal/openapi/model_message_attempt_exhausted_event_data.go b/go/internal/openapi/model_message_attempt_exhausted_event_data.go index eeb0d9b29..bb207507b 100644 --- a/go/internal/openapi/model_message_attempt_exhausted_event_data.go +++ b/go/internal/openapi/model_message_attempt_exhausted_event_data.go @@ -20,7 +20,7 @@ type MessageAttemptExhaustedEventData struct { // Optional unique identifier for the application AppUid *string `json:"appUid,omitempty"` EndpointId string `json:"endpointId"` - LastAttempt MessageAttemptFailedEvent `json:"lastAttempt"` + LastAttempt MessageAttemptFailedData `json:"lastAttempt"` MsgId string `json:"msgId"` } @@ -28,7 +28,7 @@ type MessageAttemptExhaustedEventData struct { // 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 NewMessageAttemptExhaustedEventData(appId string, endpointId string, lastAttempt MessageAttemptFailedEvent, msgId string) *MessageAttemptExhaustedEventData { +func NewMessageAttemptExhaustedEventData(appId string, endpointId string, lastAttempt MessageAttemptFailedData, msgId string) *MessageAttemptExhaustedEventData { this := MessageAttemptExhaustedEventData{} this.AppId = appId this.EndpointId = endpointId @@ -126,9 +126,9 @@ func (o *MessageAttemptExhaustedEventData) SetEndpointId(v string) { } // GetLastAttempt returns the LastAttempt field value -func (o *MessageAttemptExhaustedEventData) GetLastAttempt() MessageAttemptFailedEvent { +func (o *MessageAttemptExhaustedEventData) GetLastAttempt() MessageAttemptFailedData { if o == nil { - var ret MessageAttemptFailedEvent + var ret MessageAttemptFailedData return ret } @@ -137,7 +137,7 @@ func (o *MessageAttemptExhaustedEventData) GetLastAttempt() MessageAttemptFailed // GetLastAttemptOk returns a tuple with the LastAttempt field value // and a boolean to check if the value has been set. -func (o *MessageAttemptExhaustedEventData) GetLastAttemptOk() (*MessageAttemptFailedEvent, bool) { +func (o *MessageAttemptExhaustedEventData) GetLastAttemptOk() (*MessageAttemptFailedData, bool) { if o == nil { return nil, false } @@ -145,7 +145,7 @@ func (o *MessageAttemptExhaustedEventData) GetLastAttemptOk() (*MessageAttemptFa } // SetLastAttempt sets field value -func (o *MessageAttemptExhaustedEventData) SetLastAttempt(v MessageAttemptFailedEvent) { +func (o *MessageAttemptExhaustedEventData) SetLastAttempt(v MessageAttemptFailedData) { o.LastAttempt = v } diff --git a/go/internal/openapi/model_message_attempt_failed_data.go b/go/internal/openapi/model_message_attempt_failed_data.go new file mode 100644 index 000000000..d7f177223 --- /dev/null +++ b/go/internal/openapi/model_message_attempt_failed_data.go @@ -0,0 +1,167 @@ +/* + * 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" + "time" +) + +// MessageAttemptFailedData struct for MessageAttemptFailedData +type MessageAttemptFailedData struct { + Id string `json:"id"` + ResponseStatusCode int32 `json:"responseStatusCode"` + Timestamp time.Time `json:"timestamp"` +} + +// NewMessageAttemptFailedData instantiates a new MessageAttemptFailedData 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 NewMessageAttemptFailedData(id string, responseStatusCode int32, timestamp time.Time) *MessageAttemptFailedData { + this := MessageAttemptFailedData{} + this.Id = id + this.ResponseStatusCode = responseStatusCode + this.Timestamp = timestamp + return &this +} + +// NewMessageAttemptFailedDataWithDefaults instantiates a new MessageAttemptFailedData 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 NewMessageAttemptFailedDataWithDefaults() *MessageAttemptFailedData { + this := MessageAttemptFailedData{} + return &this +} + +// GetId returns the Id field value +func (o *MessageAttemptFailedData) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MessageAttemptFailedData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MessageAttemptFailedData) SetId(v string) { + o.Id = v +} + +// GetResponseStatusCode returns the ResponseStatusCode field value +func (o *MessageAttemptFailedData) GetResponseStatusCode() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ResponseStatusCode +} + +// GetResponseStatusCodeOk returns a tuple with the ResponseStatusCode field value +// and a boolean to check if the value has been set. +func (o *MessageAttemptFailedData) GetResponseStatusCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ResponseStatusCode, true +} + +// SetResponseStatusCode sets field value +func (o *MessageAttemptFailedData) SetResponseStatusCode(v int32) { + o.ResponseStatusCode = v +} + +// GetTimestamp returns the Timestamp field value +func (o *MessageAttemptFailedData) GetTimestamp() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *MessageAttemptFailedData) GetTimestampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *MessageAttemptFailedData) SetTimestamp(v time.Time) { + o.Timestamp = v +} + +func (o MessageAttemptFailedData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["id"] = o.Id + } + if true { + toSerialize["responseStatusCode"] = o.ResponseStatusCode + } + if true { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableMessageAttemptFailedData struct { + value *MessageAttemptFailedData + isSet bool +} + +func (v NullableMessageAttemptFailedData) Get() *MessageAttemptFailedData { + return v.value +} + +func (v *NullableMessageAttemptFailedData) Set(val *MessageAttemptFailedData) { + v.value = val + v.isSet = true +} + +func (v NullableMessageAttemptFailedData) IsSet() bool { + return v.isSet +} + +func (v *NullableMessageAttemptFailedData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMessageAttemptFailedData(val *MessageAttemptFailedData) *NullableMessageAttemptFailedData { + return &NullableMessageAttemptFailedData{value: val, isSet: true} +} + +func (v NullableMessageAttemptFailedData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMessageAttemptFailedData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_message_attempt_failing_event.go b/go/internal/openapi/model_message_attempt_failing_event.go new file mode 100644 index 000000000..9c2351b98 --- /dev/null +++ b/go/internal/openapi/model_message_attempt_failing_event.go @@ -0,0 +1,148 @@ +/* + * 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" +) + +// MessageAttemptFailingEvent Sent after a message has been failing for a few times. It's sent on the fourth failure. It complements `message.attempt.exhausted` which is sent after the last failure. +type MessageAttemptFailingEvent struct { + Data MessageAttemptFailingEventData `json:"data"` + Type *string `json:"type,omitempty"` +} + +// NewMessageAttemptFailingEvent instantiates a new MessageAttemptFailingEvent 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 NewMessageAttemptFailingEvent(data MessageAttemptFailingEventData) *MessageAttemptFailingEvent { + this := MessageAttemptFailingEvent{} + this.Data = data + var type_ string = "message.attempt.failing" + this.Type = &type_ + return &this +} + +// NewMessageAttemptFailingEventWithDefaults instantiates a new MessageAttemptFailingEvent 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 NewMessageAttemptFailingEventWithDefaults() *MessageAttemptFailingEvent { + this := MessageAttemptFailingEvent{} + var type_ string = "message.attempt.failing" + this.Type = &type_ + return &this +} + +// GetData returns the Data field value +func (o *MessageAttemptFailingEvent) GetData() MessageAttemptFailingEventData { + if o == nil { + var ret MessageAttemptFailingEventData + 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 *MessageAttemptFailingEvent) GetDataOk() (*MessageAttemptFailingEventData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *MessageAttemptFailingEvent) SetData(v MessageAttemptFailingEventData) { + o.Data = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *MessageAttemptFailingEvent) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MessageAttemptFailingEvent) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *MessageAttemptFailingEvent) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *MessageAttemptFailingEvent) SetType(v string) { + o.Type = &v +} + +func (o MessageAttemptFailingEvent) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["data"] = o.Data + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableMessageAttemptFailingEvent struct { + value *MessageAttemptFailingEvent + isSet bool +} + +func (v NullableMessageAttemptFailingEvent) Get() *MessageAttemptFailingEvent { + return v.value +} + +func (v *NullableMessageAttemptFailingEvent) Set(val *MessageAttemptFailingEvent) { + v.value = val + v.isSet = true +} + +func (v NullableMessageAttemptFailingEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableMessageAttemptFailingEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMessageAttemptFailingEvent(val *MessageAttemptFailingEvent) *NullableMessageAttemptFailingEvent { + return &NullableMessageAttemptFailingEvent{value: val, isSet: true} +} + +func (v NullableMessageAttemptFailingEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMessageAttemptFailingEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_message_attempt_failing_event_data.go b/go/internal/openapi/model_message_attempt_failing_event_data.go new file mode 100644 index 000000000..2fe4d97d5 --- /dev/null +++ b/go/internal/openapi/model_message_attempt_failing_event_data.go @@ -0,0 +1,232 @@ +/* + * 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" +) + +// MessageAttemptFailingEventData struct for MessageAttemptFailingEventData +type MessageAttemptFailingEventData struct { + AppId string `json:"appId"` + // Optional unique identifier for the application + AppUid *string `json:"appUid,omitempty"` + EndpointId string `json:"endpointId"` + LastAttempt MessageAttemptFailedData `json:"lastAttempt"` + MsgId string `json:"msgId"` +} + +// NewMessageAttemptFailingEventData instantiates a new MessageAttemptFailingEventData 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 NewMessageAttemptFailingEventData(appId string, endpointId string, lastAttempt MessageAttemptFailedData, msgId string) *MessageAttemptFailingEventData { + this := MessageAttemptFailingEventData{} + this.AppId = appId + this.EndpointId = endpointId + this.LastAttempt = lastAttempt + this.MsgId = msgId + return &this +} + +// NewMessageAttemptFailingEventDataWithDefaults instantiates a new MessageAttemptFailingEventData 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 NewMessageAttemptFailingEventDataWithDefaults() *MessageAttemptFailingEventData { + this := MessageAttemptFailingEventData{} + return &this +} + +// GetAppId returns the AppId field value +func (o *MessageAttemptFailingEventData) GetAppId() string { + if o == nil { + var ret string + return ret + } + + return o.AppId +} + +// GetAppIdOk returns a tuple with the AppId field value +// and a boolean to check if the value has been set. +func (o *MessageAttemptFailingEventData) GetAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppId, true +} + +// SetAppId sets field value +func (o *MessageAttemptFailingEventData) SetAppId(v string) { + o.AppId = v +} + +// GetAppUid returns the AppUid field value if set, zero value otherwise. +func (o *MessageAttemptFailingEventData) GetAppUid() string { + if o == nil || o.AppUid == nil { + var ret string + return ret + } + return *o.AppUid +} + +// GetAppUidOk returns a tuple with the AppUid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MessageAttemptFailingEventData) GetAppUidOk() (*string, bool) { + if o == nil || o.AppUid == nil { + return nil, false + } + return o.AppUid, true +} + +// HasAppUid returns a boolean if a field has been set. +func (o *MessageAttemptFailingEventData) HasAppUid() bool { + if o != nil && o.AppUid != nil { + return true + } + + return false +} + +// SetAppUid gets a reference to the given string and assigns it to the AppUid field. +func (o *MessageAttemptFailingEventData) SetAppUid(v string) { + o.AppUid = &v +} + +// GetEndpointId returns the EndpointId field value +func (o *MessageAttemptFailingEventData) GetEndpointId() string { + if o == nil { + var ret string + return ret + } + + return o.EndpointId +} + +// GetEndpointIdOk returns a tuple with the EndpointId field value +// and a boolean to check if the value has been set. +func (o *MessageAttemptFailingEventData) GetEndpointIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EndpointId, true +} + +// SetEndpointId sets field value +func (o *MessageAttemptFailingEventData) SetEndpointId(v string) { + o.EndpointId = v +} + +// GetLastAttempt returns the LastAttempt field value +func (o *MessageAttemptFailingEventData) GetLastAttempt() MessageAttemptFailedData { + if o == nil { + var ret MessageAttemptFailedData + return ret + } + + return o.LastAttempt +} + +// GetLastAttemptOk returns a tuple with the LastAttempt field value +// and a boolean to check if the value has been set. +func (o *MessageAttemptFailingEventData) GetLastAttemptOk() (*MessageAttemptFailedData, bool) { + if o == nil { + return nil, false + } + return &o.LastAttempt, true +} + +// SetLastAttempt sets field value +func (o *MessageAttemptFailingEventData) SetLastAttempt(v MessageAttemptFailedData) { + o.LastAttempt = v +} + +// GetMsgId returns the MsgId field value +func (o *MessageAttemptFailingEventData) GetMsgId() string { + if o == nil { + var ret string + return ret + } + + return o.MsgId +} + +// GetMsgIdOk returns a tuple with the MsgId field value +// and a boolean to check if the value has been set. +func (o *MessageAttemptFailingEventData) GetMsgIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MsgId, true +} + +// SetMsgId sets field value +func (o *MessageAttemptFailingEventData) SetMsgId(v string) { + o.MsgId = v +} + +func (o MessageAttemptFailingEventData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["appId"] = o.AppId + } + if o.AppUid != nil { + toSerialize["appUid"] = o.AppUid + } + if true { + toSerialize["endpointId"] = o.EndpointId + } + if true { + toSerialize["lastAttempt"] = o.LastAttempt + } + if true { + toSerialize["msgId"] = o.MsgId + } + return json.Marshal(toSerialize) +} + +type NullableMessageAttemptFailingEventData struct { + value *MessageAttemptFailingEventData + isSet bool +} + +func (v NullableMessageAttemptFailingEventData) Get() *MessageAttemptFailingEventData { + return v.value +} + +func (v *NullableMessageAttemptFailingEventData) Set(val *MessageAttemptFailingEventData) { + v.value = val + v.isSet = true +} + +func (v NullableMessageAttemptFailingEventData) IsSet() bool { + return v.isSet +} + +func (v *NullableMessageAttemptFailingEventData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMessageAttemptFailingEventData(val *MessageAttemptFailingEventData) *NullableMessageAttemptFailingEventData { + return &NullableMessageAttemptFailingEventData{value: val, isSet: true} +} + +func (v NullableMessageAttemptFailingEventData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMessageAttemptFailingEventData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_status_code_class.go b/go/internal/openapi/model_status_code_class.go new file mode 100644 index 000000000..835bf878b --- /dev/null +++ b/go/internal/openapi/model_status_code_class.go @@ -0,0 +1,118 @@ +/* + * 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" + "fmt" +) + +// StatusCodeClass The different classes of HTTP status codes: - CodeNone = 0 - Code1xx = 100 - Code2xx = 200 - Code3xx = 300 - Code4xx = 400 - Code5xx = 500 +type StatusCodeClass int32 + +// List of StatusCodeClass +const ( + STATUSCODECLASS_CodeNone StatusCodeClass = 0 + STATUSCODECLASS_Code1xx StatusCodeClass = 100 + STATUSCODECLASS_Code2xx StatusCodeClass = 200 + STATUSCODECLASS_Code3xx StatusCodeClass = 300 + STATUSCODECLASS_Code4xx StatusCodeClass = 400 + STATUSCODECLASS_Code5xx StatusCodeClass = 500 +) + +var allowedStatusCodeClassEnumValues = []StatusCodeClass{ + 0, + 100, + 200, + 300, + 400, + 500, +} + +func (v *StatusCodeClass) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := StatusCodeClass(value) + for _, existing := range allowedStatusCodeClassEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid StatusCodeClass", value) +} + +// NewStatusCodeClassFromValue returns a pointer to a valid StatusCodeClass +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStatusCodeClassFromValue(v int32) (*StatusCodeClass, error) { + ev := StatusCodeClass(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for StatusCodeClass: valid values are %v", v, allowedStatusCodeClassEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v StatusCodeClass) IsValid() bool { + for _, existing := range allowedStatusCodeClassEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StatusCodeClass value +func (v StatusCodeClass) Ptr() *StatusCodeClass { + return &v +} + +type NullableStatusCodeClass struct { + value *StatusCodeClass + isSet bool +} + +func (v NullableStatusCodeClass) Get() *StatusCodeClass { + return v.value +} + +func (v *NullableStatusCodeClass) Set(val *StatusCodeClass) { + v.value = val + v.isSet = true +} + +func (v NullableStatusCodeClass) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusCodeClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusCodeClass(val *StatusCodeClass) *NullableStatusCodeClass { + return &NullableStatusCodeClass{value: val, isSet: true} +} + +func (v NullableStatusCodeClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusCodeClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/go/internal/openapi/model_webhook_types.go b/go/internal/openapi/model_webhook_types.go index 180d02da8..2c31c5ef0 100644 --- a/go/internal/openapi/model_webhook_types.go +++ b/go/internal/openapi/model_webhook_types.go @@ -17,6 +17,7 @@ import ( // WebhookTypes All of the webhook types that we support type WebhookTypes struct { A EndpointDisabledEvent `json:"a"` + A1 MessageAttemptFailingEvent `json:"a1"` B EndpointCreatedEvent `json:"b"` C EndpointUpdatedEvent `json:"c"` D EndpointDeletedEvent `json:"d"` @@ -27,9 +28,10 @@ type WebhookTypes struct { // 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 NewWebhookTypes(a EndpointDisabledEvent, b EndpointCreatedEvent, c EndpointUpdatedEvent, d EndpointDeletedEvent, e MessageAttemptExhaustedEvent) *WebhookTypes { +func NewWebhookTypes(a EndpointDisabledEvent, a1 MessageAttemptFailingEvent, b EndpointCreatedEvent, c EndpointUpdatedEvent, d EndpointDeletedEvent, e MessageAttemptExhaustedEvent) *WebhookTypes { this := WebhookTypes{} this.A = a + this.A1 = a1 this.B = b this.C = c this.D = d @@ -69,6 +71,30 @@ func (o *WebhookTypes) SetA(v EndpointDisabledEvent) { o.A = v } +// GetA1 returns the A1 field value +func (o *WebhookTypes) GetA1() MessageAttemptFailingEvent { + if o == nil { + var ret MessageAttemptFailingEvent + return ret + } + + return o.A1 +} + +// GetA1Ok returns a tuple with the A1 field value +// and a boolean to check if the value has been set. +func (o *WebhookTypes) GetA1Ok() (*MessageAttemptFailingEvent, bool) { + if o == nil { + return nil, false + } + return &o.A1, true +} + +// SetA1 sets field value +func (o *WebhookTypes) SetA1(v MessageAttemptFailingEvent) { + o.A1 = v +} + // GetB returns the B field value func (o *WebhookTypes) GetB() EndpointCreatedEvent { if o == nil { @@ -170,6 +196,9 @@ func (o WebhookTypes) MarshalJSON() ([]byte, error) { if true { toSerialize["a"] = o.A } + if true { + toSerialize["a1"] = o.A1 + } if true { toSerialize["b"] = o.B } diff --git a/openapi.json b/openapi.json index c4c148ef8..ccd55cd09 100644 --- a/openapi.json +++ b/openapi.json @@ -1755,7 +1755,7 @@ "type": "string" }, "lastAttempt": { - "$ref": "#/components/schemas/MessageAttemptFailedEvent" + "$ref": "#/components/schemas/MessageAttemptFailedData" }, "msgId": { "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2", @@ -1772,7 +1772,7 @@ "title": "MessageAttemptExhaustedEventData", "type": "object" }, - "MessageAttemptFailedEvent": { + "MessageAttemptFailedData": { "properties": { "id": { "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", @@ -1795,7 +1795,81 @@ "responseStatusCode", "timestamp" ], - "title": "MessageAttemptFailedEvent", + "title": "MessageAttemptFailedData", + "type": "object" + }, + "MessageAttemptFailingEvent": { + "description": "Sent after a message has been failing for a few times.\nIt's sent on the fourth failure. It complements `message.attempt.exhausted` which is sent after the last failure.", + "example": { + "data": { + "appId": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "appUid": "unique-app-identifier", + "endpointId": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "lastAttempt": { + "id": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "responseStatusCode": 500, + "timestamp": "1970-01-01T00:00:00" + }, + "msgId": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "type": "message.attempt.failing" + }, + "properties": { + "data": { + "$ref": "#/components/schemas/MessageAttemptFailingEventData" + }, + "type": { + "default": "message.attempt.failing", + "enum": [ + "message.attempt.failing" + ], + "title": "Type", + "type": "string" + } + }, + "required": [ + "data" + ], + "title": "MessageAttemptFailingEvent", + "type": "object" + }, + "MessageAttemptFailingEventData": { + "properties": { + "appId": { + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "title": "Appid", + "type": "string" + }, + "appUid": { + "description": "Optional unique identifier for the application", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "title": "Appuid", + "type": "string" + }, + "endpointId": { + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "title": "Endpointid", + "type": "string" + }, + "lastAttempt": { + "$ref": "#/components/schemas/MessageAttemptFailedData" + }, + "msgId": { + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "title": "Msgid", + "type": "string" + } + }, + "required": [ + "appId", + "msgId", + "endpointId", + "lastAttempt" + ], + "title": "MessageAttemptFailingEventData", "type": "object" }, "MessageAttemptOut": { @@ -2232,6 +2306,27 @@ "title": "StatisticsPeriod", "type": "string" }, + "StatusCodeClass": { + "description": "The different classes of HTTP status codes:\n- CodeNone = 0\n- Code1xx = 100\n- Code2xx = 200\n- Code3xx = 300\n- Code4xx = 400\n- Code5xx = 500", + "enum": [ + 0, + 100, + 200, + 300, + 400, + 500 + ], + "title": "StatusCodeClass", + "type": "integer", + "x-enum-varnames": [ + "CodeNone", + "Code1xx", + "Code2xx", + "Code3xx", + "Code4xx", + "Code5xx" + ] + }, "ValidationError": { "properties": { "loc": { @@ -2264,6 +2359,9 @@ "a": { "$ref": "#/components/schemas/EndpointDisabledEvent" }, + "a1": { + "$ref": "#/components/schemas/MessageAttemptFailingEvent" + }, "b": { "$ref": "#/components/schemas/EndpointCreatedEvent" }, @@ -2282,7 +2380,8 @@ "b", "c", "d", - "e" + "e", + "a1" ], "title": "WebhookTypes", "type": "object" @@ -3143,6 +3242,14 @@ "$ref": "#/components/schemas/MessageStatus" } }, + { + "in": "query", + "name": "status_code_class", + "required": false, + "schema": { + "$ref": "#/components/schemas/StatusCodeClass" + } + }, { "in": "query", "name": "event_types", @@ -3398,6 +3505,14 @@ "$ref": "#/components/schemas/MessageStatus" } }, + { + "in": "query", + "name": "status_code_class", + "required": false, + "schema": { + "$ref": "#/components/schemas/StatusCodeClass" + } + }, { "in": "query", "name": "event_types", @@ -10572,6 +10687,30 @@ "Webhooks" ] } + }, + "MessageAttemptFailingEvent": { + "post": { + "description": "Sent after a message has been failing for a few times.\nIt's sent on the fourth failure. It complements `message.attempt.exhausted` which is sent after the last failure.", + "operationId": "MessageAttemptFailingEvent", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageAttemptFailingEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2XX status to indicate that the data was received successfully" + } + }, + "summary": "MessageAttemptFailingEvent", + "tags": [ + "Webhooks" + ] + } } } } \ No newline at end of file From 367595d2beed5c7c3566edd4c1e91701eedbe2af Mon Sep 17 00:00:00 2001 From: Frank Chiarulli Jr Date: Tue, 1 Mar 2022 15:15:58 -0500 Subject: [PATCH 2/7] Go: Add support for StatusCodeClass filtering --- go/messageattempt.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/go/messageattempt.go b/go/messageattempt.go index 4e455a8ff..dacc0d8f0 100644 --- a/go/messageattempt.go +++ b/go/messageattempt.go @@ -12,6 +12,7 @@ type MessageAttempt struct { } type MessageStatus openapi.MessageStatus +type StatusCodeClass openapi.StatusCodeClass type ( ListResponseMessageAttemptOut openapi.ListResponseMessageAttemptOut @@ -22,12 +23,13 @@ type ( ) type MessageAttemptListOptions struct { - Iterator *string - Limit *int32 - Status *MessageStatus - EventTypes *[]string - Before *time.Time - After *time.Time + Iterator *string + Limit *int32 + Status *MessageStatus + EventTypes *[]string + Before *time.Time + After *time.Time + StatusCodeClass *StatusCodeClass } // Deprecated: use `ListByMsg` or `ListByEndpoint` instead @@ -53,6 +55,9 @@ func (m *MessageAttempt) ListByMsg(appId string, msgId string, options *MessageA if options.After != nil { req = req.After(*options.After) } + if options.StatusCodeClass != nil { + req.StatusCodeClass(openapi.StatusCodeClass(*options.StatusCodeClass)) + } } out, res, err := req.Execute() if err != nil { @@ -80,6 +85,9 @@ func (m *MessageAttempt) ListByEndpoint(appId string, endpointId string, options if options.After != nil { req = req.After(*options.After) } + if options.StatusCodeClass != nil { + req.StatusCodeClass(openapi.StatusCodeClass(*options.StatusCodeClass)) + } } out, res, err := req.Execute() if err != nil { From b4b4538617fc353b80ac2e76c2bb80697be8b555 Mon Sep 17 00:00:00 2001 From: Frank Chiarulli Jr Date: Tue, 1 Mar 2022 15:21:02 -0500 Subject: [PATCH 3/7] Java: Add support for StatusCodeClass filtering --- .../src/main/java/com/svix/MessageAttempt.java | 2 ++ .../com/svix/MessageAttemptListOptions.java | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/java/lib/src/main/java/com/svix/MessageAttempt.java b/java/lib/src/main/java/com/svix/MessageAttempt.java index 12e03bc32..da47f7a89 100644 --- a/java/lib/src/main/java/com/svix/MessageAttempt.java +++ b/java/lib/src/main/java/com/svix/MessageAttempt.java @@ -32,6 +32,7 @@ public ListResponseMessageAttemptOut listByMsg(final String appId, final String options.getIterator(), options.getLimit(), options.getMessageStatus(), + options.getStatusCodeClass(), options.getEventTypes(), null, options.getBefore(), @@ -51,6 +52,7 @@ public ListResponseMessageAttemptOut listByEndpoint(final String appId, final St options.getIterator(), options.getLimit(), options.getMessageStatus(), + options.getStatusCodeClass(), options.getEventTypes(), null, options.getBefore(), diff --git a/java/lib/src/main/java/com/svix/MessageAttemptListOptions.java b/java/lib/src/main/java/com/svix/MessageAttemptListOptions.java index fe3349747..3c1419230 100644 --- a/java/lib/src/main/java/com/svix/MessageAttemptListOptions.java +++ b/java/lib/src/main/java/com/svix/MessageAttemptListOptions.java @@ -1,14 +1,18 @@ package com.svix; import java.util.List; + import org.threeten.bp.OffsetDateTime; import com.svix.models.MessageStatus; +import com.svix.models.StatusCodeClass; + public class MessageAttemptListOptions extends ListOptionsDouble { private MessageStatus status; private List eventTypes; private OffsetDateTime before; private OffsetDateTime after; + private StatusCodeClass statusCodeClass; public MessageAttemptListOptions() { super(); @@ -65,4 +69,17 @@ public void setAfter(final OffsetDateTime after) { public OffsetDateTime getAfter() { return after; } + + public MessageAttemptListOptions statusCodeClass(final StatusCodeClass statusCodeClass) { + this.statusCodeClass = statusCodeClass; + return this; + } + + public void setStatusCodeClass(final StatusCodeClass statusCodeClass) { + this.statusCodeClass = statusCodeClass; + } + + public StatusCodeClass getStatusCodeClass() { + return statusCodeClass; + } } From 49e423d009ee594a83ad87a4810663190c691181 Mon Sep 17 00:00:00 2001 From: Frank Chiarulli Jr Date: Tue, 1 Mar 2022 15:23:03 -0500 Subject: [PATCH 4/7] Javascript: Add support for StatusCodeClass filtering --- javascript/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/javascript/src/index.ts b/javascript/src/index.ts index 81c6262b2..b0f891c3e 100644 --- a/javascript/src/index.ts +++ b/javascript/src/index.ts @@ -41,6 +41,7 @@ import { EventTypeIn, EventTypeOut, EventTypeUpdate, + StatusCodeClass, Middleware, RequestContext, ResponseContext, @@ -156,6 +157,7 @@ export interface MessageAttemptListOptions extends ListOptionsDouble { eventTypes?: string[]; before?: Date; after?: Date; + statusCodeClass?: StatusCodeClass; } class Application { From bbb36a72d7f5f933d7e31ec55dfe3ec3b8b6bd07 Mon Sep 17 00:00:00 2001 From: Frank Chiarulli Jr Date: Tue, 1 Mar 2022 15:25:11 -0500 Subject: [PATCH 5/7] Kotlin: Add support for StatusCodeClass filtering --- kotlin/lib/src/main/kotlin/MessageAttempt.kt | 2 ++ kotlin/lib/src/main/kotlin/MessageAttemptListOptions.kt | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/kotlin/lib/src/main/kotlin/MessageAttempt.kt b/kotlin/lib/src/main/kotlin/MessageAttempt.kt index 8438a0f64..97135055c 100644 --- a/kotlin/lib/src/main/kotlin/MessageAttempt.kt +++ b/kotlin/lib/src/main/kotlin/MessageAttempt.kt @@ -33,6 +33,7 @@ class MessageAttempt internal constructor(token: String, options: SvixOptions) { options.iterator, options.limit, options.messageStatus, + options.statusCodeClass, null, null, options.before, @@ -52,6 +53,7 @@ class MessageAttempt internal constructor(token: String, options: SvixOptions) { options.iterator, options.limit, options.messageStatus, + options.statusCodeClass, null, null, options.before, diff --git a/kotlin/lib/src/main/kotlin/MessageAttemptListOptions.kt b/kotlin/lib/src/main/kotlin/MessageAttemptListOptions.kt index 9d4e40ab4..b6fd4ac5c 100644 --- a/kotlin/lib/src/main/kotlin/MessageAttemptListOptions.kt +++ b/kotlin/lib/src/main/kotlin/MessageAttemptListOptions.kt @@ -1,13 +1,15 @@ package com.svix.kotlin import com.svix.kotlin.models.MessageStatus +import com.svix.kotlin.models.StatusCodeClass import java.time.OffsetDateTime -class MessageAttemptListOptions(var messageStatus: MessageStatus? = null, var before: OffsetDateTime? = null, var after: OffsetDateTime? = null, var eventTypes: List? = null) : ListOptionsDouble() { +class MessageAttemptListOptions(var messageStatus: MessageStatus? = null, var before: OffsetDateTime? = null, var after: OffsetDateTime? = null, var eventTypes: List? = null, var statusCodeClass: StatusCodeClass? = null) : ListOptionsDouble() { fun messageStatus(messageStatus: MessageStatus) = apply { this.messageStatus = messageStatus } fun before(before: OffsetDateTime) = apply { this.before = before } fun after(after: OffsetDateTime) = apply { this.after = after } + fun statusCodeClass(statusCodeClass: StatusCodeClass) = apply { this.statusCodeClass = statusCodeClass } fun eventTypes(eventTypes: List) = apply { this.eventTypes = eventTypes } From 2d0c7081dccd136be9490eb411029e114d7728eb Mon Sep 17 00:00:00 2001 From: Frank Chiarulli Jr Date: Tue, 1 Mar 2022 15:26:57 -0500 Subject: [PATCH 6/7] Python: Add support for StatusCodeClass filtering --- python/svix/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/svix/api.py b/python/svix/api.py index 427466cb3..c8fd3316c 100644 --- a/python/svix/api.py +++ b/python/svix/api.py @@ -45,6 +45,7 @@ from .openapi_client.model.message_out import MessageOut from .openapi_client.model.message_status import MessageStatus from .openapi_client.model.recover_in import RecoverIn +from .openapi_client.model.status_code_class import StatusCodeClass DEFAULT_SERVER_URL = "https://api.svix.com" @@ -113,6 +114,7 @@ class MessageAttemptListOptions(ListOptionsDouble): before: t.Optional[datetime] = None after: t.Optional[datetime] = None channel: t.Optional[str] = None + status_code_class: t.Optional[StatusCodeClass] = None ApiClass = t.TypeVar( @@ -518,5 +520,6 @@ def message_attempt(self) -> MessageAttempt: "EndpointListOptions", "MessageAttemptListOptions", "RecoverIn", + "StatusCodeClass", "Svix", ] From cc788d962fe7c96904ccf2bc83d87184ec4f2964 Mon Sep 17 00:00:00 2001 From: Frank Chiarulli Jr Date: Tue, 1 Mar 2022 15:28:28 -0500 Subject: [PATCH 7/7] Ruby: Add support for StatusCodeClass filtering --- ruby/lib/svix.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/ruby/lib/svix.rb b/ruby/lib/svix.rb index 92248f2a5..8ac43d4e3 100644 --- a/ruby/lib/svix.rb +++ b/ruby/lib/svix.rb @@ -66,6 +66,7 @@ require "svix/models/recover_in" require "svix/models/validation_error" require "svix/models/webhook_types" +require "svix/models/status_code_class" # Core require "svix/api_client"