From ff8d49f95ff6d80093755869fc337b03f1a482b4 Mon Sep 17 00:00:00 2001 From: svix-lucho Date: Mon, 30 Sep 2024 17:04:31 -0300 Subject: [PATCH] Bump OpenAPI spec and regenerate libs --- .../model_azure_blob_storage_config.go | 166 ++++++++ go/internal/openapi/model_environment_in.go | 37 ++ go/internal/openapi/model_environment_out.go | 31 +- .../model_google_cloud_storage_config.go | 138 +++++++ go/internal/openapi/model_redshift_config.go | 345 ++++++++++++++++ go/internal/openapi/model_s3_config.go | 26 +- go/internal/openapi/model_sink_http_config.go | 36 ++ go/internal/openapi/model_sink_in.go | 28 -- go/internal/openapi/model_sink_in_one_of_4.go | 137 ------- go/internal/openapi/model_sink_out.go | 28 -- go/internal/openapi/model_snowflake_config.go | 8 +- go/internal/openapi/model_stream_sink_in.go | 84 ++++ .../openapi/model_stream_sink_in_one_of.go | 12 +- .../openapi/model_stream_sink_in_one_of_1.go | 12 +- .../openapi/model_stream_sink_in_one_of_2.go | 12 +- .../openapi/model_stream_sink_in_one_of_3.go | 12 +- .../openapi/model_stream_sink_in_one_of_4.go | 137 +++++++ .../openapi/model_stream_sink_in_one_of_5.go | 137 +++++++ .../openapi/model_stream_sink_in_one_of_6.go | 137 +++++++ go/internal/openapi/model_stream_sink_out.go | 84 ++++ .../openapi/model_stream_sink_patch.go | 84 ++++ openapi.json | 367 ++++++++++++++---- 22 files changed, 1742 insertions(+), 316 deletions(-) create mode 100644 go/internal/openapi/model_azure_blob_storage_config.go create mode 100644 go/internal/openapi/model_google_cloud_storage_config.go create mode 100644 go/internal/openapi/model_redshift_config.go delete mode 100644 go/internal/openapi/model_sink_in_one_of_4.go create mode 100644 go/internal/openapi/model_stream_sink_in_one_of_4.go create mode 100644 go/internal/openapi/model_stream_sink_in_one_of_5.go create mode 100644 go/internal/openapi/model_stream_sink_in_one_of_6.go diff --git a/go/internal/openapi/model_azure_blob_storage_config.go b/go/internal/openapi/model_azure_blob_storage_config.go new file mode 100644 index 000000000..10895333e --- /dev/null +++ b/go/internal/openapi/model_azure_blob_storage_config.go @@ -0,0 +1,166 @@ +/* + * 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" +) + +// AzureBlobStorageConfig struct for AzureBlobStorageConfig +type AzureBlobStorageConfig struct { + AccessKey string `json:"accessKey"` + Account string `json:"account"` + Container string `json:"container"` +} + +// NewAzureBlobStorageConfig instantiates a new AzureBlobStorageConfig 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 NewAzureBlobStorageConfig(accessKey string, account string, container string) *AzureBlobStorageConfig { + this := AzureBlobStorageConfig{} + this.AccessKey = accessKey + this.Account = account + this.Container = container + return &this +} + +// NewAzureBlobStorageConfigWithDefaults instantiates a new AzureBlobStorageConfig 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 NewAzureBlobStorageConfigWithDefaults() *AzureBlobStorageConfig { + this := AzureBlobStorageConfig{} + return &this +} + +// GetAccessKey returns the AccessKey field value +func (o *AzureBlobStorageConfig) GetAccessKey() string { + if o == nil { + var ret string + return ret + } + + return o.AccessKey +} + +// GetAccessKeyOk returns a tuple with the AccessKey field value +// and a boolean to check if the value has been set. +func (o *AzureBlobStorageConfig) GetAccessKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessKey, true +} + +// SetAccessKey sets field value +func (o *AzureBlobStorageConfig) SetAccessKey(v string) { + o.AccessKey = v +} + +// GetAccount returns the Account field value +func (o *AzureBlobStorageConfig) GetAccount() string { + if o == nil { + var ret string + return ret + } + + return o.Account +} + +// GetAccountOk returns a tuple with the Account field value +// and a boolean to check if the value has been set. +func (o *AzureBlobStorageConfig) GetAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Account, true +} + +// SetAccount sets field value +func (o *AzureBlobStorageConfig) SetAccount(v string) { + o.Account = v +} + +// GetContainer returns the Container field value +func (o *AzureBlobStorageConfig) GetContainer() string { + if o == nil { + var ret string + return ret + } + + return o.Container +} + +// GetContainerOk returns a tuple with the Container field value +// and a boolean to check if the value has been set. +func (o *AzureBlobStorageConfig) GetContainerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Container, true +} + +// SetContainer sets field value +func (o *AzureBlobStorageConfig) SetContainer(v string) { + o.Container = v +} + +func (o AzureBlobStorageConfig) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["accessKey"] = o.AccessKey + } + if true { + toSerialize["account"] = o.Account + } + if true { + toSerialize["container"] = o.Container + } + return json.Marshal(toSerialize) +} + +type NullableAzureBlobStorageConfig struct { + value *AzureBlobStorageConfig + isSet bool +} + +func (v NullableAzureBlobStorageConfig) Get() *AzureBlobStorageConfig { + return v.value +} + +func (v *NullableAzureBlobStorageConfig) Set(val *AzureBlobStorageConfig) { + v.value = val + v.isSet = true +} + +func (v NullableAzureBlobStorageConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableAzureBlobStorageConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAzureBlobStorageConfig(val *AzureBlobStorageConfig) *NullableAzureBlobStorageConfig { + return &NullableAzureBlobStorageConfig{value: val, isSet: true} +} + +func (v NullableAzureBlobStorageConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAzureBlobStorageConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_environment_in.go b/go/internal/openapi/model_environment_in.go index f8377d09f..43e2d00cb 100644 --- a/go/internal/openapi/model_environment_in.go +++ b/go/internal/openapi/model_environment_in.go @@ -20,6 +20,7 @@ type EnvironmentIn struct { CreatedAt time.Time `json:"createdAt"` EventTypes []EventTypeIn `json:"eventTypes,omitempty"` Settings *SettingsIn `json:"settings,omitempty"` + TransformationTemplates []TemplateIn `json:"transformationTemplates,omitempty"` Version int32 `json:"version"` } @@ -131,6 +132,39 @@ func (o *EnvironmentIn) SetSettings(v SettingsIn) { o.Settings = &v } +// GetTransformationTemplates returns the TransformationTemplates field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EnvironmentIn) GetTransformationTemplates() []TemplateIn { + if o == nil { + var ret []TemplateIn + return ret + } + return o.TransformationTemplates +} + +// GetTransformationTemplatesOk returns a tuple with the TransformationTemplates 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 *EnvironmentIn) GetTransformationTemplatesOk() (*[]TemplateIn, bool) { + if o == nil || o.TransformationTemplates == nil { + return nil, false + } + return &o.TransformationTemplates, true +} + +// HasTransformationTemplates returns a boolean if a field has been set. +func (o *EnvironmentIn) HasTransformationTemplates() bool { + if o != nil && o.TransformationTemplates != nil { + return true + } + + return false +} + +// SetTransformationTemplates gets a reference to the given []TemplateIn and assigns it to the TransformationTemplates field. +func (o *EnvironmentIn) SetTransformationTemplates(v []TemplateIn) { + o.TransformationTemplates = v +} + // GetVersion returns the Version field value func (o *EnvironmentIn) GetVersion() int32 { if o == nil { @@ -166,6 +200,9 @@ func (o EnvironmentIn) MarshalJSON() ([]byte, error) { if o.Settings != nil { toSerialize["settings"] = o.Settings } + if o.TransformationTemplates != nil { + toSerialize["transformationTemplates"] = o.TransformationTemplates + } if true { toSerialize["version"] = o.Version } diff --git a/go/internal/openapi/model_environment_out.go b/go/internal/openapi/model_environment_out.go index 3698ad562..c5afa0e34 100644 --- a/go/internal/openapi/model_environment_out.go +++ b/go/internal/openapi/model_environment_out.go @@ -20,6 +20,7 @@ type EnvironmentOut struct { CreatedAt time.Time `json:"createdAt"` EventTypes []EventTypeOut `json:"eventTypes"` Settings *SettingsOut `json:"settings,omitempty"` + TransformationTemplates []TemplateOut `json:"transformationTemplates"` Version *int32 `json:"version,omitempty"` } @@ -27,10 +28,11 @@ type EnvironmentOut struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewEnvironmentOut(createdAt time.Time, eventTypes []EventTypeOut) *EnvironmentOut { +func NewEnvironmentOut(createdAt time.Time, eventTypes []EventTypeOut, transformationTemplates []TemplateOut) *EnvironmentOut { this := EnvironmentOut{} this.CreatedAt = createdAt this.EventTypes = eventTypes + this.TransformationTemplates = transformationTemplates var version int32 = 1 this.Version = &version return &this @@ -126,6 +128,30 @@ func (o *EnvironmentOut) SetSettings(v SettingsOut) { o.Settings = &v } +// GetTransformationTemplates returns the TransformationTemplates field value +func (o *EnvironmentOut) GetTransformationTemplates() []TemplateOut { + if o == nil { + var ret []TemplateOut + return ret + } + + return o.TransformationTemplates +} + +// GetTransformationTemplatesOk returns a tuple with the TransformationTemplates field value +// and a boolean to check if the value has been set. +func (o *EnvironmentOut) GetTransformationTemplatesOk() (*[]TemplateOut, bool) { + if o == nil { + return nil, false + } + return &o.TransformationTemplates, true +} + +// SetTransformationTemplates sets field value +func (o *EnvironmentOut) SetTransformationTemplates(v []TemplateOut) { + o.TransformationTemplates = v +} + // GetVersion returns the Version field value if set, zero value otherwise. func (o *EnvironmentOut) GetVersion() int32 { if o == nil || o.Version == nil { @@ -169,6 +195,9 @@ func (o EnvironmentOut) MarshalJSON() ([]byte, error) { if o.Settings != nil { toSerialize["settings"] = o.Settings } + if true { + toSerialize["transformationTemplates"] = o.TransformationTemplates + } if o.Version != nil { toSerialize["version"] = o.Version } diff --git a/go/internal/openapi/model_google_cloud_storage_config.go b/go/internal/openapi/model_google_cloud_storage_config.go new file mode 100644 index 000000000..ee178f5a2 --- /dev/null +++ b/go/internal/openapi/model_google_cloud_storage_config.go @@ -0,0 +1,138 @@ +/* + * 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" +) + +// GoogleCloudStorageConfig Configuration for a Google Cloud Storage sink. Write stream events into the named bucket using the supplied Google Cloud credentials. +type GoogleCloudStorageConfig struct { + Bucket string `json:"bucket"` + // Google Cloud Credentials JSON Object as a string. + Credentials string `json:"credentials"` +} + +// NewGoogleCloudStorageConfig instantiates a new GoogleCloudStorageConfig 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 NewGoogleCloudStorageConfig(bucket string, credentials string) *GoogleCloudStorageConfig { + this := GoogleCloudStorageConfig{} + this.Bucket = bucket + this.Credentials = credentials + return &this +} + +// NewGoogleCloudStorageConfigWithDefaults instantiates a new GoogleCloudStorageConfig 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 NewGoogleCloudStorageConfigWithDefaults() *GoogleCloudStorageConfig { + this := GoogleCloudStorageConfig{} + return &this +} + +// GetBucket returns the Bucket field value +func (o *GoogleCloudStorageConfig) GetBucket() string { + if o == nil { + var ret string + return ret + } + + return o.Bucket +} + +// GetBucketOk returns a tuple with the Bucket field value +// and a boolean to check if the value has been set. +func (o *GoogleCloudStorageConfig) GetBucketOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bucket, true +} + +// SetBucket sets field value +func (o *GoogleCloudStorageConfig) SetBucket(v string) { + o.Bucket = v +} + +// GetCredentials returns the Credentials field value +func (o *GoogleCloudStorageConfig) GetCredentials() string { + if o == nil { + var ret string + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *GoogleCloudStorageConfig) GetCredentialsOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *GoogleCloudStorageConfig) SetCredentials(v string) { + o.Credentials = v +} + +func (o GoogleCloudStorageConfig) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["bucket"] = o.Bucket + } + if true { + toSerialize["credentials"] = o.Credentials + } + return json.Marshal(toSerialize) +} + +type NullableGoogleCloudStorageConfig struct { + value *GoogleCloudStorageConfig + isSet bool +} + +func (v NullableGoogleCloudStorageConfig) Get() *GoogleCloudStorageConfig { + return v.value +} + +func (v *NullableGoogleCloudStorageConfig) Set(val *GoogleCloudStorageConfig) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleCloudStorageConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleCloudStorageConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleCloudStorageConfig(val *GoogleCloudStorageConfig) *NullableGoogleCloudStorageConfig { + return &NullableGoogleCloudStorageConfig{value: val, isSet: true} +} + +func (v NullableGoogleCloudStorageConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleCloudStorageConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_redshift_config.go b/go/internal/openapi/model_redshift_config.go new file mode 100644 index 000000000..a02040828 --- /dev/null +++ b/go/internal/openapi/model_redshift_config.go @@ -0,0 +1,345 @@ +/* + * 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" +) + +// RedshiftConfig Configuration parameters for defining a Redshift sink. +type RedshiftConfig struct { + AccessKeyId string `json:"accessKeyId"` + ClusterIdentifier string `json:"clusterIdentifier"` + // Database name. Only required if not using transformations. + DbName *string `json:"dbName,omitempty"` + DbUser string `json:"dbUser"` + Region string `json:"region"` + // Schema name. Only used if not using transformations. + SchemaName NullableString `json:"schemaName,omitempty"` + SecretAccessKey string `json:"secretAccessKey"` + // Table name. Only required if not using transformations. + TableName *string `json:"tableName,omitempty"` +} + +// NewRedshiftConfig instantiates a new RedshiftConfig 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 NewRedshiftConfig(accessKeyId string, clusterIdentifier string, dbUser string, region string, secretAccessKey string) *RedshiftConfig { + this := RedshiftConfig{} + this.AccessKeyId = accessKeyId + this.ClusterIdentifier = clusterIdentifier + this.DbUser = dbUser + this.Region = region + this.SecretAccessKey = secretAccessKey + return &this +} + +// NewRedshiftConfigWithDefaults instantiates a new RedshiftConfig 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 NewRedshiftConfigWithDefaults() *RedshiftConfig { + this := RedshiftConfig{} + return &this +} + +// GetAccessKeyId returns the AccessKeyId field value +func (o *RedshiftConfig) GetAccessKeyId() string { + if o == nil { + var ret string + return ret + } + + return o.AccessKeyId +} + +// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value +// and a boolean to check if the value has been set. +func (o *RedshiftConfig) GetAccessKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessKeyId, true +} + +// SetAccessKeyId sets field value +func (o *RedshiftConfig) SetAccessKeyId(v string) { + o.AccessKeyId = v +} + +// GetClusterIdentifier returns the ClusterIdentifier field value +func (o *RedshiftConfig) GetClusterIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.ClusterIdentifier +} + +// GetClusterIdentifierOk returns a tuple with the ClusterIdentifier field value +// and a boolean to check if the value has been set. +func (o *RedshiftConfig) GetClusterIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClusterIdentifier, true +} + +// SetClusterIdentifier sets field value +func (o *RedshiftConfig) SetClusterIdentifier(v string) { + o.ClusterIdentifier = v +} + +// GetDbName returns the DbName field value if set, zero value otherwise. +func (o *RedshiftConfig) GetDbName() string { + if o == nil || o.DbName == nil { + var ret string + return ret + } + return *o.DbName +} + +// GetDbNameOk returns a tuple with the DbName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedshiftConfig) GetDbNameOk() (*string, bool) { + if o == nil || o.DbName == nil { + return nil, false + } + return o.DbName, true +} + +// HasDbName returns a boolean if a field has been set. +func (o *RedshiftConfig) HasDbName() bool { + if o != nil && o.DbName != nil { + return true + } + + return false +} + +// SetDbName gets a reference to the given string and assigns it to the DbName field. +func (o *RedshiftConfig) SetDbName(v string) { + o.DbName = &v +} + +// GetDbUser returns the DbUser field value +func (o *RedshiftConfig) GetDbUser() string { + if o == nil { + var ret string + return ret + } + + return o.DbUser +} + +// GetDbUserOk returns a tuple with the DbUser field value +// and a boolean to check if the value has been set. +func (o *RedshiftConfig) GetDbUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DbUser, true +} + +// SetDbUser sets field value +func (o *RedshiftConfig) SetDbUser(v string) { + o.DbUser = v +} + +// GetRegion returns the Region field value +func (o *RedshiftConfig) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *RedshiftConfig) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *RedshiftConfig) SetRegion(v string) { + o.Region = v +} + +// GetSchemaName returns the SchemaName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RedshiftConfig) GetSchemaName() string { + if o == nil || o.SchemaName.Get() == nil { + var ret string + return ret + } + return *o.SchemaName.Get() +} + +// GetSchemaNameOk returns a tuple with the SchemaName 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 *RedshiftConfig) GetSchemaNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SchemaName.Get(), o.SchemaName.IsSet() +} + +// HasSchemaName returns a boolean if a field has been set. +func (o *RedshiftConfig) HasSchemaName() bool { + if o != nil && o.SchemaName.IsSet() { + return true + } + + return false +} + +// SetSchemaName gets a reference to the given NullableString and assigns it to the SchemaName field. +func (o *RedshiftConfig) SetSchemaName(v string) { + o.SchemaName.Set(&v) +} +// SetSchemaNameNil sets the value for SchemaName to be an explicit nil +func (o *RedshiftConfig) SetSchemaNameNil() { + o.SchemaName.Set(nil) +} + +// UnsetSchemaName ensures that no value is present for SchemaName, not even an explicit nil +func (o *RedshiftConfig) UnsetSchemaName() { + o.SchemaName.Unset() +} + +// GetSecretAccessKey returns the SecretAccessKey field value +func (o *RedshiftConfig) GetSecretAccessKey() string { + if o == nil { + var ret string + return ret + } + + return o.SecretAccessKey +} + +// GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field value +// and a boolean to check if the value has been set. +func (o *RedshiftConfig) GetSecretAccessKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SecretAccessKey, true +} + +// SetSecretAccessKey sets field value +func (o *RedshiftConfig) SetSecretAccessKey(v string) { + o.SecretAccessKey = v +} + +// GetTableName returns the TableName field value if set, zero value otherwise. +func (o *RedshiftConfig) GetTableName() string { + if o == nil || o.TableName == nil { + var ret string + return ret + } + return *o.TableName +} + +// GetTableNameOk returns a tuple with the TableName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedshiftConfig) GetTableNameOk() (*string, bool) { + if o == nil || o.TableName == nil { + return nil, false + } + return o.TableName, true +} + +// HasTableName returns a boolean if a field has been set. +func (o *RedshiftConfig) HasTableName() bool { + if o != nil && o.TableName != nil { + return true + } + + return false +} + +// SetTableName gets a reference to the given string and assigns it to the TableName field. +func (o *RedshiftConfig) SetTableName(v string) { + o.TableName = &v +} + +func (o RedshiftConfig) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["accessKeyId"] = o.AccessKeyId + } + if true { + toSerialize["clusterIdentifier"] = o.ClusterIdentifier + } + if o.DbName != nil { + toSerialize["dbName"] = o.DbName + } + if true { + toSerialize["dbUser"] = o.DbUser + } + if true { + toSerialize["region"] = o.Region + } + if o.SchemaName.IsSet() { + toSerialize["schemaName"] = o.SchemaName.Get() + } + if true { + toSerialize["secretAccessKey"] = o.SecretAccessKey + } + if o.TableName != nil { + toSerialize["tableName"] = o.TableName + } + return json.Marshal(toSerialize) +} + +type NullableRedshiftConfig struct { + value *RedshiftConfig + isSet bool +} + +func (v NullableRedshiftConfig) Get() *RedshiftConfig { + return v.value +} + +func (v *NullableRedshiftConfig) Set(val *RedshiftConfig) { + v.value = val + v.isSet = true +} + +func (v NullableRedshiftConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableRedshiftConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedshiftConfig(val *RedshiftConfig) *NullableRedshiftConfig { + return &NullableRedshiftConfig{value: val, isSet: true} +} + +func (v NullableRedshiftConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedshiftConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_s3_config.go b/go/internal/openapi/model_s3_config.go index 3c1cc4ae5..dcf2d3b07 100644 --- a/go/internal/openapi/model_s3_config.go +++ b/go/internal/openapi/model_s3_config.go @@ -16,7 +16,7 @@ import ( // S3Config struct for S3Config type S3Config struct { - AccessKey string `json:"accessKey"` + AccessKeyId string `json:"accessKeyId"` Bucket string `json:"bucket"` Region string `json:"region"` SecretAccessKey string `json:"secretAccessKey"` @@ -26,9 +26,9 @@ type S3Config struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewS3Config(accessKey string, bucket string, region string, secretAccessKey string) *S3Config { +func NewS3Config(accessKeyId string, bucket string, region string, secretAccessKey string) *S3Config { this := S3Config{} - this.AccessKey = accessKey + this.AccessKeyId = accessKeyId this.Bucket = bucket this.Region = region this.SecretAccessKey = secretAccessKey @@ -43,28 +43,28 @@ func NewS3ConfigWithDefaults() *S3Config { return &this } -// GetAccessKey returns the AccessKey field value -func (o *S3Config) GetAccessKey() string { +// GetAccessKeyId returns the AccessKeyId field value +func (o *S3Config) GetAccessKeyId() string { if o == nil { var ret string return ret } - return o.AccessKey + return o.AccessKeyId } -// GetAccessKeyOk returns a tuple with the AccessKey field value +// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value // and a boolean to check if the value has been set. -func (o *S3Config) GetAccessKeyOk() (*string, bool) { +func (o *S3Config) GetAccessKeyIdOk() (*string, bool) { if o == nil { return nil, false } - return &o.AccessKey, true + return &o.AccessKeyId, true } -// SetAccessKey sets field value -func (o *S3Config) SetAccessKey(v string) { - o.AccessKey = v +// SetAccessKeyId sets field value +func (o *S3Config) SetAccessKeyId(v string) { + o.AccessKeyId = v } // GetBucket returns the Bucket field value @@ -142,7 +142,7 @@ func (o *S3Config) SetSecretAccessKey(v string) { func (o S3Config) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if true { - toSerialize["accessKey"] = o.AccessKey + toSerialize["accessKeyId"] = o.AccessKeyId } if true { toSerialize["bucket"] = o.Bucket diff --git a/go/internal/openapi/model_sink_http_config.go b/go/internal/openapi/model_sink_http_config.go index 0312760a4..3be482d57 100644 --- a/go/internal/openapi/model_sink_http_config.go +++ b/go/internal/openapi/model_sink_http_config.go @@ -16,6 +16,7 @@ import ( // SinkHttpConfig struct for SinkHttpConfig type SinkHttpConfig struct { + Headers *map[string]string `json:"headers,omitempty"` Url string `json:"url"` } @@ -37,6 +38,38 @@ func NewSinkHttpConfigWithDefaults() *SinkHttpConfig { return &this } +// GetHeaders returns the Headers field value if set, zero value otherwise. +func (o *SinkHttpConfig) GetHeaders() map[string]string { + if o == nil || o.Headers == nil { + var ret map[string]string + return ret + } + return *o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SinkHttpConfig) GetHeadersOk() (*map[string]string, bool) { + if o == nil || o.Headers == nil { + return nil, false + } + return o.Headers, true +} + +// HasHeaders returns a boolean if a field has been set. +func (o *SinkHttpConfig) HasHeaders() bool { + if o != nil && o.Headers != nil { + return true + } + + return false +} + +// SetHeaders gets a reference to the given map[string]string and assigns it to the Headers field. +func (o *SinkHttpConfig) SetHeaders(v map[string]string) { + o.Headers = &v +} + // GetUrl returns the Url field value func (o *SinkHttpConfig) GetUrl() string { if o == nil { @@ -63,6 +96,9 @@ func (o *SinkHttpConfig) SetUrl(v string) { func (o SinkHttpConfig) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} + if o.Headers != nil { + toSerialize["headers"] = o.Headers + } if true { toSerialize["url"] = o.Url } diff --git a/go/internal/openapi/model_sink_in.go b/go/internal/openapi/model_sink_in.go index b5055b4a1..96aee7081 100644 --- a/go/internal/openapi/model_sink_in.go +++ b/go/internal/openapi/model_sink_in.go @@ -21,7 +21,6 @@ type SinkIn struct { SinkInOneOf1 *SinkInOneOf1 SinkInOneOf2 *SinkInOneOf2 SinkInOneOf3 *SinkInOneOf3 - SinkInOneOf4 *SinkInOneOf4 } // SinkInOneOfAsSinkIn is a convenience function that returns SinkInOneOf wrapped in SinkIn @@ -44,11 +43,6 @@ func SinkInOneOf3AsSinkIn(v *SinkInOneOf3) SinkIn { return SinkIn{ SinkInOneOf3: v} } -// SinkInOneOf4AsSinkIn is a convenience function that returns SinkInOneOf4 wrapped in SinkIn -func SinkInOneOf4AsSinkIn(v *SinkInOneOf4) SinkIn { - return SinkIn{ SinkInOneOf4: v} -} - // Unmarshal JSON data into one of the pointers in the struct func (dst *SinkIn) UnmarshalJSON(data []byte) error { @@ -106,26 +100,12 @@ func (dst *SinkIn) UnmarshalJSON(data []byte) error { dst.SinkInOneOf3 = nil } - // try to unmarshal data into SinkInOneOf4 - err = json.Unmarshal(data, &dst.SinkInOneOf4) - if err == nil { - jsonSinkInOneOf4, _ := json.Marshal(dst.SinkInOneOf4) - if string(jsonSinkInOneOf4) == "{}" { // empty struct - dst.SinkInOneOf4 = nil - } else { - match++ - } - } else { - dst.SinkInOneOf4 = nil - } - if match > 1 { // more than 1 match // reset to nil dst.SinkInOneOf = nil dst.SinkInOneOf1 = nil dst.SinkInOneOf2 = nil dst.SinkInOneOf3 = nil - dst.SinkInOneOf4 = nil return fmt.Errorf("Data matches more than one schema in oneOf(SinkIn)") } else if match == 1 { @@ -153,10 +133,6 @@ func (src SinkIn) MarshalJSON() ([]byte, error) { return json.Marshal(&src.SinkInOneOf3) } - if src.SinkInOneOf4 != nil { - return json.Marshal(&src.SinkInOneOf4) - } - return nil, nil // no data in oneOf schemas } @@ -178,10 +154,6 @@ func (obj *SinkIn) GetActualInstance() (interface{}) { return obj.SinkInOneOf3 } - if obj.SinkInOneOf4 != nil { - return obj.SinkInOneOf4 - } - // all schemas are nil return nil } diff --git a/go/internal/openapi/model_sink_in_one_of_4.go b/go/internal/openapi/model_sink_in_one_of_4.go deleted file mode 100644 index b8d1ced13..000000000 --- a/go/internal/openapi/model_sink_in_one_of_4.go +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package openapi - -import ( - "encoding/json" -) - -// SinkInOneOf4 struct for SinkInOneOf4 -type SinkInOneOf4 struct { - Type string `json:"type"` - Url string `json:"url"` -} - -// NewSinkInOneOf4 instantiates a new SinkInOneOf4 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSinkInOneOf4(type_ string, url string) *SinkInOneOf4 { - this := SinkInOneOf4{} - this.Type = type_ - this.Url = url - return &this -} - -// NewSinkInOneOf4WithDefaults instantiates a new SinkInOneOf4 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSinkInOneOf4WithDefaults() *SinkInOneOf4 { - this := SinkInOneOf4{} - return &this -} - -// GetType returns the Type field value -func (o *SinkInOneOf4) GetType() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *SinkInOneOf4) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *SinkInOneOf4) SetType(v string) { - o.Type = v -} - -// GetUrl returns the Url field value -func (o *SinkInOneOf4) GetUrl() string { - if o == nil { - var ret string - return ret - } - - return o.Url -} - -// GetUrlOk returns a tuple with the Url field value -// and a boolean to check if the value has been set. -func (o *SinkInOneOf4) GetUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Url, true -} - -// SetUrl sets field value -func (o *SinkInOneOf4) SetUrl(v string) { - o.Url = v -} - -func (o SinkInOneOf4) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["type"] = o.Type - } - if true { - toSerialize["url"] = o.Url - } - return json.Marshal(toSerialize) -} - -type NullableSinkInOneOf4 struct { - value *SinkInOneOf4 - isSet bool -} - -func (v NullableSinkInOneOf4) Get() *SinkInOneOf4 { - return v.value -} - -func (v *NullableSinkInOneOf4) Set(val *SinkInOneOf4) { - v.value = val - v.isSet = true -} - -func (v NullableSinkInOneOf4) IsSet() bool { - return v.isSet -} - -func (v *NullableSinkInOneOf4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSinkInOneOf4(val *SinkInOneOf4) *NullableSinkInOneOf4 { - return &NullableSinkInOneOf4{value: val, isSet: true} -} - -func (v NullableSinkInOneOf4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSinkInOneOf4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/go/internal/openapi/model_sink_out.go b/go/internal/openapi/model_sink_out.go index e2416df5e..22a8439c9 100644 --- a/go/internal/openapi/model_sink_out.go +++ b/go/internal/openapi/model_sink_out.go @@ -21,7 +21,6 @@ type SinkOut struct { SinkInOneOf1 *SinkInOneOf1 SinkInOneOf2 *SinkInOneOf2 SinkInOneOf3 *SinkInOneOf3 - SinkInOneOf4 *SinkInOneOf4 } // SinkInOneOfAsSinkOut is a convenience function that returns SinkInOneOf wrapped in SinkOut @@ -44,11 +43,6 @@ func SinkInOneOf3AsSinkOut(v *SinkInOneOf3) SinkOut { return SinkOut{ SinkInOneOf3: v} } -// SinkInOneOf4AsSinkOut is a convenience function that returns SinkInOneOf4 wrapped in SinkOut -func SinkInOneOf4AsSinkOut(v *SinkInOneOf4) SinkOut { - return SinkOut{ SinkInOneOf4: v} -} - // Unmarshal JSON data into one of the pointers in the struct func (dst *SinkOut) UnmarshalJSON(data []byte) error { @@ -106,26 +100,12 @@ func (dst *SinkOut) UnmarshalJSON(data []byte) error { dst.SinkInOneOf3 = nil } - // try to unmarshal data into SinkInOneOf4 - err = json.Unmarshal(data, &dst.SinkInOneOf4) - if err == nil { - jsonSinkInOneOf4, _ := json.Marshal(dst.SinkInOneOf4) - if string(jsonSinkInOneOf4) == "{}" { // empty struct - dst.SinkInOneOf4 = nil - } else { - match++ - } - } else { - dst.SinkInOneOf4 = nil - } - if match > 1 { // more than 1 match // reset to nil dst.SinkInOneOf = nil dst.SinkInOneOf1 = nil dst.SinkInOneOf2 = nil dst.SinkInOneOf3 = nil - dst.SinkInOneOf4 = nil return fmt.Errorf("Data matches more than one schema in oneOf(SinkOut)") } else if match == 1 { @@ -153,10 +133,6 @@ func (src SinkOut) MarshalJSON() ([]byte, error) { return json.Marshal(&src.SinkInOneOf3) } - if src.SinkInOneOf4 != nil { - return json.Marshal(&src.SinkInOneOf4) - } - return nil, nil // no data in oneOf schemas } @@ -178,10 +154,6 @@ func (obj *SinkOut) GetActualInstance() (interface{}) { return obj.SinkInOneOf3 } - if obj.SinkInOneOf4 != nil { - return obj.SinkInOneOf4 - } - // all schemas are nil return nil } diff --git a/go/internal/openapi/model_snowflake_config.go b/go/internal/openapi/model_snowflake_config.go index 683af71c6..43ed0514e 100644 --- a/go/internal/openapi/model_snowflake_config.go +++ b/go/internal/openapi/model_snowflake_config.go @@ -14,13 +14,19 @@ import ( "encoding/json" ) -// SnowflakeConfig struct for SnowflakeConfig +// SnowflakeConfig Configuration parameters for defining a Snowflake sink. type SnowflakeConfig struct { + // Snowflake account identifier, which includes both the organization and account IDs separated by a hyphen. AccountIdentifier string `json:"accountIdentifier"` + // Database name. Only required if not using transformations. DbName *string `json:"dbName,omitempty"` + // PEM-encoded private key used for signing token-based requests to the Snowflake API. Beginning/end delimiters are not required. PrivateKey string `json:"privateKey"` + // Schema name. Only required if not using transformations. SchemaName *string `json:"schemaName,omitempty"` + // Table name. Only required if not using transformations. TableName *string `json:"tableName,omitempty"` + // The Snowflake user id. UserId string `json:"userId"` } diff --git a/go/internal/openapi/model_stream_sink_in.go b/go/internal/openapi/model_stream_sink_in.go index 946d585ba..7f376bb7e 100644 --- a/go/internal/openapi/model_stream_sink_in.go +++ b/go/internal/openapi/model_stream_sink_in.go @@ -21,6 +21,9 @@ type StreamSinkIn struct { StreamSinkInOneOf1 *StreamSinkInOneOf1 StreamSinkInOneOf2 *StreamSinkInOneOf2 StreamSinkInOneOf3 *StreamSinkInOneOf3 + StreamSinkInOneOf4 *StreamSinkInOneOf4 + StreamSinkInOneOf5 *StreamSinkInOneOf5 + StreamSinkInOneOf6 *StreamSinkInOneOf6 } // StreamSinkInOneOfAsStreamSinkIn is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkIn @@ -43,6 +46,21 @@ func StreamSinkInOneOf3AsStreamSinkIn(v *StreamSinkInOneOf3) StreamSinkIn { return StreamSinkIn{ StreamSinkInOneOf3: v} } +// StreamSinkInOneOf4AsStreamSinkIn is a convenience function that returns StreamSinkInOneOf4 wrapped in StreamSinkIn +func StreamSinkInOneOf4AsStreamSinkIn(v *StreamSinkInOneOf4) StreamSinkIn { + return StreamSinkIn{ StreamSinkInOneOf4: v} +} + +// StreamSinkInOneOf5AsStreamSinkIn is a convenience function that returns StreamSinkInOneOf5 wrapped in StreamSinkIn +func StreamSinkInOneOf5AsStreamSinkIn(v *StreamSinkInOneOf5) StreamSinkIn { + return StreamSinkIn{ StreamSinkInOneOf5: v} +} + +// StreamSinkInOneOf6AsStreamSinkIn is a convenience function that returns StreamSinkInOneOf6 wrapped in StreamSinkIn +func StreamSinkInOneOf6AsStreamSinkIn(v *StreamSinkInOneOf6) StreamSinkIn { + return StreamSinkIn{ StreamSinkInOneOf6: v} +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *StreamSinkIn) UnmarshalJSON(data []byte) error { @@ -100,12 +118,54 @@ func (dst *StreamSinkIn) UnmarshalJSON(data []byte) error { dst.StreamSinkInOneOf3 = nil } + // try to unmarshal data into StreamSinkInOneOf4 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf4) + if err == nil { + jsonStreamSinkInOneOf4, _ := json.Marshal(dst.StreamSinkInOneOf4) + if string(jsonStreamSinkInOneOf4) == "{}" { // empty struct + dst.StreamSinkInOneOf4 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf4 = nil + } + + // try to unmarshal data into StreamSinkInOneOf5 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf5) + if err == nil { + jsonStreamSinkInOneOf5, _ := json.Marshal(dst.StreamSinkInOneOf5) + if string(jsonStreamSinkInOneOf5) == "{}" { // empty struct + dst.StreamSinkInOneOf5 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf5 = nil + } + + // try to unmarshal data into StreamSinkInOneOf6 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf6) + if err == nil { + jsonStreamSinkInOneOf6, _ := json.Marshal(dst.StreamSinkInOneOf6) + if string(jsonStreamSinkInOneOf6) == "{}" { // empty struct + dst.StreamSinkInOneOf6 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf6 = nil + } + if match > 1 { // more than 1 match // reset to nil dst.StreamSinkInOneOf = nil dst.StreamSinkInOneOf1 = nil dst.StreamSinkInOneOf2 = nil dst.StreamSinkInOneOf3 = nil + dst.StreamSinkInOneOf4 = nil + dst.StreamSinkInOneOf5 = nil + dst.StreamSinkInOneOf6 = nil return fmt.Errorf("Data matches more than one schema in oneOf(StreamSinkIn)") } else if match == 1 { @@ -133,6 +193,18 @@ func (src StreamSinkIn) MarshalJSON() ([]byte, error) { return json.Marshal(&src.StreamSinkInOneOf3) } + if src.StreamSinkInOneOf4 != nil { + return json.Marshal(&src.StreamSinkInOneOf4) + } + + if src.StreamSinkInOneOf5 != nil { + return json.Marshal(&src.StreamSinkInOneOf5) + } + + if src.StreamSinkInOneOf6 != nil { + return json.Marshal(&src.StreamSinkInOneOf6) + } + return nil, nil // no data in oneOf schemas } @@ -154,6 +226,18 @@ func (obj *StreamSinkIn) GetActualInstance() (interface{}) { return obj.StreamSinkInOneOf3 } + if obj.StreamSinkInOneOf4 != nil { + return obj.StreamSinkInOneOf4 + } + + if obj.StreamSinkInOneOf5 != nil { + return obj.StreamSinkInOneOf5 + } + + if obj.StreamSinkInOneOf6 != nil { + return obj.StreamSinkInOneOf6 + } + // all schemas are nil return nil } diff --git a/go/internal/openapi/model_stream_sink_in_one_of.go b/go/internal/openapi/model_stream_sink_in_one_of.go index 013243b86..7234878fc 100644 --- a/go/internal/openapi/model_stream_sink_in_one_of.go +++ b/go/internal/openapi/model_stream_sink_in_one_of.go @@ -16,7 +16,7 @@ import ( // StreamSinkInOneOf struct for StreamSinkInOneOf type StreamSinkInOneOf struct { - Config SinkOtelV1Config `json:"config"` + Config AzureBlobStorageConfig `json:"config"` Type string `json:"type"` } @@ -24,7 +24,7 @@ type StreamSinkInOneOf struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewStreamSinkInOneOf(config SinkOtelV1Config, type_ string) *StreamSinkInOneOf { +func NewStreamSinkInOneOf(config AzureBlobStorageConfig, type_ string) *StreamSinkInOneOf { this := StreamSinkInOneOf{} this.Config = config this.Type = type_ @@ -40,9 +40,9 @@ func NewStreamSinkInOneOfWithDefaults() *StreamSinkInOneOf { } // GetConfig returns the Config field value -func (o *StreamSinkInOneOf) GetConfig() SinkOtelV1Config { +func (o *StreamSinkInOneOf) GetConfig() AzureBlobStorageConfig { if o == nil { - var ret SinkOtelV1Config + var ret AzureBlobStorageConfig return ret } @@ -51,7 +51,7 @@ func (o *StreamSinkInOneOf) GetConfig() SinkOtelV1Config { // GetConfigOk returns a tuple with the Config field value // and a boolean to check if the value has been set. -func (o *StreamSinkInOneOf) GetConfigOk() (*SinkOtelV1Config, bool) { +func (o *StreamSinkInOneOf) GetConfigOk() (*AzureBlobStorageConfig, bool) { if o == nil { return nil, false } @@ -59,7 +59,7 @@ func (o *StreamSinkInOneOf) GetConfigOk() (*SinkOtelV1Config, bool) { } // SetConfig sets field value -func (o *StreamSinkInOneOf) SetConfig(v SinkOtelV1Config) { +func (o *StreamSinkInOneOf) SetConfig(v AzureBlobStorageConfig) { o.Config = v } 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 index ca3aaf5e9..9799ae223 100644 --- a/go/internal/openapi/model_stream_sink_in_one_of_1.go +++ b/go/internal/openapi/model_stream_sink_in_one_of_1.go @@ -16,7 +16,7 @@ import ( // StreamSinkInOneOf1 struct for StreamSinkInOneOf1 type StreamSinkInOneOf1 struct { - Config SinkHttpConfig `json:"config"` + Config SinkOtelV1Config `json:"config"` Type string `json:"type"` } @@ -24,7 +24,7 @@ type StreamSinkInOneOf1 struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewStreamSinkInOneOf1(config SinkHttpConfig, type_ string) *StreamSinkInOneOf1 { +func NewStreamSinkInOneOf1(config SinkOtelV1Config, type_ string) *StreamSinkInOneOf1 { this := StreamSinkInOneOf1{} this.Config = config this.Type = type_ @@ -40,9 +40,9 @@ func NewStreamSinkInOneOf1WithDefaults() *StreamSinkInOneOf1 { } // GetConfig returns the Config field value -func (o *StreamSinkInOneOf1) GetConfig() SinkHttpConfig { +func (o *StreamSinkInOneOf1) GetConfig() SinkOtelV1Config { if o == nil { - var ret SinkHttpConfig + var ret SinkOtelV1Config return ret } @@ -51,7 +51,7 @@ func (o *StreamSinkInOneOf1) GetConfig() SinkHttpConfig { // GetConfigOk returns a tuple with the Config field value // and a boolean to check if the value has been set. -func (o *StreamSinkInOneOf1) GetConfigOk() (*SinkHttpConfig, bool) { +func (o *StreamSinkInOneOf1) GetConfigOk() (*SinkOtelV1Config, bool) { if o == nil { return nil, false } @@ -59,7 +59,7 @@ func (o *StreamSinkInOneOf1) GetConfigOk() (*SinkHttpConfig, bool) { } // SetConfig sets field value -func (o *StreamSinkInOneOf1) SetConfig(v SinkHttpConfig) { +func (o *StreamSinkInOneOf1) SetConfig(v SinkOtelV1Config) { o.Config = v } diff --git a/go/internal/openapi/model_stream_sink_in_one_of_2.go b/go/internal/openapi/model_stream_sink_in_one_of_2.go index ec180924b..dd4538eb2 100644 --- a/go/internal/openapi/model_stream_sink_in_one_of_2.go +++ b/go/internal/openapi/model_stream_sink_in_one_of_2.go @@ -16,7 +16,7 @@ import ( // StreamSinkInOneOf2 struct for StreamSinkInOneOf2 type StreamSinkInOneOf2 struct { - Config S3Config `json:"config"` + Config SinkHttpConfig `json:"config"` Type string `json:"type"` } @@ -24,7 +24,7 @@ type StreamSinkInOneOf2 struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewStreamSinkInOneOf2(config S3Config, type_ string) *StreamSinkInOneOf2 { +func NewStreamSinkInOneOf2(config SinkHttpConfig, type_ string) *StreamSinkInOneOf2 { this := StreamSinkInOneOf2{} this.Config = config this.Type = type_ @@ -40,9 +40,9 @@ func NewStreamSinkInOneOf2WithDefaults() *StreamSinkInOneOf2 { } // GetConfig returns the Config field value -func (o *StreamSinkInOneOf2) GetConfig() S3Config { +func (o *StreamSinkInOneOf2) GetConfig() SinkHttpConfig { if o == nil { - var ret S3Config + var ret SinkHttpConfig return ret } @@ -51,7 +51,7 @@ func (o *StreamSinkInOneOf2) GetConfig() S3Config { // GetConfigOk returns a tuple with the Config field value // and a boolean to check if the value has been set. -func (o *StreamSinkInOneOf2) GetConfigOk() (*S3Config, bool) { +func (o *StreamSinkInOneOf2) GetConfigOk() (*SinkHttpConfig, bool) { if o == nil { return nil, false } @@ -59,7 +59,7 @@ func (o *StreamSinkInOneOf2) GetConfigOk() (*S3Config, bool) { } // SetConfig sets field value -func (o *StreamSinkInOneOf2) SetConfig(v S3Config) { +func (o *StreamSinkInOneOf2) SetConfig(v SinkHttpConfig) { o.Config = v } diff --git a/go/internal/openapi/model_stream_sink_in_one_of_3.go b/go/internal/openapi/model_stream_sink_in_one_of_3.go index 98003cb2d..8f659a3a8 100644 --- a/go/internal/openapi/model_stream_sink_in_one_of_3.go +++ b/go/internal/openapi/model_stream_sink_in_one_of_3.go @@ -16,7 +16,7 @@ import ( // StreamSinkInOneOf3 struct for StreamSinkInOneOf3 type StreamSinkInOneOf3 struct { - Config SnowflakeConfig `json:"config"` + Config S3Config `json:"config"` Type string `json:"type"` } @@ -24,7 +24,7 @@ type StreamSinkInOneOf3 struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewStreamSinkInOneOf3(config SnowflakeConfig, type_ string) *StreamSinkInOneOf3 { +func NewStreamSinkInOneOf3(config S3Config, type_ string) *StreamSinkInOneOf3 { this := StreamSinkInOneOf3{} this.Config = config this.Type = type_ @@ -40,9 +40,9 @@ func NewStreamSinkInOneOf3WithDefaults() *StreamSinkInOneOf3 { } // GetConfig returns the Config field value -func (o *StreamSinkInOneOf3) GetConfig() SnowflakeConfig { +func (o *StreamSinkInOneOf3) GetConfig() S3Config { if o == nil { - var ret SnowflakeConfig + var ret S3Config return ret } @@ -51,7 +51,7 @@ func (o *StreamSinkInOneOf3) GetConfig() SnowflakeConfig { // GetConfigOk returns a tuple with the Config field value // and a boolean to check if the value has been set. -func (o *StreamSinkInOneOf3) GetConfigOk() (*SnowflakeConfig, bool) { +func (o *StreamSinkInOneOf3) GetConfigOk() (*S3Config, bool) { if o == nil { return nil, false } @@ -59,7 +59,7 @@ func (o *StreamSinkInOneOf3) GetConfigOk() (*SnowflakeConfig, bool) { } // SetConfig sets field value -func (o *StreamSinkInOneOf3) SetConfig(v SnowflakeConfig) { +func (o *StreamSinkInOneOf3) SetConfig(v S3Config) { o.Config = v } diff --git a/go/internal/openapi/model_stream_sink_in_one_of_4.go b/go/internal/openapi/model_stream_sink_in_one_of_4.go new file mode 100644 index 000000000..1ff8be685 --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of_4.go @@ -0,0 +1,137 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// StreamSinkInOneOf4 struct for StreamSinkInOneOf4 +type StreamSinkInOneOf4 struct { + Config SnowflakeConfig `json:"config"` + Type string `json:"type"` +} + +// NewStreamSinkInOneOf4 instantiates a new StreamSinkInOneOf4 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 NewStreamSinkInOneOf4(config SnowflakeConfig, type_ string) *StreamSinkInOneOf4 { + this := StreamSinkInOneOf4{} + this.Config = config + this.Type = type_ + return &this +} + +// NewStreamSinkInOneOf4WithDefaults instantiates a new StreamSinkInOneOf4 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 NewStreamSinkInOneOf4WithDefaults() *StreamSinkInOneOf4 { + this := StreamSinkInOneOf4{} + return &this +} + +// GetConfig returns the Config field value +func (o *StreamSinkInOneOf4) GetConfig() SnowflakeConfig { + if o == nil { + var ret SnowflakeConfig + 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 *StreamSinkInOneOf4) GetConfigOk() (*SnowflakeConfig, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *StreamSinkInOneOf4) SetConfig(v SnowflakeConfig) { + o.Config = v +} + +// GetType returns the Type field value +func (o *StreamSinkInOneOf4) 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 *StreamSinkInOneOf4) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *StreamSinkInOneOf4) SetType(v string) { + o.Type = v +} + +func (o StreamSinkInOneOf4) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["config"] = o.Config + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableStreamSinkInOneOf4 struct { + value *StreamSinkInOneOf4 + isSet bool +} + +func (v NullableStreamSinkInOneOf4) Get() *StreamSinkInOneOf4 { + return v.value +} + +func (v *NullableStreamSinkInOneOf4) Set(val *StreamSinkInOneOf4) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOf4) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOf4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOf4(val *StreamSinkInOneOf4) *NullableStreamSinkInOneOf4 { + return &NullableStreamSinkInOneOf4{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOf4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOf4) 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_5.go b/go/internal/openapi/model_stream_sink_in_one_of_5.go new file mode 100644 index 000000000..a38821d48 --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of_5.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" +) + +// StreamSinkInOneOf5 struct for StreamSinkInOneOf5 +type StreamSinkInOneOf5 struct { + Config GoogleCloudStorageConfig `json:"config"` + Type string `json:"type"` +} + +// NewStreamSinkInOneOf5 instantiates a new StreamSinkInOneOf5 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 NewStreamSinkInOneOf5(config GoogleCloudStorageConfig, type_ string) *StreamSinkInOneOf5 { + this := StreamSinkInOneOf5{} + this.Config = config + this.Type = type_ + return &this +} + +// NewStreamSinkInOneOf5WithDefaults instantiates a new StreamSinkInOneOf5 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 NewStreamSinkInOneOf5WithDefaults() *StreamSinkInOneOf5 { + this := StreamSinkInOneOf5{} + return &this +} + +// GetConfig returns the Config field value +func (o *StreamSinkInOneOf5) GetConfig() GoogleCloudStorageConfig { + if o == nil { + var ret GoogleCloudStorageConfig + 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 *StreamSinkInOneOf5) GetConfigOk() (*GoogleCloudStorageConfig, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *StreamSinkInOneOf5) SetConfig(v GoogleCloudStorageConfig) { + o.Config = v +} + +// GetType returns the Type field value +func (o *StreamSinkInOneOf5) 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 *StreamSinkInOneOf5) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *StreamSinkInOneOf5) SetType(v string) { + o.Type = v +} + +func (o StreamSinkInOneOf5) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["config"] = o.Config + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableStreamSinkInOneOf5 struct { + value *StreamSinkInOneOf5 + isSet bool +} + +func (v NullableStreamSinkInOneOf5) Get() *StreamSinkInOneOf5 { + return v.value +} + +func (v *NullableStreamSinkInOneOf5) Set(val *StreamSinkInOneOf5) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOf5) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOf5) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOf5(val *StreamSinkInOneOf5) *NullableStreamSinkInOneOf5 { + return &NullableStreamSinkInOneOf5{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOf5) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOf5) 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_6.go b/go/internal/openapi/model_stream_sink_in_one_of_6.go new file mode 100644 index 000000000..f435d39eb --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of_6.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" +) + +// StreamSinkInOneOf6 struct for StreamSinkInOneOf6 +type StreamSinkInOneOf6 struct { + Config RedshiftConfig `json:"config"` + Type string `json:"type"` +} + +// NewStreamSinkInOneOf6 instantiates a new StreamSinkInOneOf6 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 NewStreamSinkInOneOf6(config RedshiftConfig, type_ string) *StreamSinkInOneOf6 { + this := StreamSinkInOneOf6{} + this.Config = config + this.Type = type_ + return &this +} + +// NewStreamSinkInOneOf6WithDefaults instantiates a new StreamSinkInOneOf6 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 NewStreamSinkInOneOf6WithDefaults() *StreamSinkInOneOf6 { + this := StreamSinkInOneOf6{} + return &this +} + +// GetConfig returns the Config field value +func (o *StreamSinkInOneOf6) GetConfig() RedshiftConfig { + if o == nil { + var ret RedshiftConfig + 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 *StreamSinkInOneOf6) GetConfigOk() (*RedshiftConfig, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *StreamSinkInOneOf6) SetConfig(v RedshiftConfig) { + o.Config = v +} + +// GetType returns the Type field value +func (o *StreamSinkInOneOf6) 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 *StreamSinkInOneOf6) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *StreamSinkInOneOf6) SetType(v string) { + o.Type = v +} + +func (o StreamSinkInOneOf6) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["config"] = o.Config + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableStreamSinkInOneOf6 struct { + value *StreamSinkInOneOf6 + isSet bool +} + +func (v NullableStreamSinkInOneOf6) Get() *StreamSinkInOneOf6 { + return v.value +} + +func (v *NullableStreamSinkInOneOf6) Set(val *StreamSinkInOneOf6) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOf6) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOf6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOf6(val *StreamSinkInOneOf6) *NullableStreamSinkInOneOf6 { + return &NullableStreamSinkInOneOf6{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOf6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOf6) 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 index b8d146e9a..34e2e1c6b 100644 --- a/go/internal/openapi/model_stream_sink_out.go +++ b/go/internal/openapi/model_stream_sink_out.go @@ -21,6 +21,9 @@ type StreamSinkOut struct { StreamSinkInOneOf1 *StreamSinkInOneOf1 StreamSinkInOneOf2 *StreamSinkInOneOf2 StreamSinkInOneOf3 *StreamSinkInOneOf3 + StreamSinkInOneOf4 *StreamSinkInOneOf4 + StreamSinkInOneOf5 *StreamSinkInOneOf5 + StreamSinkInOneOf6 *StreamSinkInOneOf6 } // StreamSinkInOneOfAsStreamSinkOut is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkOut @@ -43,6 +46,21 @@ func StreamSinkInOneOf3AsStreamSinkOut(v *StreamSinkInOneOf3) StreamSinkOut { return StreamSinkOut{ StreamSinkInOneOf3: v} } +// StreamSinkInOneOf4AsStreamSinkOut is a convenience function that returns StreamSinkInOneOf4 wrapped in StreamSinkOut +func StreamSinkInOneOf4AsStreamSinkOut(v *StreamSinkInOneOf4) StreamSinkOut { + return StreamSinkOut{ StreamSinkInOneOf4: v} +} + +// StreamSinkInOneOf5AsStreamSinkOut is a convenience function that returns StreamSinkInOneOf5 wrapped in StreamSinkOut +func StreamSinkInOneOf5AsStreamSinkOut(v *StreamSinkInOneOf5) StreamSinkOut { + return StreamSinkOut{ StreamSinkInOneOf5: v} +} + +// StreamSinkInOneOf6AsStreamSinkOut is a convenience function that returns StreamSinkInOneOf6 wrapped in StreamSinkOut +func StreamSinkInOneOf6AsStreamSinkOut(v *StreamSinkInOneOf6) StreamSinkOut { + return StreamSinkOut{ StreamSinkInOneOf6: v} +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *StreamSinkOut) UnmarshalJSON(data []byte) error { @@ -100,12 +118,54 @@ func (dst *StreamSinkOut) UnmarshalJSON(data []byte) error { dst.StreamSinkInOneOf3 = nil } + // try to unmarshal data into StreamSinkInOneOf4 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf4) + if err == nil { + jsonStreamSinkInOneOf4, _ := json.Marshal(dst.StreamSinkInOneOf4) + if string(jsonStreamSinkInOneOf4) == "{}" { // empty struct + dst.StreamSinkInOneOf4 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf4 = nil + } + + // try to unmarshal data into StreamSinkInOneOf5 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf5) + if err == nil { + jsonStreamSinkInOneOf5, _ := json.Marshal(dst.StreamSinkInOneOf5) + if string(jsonStreamSinkInOneOf5) == "{}" { // empty struct + dst.StreamSinkInOneOf5 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf5 = nil + } + + // try to unmarshal data into StreamSinkInOneOf6 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf6) + if err == nil { + jsonStreamSinkInOneOf6, _ := json.Marshal(dst.StreamSinkInOneOf6) + if string(jsonStreamSinkInOneOf6) == "{}" { // empty struct + dst.StreamSinkInOneOf6 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf6 = nil + } + if match > 1 { // more than 1 match // reset to nil dst.StreamSinkInOneOf = nil dst.StreamSinkInOneOf1 = nil dst.StreamSinkInOneOf2 = nil dst.StreamSinkInOneOf3 = nil + dst.StreamSinkInOneOf4 = nil + dst.StreamSinkInOneOf5 = nil + dst.StreamSinkInOneOf6 = nil return fmt.Errorf("Data matches more than one schema in oneOf(StreamSinkOut)") } else if match == 1 { @@ -133,6 +193,18 @@ func (src StreamSinkOut) MarshalJSON() ([]byte, error) { return json.Marshal(&src.StreamSinkInOneOf3) } + if src.StreamSinkInOneOf4 != nil { + return json.Marshal(&src.StreamSinkInOneOf4) + } + + if src.StreamSinkInOneOf5 != nil { + return json.Marshal(&src.StreamSinkInOneOf5) + } + + if src.StreamSinkInOneOf6 != nil { + return json.Marshal(&src.StreamSinkInOneOf6) + } + return nil, nil // no data in oneOf schemas } @@ -154,6 +226,18 @@ func (obj *StreamSinkOut) GetActualInstance() (interface{}) { return obj.StreamSinkInOneOf3 } + if obj.StreamSinkInOneOf4 != nil { + return obj.StreamSinkInOneOf4 + } + + if obj.StreamSinkInOneOf5 != nil { + return obj.StreamSinkInOneOf5 + } + + if obj.StreamSinkInOneOf6 != nil { + return obj.StreamSinkInOneOf6 + } + // all schemas are nil return nil } diff --git a/go/internal/openapi/model_stream_sink_patch.go b/go/internal/openapi/model_stream_sink_patch.go index 1d7bcbcba..39bf5a778 100644 --- a/go/internal/openapi/model_stream_sink_patch.go +++ b/go/internal/openapi/model_stream_sink_patch.go @@ -21,6 +21,9 @@ type StreamSinkPatch struct { StreamSinkInOneOf1 *StreamSinkInOneOf1 StreamSinkInOneOf2 *StreamSinkInOneOf2 StreamSinkInOneOf3 *StreamSinkInOneOf3 + StreamSinkInOneOf4 *StreamSinkInOneOf4 + StreamSinkInOneOf5 *StreamSinkInOneOf5 + StreamSinkInOneOf6 *StreamSinkInOneOf6 } // StreamSinkInOneOfAsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkPatch @@ -43,6 +46,21 @@ func StreamSinkInOneOf3AsStreamSinkPatch(v *StreamSinkInOneOf3) StreamSinkPatch return StreamSinkPatch{ StreamSinkInOneOf3: v} } +// StreamSinkInOneOf4AsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf4 wrapped in StreamSinkPatch +func StreamSinkInOneOf4AsStreamSinkPatch(v *StreamSinkInOneOf4) StreamSinkPatch { + return StreamSinkPatch{ StreamSinkInOneOf4: v} +} + +// StreamSinkInOneOf5AsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf5 wrapped in StreamSinkPatch +func StreamSinkInOneOf5AsStreamSinkPatch(v *StreamSinkInOneOf5) StreamSinkPatch { + return StreamSinkPatch{ StreamSinkInOneOf5: v} +} + +// StreamSinkInOneOf6AsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf6 wrapped in StreamSinkPatch +func StreamSinkInOneOf6AsStreamSinkPatch(v *StreamSinkInOneOf6) StreamSinkPatch { + return StreamSinkPatch{ StreamSinkInOneOf6: v} +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *StreamSinkPatch) UnmarshalJSON(data []byte) error { @@ -100,12 +118,54 @@ func (dst *StreamSinkPatch) UnmarshalJSON(data []byte) error { dst.StreamSinkInOneOf3 = nil } + // try to unmarshal data into StreamSinkInOneOf4 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf4) + if err == nil { + jsonStreamSinkInOneOf4, _ := json.Marshal(dst.StreamSinkInOneOf4) + if string(jsonStreamSinkInOneOf4) == "{}" { // empty struct + dst.StreamSinkInOneOf4 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf4 = nil + } + + // try to unmarshal data into StreamSinkInOneOf5 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf5) + if err == nil { + jsonStreamSinkInOneOf5, _ := json.Marshal(dst.StreamSinkInOneOf5) + if string(jsonStreamSinkInOneOf5) == "{}" { // empty struct + dst.StreamSinkInOneOf5 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf5 = nil + } + + // try to unmarshal data into StreamSinkInOneOf6 + err = json.Unmarshal(data, &dst.StreamSinkInOneOf6) + if err == nil { + jsonStreamSinkInOneOf6, _ := json.Marshal(dst.StreamSinkInOneOf6) + if string(jsonStreamSinkInOneOf6) == "{}" { // empty struct + dst.StreamSinkInOneOf6 = nil + } else { + match++ + } + } else { + dst.StreamSinkInOneOf6 = nil + } + if match > 1 { // more than 1 match // reset to nil dst.StreamSinkInOneOf = nil dst.StreamSinkInOneOf1 = nil dst.StreamSinkInOneOf2 = nil dst.StreamSinkInOneOf3 = nil + dst.StreamSinkInOneOf4 = nil + dst.StreamSinkInOneOf5 = nil + dst.StreamSinkInOneOf6 = nil return fmt.Errorf("Data matches more than one schema in oneOf(StreamSinkPatch)") } else if match == 1 { @@ -133,6 +193,18 @@ func (src StreamSinkPatch) MarshalJSON() ([]byte, error) { return json.Marshal(&src.StreamSinkInOneOf3) } + if src.StreamSinkInOneOf4 != nil { + return json.Marshal(&src.StreamSinkInOneOf4) + } + + if src.StreamSinkInOneOf5 != nil { + return json.Marshal(&src.StreamSinkInOneOf5) + } + + if src.StreamSinkInOneOf6 != nil { + return json.Marshal(&src.StreamSinkInOneOf6) + } + return nil, nil // no data in oneOf schemas } @@ -154,6 +226,18 @@ func (obj *StreamSinkPatch) GetActualInstance() (interface{}) { return obj.StreamSinkInOneOf3 } + if obj.StreamSinkInOneOf4 != nil { + return obj.StreamSinkInOneOf4 + } + + if obj.StreamSinkInOneOf5 != nil { + return obj.StreamSinkInOneOf5 + } + + if obj.StreamSinkInOneOf6 != nil { + return obj.StreamSinkInOneOf6 + } + // all schemas are nil return nil } diff --git a/openapi.json b/openapi.json index 71de35380..5b2410788 100644 --- a/openapi.json +++ b/openapi.json @@ -364,6 +364,25 @@ ], "type": "object" }, + "AzureBlobStorageConfig": { + "properties": { + "accessKey": { + "type": "string" + }, + "account": { + "type": "string" + }, + "container": { + "type": "string" + } + }, + "required": [ + "accessKey", + "account", + "container" + ], + "type": "object" + }, "BackgroundTaskData": { "type": "object" }, @@ -1643,6 +1662,13 @@ "$ref": "#/components/schemas/SettingsIn", "nullable": true }, + "transformationTemplates": { + "items": { + "$ref": "#/components/schemas/TemplateIn" + }, + "nullable": true, + "type": "array" + }, "version": { "format": "int", "type": "integer" @@ -1670,6 +1696,12 @@ "$ref": "#/components/schemas/SettingsOut", "nullable": true }, + "transformationTemplates": { + "items": { + "$ref": "#/components/schemas/TemplateOut" + }, + "type": "array" + }, "version": { "default": 1, "format": "int", @@ -1678,7 +1710,8 @@ }, "required": [ "createdAt", - "eventTypes" + "eventTypes", + "transformationTemplates" ], "type": "object" }, @@ -2414,6 +2447,23 @@ ], "type": "object" }, + "GoogleCloudStorageConfig": { + "description": "Configuration for a Google Cloud Storage sink.\n\nWrite stream events into the named bucket using the supplied Google Cloud credentials.", + "properties": { + "bucket": { + "type": "string" + }, + "credentials": { + "description": "Google Cloud Credentials JSON Object as a string.", + "type": "string" + } + }, + "required": [ + "bucket", + "credentials" + ], + "type": "object" + }, "HTTPValidationError": { "properties": { "detail": { @@ -3948,6 +3998,47 @@ ], "type": "object" }, + "RedshiftConfig": { + "description": "Configuration parameters for defining a Redshift sink.", + "properties": { + "accessKeyId": { + "type": "string" + }, + "clusterIdentifier": { + "type": "string" + }, + "dbName": { + "description": "Database name.\n\nOnly required if not using transformations.", + "type": "string" + }, + "dbUser": { + "type": "string" + }, + "region": { + "type": "string" + }, + "schemaName": { + "description": "Schema name.\n\nOnly used if not using transformations.", + "nullable": true, + "type": "string" + }, + "secretAccessKey": { + "type": "string" + }, + "tableName": { + "description": "Table name.\n\nOnly required if not using transformations.", + "type": "string" + } + }, + "required": [ + "accessKeyId", + "clusterIdentifier", + "dbUser", + "region", + "secretAccessKey" + ], + "type": "object" + }, "ReplayIn": { "properties": { "since": { @@ -4012,7 +4103,7 @@ }, "S3Config": { "properties": { - "accessKey": { + "accessKeyId": { "type": "string" }, "bucket": { @@ -4026,7 +4117,7 @@ } }, "required": [ - "accessKey", + "accessKeyId", "bucket", "region", "secretAccessKey" @@ -4217,6 +4308,13 @@ }, "SinkHttpConfig": { "properties": { + "headers": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "type": "object" + }, "url": { "format": "uri", "type": "string" @@ -4318,25 +4416,6 @@ ], "type": "object" }, - { - "properties": { - "type": { - "enum": [ - "otelV1HttpTrace" - ], - "type": "string" - }, - "url": { - "format": "uri", - "type": "string" - } - }, - "required": [ - "type", - "url" - ], - "type": "object" - }, { "properties": { "type": { @@ -4358,14 +4437,6 @@ } ], "properties": { - "batchSize": { - "default": 100, - "description": "Upper limit for how many messages to publish to the sink at once.\n\nDefault: `100`", - "format": "uint16", - "maximum": 1000, - "minimum": 1, - "type": "integer" - }, "channels": { "description": "List of message channels this sink listens to (omit for all)", "example": [ @@ -4411,14 +4482,6 @@ "type": "array", "uniqueItems": true }, - "maxWait": { - "default": 0, - "description": "How many seconds to spend waiting to try and fill a given batch.\n\nWhen preparing to flush a partial batch of messages to the sink, wait this long for any late-arriving messages that could complete the batch.\n\nDefault: `0` meaning \"don't wait.\"", - "format": "uint16", - "maximum": 3600, - "minimum": 0, - "type": "integer" - }, "metadata": { "additionalProperties": { "type": "string" @@ -4554,25 +4617,6 @@ ], "type": "object" }, - { - "properties": { - "type": { - "enum": [ - "otelV1HttpTrace" - ], - "type": "string" - }, - "url": { - "format": "uri", - "type": "string" - } - }, - "required": [ - "type", - "url" - ], - "type": "object" - }, { "properties": { "type": { @@ -4594,12 +4638,6 @@ } ], "properties": { - "batchSize": { - "description": "The desired batch size when flushing events to the sink.", - "format": "uint16", - "minimum": 0, - "type": "integer" - }, "channels": { "description": "List of message channels this endpoint listens to (omit for all)", "example": [ @@ -4653,12 +4691,6 @@ "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, - "maxWait": { - "description": "How many seconds to spend waiting to try and fill a given batch.\n\nWhen preparing to flush a partial batch of messages to the sink, wait this long for any late-arriving messages that could complete the batch.\n\nDefault: `0` meaning \"don't wait.\"", - "format": "uint16", - "minimum": 0, - "type": "integer" - }, "metadata": { "additionalProperties": { "type": "string" @@ -4686,11 +4718,9 @@ } }, "required": [ - "batchSize", "createdAt", "description", "id", - "maxWait", "metadata", "updatedAt" ], @@ -4745,23 +4775,30 @@ "type": "object" }, "SnowflakeConfig": { + "description": "Configuration parameters for defining a Snowflake sink.", "properties": { "accountIdentifier": { + "description": "Snowflake account identifier, which includes both the organization and account IDs separated by a hyphen.", "type": "string" }, "dbName": { + "description": "Database name.\n\nOnly required if not using transformations.", "type": "string" }, "privateKey": { + "description": "PEM-encoded private key used for signing token-based requests to the Snowflake API.\n\nBeginning/end delimiters are not required.", "type": "string" }, "schemaName": { + "description": "Schema name.\n\nOnly required if not using transformations.", "type": "string" }, "tableName": { + "description": "Table name.\n\nOnly required if not using transformations.", "type": "string" }, "userId": { + "description": "The Snowflake user id.", "type": "string" } }, @@ -4862,6 +4899,24 @@ }, "StreamSinkIn": { "oneOf": [ + { + "properties": { + "config": { + "$ref": "#/components/schemas/AzureBlobStorageConfig" + }, + "type": { + "enum": [ + "azureBlobStorage" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + }, { "properties": { "config": { @@ -4933,6 +4988,42 @@ "type" ], "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/GoogleCloudStorageConfig" + }, + "type": { + "enum": [ + "googleCloudStorage" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/RedshiftConfig" + }, + "type": { + "enum": [ + "redshift" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" } ], "properties": { @@ -4968,6 +5059,24 @@ }, "StreamSinkOut": { "oneOf": [ + { + "properties": { + "config": { + "$ref": "#/components/schemas/AzureBlobStorageConfig" + }, + "type": { + "enum": [ + "azureBlobStorage" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + }, { "properties": { "config": { @@ -5039,6 +5148,42 @@ "type" ], "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/GoogleCloudStorageConfig" + }, + "type": { + "enum": [ + "googleCloudStorage" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/RedshiftConfig" + }, + "type": { + "enum": [ + "redshift" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" } ], "properties": { @@ -5093,6 +5238,24 @@ }, "StreamSinkPatch": { "oneOf": [ + { + "properties": { + "config": { + "$ref": "#/components/schemas/AzureBlobStorageConfig" + }, + "type": { + "enum": [ + "azureBlobStorage" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + }, { "properties": { "config": { @@ -5164,6 +5327,42 @@ "type" ], "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/GoogleCloudStorageConfig" + }, + "type": { + "enum": [ + "googleCloudStorage" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/RedshiftConfig" + }, + "type": { + "enum": [ + "redshift" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" } ], "properties": { @@ -20403,62 +20602,62 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.environment.import({\n eventTypes: null,\n settings: null\n});" + "source": "await svix.environment.import({\n eventTypes: null,\n settings: null,\n transformationTemplates: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.environment.import({\n eventTypes: null,\n settings: null\n});" + "source": "await svix.environment.import({\n eventTypes: null,\n settings: null,\n transformationTemplates: null\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None\n), None)" + "source": "svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None,\n transformation_templates=None\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None\n), None)" + "source": "await svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None,\n transformation_templates=None\n), None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Environment.Import(ctx, &EnvironmentIn{\n EventTypes: nil,\n Settings: nil,\n})" + "source": "err := svixClient.Environment.Import(ctx, &EnvironmentIn{\n EventTypes: nil,\n Settings: nil,\n TransformationTemplates: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.environment.import(EnvironmentIn()\n .eventTypes(null)\n .settings(null)\n)" + "source": "svix.environment.import(EnvironmentIn()\n .eventTypes(null)\n .settings(null)\n .transformationTemplates(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getEnvironment().import(new EnvironmentIn()\n .eventTypes(null)\n .settings(null)\n)" + "source": "svix.getEnvironment().import(new EnvironmentIn()\n .eventTypes(null)\n .settings(null)\n .transformationTemplates(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.environment.import(Svix::EnvironmentIn.new({\n \"event_types\": nil,\n \"settings\": nil\n}))" + "source": "svix.environment.import(Svix::EnvironmentIn.new({\n \"event_types\": nil,\n \"settings\": nil,\n \"transformation_templates\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.environment().import(EnvironmentIn {\n event_types: None,\n settings: None,\n}, None).await?;" + "source": "svix.environment().import(EnvironmentIn {\n event_types: None,\n settings: None,\n transformation_templates: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Environment.ImportAsync(new EnvironmentIn{\n eventTypes: null,\n settings: null\n})" + "source": "await svix.Environment.ImportAsync(new EnvironmentIn{\n eventTypes: null,\n settings: null,\n transformationTemplates: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix environment import '{\n \"eventTypes\": null,\n \"settings\": null\n}'" + "source": "svix environment import '{\n \"eventTypes\": null,\n \"settings\": null,\n \"transformationTemplates\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/environment/import' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventTypes\": null,\n \"settings\": null\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/environment/import' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventTypes\": null,\n \"settings\": null,\n \"transformationTemplates\": null\n }'" } ] } @@ -27624,4 +27823,4 @@ } } } -} \ No newline at end of file +}