diff --git a/go/internal/openapi/model_app_portal_access_in.go b/go/internal/openapi/model_app_portal_access_in.go index 42330bdf9..5676fa53c 100644 --- a/go/internal/openapi/model_app_portal_access_in.go +++ b/go/internal/openapi/model_app_portal_access_in.go @@ -16,6 +16,7 @@ import ( // AppPortalAccessIn struct for AppPortalAccessIn type AppPortalAccessIn struct { + Application *ApplicationIn `json:"application,omitempty"` // How long the token will be valid for, in seconds. Valid values are between 1 hour and 7 days. The default is 7 days. Expiry NullableInt32 `json:"expiry,omitempty"` // The set of feature flags the created token will have access to. @@ -45,6 +46,38 @@ func NewAppPortalAccessInWithDefaults() *AppPortalAccessIn { return &this } +// GetApplication returns the Application field value if set, zero value otherwise. +func (o *AppPortalAccessIn) GetApplication() ApplicationIn { + if o == nil || o.Application == nil { + var ret ApplicationIn + return ret + } + return *o.Application +} + +// GetApplicationOk returns a tuple with the Application field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppPortalAccessIn) GetApplicationOk() (*ApplicationIn, bool) { + if o == nil || o.Application == nil { + return nil, false + } + return o.Application, true +} + +// HasApplication returns a boolean if a field has been set. +func (o *AppPortalAccessIn) HasApplication() bool { + if o != nil && o.Application != nil { + return true + } + + return false +} + +// SetApplication gets a reference to the given ApplicationIn and assigns it to the Application field. +func (o *AppPortalAccessIn) SetApplication(v ApplicationIn) { + o.Application = &v +} + // GetExpiry returns the Expiry field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AppPortalAccessIn) GetExpiry() int32 { if o == nil || o.Expiry.Get() == nil { @@ -163,6 +196,9 @@ func (o *AppPortalAccessIn) UnsetReadOnly() { func (o AppPortalAccessIn) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} + if o.Application != nil { + toSerialize["application"] = o.Application + } if o.Expiry.IsSet() { toSerialize["expiry"] = o.Expiry.Get() } diff --git a/go/internal/openapi/model_create_stream_in.go b/go/internal/openapi/model_create_stream_in.go index 0fe814b18..2f5640284 100644 --- a/go/internal/openapi/model_create_stream_in.go +++ b/go/internal/openapi/model_create_stream_in.go @@ -16,16 +16,16 @@ import ( // CreateStreamIn struct for CreateStreamIn type CreateStreamIn struct { - Events []EventIn `json:"events"` + Messages []EventIn `json:"messages"` } // NewCreateStreamIn instantiates a new CreateStreamIn 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 NewCreateStreamIn(events []EventIn) *CreateStreamIn { +func NewCreateStreamIn(messages []EventIn) *CreateStreamIn { this := CreateStreamIn{} - this.Events = events + this.Messages = messages return &this } @@ -37,34 +37,34 @@ func NewCreateStreamInWithDefaults() *CreateStreamIn { return &this } -// GetEvents returns the Events field value -func (o *CreateStreamIn) GetEvents() []EventIn { +// GetMessages returns the Messages field value +func (o *CreateStreamIn) GetMessages() []EventIn { if o == nil { var ret []EventIn return ret } - return o.Events + return o.Messages } -// GetEventsOk returns a tuple with the Events field value +// GetMessagesOk returns a tuple with the Messages field value // and a boolean to check if the value has been set. -func (o *CreateStreamIn) GetEventsOk() (*[]EventIn, bool) { +func (o *CreateStreamIn) GetMessagesOk() (*[]EventIn, bool) { if o == nil { return nil, false } - return &o.Events, true + return &o.Messages, true } -// SetEvents sets field value -func (o *CreateStreamIn) SetEvents(v []EventIn) { - o.Events = v +// SetMessages sets field value +func (o *CreateStreamIn) SetMessages(v []EventIn) { + o.Messages = v } func (o CreateStreamIn) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if true { - toSerialize["events"] = o.Events + toSerialize["messages"] = o.Messages } return json.Marshal(toSerialize) } diff --git a/go/internal/openapi/model_list_response_stream_out_.go b/go/internal/openapi/model_list_response_stream_out_.go new file mode 100644 index 000000000..cfa3abe0a --- /dev/null +++ b/go/internal/openapi/model_list_response_stream_out_.go @@ -0,0 +1,229 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// ListResponseStreamOut struct for ListResponseStreamOut +type ListResponseStreamOut struct { + Data []StreamOut `json:"data"` + Done bool `json:"done"` + Iterator NullableString `json:"iterator,omitempty"` + PrevIterator NullableString `json:"prevIterator,omitempty"` +} + +// NewListResponseStreamOut instantiates a new ListResponseStreamOut 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 NewListResponseStreamOut(data []StreamOut, done bool) *ListResponseStreamOut { + this := ListResponseStreamOut{} + this.Data = data + this.Done = done + return &this +} + +// NewListResponseStreamOutWithDefaults instantiates a new ListResponseStreamOut 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 NewListResponseStreamOutWithDefaults() *ListResponseStreamOut { + this := ListResponseStreamOut{} + return &this +} + +// GetData returns the Data field value +func (o *ListResponseStreamOut) GetData() []StreamOut { + if o == nil { + var ret []StreamOut + 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 *ListResponseStreamOut) GetDataOk() (*[]StreamOut, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListResponseStreamOut) SetData(v []StreamOut) { + o.Data = v +} + +// GetDone returns the Done field value +func (o *ListResponseStreamOut) GetDone() bool { + if o == nil { + var ret bool + return ret + } + + return o.Done +} + +// GetDoneOk returns a tuple with the Done field value +// and a boolean to check if the value has been set. +func (o *ListResponseStreamOut) GetDoneOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Done, true +} + +// SetDone sets field value +func (o *ListResponseStreamOut) SetDone(v bool) { + o.Done = v +} + +// GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListResponseStreamOut) GetIterator() string { + if o == nil || o.Iterator.Get() == nil { + var ret string + return ret + } + return *o.Iterator.Get() +} + +// GetIteratorOk returns a tuple with the Iterator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListResponseStreamOut) GetIteratorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Iterator.Get(), o.Iterator.IsSet() +} + +// HasIterator returns a boolean if a field has been set. +func (o *ListResponseStreamOut) HasIterator() bool { + if o != nil && o.Iterator.IsSet() { + return true + } + + return false +} + +// SetIterator gets a reference to the given NullableString and assigns it to the Iterator field. +func (o *ListResponseStreamOut) SetIterator(v string) { + o.Iterator.Set(&v) +} +// SetIteratorNil sets the value for Iterator to be an explicit nil +func (o *ListResponseStreamOut) SetIteratorNil() { + o.Iterator.Set(nil) +} + +// UnsetIterator ensures that no value is present for Iterator, not even an explicit nil +func (o *ListResponseStreamOut) UnsetIterator() { + o.Iterator.Unset() +} + +// GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListResponseStreamOut) GetPrevIterator() string { + if o == nil || o.PrevIterator.Get() == nil { + var ret string + return ret + } + return *o.PrevIterator.Get() +} + +// GetPrevIteratorOk returns a tuple with the PrevIterator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListResponseStreamOut) GetPrevIteratorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PrevIterator.Get(), o.PrevIterator.IsSet() +} + +// HasPrevIterator returns a boolean if a field has been set. +func (o *ListResponseStreamOut) HasPrevIterator() bool { + if o != nil && o.PrevIterator.IsSet() { + return true + } + + return false +} + +// SetPrevIterator gets a reference to the given NullableString and assigns it to the PrevIterator field. +func (o *ListResponseStreamOut) SetPrevIterator(v string) { + o.PrevIterator.Set(&v) +} +// SetPrevIteratorNil sets the value for PrevIterator to be an explicit nil +func (o *ListResponseStreamOut) SetPrevIteratorNil() { + o.PrevIterator.Set(nil) +} + +// UnsetPrevIterator ensures that no value is present for PrevIterator, not even an explicit nil +func (o *ListResponseStreamOut) UnsetPrevIterator() { + o.PrevIterator.Unset() +} + +func (o ListResponseStreamOut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["data"] = o.Data + } + if true { + toSerialize["done"] = o.Done + } + if o.Iterator.IsSet() { + toSerialize["iterator"] = o.Iterator.Get() + } + if o.PrevIterator.IsSet() { + toSerialize["prevIterator"] = o.PrevIterator.Get() + } + return json.Marshal(toSerialize) +} + +type NullableListResponseStreamOut struct { + value *ListResponseStreamOut + isSet bool +} + +func (v NullableListResponseStreamOut) Get() *ListResponseStreamOut { + return v.value +} + +func (v *NullableListResponseStreamOut) Set(val *ListResponseStreamOut) { + v.value = val + v.isSet = true +} + +func (v NullableListResponseStreamOut) IsSet() bool { + return v.isSet +} + +func (v *NullableListResponseStreamOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListResponseStreamOut(val *ListResponseStreamOut) *NullableListResponseStreamOut { + return &NullableListResponseStreamOut{value: val, isSet: true} +} + +func (v NullableListResponseStreamOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListResponseStreamOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_list_response_stream_sink_out_.go b/go/internal/openapi/model_list_response_stream_sink_out_.go new file mode 100644 index 000000000..ee98d38de --- /dev/null +++ b/go/internal/openapi/model_list_response_stream_sink_out_.go @@ -0,0 +1,229 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// ListResponseStreamSinkOut struct for ListResponseStreamSinkOut +type ListResponseStreamSinkOut struct { + Data []StreamSinkOut `json:"data"` + Done bool `json:"done"` + Iterator NullableString `json:"iterator,omitempty"` + PrevIterator NullableString `json:"prevIterator,omitempty"` +} + +// NewListResponseStreamSinkOut instantiates a new ListResponseStreamSinkOut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListResponseStreamSinkOut(data []StreamSinkOut, done bool) *ListResponseStreamSinkOut { + this := ListResponseStreamSinkOut{} + this.Data = data + this.Done = done + return &this +} + +// NewListResponseStreamSinkOutWithDefaults instantiates a new ListResponseStreamSinkOut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListResponseStreamSinkOutWithDefaults() *ListResponseStreamSinkOut { + this := ListResponseStreamSinkOut{} + return &this +} + +// GetData returns the Data field value +func (o *ListResponseStreamSinkOut) GetData() []StreamSinkOut { + if o == nil { + var ret []StreamSinkOut + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListResponseStreamSinkOut) GetDataOk() (*[]StreamSinkOut, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *ListResponseStreamSinkOut) SetData(v []StreamSinkOut) { + o.Data = v +} + +// GetDone returns the Done field value +func (o *ListResponseStreamSinkOut) GetDone() bool { + if o == nil { + var ret bool + return ret + } + + return o.Done +} + +// GetDoneOk returns a tuple with the Done field value +// and a boolean to check if the value has been set. +func (o *ListResponseStreamSinkOut) GetDoneOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Done, true +} + +// SetDone sets field value +func (o *ListResponseStreamSinkOut) SetDone(v bool) { + o.Done = v +} + +// GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListResponseStreamSinkOut) GetIterator() string { + if o == nil || o.Iterator.Get() == nil { + var ret string + return ret + } + return *o.Iterator.Get() +} + +// GetIteratorOk returns a tuple with the Iterator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListResponseStreamSinkOut) GetIteratorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Iterator.Get(), o.Iterator.IsSet() +} + +// HasIterator returns a boolean if a field has been set. +func (o *ListResponseStreamSinkOut) HasIterator() bool { + if o != nil && o.Iterator.IsSet() { + return true + } + + return false +} + +// SetIterator gets a reference to the given NullableString and assigns it to the Iterator field. +func (o *ListResponseStreamSinkOut) SetIterator(v string) { + o.Iterator.Set(&v) +} +// SetIteratorNil sets the value for Iterator to be an explicit nil +func (o *ListResponseStreamSinkOut) SetIteratorNil() { + o.Iterator.Set(nil) +} + +// UnsetIterator ensures that no value is present for Iterator, not even an explicit nil +func (o *ListResponseStreamSinkOut) UnsetIterator() { + o.Iterator.Unset() +} + +// GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListResponseStreamSinkOut) GetPrevIterator() string { + if o == nil || o.PrevIterator.Get() == nil { + var ret string + return ret + } + return *o.PrevIterator.Get() +} + +// GetPrevIteratorOk returns a tuple with the PrevIterator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListResponseStreamSinkOut) GetPrevIteratorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PrevIterator.Get(), o.PrevIterator.IsSet() +} + +// HasPrevIterator returns a boolean if a field has been set. +func (o *ListResponseStreamSinkOut) HasPrevIterator() bool { + if o != nil && o.PrevIterator.IsSet() { + return true + } + + return false +} + +// SetPrevIterator gets a reference to the given NullableString and assigns it to the PrevIterator field. +func (o *ListResponseStreamSinkOut) SetPrevIterator(v string) { + o.PrevIterator.Set(&v) +} +// SetPrevIteratorNil sets the value for PrevIterator to be an explicit nil +func (o *ListResponseStreamSinkOut) SetPrevIteratorNil() { + o.PrevIterator.Set(nil) +} + +// UnsetPrevIterator ensures that no value is present for PrevIterator, not even an explicit nil +func (o *ListResponseStreamSinkOut) UnsetPrevIterator() { + o.PrevIterator.Unset() +} + +func (o ListResponseStreamSinkOut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["data"] = o.Data + } + if true { + toSerialize["done"] = o.Done + } + if o.Iterator.IsSet() { + toSerialize["iterator"] = o.Iterator.Get() + } + if o.PrevIterator.IsSet() { + toSerialize["prevIterator"] = o.PrevIterator.Get() + } + return json.Marshal(toSerialize) +} + +type NullableListResponseStreamSinkOut struct { + value *ListResponseStreamSinkOut + isSet bool +} + +func (v NullableListResponseStreamSinkOut) Get() *ListResponseStreamSinkOut { + return v.value +} + +func (v *NullableListResponseStreamSinkOut) Set(val *ListResponseStreamSinkOut) { + v.value = val + v.isSet = true +} + +func (v NullableListResponseStreamSinkOut) IsSet() bool { + return v.isSet +} + +func (v *NullableListResponseStreamSinkOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListResponseStreamSinkOut(val *ListResponseStreamSinkOut) *NullableListResponseStreamSinkOut { + return &NullableListResponseStreamSinkOut{value: val, isSet: true} +} + +func (v NullableListResponseStreamSinkOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListResponseStreamSinkOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_message_broadcast_in.go b/go/internal/openapi/model_message_broadcast_in.go index 98d29c7c7..243c707dc 100644 --- a/go/internal/openapi/model_message_broadcast_in.go +++ b/go/internal/openapi/model_message_broadcast_in.go @@ -23,7 +23,10 @@ type MessageBroadcastIn struct { // The event type's name EventType string `json:"eventType"` Payload map[string]interface{} `json:"payload"` - PayloadRetentionPeriod *int64 `json:"payloadRetentionPeriod,omitempty"` + // Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`. + PayloadRetentionHours NullableInt64 `json:"payloadRetentionHours,omitempty"` + // Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`. + PayloadRetentionPeriod NullableInt64 `json:"payloadRetentionPeriod,omitempty"` } // NewMessageBroadcastIn instantiates a new MessageBroadcastIn object @@ -35,7 +38,7 @@ func NewMessageBroadcastIn(eventType string, payload map[string]interface{}) *Me this.EventType = eventType this.Payload = payload var payloadRetentionPeriod int64 = 90 - this.PayloadRetentionPeriod = &payloadRetentionPeriod + this.PayloadRetentionPeriod = *NewNullableInt64(&payloadRetentionPeriod) return &this } @@ -45,7 +48,7 @@ func NewMessageBroadcastIn(eventType string, payload map[string]interface{}) *Me func NewMessageBroadcastInWithDefaults() *MessageBroadcastIn { this := MessageBroadcastIn{} var payloadRetentionPeriod int64 = 90 - this.PayloadRetentionPeriod = &payloadRetentionPeriod + this.PayloadRetentionPeriod = *NewNullableInt64(&payloadRetentionPeriod) return &this } @@ -172,36 +175,88 @@ func (o *MessageBroadcastIn) SetPayload(v map[string]interface{}) { o.Payload = v } -// GetPayloadRetentionPeriod returns the PayloadRetentionPeriod field value if set, zero value otherwise. +// GetPayloadRetentionHours returns the PayloadRetentionHours field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *MessageBroadcastIn) GetPayloadRetentionHours() int64 { + if o == nil || o.PayloadRetentionHours.Get() == nil { + var ret int64 + return ret + } + return *o.PayloadRetentionHours.Get() +} + +// GetPayloadRetentionHoursOk returns a tuple with the PayloadRetentionHours 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 *MessageBroadcastIn) GetPayloadRetentionHoursOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.PayloadRetentionHours.Get(), o.PayloadRetentionHours.IsSet() +} + +// HasPayloadRetentionHours returns a boolean if a field has been set. +func (o *MessageBroadcastIn) HasPayloadRetentionHours() bool { + if o != nil && o.PayloadRetentionHours.IsSet() { + return true + } + + return false +} + +// SetPayloadRetentionHours gets a reference to the given NullableInt64 and assigns it to the PayloadRetentionHours field. +func (o *MessageBroadcastIn) SetPayloadRetentionHours(v int64) { + o.PayloadRetentionHours.Set(&v) +} +// SetPayloadRetentionHoursNil sets the value for PayloadRetentionHours to be an explicit nil +func (o *MessageBroadcastIn) SetPayloadRetentionHoursNil() { + o.PayloadRetentionHours.Set(nil) +} + +// UnsetPayloadRetentionHours ensures that no value is present for PayloadRetentionHours, not even an explicit nil +func (o *MessageBroadcastIn) UnsetPayloadRetentionHours() { + o.PayloadRetentionHours.Unset() +} + +// GetPayloadRetentionPeriod returns the PayloadRetentionPeriod field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageBroadcastIn) GetPayloadRetentionPeriod() int64 { - if o == nil || o.PayloadRetentionPeriod == nil { + if o == nil || o.PayloadRetentionPeriod.Get() == nil { var ret int64 return ret } - return *o.PayloadRetentionPeriod + return *o.PayloadRetentionPeriod.Get() } // GetPayloadRetentionPeriodOk returns a tuple with the PayloadRetentionPeriod 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 *MessageBroadcastIn) GetPayloadRetentionPeriodOk() (*int64, bool) { - if o == nil || o.PayloadRetentionPeriod == nil { + if o == nil { return nil, false } - return o.PayloadRetentionPeriod, true + return o.PayloadRetentionPeriod.Get(), o.PayloadRetentionPeriod.IsSet() } // HasPayloadRetentionPeriod returns a boolean if a field has been set. func (o *MessageBroadcastIn) HasPayloadRetentionPeriod() bool { - if o != nil && o.PayloadRetentionPeriod != nil { + if o != nil && o.PayloadRetentionPeriod.IsSet() { return true } return false } -// SetPayloadRetentionPeriod gets a reference to the given int64 and assigns it to the PayloadRetentionPeriod field. +// SetPayloadRetentionPeriod gets a reference to the given NullableInt64 and assigns it to the PayloadRetentionPeriod field. func (o *MessageBroadcastIn) SetPayloadRetentionPeriod(v int64) { - o.PayloadRetentionPeriod = &v + o.PayloadRetentionPeriod.Set(&v) +} +// SetPayloadRetentionPeriodNil sets the value for PayloadRetentionPeriod to be an explicit nil +func (o *MessageBroadcastIn) SetPayloadRetentionPeriodNil() { + o.PayloadRetentionPeriod.Set(nil) +} + +// UnsetPayloadRetentionPeriod ensures that no value is present for PayloadRetentionPeriod, not even an explicit nil +func (o *MessageBroadcastIn) UnsetPayloadRetentionPeriod() { + o.PayloadRetentionPeriod.Unset() } func (o MessageBroadcastIn) MarshalJSON() ([]byte, error) { @@ -218,8 +273,11 @@ func (o MessageBroadcastIn) MarshalJSON() ([]byte, error) { if true { toSerialize["payload"] = o.Payload } - if o.PayloadRetentionPeriod != nil { - toSerialize["payloadRetentionPeriod"] = o.PayloadRetentionPeriod + if o.PayloadRetentionHours.IsSet() { + toSerialize["payloadRetentionHours"] = o.PayloadRetentionHours.Get() + } + if o.PayloadRetentionPeriod.IsSet() { + toSerialize["payloadRetentionPeriod"] = o.PayloadRetentionPeriod.Get() } return json.Marshal(toSerialize) } diff --git a/go/internal/openapi/model_message_in.go b/go/internal/openapi/model_message_in.go index e819f6e9a..8971d368c 100644 --- a/go/internal/openapi/model_message_in.go +++ b/go/internal/openapi/model_message_in.go @@ -23,8 +23,12 @@ type MessageIn struct { EventId NullableString `json:"eventId,omitempty"` // The event type's name EventType string `json:"eventType"` + // JSON payload to send as the request body of the webhook. We also support sending non-JSON payloads. Please contact us for more information. Payload map[string]interface{} `json:"payload"` - PayloadRetentionPeriod *int64 `json:"payloadRetentionPeriod,omitempty"` + // Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`. + PayloadRetentionHours NullableInt64 `json:"payloadRetentionHours,omitempty"` + // Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`. + PayloadRetentionPeriod NullableInt64 `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) @@ -40,7 +44,7 @@ func NewMessageIn(eventType string, payload map[string]interface{}) *MessageIn { this.EventType = eventType this.Payload = payload var payloadRetentionPeriod int64 = 90 - this.PayloadRetentionPeriod = &payloadRetentionPeriod + this.PayloadRetentionPeriod = *NewNullableInt64(&payloadRetentionPeriod) return &this } @@ -50,7 +54,7 @@ func NewMessageIn(eventType string, payload map[string]interface{}) *MessageIn { func NewMessageInWithDefaults() *MessageIn { this := MessageIn{} var payloadRetentionPeriod int64 = 90 - this.PayloadRetentionPeriod = &payloadRetentionPeriod + this.PayloadRetentionPeriod = *NewNullableInt64(&payloadRetentionPeriod) return &this } @@ -209,36 +213,88 @@ func (o *MessageIn) SetPayload(v map[string]interface{}) { o.Payload = v } -// GetPayloadRetentionPeriod returns the PayloadRetentionPeriod field value if set, zero value otherwise. +// GetPayloadRetentionHours returns the PayloadRetentionHours field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *MessageIn) GetPayloadRetentionHours() int64 { + if o == nil || o.PayloadRetentionHours.Get() == nil { + var ret int64 + return ret + } + return *o.PayloadRetentionHours.Get() +} + +// GetPayloadRetentionHoursOk returns a tuple with the PayloadRetentionHours 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) GetPayloadRetentionHoursOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.PayloadRetentionHours.Get(), o.PayloadRetentionHours.IsSet() +} + +// HasPayloadRetentionHours returns a boolean if a field has been set. +func (o *MessageIn) HasPayloadRetentionHours() bool { + if o != nil && o.PayloadRetentionHours.IsSet() { + return true + } + + return false +} + +// SetPayloadRetentionHours gets a reference to the given NullableInt64 and assigns it to the PayloadRetentionHours field. +func (o *MessageIn) SetPayloadRetentionHours(v int64) { + o.PayloadRetentionHours.Set(&v) +} +// SetPayloadRetentionHoursNil sets the value for PayloadRetentionHours to be an explicit nil +func (o *MessageIn) SetPayloadRetentionHoursNil() { + o.PayloadRetentionHours.Set(nil) +} + +// UnsetPayloadRetentionHours ensures that no value is present for PayloadRetentionHours, not even an explicit nil +func (o *MessageIn) UnsetPayloadRetentionHours() { + o.PayloadRetentionHours.Unset() +} + +// GetPayloadRetentionPeriod returns the PayloadRetentionPeriod field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageIn) GetPayloadRetentionPeriod() int64 { - if o == nil || o.PayloadRetentionPeriod == nil { + if o == nil || o.PayloadRetentionPeriod.Get() == nil { var ret int64 return ret } - return *o.PayloadRetentionPeriod + return *o.PayloadRetentionPeriod.Get() } // GetPayloadRetentionPeriodOk returns a tuple with the PayloadRetentionPeriod 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) GetPayloadRetentionPeriodOk() (*int64, bool) { - if o == nil || o.PayloadRetentionPeriod == nil { + if o == nil { return nil, false } - return o.PayloadRetentionPeriod, true + return o.PayloadRetentionPeriod.Get(), o.PayloadRetentionPeriod.IsSet() } // HasPayloadRetentionPeriod returns a boolean if a field has been set. func (o *MessageIn) HasPayloadRetentionPeriod() bool { - if o != nil && o.PayloadRetentionPeriod != nil { + if o != nil && o.PayloadRetentionPeriod.IsSet() { return true } return false } -// SetPayloadRetentionPeriod gets a reference to the given int64 and assigns it to the PayloadRetentionPeriod field. +// SetPayloadRetentionPeriod gets a reference to the given NullableInt64 and assigns it to the PayloadRetentionPeriod field. func (o *MessageIn) SetPayloadRetentionPeriod(v int64) { - o.PayloadRetentionPeriod = &v + o.PayloadRetentionPeriod.Set(&v) +} +// SetPayloadRetentionPeriodNil sets the value for PayloadRetentionPeriod to be an explicit nil +func (o *MessageIn) SetPayloadRetentionPeriodNil() { + o.PayloadRetentionPeriod.Set(nil) +} + +// UnsetPayloadRetentionPeriod ensures that no value is present for PayloadRetentionPeriod, not even an explicit nil +func (o *MessageIn) UnsetPayloadRetentionPeriod() { + o.PayloadRetentionPeriod.Unset() } // GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). @@ -324,8 +380,11 @@ func (o MessageIn) MarshalJSON() ([]byte, error) { if true { toSerialize["payload"] = o.Payload } - if o.PayloadRetentionPeriod != nil { - toSerialize["payloadRetentionPeriod"] = o.PayloadRetentionPeriod + if o.PayloadRetentionHours.IsSet() { + toSerialize["payloadRetentionHours"] = o.PayloadRetentionHours.Get() + } + if o.PayloadRetentionPeriod.IsSet() { + toSerialize["payloadRetentionPeriod"] = o.PayloadRetentionPeriod.Get() } if o.Tags != nil { toSerialize["tags"] = o.Tags diff --git a/go/internal/openapi/model_sink_payload_format.go b/go/internal/openapi/model_sink_payload_format.go new file mode 100644 index 000000000..416108206 --- /dev/null +++ b/go/internal/openapi/model_sink_payload_format.go @@ -0,0 +1,108 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// SinkPayloadFormat the model 'SinkPayloadFormat' +type SinkPayloadFormat string + +// List of SinkPayloadFormat +const ( + SINKPAYLOADFORMAT_JSON SinkPayloadFormat = "json" +) + +var allowedSinkPayloadFormatEnumValues = []SinkPayloadFormat{ + "json", +} + +func (v *SinkPayloadFormat) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SinkPayloadFormat(value) + for _, existing := range allowedSinkPayloadFormatEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SinkPayloadFormat", value) +} + +// NewSinkPayloadFormatFromValue returns a pointer to a valid SinkPayloadFormat +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSinkPayloadFormatFromValue(v string) (*SinkPayloadFormat, error) { + ev := SinkPayloadFormat(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SinkPayloadFormat: valid values are %v", v, allowedSinkPayloadFormatEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SinkPayloadFormat) IsValid() bool { + for _, existing := range allowedSinkPayloadFormatEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SinkPayloadFormat value +func (v SinkPayloadFormat) Ptr() *SinkPayloadFormat { + return &v +} + +type NullableSinkPayloadFormat struct { + value *SinkPayloadFormat + isSet bool +} + +func (v NullableSinkPayloadFormat) Get() *SinkPayloadFormat { + return v.value +} + +func (v *NullableSinkPayloadFormat) Set(val *SinkPayloadFormat) { + v.value = val + v.isSet = true +} + +func (v NullableSinkPayloadFormat) IsSet() bool { + return v.isSet +} + +func (v *NullableSinkPayloadFormat) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSinkPayloadFormat(val *SinkPayloadFormat) *NullableSinkPayloadFormat { + return &NullableSinkPayloadFormat{value: val, isSet: true} +} + +func (v NullableSinkPayloadFormat) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSinkPayloadFormat) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/go/internal/openapi/model_sink_status.go b/go/internal/openapi/model_sink_status.go new file mode 100644 index 000000000..be0722504 --- /dev/null +++ b/go/internal/openapi/model_sink_status.go @@ -0,0 +1,112 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// SinkStatus the model 'SinkStatus' +type SinkStatus string + +// List of SinkStatus +const ( + SINKSTATUS_ENABLED SinkStatus = "enabled" + SINKSTATUS_PAUSED SinkStatus = "paused" + SINKSTATUS_DISABLED SinkStatus = "disabled" +) + +var allowedSinkStatusEnumValues = []SinkStatus{ + "enabled", + "paused", + "disabled", +} + +func (v *SinkStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SinkStatus(value) + for _, existing := range allowedSinkStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SinkStatus", value) +} + +// NewSinkStatusFromValue returns a pointer to a valid SinkStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSinkStatusFromValue(v string) (*SinkStatus, error) { + ev := SinkStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SinkStatus: valid values are %v", v, allowedSinkStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SinkStatus) IsValid() bool { + for _, existing := range allowedSinkStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SinkStatus value +func (v SinkStatus) Ptr() *SinkStatus { + return &v +} + +type NullableSinkStatus struct { + value *SinkStatus + isSet bool +} + +func (v NullableSinkStatus) Get() *SinkStatus { + return v.value +} + +func (v *NullableSinkStatus) Set(val *SinkStatus) { + v.value = val + v.isSet = true +} + +func (v NullableSinkStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableSinkStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSinkStatus(val *SinkStatus) *NullableSinkStatus { + return &NullableSinkStatus{value: val, isSet: true} +} + +func (v NullableSinkStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSinkStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/go/internal/openapi/model_sink_status_in.go b/go/internal/openapi/model_sink_status_in.go new file mode 100644 index 000000000..0ec0e7c33 --- /dev/null +++ b/go/internal/openapi/model_sink_status_in.go @@ -0,0 +1,110 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// SinkStatusIn the model 'SinkStatusIn' +type SinkStatusIn string + +// List of SinkStatusIn +const ( + SINKSTATUSIN_ENABLED SinkStatusIn = "enabled" + SINKSTATUSIN_PAUSED SinkStatusIn = "paused" +) + +var allowedSinkStatusInEnumValues = []SinkStatusIn{ + "enabled", + "paused", +} + +func (v *SinkStatusIn) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SinkStatusIn(value) + for _, existing := range allowedSinkStatusInEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SinkStatusIn", value) +} + +// NewSinkStatusInFromValue returns a pointer to a valid SinkStatusIn +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSinkStatusInFromValue(v string) (*SinkStatusIn, error) { + ev := SinkStatusIn(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SinkStatusIn: valid values are %v", v, allowedSinkStatusInEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SinkStatusIn) IsValid() bool { + for _, existing := range allowedSinkStatusInEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SinkStatusIn value +func (v SinkStatusIn) Ptr() *SinkStatusIn { + return &v +} + +type NullableSinkStatusIn struct { + value *SinkStatusIn + isSet bool +} + +func (v NullableSinkStatusIn) Get() *SinkStatusIn { + return v.value +} + +func (v *NullableSinkStatusIn) Set(val *SinkStatusIn) { + v.value = val + v.isSet = true +} + +func (v NullableSinkStatusIn) IsSet() bool { + return v.isSet +} + +func (v *NullableSinkStatusIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSinkStatusIn(val *SinkStatusIn) *NullableSinkStatusIn { + return &NullableSinkStatusIn{value: val, isSet: true} +} + +func (v NullableSinkStatusIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSinkStatusIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/go/internal/openapi/model_sink_transform_in.go b/go/internal/openapi/model_sink_transform_in.go new file mode 100644 index 000000000..a7cf50d07 --- /dev/null +++ b/go/internal/openapi/model_sink_transform_in.go @@ -0,0 +1,161 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// SinkTransformIn struct for SinkTransformIn +type SinkTransformIn struct { + Code NullableString `json:"code,omitempty"` + Enabled *bool `json:"enabled,omitempty"` +} + +// NewSinkTransformIn instantiates a new SinkTransformIn 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 NewSinkTransformIn() *SinkTransformIn { + this := SinkTransformIn{} + return &this +} + +// NewSinkTransformInWithDefaults instantiates a new SinkTransformIn 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 NewSinkTransformInWithDefaults() *SinkTransformIn { + this := SinkTransformIn{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SinkTransformIn) GetCode() string { + if o == nil || o.Code.Get() == nil { + var ret string + return ret + } + return *o.Code.Get() +} + +// GetCodeOk returns a tuple with the Code 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 *SinkTransformIn) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Code.Get(), o.Code.IsSet() +} + +// HasCode returns a boolean if a field has been set. +func (o *SinkTransformIn) HasCode() bool { + if o != nil && o.Code.IsSet() { + return true + } + + return false +} + +// SetCode gets a reference to the given NullableString and assigns it to the Code field. +func (o *SinkTransformIn) SetCode(v string) { + o.Code.Set(&v) +} +// SetCodeNil sets the value for Code to be an explicit nil +func (o *SinkTransformIn) SetCodeNil() { + o.Code.Set(nil) +} + +// UnsetCode ensures that no value is present for Code, not even an explicit nil +func (o *SinkTransformIn) UnsetCode() { + o.Code.Unset() +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SinkTransformIn) GetEnabled() bool { + if o == nil || o.Enabled == nil { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SinkTransformIn) GetEnabledOk() (*bool, bool) { + if o == nil || o.Enabled == nil { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *SinkTransformIn) HasEnabled() bool { + if o != nil && o.Enabled != nil { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SinkTransformIn) SetEnabled(v bool) { + o.Enabled = &v +} + +func (o SinkTransformIn) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code.IsSet() { + toSerialize["code"] = o.Code.Get() + } + if o.Enabled != nil { + toSerialize["enabled"] = o.Enabled + } + return json.Marshal(toSerialize) +} + +type NullableSinkTransformIn struct { + value *SinkTransformIn + isSet bool +} + +func (v NullableSinkTransformIn) Get() *SinkTransformIn { + return v.value +} + +func (v *NullableSinkTransformIn) Set(val *SinkTransformIn) { + v.value = val + v.isSet = true +} + +func (v NullableSinkTransformIn) IsSet() bool { + return v.isSet +} + +func (v *NullableSinkTransformIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSinkTransformIn(val *SinkTransformIn) *NullableSinkTransformIn { + return &NullableSinkTransformIn{value: val, isSet: true} +} + +func (v NullableSinkTransformIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSinkTransformIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_sink_transformation_out.go b/go/internal/openapi/model_sink_transformation_out.go new file mode 100644 index 000000000..d7cce63d8 --- /dev/null +++ b/go/internal/openapi/model_sink_transformation_out.go @@ -0,0 +1,165 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// SinkTransformationOut struct for SinkTransformationOut +type SinkTransformationOut struct { + Code NullableString `json:"code,omitempty"` + Enabled *bool `json:"enabled,omitempty"` +} + +// NewSinkTransformationOut instantiates a new SinkTransformationOut 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 NewSinkTransformationOut() *SinkTransformationOut { + this := SinkTransformationOut{} + var enabled bool = true + this.Enabled = &enabled + return &this +} + +// NewSinkTransformationOutWithDefaults instantiates a new SinkTransformationOut 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 NewSinkTransformationOutWithDefaults() *SinkTransformationOut { + this := SinkTransformationOut{} + var enabled bool = true + this.Enabled = &enabled + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SinkTransformationOut) GetCode() string { + if o == nil || o.Code.Get() == nil { + var ret string + return ret + } + return *o.Code.Get() +} + +// GetCodeOk returns a tuple with the Code 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 *SinkTransformationOut) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Code.Get(), o.Code.IsSet() +} + +// HasCode returns a boolean if a field has been set. +func (o *SinkTransformationOut) HasCode() bool { + if o != nil && o.Code.IsSet() { + return true + } + + return false +} + +// SetCode gets a reference to the given NullableString and assigns it to the Code field. +func (o *SinkTransformationOut) SetCode(v string) { + o.Code.Set(&v) +} +// SetCodeNil sets the value for Code to be an explicit nil +func (o *SinkTransformationOut) SetCodeNil() { + o.Code.Set(nil) +} + +// UnsetCode ensures that no value is present for Code, not even an explicit nil +func (o *SinkTransformationOut) UnsetCode() { + o.Code.Unset() +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SinkTransformationOut) GetEnabled() bool { + if o == nil || o.Enabled == nil { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SinkTransformationOut) GetEnabledOk() (*bool, bool) { + if o == nil || o.Enabled == nil { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *SinkTransformationOut) HasEnabled() bool { + if o != nil && o.Enabled != nil { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SinkTransformationOut) SetEnabled(v bool) { + o.Enabled = &v +} + +func (o SinkTransformationOut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code.IsSet() { + toSerialize["code"] = o.Code.Get() + } + if o.Enabled != nil { + toSerialize["enabled"] = o.Enabled + } + return json.Marshal(toSerialize) +} + +type NullableSinkTransformationOut struct { + value *SinkTransformationOut + isSet bool +} + +func (v NullableSinkTransformationOut) Get() *SinkTransformationOut { + return v.value +} + +func (v *NullableSinkTransformationOut) Set(val *SinkTransformationOut) { + v.value = val + v.isSet = true +} + +func (v NullableSinkTransformationOut) IsSet() bool { + return v.isSet +} + +func (v *NullableSinkTransformationOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSinkTransformationOut(val *SinkTransformationOut) *NullableSinkTransformationOut { + return &NullableSinkTransformationOut{value: val, isSet: true} +} + +func (v NullableSinkTransformationOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSinkTransformationOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_in.go b/go/internal/openapi/model_stream_in.go new file mode 100644 index 000000000..bf4f6d90a --- /dev/null +++ b/go/internal/openapi/model_stream_in.go @@ -0,0 +1,155 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// StreamIn struct for StreamIn +type StreamIn struct { + Description string `json:"description"` + // Optional unique identifier for the stream + Uid NullableString `json:"uid,omitempty"` +} + +// NewStreamIn instantiates a new StreamIn 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 NewStreamIn(description string) *StreamIn { + this := StreamIn{} + this.Description = description + return &this +} + +// NewStreamInWithDefaults instantiates a new StreamIn 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 NewStreamInWithDefaults() *StreamIn { + this := StreamIn{} + return &this +} + +// GetDescription returns the Description field value +func (o *StreamIn) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *StreamIn) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *StreamIn) SetDescription(v string) { + o.Description = v +} + +// GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *StreamIn) GetUid() string { + if o == nil || o.Uid.Get() == nil { + var ret string + return ret + } + return *o.Uid.Get() +} + +// GetUidOk returns a tuple with the Uid 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 *StreamIn) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Uid.Get(), o.Uid.IsSet() +} + +// HasUid returns a boolean if a field has been set. +func (o *StreamIn) HasUid() bool { + if o != nil && o.Uid.IsSet() { + return true + } + + return false +} + +// SetUid gets a reference to the given NullableString and assigns it to the Uid field. +func (o *StreamIn) SetUid(v string) { + o.Uid.Set(&v) +} +// SetUidNil sets the value for Uid to be an explicit nil +func (o *StreamIn) SetUidNil() { + o.Uid.Set(nil) +} + +// UnsetUid ensures that no value is present for Uid, not even an explicit nil +func (o *StreamIn) UnsetUid() { + o.Uid.Unset() +} + +func (o StreamIn) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["description"] = o.Description + } + if o.Uid.IsSet() { + toSerialize["uid"] = o.Uid.Get() + } + return json.Marshal(toSerialize) +} + +type NullableStreamIn struct { + value *StreamIn + isSet bool +} + +func (v NullableStreamIn) Get() *StreamIn { + return v.value +} + +func (v *NullableStreamIn) Set(val *StreamIn) { + v.value = val + v.isSet = true +} + +func (v NullableStreamIn) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamIn(val *StreamIn) *NullableStreamIn { + return &NullableStreamIn{value: val, isSet: true} +} + +func (v NullableStreamIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_out.go b/go/internal/openapi/model_stream_out.go new file mode 100644 index 000000000..1817e78f7 --- /dev/null +++ b/go/internal/openapi/model_stream_out.go @@ -0,0 +1,259 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "time" +) + +// StreamOut struct for StreamOut +type StreamOut struct { + CreatedAt time.Time `json:"createdAt"` + Description NullableString `json:"description,omitempty"` + Id string `json:"id"` + Uid NullableString `json:"uid,omitempty"` + UpdatedAt time.Time `json:"updatedAt"` +} + +// NewStreamOut instantiates a new StreamOut 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 NewStreamOut(createdAt time.Time, id string, updatedAt time.Time) *StreamOut { + this := StreamOut{} + this.CreatedAt = createdAt + this.Id = id + this.UpdatedAt = updatedAt + return &this +} + +// NewStreamOutWithDefaults instantiates a new StreamOut 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 NewStreamOutWithDefaults() *StreamOut { + this := StreamOut{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value +func (o *StreamOut) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *StreamOut) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *StreamOut) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *StreamOut) GetDescription() string { + if o == nil || o.Description.Get() == nil { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description 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 *StreamOut) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *StreamOut) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *StreamOut) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *StreamOut) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *StreamOut) UnsetDescription() { + o.Description.Unset() +} + +// GetId returns the Id field value +func (o *StreamOut) 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 *StreamOut) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *StreamOut) SetId(v string) { + o.Id = v +} + +// GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *StreamOut) GetUid() string { + if o == nil || o.Uid.Get() == nil { + var ret string + return ret + } + return *o.Uid.Get() +} + +// GetUidOk returns a tuple with the Uid 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 *StreamOut) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Uid.Get(), o.Uid.IsSet() +} + +// HasUid returns a boolean if a field has been set. +func (o *StreamOut) HasUid() bool { + if o != nil && o.Uid.IsSet() { + return true + } + + return false +} + +// SetUid gets a reference to the given NullableString and assigns it to the Uid field. +func (o *StreamOut) SetUid(v string) { + o.Uid.Set(&v) +} +// SetUidNil sets the value for Uid to be an explicit nil +func (o *StreamOut) SetUidNil() { + o.Uid.Set(nil) +} + +// UnsetUid ensures that no value is present for Uid, not even an explicit nil +func (o *StreamOut) UnsetUid() { + o.Uid.Unset() +} + +// GetUpdatedAt returns the UpdatedAt field value +func (o *StreamOut) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *StreamOut) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *StreamOut) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +func (o StreamOut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["createdAt"] = o.CreatedAt + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if true { + toSerialize["id"] = o.Id + } + if o.Uid.IsSet() { + toSerialize["uid"] = o.Uid.Get() + } + if true { + toSerialize["updatedAt"] = o.UpdatedAt + } + return json.Marshal(toSerialize) +} + +type NullableStreamOut struct { + value *StreamOut + isSet bool +} + +func (v NullableStreamOut) Get() *StreamOut { + return v.value +} + +func (v *NullableStreamOut) Set(val *StreamOut) { + v.value = val + v.isSet = true +} + +func (v NullableStreamOut) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamOut(val *StreamOut) *NullableStreamOut { + return &NullableStreamOut{value: val, isSet: true} +} + +func (v NullableStreamOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_patch.go b/go/internal/openapi/model_stream_patch.go new file mode 100644 index 000000000..516f2e188 --- /dev/null +++ b/go/internal/openapi/model_stream_patch.go @@ -0,0 +1,162 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// StreamPatch struct for StreamPatch +type StreamPatch struct { + Description *string `json:"description,omitempty"` + // Optional unique identifier for the stream + Uid NullableString `json:"uid,omitempty"` +} + +// NewStreamPatch instantiates a new StreamPatch 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 NewStreamPatch() *StreamPatch { + this := StreamPatch{} + return &this +} + +// NewStreamPatchWithDefaults instantiates a new StreamPatch 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 NewStreamPatchWithDefaults() *StreamPatch { + this := StreamPatch{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *StreamPatch) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamPatch) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *StreamPatch) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *StreamPatch) SetDescription(v string) { + o.Description = &v +} + +// GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *StreamPatch) GetUid() string { + if o == nil || o.Uid.Get() == nil { + var ret string + return ret + } + return *o.Uid.Get() +} + +// GetUidOk returns a tuple with the Uid 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 *StreamPatch) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Uid.Get(), o.Uid.IsSet() +} + +// HasUid returns a boolean if a field has been set. +func (o *StreamPatch) HasUid() bool { + if o != nil && o.Uid.IsSet() { + return true + } + + return false +} + +// SetUid gets a reference to the given NullableString and assigns it to the Uid field. +func (o *StreamPatch) SetUid(v string) { + o.Uid.Set(&v) +} +// SetUidNil sets the value for Uid to be an explicit nil +func (o *StreamPatch) SetUidNil() { + o.Uid.Set(nil) +} + +// UnsetUid ensures that no value is present for Uid, not even an explicit nil +func (o *StreamPatch) UnsetUid() { + o.Uid.Unset() +} + +func (o StreamPatch) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Uid.IsSet() { + toSerialize["uid"] = o.Uid.Get() + } + return json.Marshal(toSerialize) +} + +type NullableStreamPatch struct { + value *StreamPatch + isSet bool +} + +func (v NullableStreamPatch) Get() *StreamPatch { + return v.value +} + +func (v *NullableStreamPatch) Set(val *StreamPatch) { + v.value = val + v.isSet = true +} + +func (v NullableStreamPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamPatch(val *StreamPatch) *NullableStreamPatch { + return &NullableStreamPatch{value: val, isSet: true} +} + +func (v NullableStreamPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_in.go b/go/internal/openapi/model_stream_sink_in.go new file mode 100644 index 000000000..d1cc3a940 --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in.go @@ -0,0 +1,141 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// StreamSinkIn - struct for StreamSinkIn +type StreamSinkIn struct { + StreamSinkInOneOf *StreamSinkInOneOf + StreamSinkInOneOf1 *StreamSinkInOneOf1 +} + +// StreamSinkInOneOfAsStreamSinkIn is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkIn +func StreamSinkInOneOfAsStreamSinkIn(v *StreamSinkInOneOf) StreamSinkIn { + return StreamSinkIn{ StreamSinkInOneOf: v} +} + +// StreamSinkInOneOf1AsStreamSinkIn is a convenience function that returns StreamSinkInOneOf1 wrapped in StreamSinkIn +func StreamSinkInOneOf1AsStreamSinkIn(v *StreamSinkInOneOf1) StreamSinkIn { + return StreamSinkIn{ StreamSinkInOneOf1: v} +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *StreamSinkIn) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into StreamSinkInOneOf + err = json.Unmarshal(data, &dst.StreamSinkInOneOf) + if err == nil { + jsonStreamSinkInOneOf, _ := json.Marshal(dst.StreamSinkInOneOf) + if string(jsonStreamSinkInOneOf) == "{}" { // empty struct + dst.StreamSinkInOneOf = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf = nil + } + + // try to unmarshal data into StreamSinkInOneOf1 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf1) + if err == nil { + jsonStreamSinkInOneOf1, _ := json.Marshal(dst.StreamSinkInOneOf1) + if string(jsonStreamSinkInOneOf1) == "{}" { // empty struct + dst.StreamSinkInOneOf1 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.StreamSinkInOneOf = nil + dst.StreamSinkInOneOf1 = nil + + return fmt.Errorf("Data matches more than one schema in oneOf(StreamSinkIn)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("Data failed to match schemas in oneOf(StreamSinkIn)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src StreamSinkIn) MarshalJSON() ([]byte, error) { + if src.StreamSinkInOneOf != nil { + return json.Marshal(&src.StreamSinkInOneOf) + } + + if src.StreamSinkInOneOf1 != nil { + return json.Marshal(&src.StreamSinkInOneOf1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *StreamSinkIn) GetActualInstance() (interface{}) { + if obj.StreamSinkInOneOf != nil { + return obj.StreamSinkInOneOf + } + + if obj.StreamSinkInOneOf1 != nil { + return obj.StreamSinkInOneOf1 + } + + // all schemas are nil + return nil +} + +type NullableStreamSinkIn struct { + value *StreamSinkIn + isSet bool +} + +func (v NullableStreamSinkIn) Get() *StreamSinkIn { + return v.value +} + +func (v *NullableStreamSinkIn) Set(val *StreamSinkIn) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkIn) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkIn(val *StreamSinkIn) *NullableStreamSinkIn { + return &NullableStreamSinkIn{value: val, isSet: true} +} + +func (v NullableStreamSinkIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_in_one_of.go b/go/internal/openapi/model_stream_sink_in_one_of.go new file mode 100644 index 000000000..40d0e5b53 --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of.go @@ -0,0 +1,137 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// StreamSinkInOneOf struct for StreamSinkInOneOf +type StreamSinkInOneOf struct { + Config StreamSinkInOneOfConfig `json:"config"` + Type string `json:"type"` +} + +// NewStreamSinkInOneOf instantiates a new StreamSinkInOneOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStreamSinkInOneOf(config StreamSinkInOneOfConfig, type_ string) *StreamSinkInOneOf { + this := StreamSinkInOneOf{} + this.Config = config + this.Type = type_ + return &this +} + +// NewStreamSinkInOneOfWithDefaults instantiates a new StreamSinkInOneOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStreamSinkInOneOfWithDefaults() *StreamSinkInOneOf { + this := StreamSinkInOneOf{} + return &this +} + +// GetConfig returns the Config field value +func (o *StreamSinkInOneOf) GetConfig() StreamSinkInOneOfConfig { + if o == nil { + var ret StreamSinkInOneOfConfig + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf) GetConfigOk() (*StreamSinkInOneOfConfig, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *StreamSinkInOneOf) SetConfig(v StreamSinkInOneOfConfig) { + o.Config = v +} + +// GetType returns the Type field value +func (o *StreamSinkInOneOf) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *StreamSinkInOneOf) SetType(v string) { + o.Type = v +} + +func (o StreamSinkInOneOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["config"] = o.Config + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableStreamSinkInOneOf struct { + value *StreamSinkInOneOf + isSet bool +} + +func (v NullableStreamSinkInOneOf) Get() *StreamSinkInOneOf { + return v.value +} + +func (v *NullableStreamSinkInOneOf) Set(val *StreamSinkInOneOf) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOf) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOf(val *StreamSinkInOneOf) *NullableStreamSinkInOneOf { + return &NullableStreamSinkInOneOf{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_in_one_of_1.go b/go/internal/openapi/model_stream_sink_in_one_of_1.go new file mode 100644 index 000000000..a5e5052d8 --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of_1.go @@ -0,0 +1,137 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// StreamSinkInOneOf1 struct for StreamSinkInOneOf1 +type StreamSinkInOneOf1 struct { + Config StreamSinkInOneOfConfig `json:"config"` + Type string `json:"type"` +} + +// NewStreamSinkInOneOf1 instantiates a new StreamSinkInOneOf1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStreamSinkInOneOf1(config StreamSinkInOneOfConfig, type_ string) *StreamSinkInOneOf1 { + this := StreamSinkInOneOf1{} + this.Config = config + this.Type = type_ + return &this +} + +// NewStreamSinkInOneOf1WithDefaults instantiates a new StreamSinkInOneOf1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStreamSinkInOneOf1WithDefaults() *StreamSinkInOneOf1 { + this := StreamSinkInOneOf1{} + return &this +} + +// GetConfig returns the Config field value +func (o *StreamSinkInOneOf1) GetConfig() StreamSinkInOneOfConfig { + if o == nil { + var ret StreamSinkInOneOfConfig + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf1) GetConfigOk() (*StreamSinkInOneOfConfig, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *StreamSinkInOneOf1) SetConfig(v StreamSinkInOneOfConfig) { + o.Config = v +} + +// GetType returns the Type field value +func (o *StreamSinkInOneOf1) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf1) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *StreamSinkInOneOf1) SetType(v string) { + o.Type = v +} + +func (o StreamSinkInOneOf1) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["config"] = o.Config + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableStreamSinkInOneOf1 struct { + value *StreamSinkInOneOf1 + isSet bool +} + +func (v NullableStreamSinkInOneOf1) Get() *StreamSinkInOneOf1 { + return v.value +} + +func (v *NullableStreamSinkInOneOf1) Set(val *StreamSinkInOneOf1) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOf1) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOf1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOf1(val *StreamSinkInOneOf1) *NullableStreamSinkInOneOf1 { + return &NullableStreamSinkInOneOf1{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOf1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOf1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_in_one_of_config.go b/go/internal/openapi/model_stream_sink_in_one_of_config.go new file mode 100644 index 000000000..ae15db50f --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of_config.go @@ -0,0 +1,108 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// StreamSinkInOneOfConfig struct for StreamSinkInOneOfConfig +type StreamSinkInOneOfConfig struct { + Url string `json:"url"` +} + +// NewStreamSinkInOneOfConfig instantiates a new StreamSinkInOneOfConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStreamSinkInOneOfConfig(url string) *StreamSinkInOneOfConfig { + this := StreamSinkInOneOfConfig{} + this.Url = url + return &this +} + +// NewStreamSinkInOneOfConfigWithDefaults instantiates a new StreamSinkInOneOfConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStreamSinkInOneOfConfigWithDefaults() *StreamSinkInOneOfConfig { + this := StreamSinkInOneOfConfig{} + return &this +} + +// GetUrl returns the Url field value +func (o *StreamSinkInOneOfConfig) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOfConfig) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *StreamSinkInOneOfConfig) SetUrl(v string) { + o.Url = v +} + +func (o StreamSinkInOneOfConfig) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["url"] = o.Url + } + return json.Marshal(toSerialize) +} + +type NullableStreamSinkInOneOfConfig struct { + value *StreamSinkInOneOfConfig + isSet bool +} + +func (v NullableStreamSinkInOneOfConfig) Get() *StreamSinkInOneOfConfig { + return v.value +} + +func (v *NullableStreamSinkInOneOfConfig) Set(val *StreamSinkInOneOfConfig) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOfConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOfConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOfConfig(val *StreamSinkInOneOfConfig) *NullableStreamSinkInOneOfConfig { + return &NullableStreamSinkInOneOfConfig{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOfConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOfConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_out.go b/go/internal/openapi/model_stream_sink_out.go new file mode 100644 index 000000000..cf0a93aed --- /dev/null +++ b/go/internal/openapi/model_stream_sink_out.go @@ -0,0 +1,141 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// StreamSinkOut - struct for StreamSinkOut +type StreamSinkOut struct { + StreamSinkInOneOf *StreamSinkInOneOf + StreamSinkInOneOf1 *StreamSinkInOneOf1 +} + +// StreamSinkInOneOfAsStreamSinkOut is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkOut +func StreamSinkInOneOfAsStreamSinkOut(v *StreamSinkInOneOf) StreamSinkOut { + return StreamSinkOut{ StreamSinkInOneOf: v} +} + +// StreamSinkInOneOf1AsStreamSinkOut is a convenience function that returns StreamSinkInOneOf1 wrapped in StreamSinkOut +func StreamSinkInOneOf1AsStreamSinkOut(v *StreamSinkInOneOf1) StreamSinkOut { + return StreamSinkOut{ StreamSinkInOneOf1: v} +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *StreamSinkOut) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into StreamSinkInOneOf + err = json.Unmarshal(data, &dst.StreamSinkInOneOf) + if err == nil { + jsonStreamSinkInOneOf, _ := json.Marshal(dst.StreamSinkInOneOf) + if string(jsonStreamSinkInOneOf) == "{}" { // empty struct + dst.StreamSinkInOneOf = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf = nil + } + + // try to unmarshal data into StreamSinkInOneOf1 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf1) + if err == nil { + jsonStreamSinkInOneOf1, _ := json.Marshal(dst.StreamSinkInOneOf1) + if string(jsonStreamSinkInOneOf1) == "{}" { // empty struct + dst.StreamSinkInOneOf1 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.StreamSinkInOneOf = nil + dst.StreamSinkInOneOf1 = nil + + return fmt.Errorf("Data matches more than one schema in oneOf(StreamSinkOut)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("Data failed to match schemas in oneOf(StreamSinkOut)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src StreamSinkOut) MarshalJSON() ([]byte, error) { + if src.StreamSinkInOneOf != nil { + return json.Marshal(&src.StreamSinkInOneOf) + } + + if src.StreamSinkInOneOf1 != nil { + return json.Marshal(&src.StreamSinkInOneOf1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *StreamSinkOut) GetActualInstance() (interface{}) { + if obj.StreamSinkInOneOf != nil { + return obj.StreamSinkInOneOf + } + + if obj.StreamSinkInOneOf1 != nil { + return obj.StreamSinkInOneOf1 + } + + // all schemas are nil + return nil +} + +type NullableStreamSinkOut struct { + value *StreamSinkOut + isSet bool +} + +func (v NullableStreamSinkOut) Get() *StreamSinkOut { + return v.value +} + +func (v *NullableStreamSinkOut) Set(val *StreamSinkOut) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkOut) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkOut(val *StreamSinkOut) *NullableStreamSinkOut { + return &NullableStreamSinkOut{value: val, isSet: true} +} + +func (v NullableStreamSinkOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_patch.go b/go/internal/openapi/model_stream_sink_patch.go new file mode 100644 index 000000000..4b4233f5a --- /dev/null +++ b/go/internal/openapi/model_stream_sink_patch.go @@ -0,0 +1,141 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// StreamSinkPatch - struct for StreamSinkPatch +type StreamSinkPatch struct { + StreamSinkInOneOf *StreamSinkInOneOf + StreamSinkInOneOf1 *StreamSinkInOneOf1 +} + +// StreamSinkInOneOfAsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkPatch +func StreamSinkInOneOfAsStreamSinkPatch(v *StreamSinkInOneOf) StreamSinkPatch { + return StreamSinkPatch{ StreamSinkInOneOf: v} +} + +// StreamSinkInOneOf1AsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf1 wrapped in StreamSinkPatch +func StreamSinkInOneOf1AsStreamSinkPatch(v *StreamSinkInOneOf1) StreamSinkPatch { + return StreamSinkPatch{ StreamSinkInOneOf1: v} +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *StreamSinkPatch) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into StreamSinkInOneOf + err = json.Unmarshal(data, &dst.StreamSinkInOneOf) + if err == nil { + jsonStreamSinkInOneOf, _ := json.Marshal(dst.StreamSinkInOneOf) + if string(jsonStreamSinkInOneOf) == "{}" { // empty struct + dst.StreamSinkInOneOf = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf = nil + } + + // try to unmarshal data into StreamSinkInOneOf1 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf1) + if err == nil { + jsonStreamSinkInOneOf1, _ := json.Marshal(dst.StreamSinkInOneOf1) + if string(jsonStreamSinkInOneOf1) == "{}" { // empty struct + dst.StreamSinkInOneOf1 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.StreamSinkInOneOf = nil + dst.StreamSinkInOneOf1 = nil + + return fmt.Errorf("Data matches more than one schema in oneOf(StreamSinkPatch)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("Data failed to match schemas in oneOf(StreamSinkPatch)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src StreamSinkPatch) MarshalJSON() ([]byte, error) { + if src.StreamSinkInOneOf != nil { + return json.Marshal(&src.StreamSinkInOneOf) + } + + if src.StreamSinkInOneOf1 != nil { + return json.Marshal(&src.StreamSinkInOneOf1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *StreamSinkPatch) GetActualInstance() (interface{}) { + if obj.StreamSinkInOneOf != nil { + return obj.StreamSinkInOneOf + } + + if obj.StreamSinkInOneOf1 != nil { + return obj.StreamSinkInOneOf1 + } + + // all schemas are nil + return nil +} + +type NullableStreamSinkPatch struct { + value *StreamSinkPatch + isSet bool +} + +func (v NullableStreamSinkPatch) Get() *StreamSinkPatch { + return v.value +} + +func (v *NullableStreamSinkPatch) Set(val *StreamSinkPatch) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkPatch(val *StreamSinkPatch) *NullableStreamSinkPatch { + return &NullableStreamSinkPatch{value: val, isSet: true} +} + +func (v NullableStreamSinkPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/openapi.json b/openapi.json index 580cb4abc..adf77e52c 100644 --- a/openapi.json +++ b/openapi.json @@ -22,6 +22,11 @@ }, "AppPortalAccessIn": { "properties": { + "application": { + "$ref": "#/components/schemas/ApplicationIn", + "description": "Optionally creates a new application while generating the access link. If the application id or uid that is used in the path already exists, this argument is ignored.", + "nullable": true + }, "expiry": { "default": 604800, "description": "How long the token will be valid for, in seconds.\n\nValid values are between 1 hour and 7 days. The default is 7 days.", @@ -516,7 +521,7 @@ }, "CreateStreamIn": { "properties": { - "events": { + "messages": { "items": { "$ref": "#/components/schemas/EventIn" }, @@ -524,7 +529,7 @@ } }, "required": [ - "events" + "messages" ], "type": "object" }, @@ -2875,6 +2880,34 @@ ], "type": "object" }, + "ListResponse_StreamOut_": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/StreamOut" + }, + "type": "array" + }, + "done": { + "type": "boolean" + }, + "iterator": { + "example": "iterator", + "nullable": true, + "type": "string" + }, + "prevIterator": { + "example": "-iterator", + "nullable": true, + "type": "string" + } + }, + "required": [ + "data", + "done" + ], + "type": "object" + }, "ListResponse_TemplateOut_": { "properties": { "data": { @@ -3353,12 +3386,23 @@ }, "type": "object" }, + "payloadRetentionHours": { + "default": null, + "description": "Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`.", + "format": "int64", + "maximum": 2160, + "minimum": 1, + "nullable": true, + "type": "integer" + }, "payloadRetentionPeriod": { "default": 90, + "description": "Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`.", "example": 90, "format": "int64", "maximum": 90, - "minimum": 5, + "minimum": 1, + "nullable": true, "type": "integer" } }, @@ -3559,6 +3603,7 @@ "type": "string" }, "payload": { + "description": "JSON payload to send as the request body of the webhook.\n\nWe also support sending non-JSON payloads. Please contact us for more information.", "example": { "email": "test@example.com", "type": "user.created", @@ -3566,12 +3611,23 @@ }, "type": "object" }, + "payloadRetentionHours": { + "default": null, + "description": "Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`.", + "format": "int64", + "maximum": 2160, + "minimum": 1, + "nullable": true, + "type": "integer" + }, "payloadRetentionPeriod": { "default": 90, + "description": "Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`.", "example": 90, "format": "int64", "maximum": 90, - "minimum": 5, + "minimum": 1, + "nullable": true, "type": "integer" }, "tags": { @@ -4496,6 +4552,33 @@ ], "type": "object" }, + "SinkTransformIn": { + "properties": { + "code": { + "maxLength": 51200, + "minLength": 10, + "nullable": true, + "type": "string" + }, + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "SinkTransformationOut": { + "properties": { + "code": { + "nullable": true, + "type": "string" + }, + "enabled": { + "default": true, + "type": "boolean" + } + }, + "type": "object" + }, "StatisticsPeriod": { "description": "Period length for a statistics data point", "enum": [ @@ -4525,6 +4608,65 @@ "Code5xx" ] }, + "StreamIn": { + "properties": { + "description": { + "minLength": 1, + "type": "string" + }, + "uid": { + "description": "Optional unique identifier for the stream", + "nullable": true, + "type": "string" + } + }, + "required": [ + "description" + ], + "type": "object" + }, + "StreamOut": { + "properties": { + "createdAt": { + "format": "date-time", + "type": "string" + }, + "description": { + "nullable": true, + "type": "string" + }, + "id": { + "type": "string" + }, + "uid": { + "nullable": true, + "type": "string" + }, + "updatedAt": { + "format": "date-time", + "type": "string" + } + }, + "required": [ + "createdAt", + "id", + "updatedAt" + ], + "type": "object" + }, + "StreamPatch": { + "properties": { + "description": { + "type": "string" + }, + "uid": { + "description": "Optional unique identifier for the stream", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, "TemplateIn": { "properties": { "description": { @@ -14808,62 +14950,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 transformationsParams: null\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 application: null,\n tags: [\"my_tag\", \"other\"],\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: 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 transformationsParams: null\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 application: null,\n tags: [\"my_tag\", \"other\"],\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: 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 transformations_params=None\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 application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None,\n payload_retention_period=90,\n payload_retention_hours=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "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)" + "source": "message_out = await svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None,\n payload_retention_period=90,\n payload_retention_hours=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "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})" + "source": "messageOut, err := svixClient.Message.Create(ctx, \"app_id\", &MessageIn{\n EventId: \"unique-msg-identifier\",\n EventType: \"user.signup\",\n Payload: map[string]interface{}{\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n Channels: []string{\"project_123\", \"group_2\"},\n Application: nil,\n Tags: []string{\"my_tag\", \"other\"},\n TransformationsParams: nil,\n PayloadRetentionPeriod: 90,\n PayloadRetentionHours: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val 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)" + "source": "val messageOut = svix.message.create(\"app_id\", MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(/* ... */)\n .channels(arrayOf(\"project_123\", \"group_2\"))\n .application(null)\n .tags(arrayOf(\"my_tag\", \"other\"))\n .transformationsParams(null)\n .payloadRetentionPeriod(90)\n .payloadRetentionHours(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "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)" + "source": "MessageOut messageOut = svix.getMessage().create(\"app_id\", new MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(/* ... */)\n .channels(new String[]{\"project_123\", \"group_2\"})\n .application(null)\n .tags(new String[]{\"my_tag\", \"other\"})\n .transformationsParams(null)\n .payloadRetentionPeriod(90)\n .payloadRetentionHours(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "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}))" + "source": "message_out = svix.message.create(\"app_id\", Svix::MessageIn.new({\n \"event_id\": \"unique-msg-identifier\",\n \"event_type\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"application\": nil,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformations_params\": nil,\n \"payload_retention_period\": 90,\n \"payload_retention_hours\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let 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?;" + "source": "let message_out = svix.message().create(\"app_id\", MessageIn {\n event_id: Some(\"unique-msg-identifier\".to_string()),\n event_type: \"user.signup\".to_string(),\n payload: json!({\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"}),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n application: None,\n tags: Some(vec![\"my_tag\".to_string(), \"other\".to_string()]),\n transformations_params: None,\n payload_retention_period: Some(90),\n payload_retention_hours: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var 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})" + "source": "var messageOut = await svix.Message.CreateAsync(\"app_id\", new MessageIn{\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: /* ... */,\n channels: new string[] {\"project_123\", \"group_2\"},\n application: null,\n tags: new string[] {\"my_tag\", \"other\"},\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix 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}'" + "source": "svix message create \"app_id\" '{\n \"eventId\": \"unique-msg-identifier\",\n \"eventType\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformationsParams\": null,\n \"payloadRetentionPeriod\": 90,\n \"payloadRetentionHours\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X '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 }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventId\": \"unique-msg-identifier\",\n \"eventType\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformationsParams\": null,\n \"payloadRetentionPeriod\": 90,\n \"payloadRetentionHours\": null\n }'" } ] } @@ -18041,62 +18183,62 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null\n});" + "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null,\n application: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null\n});" + "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null,\n application: null\n});" }, { "label": "Python", "lang": "Python", - "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None\n), None)" + "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None,\n application=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "app_portal_access_out = await svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None\n), None)" + "source": "app_portal_access_out = await svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None,\n application=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "appPortalAccessOut, err := svixClient.Authentication.AppPortalAccess(ctx, \"app_id\", &AppPortalAccessIn{\n FeatureFlags: []interface{}{},\n Expiry: nil,\n ReadOnly: nil,\n})" + "source": "appPortalAccessOut, err := svixClient.Authentication.AppPortalAccess(ctx, \"app_id\", &AppPortalAccessIn{\n FeatureFlags: []interface{}{},\n Expiry: nil,\n ReadOnly: nil,\n Application: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val appPortalAccessOut = svix.authentication.appPortalAccess(\"app_id\", AppPortalAccessIn()\n .featureFlags(arrayOf())\n .expiry(null)\n .readOnly(null)\n)" + "source": "val appPortalAccessOut = svix.authentication.appPortalAccess(\"app_id\", AppPortalAccessIn()\n .featureFlags(arrayOf())\n .expiry(null)\n .readOnly(null)\n .application(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "AppPortalAccessOut appPortalAccessOut = svix.getAuthentication().appPortalAccess(\"app_id\", new AppPortalAccessIn()\n .featureFlags(new Object[]{})\n .expiry(null)\n .readOnly(null)\n)" + "source": "AppPortalAccessOut appPortalAccessOut = svix.getAuthentication().appPortalAccess(\"app_id\", new AppPortalAccessIn()\n .featureFlags(new Object[]{})\n .expiry(null)\n .readOnly(null)\n .application(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", Svix::AppPortalAccessIn.new({\n \"feature_flags\": [],\n \"expiry\": nil,\n \"read_only\": nil\n}))" + "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", Svix::AppPortalAccessIn.new({\n \"feature_flags\": [],\n \"expiry\": nil,\n \"read_only\": nil,\n \"application\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let app_portal_access_out = svix.authentication().app_portal_access(\"app_id\", AppPortalAccessIn {\n feature_flags: Some(vec![]),\n expiry: None,\n read_only: None,\n}, None).await?;" + "source": "let app_portal_access_out = svix.authentication().app_portal_access(\"app_id\", AppPortalAccessIn {\n feature_flags: Some(vec![]),\n expiry: None,\n read_only: None,\n application: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var appPortalAccessOut = await svix.Authentication.AppPortalAccessAsync(\"app_id\", new AppPortalAccessIn{\n featureFlags: new Object[] {},\n expiry: null,\n readOnly: null\n})" + "source": "var appPortalAccessOut = await svix.Authentication.AppPortalAccessAsync(\"app_id\", new AppPortalAccessIn{\n featureFlags: new Object[] {},\n expiry: null,\n readOnly: null,\n application: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication app-portal-access \"app_id\" '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null\n}'" + "source": "svix authentication app-portal-access \"app_id\" '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null,\n \"application\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app-portal-access/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app-portal-access/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null,\n \"application\": null\n }'" } ] }