diff --git a/services/cdn/go.mod b/services/cdn/go.mod index c800718c7..b440be260 100644 --- a/services/cdn/go.mod +++ b/services/cdn/go.mod @@ -4,7 +4,7 @@ go 1.25 require ( github.com/google/go-cmp v0.7.0 - github.com/stackitcloud/stackit-sdk-go/core v0.26.0 + github.com/stackitcloud/stackit-sdk-go/core v0.27.0 ) require ( diff --git a/services/cdn/go.sum b/services/cdn/go.sum index 3712a0c87..042f4a71a 100644 --- a/services/cdn/go.sum +++ b/services/cdn/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.26.0 h1:jQEb9gkehfp6VCP6TcYk7BI10cz4l0KM2L6hqYBH2QA= -github.com/stackitcloud/stackit-sdk-go/core v0.26.0/go.mod h1:WU1hhxnjXw2EV7CYa1nlEvNpMiRY6CvmIOaHuL3pOaA= +github.com/stackitcloud/stackit-sdk-go/core v0.27.0 h1:7lc6qStcFDFf8zHP4ORPa9joybw+Sa2LtB6BVjKQ+ek= +github.com/stackitcloud/stackit-sdk-go/core v0.27.0/go.mod h1:WU1hhxnjXw2EV7CYa1nlEvNpMiRY6CvmIOaHuL3pOaA= diff --git a/services/cdn/model_cache_config.go b/services/cdn/model_cache_config.go new file mode 100644 index 000000000..c2052a14f --- /dev/null +++ b/services/cdn/model_cache_config.go @@ -0,0 +1,258 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package cdn + +import ( + "encoding/json" +) + +// checks if the CacheConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CacheConfig{} + +/* + types and functions for cacheKeyHeaders +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigGetCacheKeyHeadersAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigGetCacheKeyHeadersArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigGetCacheKeyHeadersRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCacheConfigGetCacheKeyHeadersAttributeTypeOk(arg CacheConfigGetCacheKeyHeadersAttributeType) (ret CacheConfigGetCacheKeyHeadersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCacheConfigGetCacheKeyHeadersAttributeType(arg *CacheConfigGetCacheKeyHeadersAttributeType, val CacheConfigGetCacheKeyHeadersRetType) { + *arg = &val +} + +/* + types and functions for queryStringVaryEnabled +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfiggetQueryStringVaryEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfiggetQueryStringVaryEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfiggetQueryStringVaryEnabledRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCacheConfiggetQueryStringVaryEnabledAttributeTypeOk(arg CacheConfiggetQueryStringVaryEnabledAttributeType) (ret CacheConfiggetQueryStringVaryEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCacheConfiggetQueryStringVaryEnabledAttributeType(arg *CacheConfiggetQueryStringVaryEnabledAttributeType, val CacheConfiggetQueryStringVaryEnabledRetType) { + *arg = &val +} + +/* + types and functions for queryStringVaryParameters +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigGetQueryStringVaryParametersAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigGetQueryStringVaryParametersArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigGetQueryStringVaryParametersRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCacheConfigGetQueryStringVaryParametersAttributeTypeOk(arg CacheConfigGetQueryStringVaryParametersAttributeType) (ret CacheConfigGetQueryStringVaryParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCacheConfigGetQueryStringVaryParametersAttributeType(arg *CacheConfigGetQueryStringVaryParametersAttributeType, val CacheConfigGetQueryStringVaryParametersRetType) { + *arg = &val +} + +// CacheConfig Groups the cache options that influence how the CDN builds its cache key. **Cache cardinality warning:** enabling query-string vary produces one cache entry per unique query-string combination (**unbounded** when `queryStringVaryParameters` is empty). Each entry in `cacheKeyHeaders` multiplies the number of cache variants by the number of distinct values observed for that header. Use these settings sparingly. `queryStringVaryParameters` is stored independently of `queryStringVaryEnabled` so that this feature can be toggled on and off without losing the configured allowlist. Only `queryStringVaryEnabled` gates whether the parameter allowlist actually varies the cache. **Optimizer interaction:** when the Optimizer is enabled, the CDN automatically enables query-string vary for image responses regardless of this setting. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfig struct { + // HTTP request header names whose values participate in the cache key. Each entry multiplies the number of cache variants by the number of distinct values observed for that header. + // REQUIRED + CacheKeyHeaders CacheConfigGetCacheKeyHeadersAttributeType `json:"cacheKeyHeaders" required:"true"` + // When true, the CDN varies its cache by the request query string. If `queryStringVaryParameters` is empty, every unique query-string combination produces its own cache entry; if non-empty, only the listed parameters influence the cache key. + // REQUIRED + QueryStringVaryEnabled CacheConfiggetQueryStringVaryEnabledAttributeType `json:"queryStringVaryEnabled" required:"true"` + // Allowlist of query-string parameter names that participate in the cache key when `queryStringVaryEnabled` is true. Ignored while `queryStringVaryEnabled` is false, but still stored so it can be re-activated without losing the list. + // REQUIRED + QueryStringVaryParameters CacheConfigGetQueryStringVaryParametersAttributeType `json:"queryStringVaryParameters" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CacheConfig CacheConfig + +// NewCacheConfig instantiates a new CacheConfig 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCacheConfig(cacheKeyHeaders CacheConfigGetCacheKeyHeadersArgType, queryStringVaryEnabled CacheConfiggetQueryStringVaryEnabledArgType, queryStringVaryParameters CacheConfigGetQueryStringVaryParametersArgType) *CacheConfig { + this := CacheConfig{} + setCacheConfigGetCacheKeyHeadersAttributeType(&this.CacheKeyHeaders, cacheKeyHeaders) + setCacheConfiggetQueryStringVaryEnabledAttributeType(&this.QueryStringVaryEnabled, queryStringVaryEnabled) + setCacheConfigGetQueryStringVaryParametersAttributeType(&this.QueryStringVaryParameters, queryStringVaryParameters) + return &this +} + +// NewCacheConfigWithDefaults instantiates a new CacheConfig 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCacheConfigWithDefaults() *CacheConfig { + this := CacheConfig{} + return &this +} + +// GetCacheKeyHeaders returns the CacheKeyHeaders field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfig) GetCacheKeyHeaders() (ret CacheConfigGetCacheKeyHeadersRetType) { + ret, _ = o.GetCacheKeyHeadersOk() + return ret +} + +// GetCacheKeyHeadersOk returns a tuple with the CacheKeyHeaders field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfig) GetCacheKeyHeadersOk() (ret CacheConfigGetCacheKeyHeadersRetType, ok bool) { + return getCacheConfigGetCacheKeyHeadersAttributeTypeOk(o.CacheKeyHeaders) +} + +// SetCacheKeyHeaders sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfig) SetCacheKeyHeaders(v CacheConfigGetCacheKeyHeadersRetType) { + setCacheConfigGetCacheKeyHeadersAttributeType(&o.CacheKeyHeaders, v) +} + +// GetQueryStringVaryEnabled returns the QueryStringVaryEnabled field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfig) GetQueryStringVaryEnabled() (ret CacheConfiggetQueryStringVaryEnabledRetType) { + ret, _ = o.GetQueryStringVaryEnabledOk() + return ret +} + +// GetQueryStringVaryEnabledOk returns a tuple with the QueryStringVaryEnabled field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfig) GetQueryStringVaryEnabledOk() (ret CacheConfiggetQueryStringVaryEnabledRetType, ok bool) { + return getCacheConfiggetQueryStringVaryEnabledAttributeTypeOk(o.QueryStringVaryEnabled) +} + +// SetQueryStringVaryEnabled sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfig) SetQueryStringVaryEnabled(v CacheConfiggetQueryStringVaryEnabledRetType) { + setCacheConfiggetQueryStringVaryEnabledAttributeType(&o.QueryStringVaryEnabled, v) +} + +// GetQueryStringVaryParameters returns the QueryStringVaryParameters field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfig) GetQueryStringVaryParameters() (ret CacheConfigGetQueryStringVaryParametersRetType) { + ret, _ = o.GetQueryStringVaryParametersOk() + return ret +} + +// GetQueryStringVaryParametersOk returns a tuple with the QueryStringVaryParameters field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfig) GetQueryStringVaryParametersOk() (ret CacheConfigGetQueryStringVaryParametersRetType, ok bool) { + return getCacheConfigGetQueryStringVaryParametersAttributeTypeOk(o.QueryStringVaryParameters) +} + +// SetQueryStringVaryParameters sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfig) SetQueryStringVaryParameters(v CacheConfigGetQueryStringVaryParametersRetType) { + setCacheConfigGetQueryStringVaryParametersAttributeType(&o.QueryStringVaryParameters, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CacheConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCacheConfigGetCacheKeyHeadersAttributeTypeOk(o.CacheKeyHeaders); ok { + toSerialize["CacheKeyHeaders"] = val + } + if val, ok := getCacheConfiggetQueryStringVaryEnabledAttributeTypeOk(o.QueryStringVaryEnabled); ok { + toSerialize["QueryStringVaryEnabled"] = val + } + if val, ok := getCacheConfigGetQueryStringVaryParametersAttributeTypeOk(o.QueryStringVaryParameters); ok { + toSerialize["QueryStringVaryParameters"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCacheConfig struct { + value *CacheConfig + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCacheConfig) Get() *CacheConfig { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCacheConfig) Set(val *CacheConfig) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCacheConfig) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCacheConfig) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCacheConfig(val *CacheConfig) *NullableCacheConfig { + return &NullableCacheConfig{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCacheConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCacheConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/model_cache_config_create.go b/services/cdn/model_cache_config_create.go new file mode 100644 index 000000000..d10d3f927 --- /dev/null +++ b/services/cdn/model_cache_config_create.go @@ -0,0 +1,272 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package cdn + +import ( + "encoding/json" +) + +// checks if the CacheConfigCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CacheConfigCreate{} + +/* + types and functions for cacheKeyHeaders +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigCreateGetCacheKeyHeadersAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigCreateGetCacheKeyHeadersArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigCreateGetCacheKeyHeadersRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCacheConfigCreateGetCacheKeyHeadersAttributeTypeOk(arg CacheConfigCreateGetCacheKeyHeadersAttributeType) (ret CacheConfigCreateGetCacheKeyHeadersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCacheConfigCreateGetCacheKeyHeadersAttributeType(arg *CacheConfigCreateGetCacheKeyHeadersAttributeType, val CacheConfigCreateGetCacheKeyHeadersRetType) { + *arg = &val +} + +/* + types and functions for queryStringVaryEnabled +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigCreategetQueryStringVaryEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigCreategetQueryStringVaryEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigCreategetQueryStringVaryEnabledRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCacheConfigCreategetQueryStringVaryEnabledAttributeTypeOk(arg CacheConfigCreategetQueryStringVaryEnabledAttributeType) (ret CacheConfigCreategetQueryStringVaryEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCacheConfigCreategetQueryStringVaryEnabledAttributeType(arg *CacheConfigCreategetQueryStringVaryEnabledAttributeType, val CacheConfigCreategetQueryStringVaryEnabledRetType) { + *arg = &val +} + +/* + types and functions for queryStringVaryParameters +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigCreateGetQueryStringVaryParametersAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigCreateGetQueryStringVaryParametersArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigCreateGetQueryStringVaryParametersRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCacheConfigCreateGetQueryStringVaryParametersAttributeTypeOk(arg CacheConfigCreateGetQueryStringVaryParametersAttributeType) (ret CacheConfigCreateGetQueryStringVaryParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCacheConfigCreateGetQueryStringVaryParametersAttributeType(arg *CacheConfigCreateGetQueryStringVaryParametersAttributeType, val CacheConfigCreateGetQueryStringVaryParametersRetType) { + *arg = &val +} + +// CacheConfigCreate Groups the cache options that influence how the CDN builds its cache key on distribution creation. **Cache cardinality warning:** enabling query-string vary produces one cache entry per unique query-string combination (**unbounded** when `queryStringVaryParameters` is empty). Each entry in `cacheKeyHeaders` multiplies the number of cache variants by the number of distinct values observed for that header. Use these settings sparingly. `queryStringVaryParameters` is stored independently of `queryStringVaryEnabled` so that this feature can be toggled on and off without losing the configured allowlist. Only `queryStringVaryEnabled` gates whether the parameter allowlist actually varies the cache. **Optimizer interaction:** when the Optimizer is enabled, the CDN automatically enables query-string vary for image responses regardless of this setting. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigCreate struct { + // HTTP request header names whose values participate in the cache key. Each entry multiplies the number of cache variants by the number of distinct values observed for that header. + CacheKeyHeaders CacheConfigCreateGetCacheKeyHeadersAttributeType `json:"cacheKeyHeaders,omitempty"` + // When true, the CDN varies its cache by the request query string. If `queryStringVaryParameters` is empty, every unique query-string combination produces its own cache entry; if non-empty, only the listed parameters influence the cache key. + QueryStringVaryEnabled CacheConfigCreategetQueryStringVaryEnabledAttributeType `json:"queryStringVaryEnabled,omitempty"` + // Allowlist of query-string parameter names that participate in the cache key when `queryStringVaryEnabled` is true. Ignored while `queryStringVaryEnabled` is false, but still stored so it can be re-activated without losing the list. + QueryStringVaryParameters CacheConfigCreateGetQueryStringVaryParametersAttributeType `json:"queryStringVaryParameters,omitempty"` +} + +// NewCacheConfigCreate instantiates a new CacheConfigCreate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCacheConfigCreate() *CacheConfigCreate { + this := CacheConfigCreate{} + return &this +} + +// NewCacheConfigCreateWithDefaults instantiates a new CacheConfigCreate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCacheConfigCreateWithDefaults() *CacheConfigCreate { + this := CacheConfigCreate{} + var queryStringVaryEnabled bool = false + this.QueryStringVaryEnabled = &queryStringVaryEnabled + return &this +} + +// GetCacheKeyHeaders returns the CacheKeyHeaders field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) GetCacheKeyHeaders() (res CacheConfigCreateGetCacheKeyHeadersRetType) { + res, _ = o.GetCacheKeyHeadersOk() + return +} + +// GetCacheKeyHeadersOk returns a tuple with the CacheKeyHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) GetCacheKeyHeadersOk() (ret CacheConfigCreateGetCacheKeyHeadersRetType, ok bool) { + return getCacheConfigCreateGetCacheKeyHeadersAttributeTypeOk(o.CacheKeyHeaders) +} + +// HasCacheKeyHeaders returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) HasCacheKeyHeaders() bool { + _, ok := o.GetCacheKeyHeadersOk() + return ok +} + +// SetCacheKeyHeaders gets a reference to the given []string and assigns it to the CacheKeyHeaders field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) SetCacheKeyHeaders(v CacheConfigCreateGetCacheKeyHeadersRetType) { + setCacheConfigCreateGetCacheKeyHeadersAttributeType(&o.CacheKeyHeaders, v) +} + +// GetQueryStringVaryEnabled returns the QueryStringVaryEnabled field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) GetQueryStringVaryEnabled() (res CacheConfigCreategetQueryStringVaryEnabledRetType) { + res, _ = o.GetQueryStringVaryEnabledOk() + return +} + +// GetQueryStringVaryEnabledOk returns a tuple with the QueryStringVaryEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) GetQueryStringVaryEnabledOk() (ret CacheConfigCreategetQueryStringVaryEnabledRetType, ok bool) { + return getCacheConfigCreategetQueryStringVaryEnabledAttributeTypeOk(o.QueryStringVaryEnabled) +} + +// HasQueryStringVaryEnabled returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) HasQueryStringVaryEnabled() bool { + _, ok := o.GetQueryStringVaryEnabledOk() + return ok +} + +// SetQueryStringVaryEnabled gets a reference to the given bool and assigns it to the QueryStringVaryEnabled field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) SetQueryStringVaryEnabled(v CacheConfigCreategetQueryStringVaryEnabledRetType) { + setCacheConfigCreategetQueryStringVaryEnabledAttributeType(&o.QueryStringVaryEnabled, v) +} + +// GetQueryStringVaryParameters returns the QueryStringVaryParameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) GetQueryStringVaryParameters() (res CacheConfigCreateGetQueryStringVaryParametersRetType) { + res, _ = o.GetQueryStringVaryParametersOk() + return +} + +// GetQueryStringVaryParametersOk returns a tuple with the QueryStringVaryParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) GetQueryStringVaryParametersOk() (ret CacheConfigCreateGetQueryStringVaryParametersRetType, ok bool) { + return getCacheConfigCreateGetQueryStringVaryParametersAttributeTypeOk(o.QueryStringVaryParameters) +} + +// HasQueryStringVaryParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) HasQueryStringVaryParameters() bool { + _, ok := o.GetQueryStringVaryParametersOk() + return ok +} + +// SetQueryStringVaryParameters gets a reference to the given []string and assigns it to the QueryStringVaryParameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigCreate) SetQueryStringVaryParameters(v CacheConfigCreateGetQueryStringVaryParametersRetType) { + setCacheConfigCreateGetQueryStringVaryParametersAttributeType(&o.QueryStringVaryParameters, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CacheConfigCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCacheConfigCreateGetCacheKeyHeadersAttributeTypeOk(o.CacheKeyHeaders); ok { + toSerialize["CacheKeyHeaders"] = val + } + if val, ok := getCacheConfigCreategetQueryStringVaryEnabledAttributeTypeOk(o.QueryStringVaryEnabled); ok { + toSerialize["QueryStringVaryEnabled"] = val + } + if val, ok := getCacheConfigCreateGetQueryStringVaryParametersAttributeTypeOk(o.QueryStringVaryParameters); ok { + toSerialize["QueryStringVaryParameters"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCacheConfigCreate struct { + value *CacheConfigCreate + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCacheConfigCreate) Get() *CacheConfigCreate { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCacheConfigCreate) Set(val *CacheConfigCreate) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCacheConfigCreate) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCacheConfigCreate) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCacheConfigCreate(val *CacheConfigCreate) *NullableCacheConfigCreate { + return &NullableCacheConfigCreate{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCacheConfigCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCacheConfigCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/model_cache_config_create_test.go b/services/cdn/model_cache_config_create_test.go new file mode 100644 index 000000000..424823139 --- /dev/null +++ b/services/cdn/model_cache_config_create_test.go @@ -0,0 +1,11 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cdn diff --git a/services/cdn/model_cache_config_patch.go b/services/cdn/model_cache_config_patch.go new file mode 100644 index 000000000..2532d6022 --- /dev/null +++ b/services/cdn/model_cache_config_patch.go @@ -0,0 +1,270 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package cdn + +import ( + "encoding/json" +) + +// checks if the CacheConfigPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CacheConfigPatch{} + +/* + types and functions for cacheKeyHeaders +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigPatchGetCacheKeyHeadersAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigPatchGetCacheKeyHeadersArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigPatchGetCacheKeyHeadersRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCacheConfigPatchGetCacheKeyHeadersAttributeTypeOk(arg CacheConfigPatchGetCacheKeyHeadersAttributeType) (ret CacheConfigPatchGetCacheKeyHeadersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCacheConfigPatchGetCacheKeyHeadersAttributeType(arg *CacheConfigPatchGetCacheKeyHeadersAttributeType, val CacheConfigPatchGetCacheKeyHeadersRetType) { + *arg = &val +} + +/* + types and functions for queryStringVaryEnabled +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigPatchgetQueryStringVaryEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigPatchgetQueryStringVaryEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigPatchgetQueryStringVaryEnabledRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCacheConfigPatchgetQueryStringVaryEnabledAttributeTypeOk(arg CacheConfigPatchgetQueryStringVaryEnabledAttributeType) (ret CacheConfigPatchgetQueryStringVaryEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCacheConfigPatchgetQueryStringVaryEnabledAttributeType(arg *CacheConfigPatchgetQueryStringVaryEnabledAttributeType, val CacheConfigPatchgetQueryStringVaryEnabledRetType) { + *arg = &val +} + +/* + types and functions for queryStringVaryParameters +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigPatchGetQueryStringVaryParametersAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigPatchGetQueryStringVaryParametersArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigPatchGetQueryStringVaryParametersRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCacheConfigPatchGetQueryStringVaryParametersAttributeTypeOk(arg CacheConfigPatchGetQueryStringVaryParametersAttributeType) (ret CacheConfigPatchGetQueryStringVaryParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCacheConfigPatchGetQueryStringVaryParametersAttributeType(arg *CacheConfigPatchGetQueryStringVaryParametersAttributeType, val CacheConfigPatchGetQueryStringVaryParametersRetType) { + *arg = &val +} + +// CacheConfigPatch PATCH variant of `CacheConfig`. Follows the standard PATCH conventions for this API: - Field omitted from the request: current value is left unchanged. - Array field sent as `[]`: current list is cleared. - `queryStringVaryEnabled` is a plain boolean (non-nullable); omit it to leave unchanged. `queryStringVaryParameters` is stored independently of `queryStringVaryEnabled`. Sending a non-empty `queryStringVaryParameters` together with `queryStringVaryEnabled=false` is accepted: the list is persisted for later re-activation but does not affect the cache while the flag is false. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CacheConfigPatch struct { + // HTTP request header names that participate in the cache key. Omit to leave unchanged; send `[]` to clear. + CacheKeyHeaders CacheConfigPatchGetCacheKeyHeadersAttributeType `json:"cacheKeyHeaders,omitempty"` + // When true, the CDN varies its cache by the request query string. Omit to leave unchanged. + QueryStringVaryEnabled CacheConfigPatchgetQueryStringVaryEnabledAttributeType `json:"queryStringVaryEnabled,omitempty"` + // Allowlist of query-string parameter names. Omit to leave unchanged; send `[]` to clear. + QueryStringVaryParameters CacheConfigPatchGetQueryStringVaryParametersAttributeType `json:"queryStringVaryParameters,omitempty"` +} + +// NewCacheConfigPatch instantiates a new CacheConfigPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCacheConfigPatch() *CacheConfigPatch { + this := CacheConfigPatch{} + return &this +} + +// NewCacheConfigPatchWithDefaults instantiates a new CacheConfigPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCacheConfigPatchWithDefaults() *CacheConfigPatch { + this := CacheConfigPatch{} + return &this +} + +// GetCacheKeyHeaders returns the CacheKeyHeaders field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) GetCacheKeyHeaders() (res CacheConfigPatchGetCacheKeyHeadersRetType) { + res, _ = o.GetCacheKeyHeadersOk() + return +} + +// GetCacheKeyHeadersOk returns a tuple with the CacheKeyHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) GetCacheKeyHeadersOk() (ret CacheConfigPatchGetCacheKeyHeadersRetType, ok bool) { + return getCacheConfigPatchGetCacheKeyHeadersAttributeTypeOk(o.CacheKeyHeaders) +} + +// HasCacheKeyHeaders returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) HasCacheKeyHeaders() bool { + _, ok := o.GetCacheKeyHeadersOk() + return ok +} + +// SetCacheKeyHeaders gets a reference to the given []string and assigns it to the CacheKeyHeaders field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) SetCacheKeyHeaders(v CacheConfigPatchGetCacheKeyHeadersRetType) { + setCacheConfigPatchGetCacheKeyHeadersAttributeType(&o.CacheKeyHeaders, v) +} + +// GetQueryStringVaryEnabled returns the QueryStringVaryEnabled field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) GetQueryStringVaryEnabled() (res CacheConfigPatchgetQueryStringVaryEnabledRetType) { + res, _ = o.GetQueryStringVaryEnabledOk() + return +} + +// GetQueryStringVaryEnabledOk returns a tuple with the QueryStringVaryEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) GetQueryStringVaryEnabledOk() (ret CacheConfigPatchgetQueryStringVaryEnabledRetType, ok bool) { + return getCacheConfigPatchgetQueryStringVaryEnabledAttributeTypeOk(o.QueryStringVaryEnabled) +} + +// HasQueryStringVaryEnabled returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) HasQueryStringVaryEnabled() bool { + _, ok := o.GetQueryStringVaryEnabledOk() + return ok +} + +// SetQueryStringVaryEnabled gets a reference to the given bool and assigns it to the QueryStringVaryEnabled field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) SetQueryStringVaryEnabled(v CacheConfigPatchgetQueryStringVaryEnabledRetType) { + setCacheConfigPatchgetQueryStringVaryEnabledAttributeType(&o.QueryStringVaryEnabled, v) +} + +// GetQueryStringVaryParameters returns the QueryStringVaryParameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) GetQueryStringVaryParameters() (res CacheConfigPatchGetQueryStringVaryParametersRetType) { + res, _ = o.GetQueryStringVaryParametersOk() + return +} + +// GetQueryStringVaryParametersOk returns a tuple with the QueryStringVaryParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) GetQueryStringVaryParametersOk() (ret CacheConfigPatchGetQueryStringVaryParametersRetType, ok bool) { + return getCacheConfigPatchGetQueryStringVaryParametersAttributeTypeOk(o.QueryStringVaryParameters) +} + +// HasQueryStringVaryParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) HasQueryStringVaryParameters() bool { + _, ok := o.GetQueryStringVaryParametersOk() + return ok +} + +// SetQueryStringVaryParameters gets a reference to the given []string and assigns it to the QueryStringVaryParameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CacheConfigPatch) SetQueryStringVaryParameters(v CacheConfigPatchGetQueryStringVaryParametersRetType) { + setCacheConfigPatchGetQueryStringVaryParametersAttributeType(&o.QueryStringVaryParameters, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CacheConfigPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCacheConfigPatchGetCacheKeyHeadersAttributeTypeOk(o.CacheKeyHeaders); ok { + toSerialize["CacheKeyHeaders"] = val + } + if val, ok := getCacheConfigPatchgetQueryStringVaryEnabledAttributeTypeOk(o.QueryStringVaryEnabled); ok { + toSerialize["QueryStringVaryEnabled"] = val + } + if val, ok := getCacheConfigPatchGetQueryStringVaryParametersAttributeTypeOk(o.QueryStringVaryParameters); ok { + toSerialize["QueryStringVaryParameters"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCacheConfigPatch struct { + value *CacheConfigPatch + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCacheConfigPatch) Get() *CacheConfigPatch { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCacheConfigPatch) Set(val *CacheConfigPatch) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCacheConfigPatch) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCacheConfigPatch) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCacheConfigPatch(val *CacheConfigPatch) *NullableCacheConfigPatch { + return &NullableCacheConfigPatch{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCacheConfigPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCacheConfigPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/model_cache_config_patch_test.go b/services/cdn/model_cache_config_patch_test.go new file mode 100644 index 000000000..424823139 --- /dev/null +++ b/services/cdn/model_cache_config_patch_test.go @@ -0,0 +1,11 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cdn diff --git a/services/cdn/model_cache_config_test.go b/services/cdn/model_cache_config_test.go new file mode 100644 index 000000000..424823139 --- /dev/null +++ b/services/cdn/model_cache_config_test.go @@ -0,0 +1,11 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cdn diff --git a/services/cdn/model_config.go b/services/cdn/model_config.go index b92809163..67dea99f1 100644 --- a/services/cdn/model_config.go +++ b/services/cdn/model_config.go @@ -99,6 +99,33 @@ func setConfigGetBlockedIpsAttributeType(arg *ConfigGetBlockedIpsAttributeType, *arg = &val } +/* + types and functions for cacheConfig +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConfigGetCacheConfigAttributeType = *CacheConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConfigGetCacheConfigArgType = CacheConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConfigGetCacheConfigRetType = CacheConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getConfigGetCacheConfigAttributeTypeOk(arg ConfigGetCacheConfigAttributeType) (ret ConfigGetCacheConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setConfigGetCacheConfigAttributeType(arg *ConfigGetCacheConfigAttributeType, val ConfigGetCacheConfigRetType) { + *arg = &val +} + /* types and functions for defaultCacheDuration */ @@ -411,6 +438,8 @@ type Config struct { // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. // REQUIRED BlockedIps ConfigGetBlockedIpsAttributeType `json:"blockedIps" required:"true"` + // REQUIRED + CacheConfig ConfigGetCacheConfigAttributeType `json:"cacheConfig" required:"true"` // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) DefaultCacheDuration ConfigGetDefaultCacheDurationAttributeType `json:"defaultCacheDuration,omitempty"` // Enabling this allows the 'Host' header to be passed through to the origin. @@ -442,11 +471,12 @@ type _Config Config // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewConfig(backend ConfigGetBackendArgType, blockedCountries ConfigGetBlockedCountriesArgType, blockedIps ConfigGetBlockedIpsArgType, forwardHostHeader ConfiggetForwardHostHeaderArgType, regions ConfigGetRegionsArgType, stripResponseCookies ConfiggetStripResponseCookiesArgType, tls ConfigGetTlsArgType, waf ConfigGetWafArgType) *Config { +func NewConfig(backend ConfigGetBackendArgType, blockedCountries ConfigGetBlockedCountriesArgType, blockedIps ConfigGetBlockedIpsArgType, cacheConfig ConfigGetCacheConfigArgType, forwardHostHeader ConfiggetForwardHostHeaderArgType, regions ConfigGetRegionsArgType, stripResponseCookies ConfiggetStripResponseCookiesArgType, tls ConfigGetTlsArgType, waf ConfigGetWafArgType) *Config { this := Config{} setConfigGetBackendAttributeType(&this.Backend, backend) setConfigGetBlockedCountriesAttributeType(&this.BlockedCountries, blockedCountries) setConfigGetBlockedIpsAttributeType(&this.BlockedIps, blockedIps) + setConfigGetCacheConfigAttributeType(&this.CacheConfig, cacheConfig) setConfiggetForwardHostHeaderAttributeType(&this.ForwardHostHeader, forwardHostHeader) setConfigGetRegionsAttributeType(&this.Regions, regions) setConfiggetStripResponseCookiesAttributeType(&this.StripResponseCookies, stripResponseCookies) @@ -524,6 +554,26 @@ func (o *Config) SetBlockedIps(v ConfigGetBlockedIpsRetType) { setConfigGetBlockedIpsAttributeType(&o.BlockedIps, v) } +// GetCacheConfig returns the CacheConfig field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Config) GetCacheConfig() (ret ConfigGetCacheConfigRetType) { + ret, _ = o.GetCacheConfigOk() + return ret +} + +// GetCacheConfigOk returns a tuple with the CacheConfig field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Config) GetCacheConfigOk() (ret ConfigGetCacheConfigRetType, ok bool) { + return getConfigGetCacheConfigAttributeTypeOk(o.CacheConfig) +} + +// SetCacheConfig sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Config) SetCacheConfig(v ConfigGetCacheConfigRetType) { + setConfigGetCacheConfigAttributeType(&o.CacheConfig, v) +} + // GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetDefaultCacheDuration() (res ConfigGetDefaultCacheDurationRetType) { @@ -824,6 +874,9 @@ func (o Config) ToMap() (map[string]interface{}, error) { if val, ok := getConfigGetBlockedIpsAttributeTypeOk(o.BlockedIps); ok { toSerialize["BlockedIps"] = val } + if val, ok := getConfigGetCacheConfigAttributeTypeOk(o.CacheConfig); ok { + toSerialize["CacheConfig"] = val + } if val, ok := getConfigGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration); ok { toSerialize["DefaultCacheDuration"] = val } diff --git a/services/cdn/model_config_log_sink.go b/services/cdn/model_config_log_sink.go index 0681e4ebf..448b0a8dd 100644 --- a/services/cdn/model_config_log_sink.go +++ b/services/cdn/model_config_log_sink.go @@ -20,6 +20,7 @@ import ( // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigLogSink struct { LokiLogSink *LokiLogSink + OtlpLogSink *OtlpLogSink } // LokiLogSinkAsConfigLogSink is a convenience function that returns LokiLogSink wrapped in ConfigLogSink @@ -30,6 +31,14 @@ func LokiLogSinkAsConfigLogSink(v *LokiLogSink) ConfigLogSink { } } +// OtlpLogSinkAsConfigLogSink is a convenience function that returns OtlpLogSink wrapped in ConfigLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func OtlpLogSinkAsConfigLogSink(v *OtlpLogSink) ConfigLogSink { + return ConfigLogSink{ + OtlpLogSink: v, + } +} + // Unmarshal JSON data into one of the pointers in the struct // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *ConfigLogSink) UnmarshalJSON(data []byte) error { @@ -53,6 +62,18 @@ func (dst *ConfigLogSink) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'OtlpLogSink' + if jsonDict["type"] == "OtlpLogSink" { + // try to unmarshal JSON data into OtlpLogSink + err = json.Unmarshal(data, &dst.OtlpLogSink) + if err == nil { + return nil // data stored in dst.OtlpLogSink, return on the first match + } else { + dst.OtlpLogSink = nil + return fmt.Errorf("failed to unmarshal ConfigLogSink as OtlpLogSink: %s", err.Error()) + } + } + // check if the discriminator value is 'loki' if jsonDict["type"] == "loki" { // try to unmarshal JSON data into LokiLogSink @@ -65,6 +86,18 @@ func (dst *ConfigLogSink) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'otlp' + if jsonDict["type"] == "otlp" { + // try to unmarshal JSON data into OtlpLogSink + err = json.Unmarshal(data, &dst.OtlpLogSink) + if err == nil { + return nil // data stored in dst.OtlpLogSink, return on the first match + } else { + dst.OtlpLogSink = nil + return fmt.Errorf("failed to unmarshal ConfigLogSink as OtlpLogSink: %s", err.Error()) + } + } + return nil } @@ -75,6 +108,10 @@ func (src ConfigLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(&src.LokiLogSink) } + if src.OtlpLogSink != nil { + return json.Marshal(&src.OtlpLogSink) + } + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object } @@ -88,6 +125,10 @@ func (obj *ConfigLogSink) GetActualInstance() interface{} { return obj.LokiLogSink } + if obj.OtlpLogSink != nil { + return obj.OtlpLogSink + } + // all schemas are nil return nil } diff --git a/services/cdn/model_config_patch.go b/services/cdn/model_config_patch.go index d3ee0279a..e6e6fd875 100644 --- a/services/cdn/model_config_patch.go +++ b/services/cdn/model_config_patch.go @@ -99,6 +99,33 @@ func setConfigPatchGetBlockedIpsAttributeType(arg *ConfigPatchGetBlockedIpsAttri *arg = &val } +/* + types and functions for cacheConfig +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConfigPatchGetCacheConfigAttributeType = *CacheConfigPatch + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConfigPatchGetCacheConfigArgType = CacheConfigPatch + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConfigPatchGetCacheConfigRetType = CacheConfigPatch + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getConfigPatchGetCacheConfigAttributeTypeOk(arg ConfigPatchGetCacheConfigAttributeType) (ret ConfigPatchGetCacheConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setConfigPatchGetCacheConfigAttributeType(arg *ConfigPatchGetCacheConfigAttributeType, val ConfigPatchGetCacheConfigRetType) { + *arg = &val +} + /* types and functions for defaultCacheDuration */ @@ -407,7 +434,8 @@ type ConfigPatch struct { // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. BlockedCountries ConfigPatchGetBlockedCountriesAttributeType `json:"blockedCountries,omitempty"` // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIps ConfigPatchGetBlockedIpsAttributeType `json:"blockedIps,omitempty"` + BlockedIps ConfigPatchGetBlockedIpsAttributeType `json:"blockedIps,omitempty"` + CacheConfig ConfigPatchGetCacheConfigAttributeType `json:"cacheConfig,omitempty"` // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) DefaultCacheDuration ConfigPatchGetDefaultCacheDurationAttributeType `json:"defaultCacheDuration,omitempty"` // Enabling this allows the 'Host' header to be passed through to the origin. @@ -526,6 +554,33 @@ func (o *ConfigPatch) SetBlockedIps(v ConfigPatchGetBlockedIpsRetType) { setConfigPatchGetBlockedIpsAttributeType(&o.BlockedIps, v) } +// GetCacheConfig returns the CacheConfig field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ConfigPatch) GetCacheConfig() (res ConfigPatchGetCacheConfigRetType) { + res, _ = o.GetCacheConfigOk() + return +} + +// GetCacheConfigOk returns a tuple with the CacheConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ConfigPatch) GetCacheConfigOk() (ret ConfigPatchGetCacheConfigRetType, ok bool) { + return getConfigPatchGetCacheConfigAttributeTypeOk(o.CacheConfig) +} + +// HasCacheConfig returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ConfigPatch) HasCacheConfig() bool { + _, ok := o.GetCacheConfigOk() + return ok +} + +// SetCacheConfig gets a reference to the given CacheConfigPatch and assigns it to the CacheConfig field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ConfigPatch) SetCacheConfig(v ConfigPatchGetCacheConfigRetType) { + setConfigPatchGetCacheConfigAttributeType(&o.CacheConfig, v) +} + // GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetDefaultCacheDuration() (res ConfigPatchGetDefaultCacheDurationRetType) { @@ -874,6 +929,9 @@ func (o ConfigPatch) ToMap() (map[string]interface{}, error) { if val, ok := getConfigPatchGetBlockedIpsAttributeTypeOk(o.BlockedIps); ok { toSerialize["BlockedIps"] = val } + if val, ok := getConfigPatchGetCacheConfigAttributeTypeOk(o.CacheConfig); ok { + toSerialize["CacheConfig"] = val + } if val, ok := getConfigPatchGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration); ok { toSerialize["DefaultCacheDuration"] = val } diff --git a/services/cdn/model_config_patch_log_sink.go b/services/cdn/model_config_patch_log_sink.go index f43741be9..326c4df8c 100644 --- a/services/cdn/model_config_patch_log_sink.go +++ b/services/cdn/model_config_patch_log_sink.go @@ -20,6 +20,7 @@ import ( // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchLogSink struct { LokiLogSinkPatch *LokiLogSinkPatch + OtlpLogSinkPatch *OtlpLogSinkPatch } // LokiLogSinkPatchAsConfigPatchLogSink is a convenience function that returns LokiLogSinkPatch wrapped in ConfigPatchLogSink @@ -30,6 +31,14 @@ func LokiLogSinkPatchAsConfigPatchLogSink(v *LokiLogSinkPatch) ConfigPatchLogSin } } +// OtlpLogSinkPatchAsConfigPatchLogSink is a convenience function that returns OtlpLogSinkPatch wrapped in ConfigPatchLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func OtlpLogSinkPatchAsConfigPatchLogSink(v *OtlpLogSinkPatch) ConfigPatchLogSink { + return ConfigPatchLogSink{ + OtlpLogSinkPatch: v, + } +} + // Unmarshal JSON data into one of the pointers in the struct // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *ConfigPatchLogSink) UnmarshalJSON(data []byte) error { @@ -58,6 +67,18 @@ func (dst *ConfigPatchLogSink) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'OtlpLogSinkPatch' + if jsonDict["type"] == "OtlpLogSinkPatch" { + // try to unmarshal JSON data into OtlpLogSinkPatch + err = json.Unmarshal(data, &dst.OtlpLogSinkPatch) + if err == nil { + return nil // data stored in dst.OtlpLogSinkPatch, return on the first match + } else { + dst.OtlpLogSinkPatch = nil + return fmt.Errorf("failed to unmarshal ConfigPatchLogSink as OtlpLogSinkPatch: %s", err.Error()) + } + } + // check if the discriminator value is 'loki' if jsonDict["type"] == "loki" { // try to unmarshal JSON data into LokiLogSinkPatch @@ -70,6 +91,18 @@ func (dst *ConfigPatchLogSink) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'otlp' + if jsonDict["type"] == "otlp" { + // try to unmarshal JSON data into OtlpLogSinkPatch + err = json.Unmarshal(data, &dst.OtlpLogSinkPatch) + if err == nil { + return nil // data stored in dst.OtlpLogSinkPatch, return on the first match + } else { + dst.OtlpLogSinkPatch = nil + return fmt.Errorf("failed to unmarshal ConfigPatchLogSink as OtlpLogSinkPatch: %s", err.Error()) + } + } + return nil } @@ -80,6 +113,10 @@ func (src ConfigPatchLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(&src.LokiLogSinkPatch) } + if src.OtlpLogSinkPatch != nil { + return json.Marshal(&src.OtlpLogSinkPatch) + } + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object } @@ -93,6 +130,10 @@ func (obj *ConfigPatchLogSink) GetActualInstance() interface{} { return obj.LokiLogSinkPatch } + if obj.OtlpLogSinkPatch != nil { + return obj.OtlpLogSinkPatch + } + // all schemas are nil return nil } diff --git a/services/cdn/model_create_distribution_payload.go b/services/cdn/model_create_distribution_payload.go index 0e17ab2bf..b4228b138 100644 --- a/services/cdn/model_create_distribution_payload.go +++ b/services/cdn/model_create_distribution_payload.go @@ -99,6 +99,33 @@ func setCreateDistributionPayloadGetBlockedIpsAttributeType(arg *CreateDistribut *arg = &val } +/* + types and functions for cacheConfig +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateDistributionPayloadGetCacheConfigAttributeType = *CacheConfigCreate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateDistributionPayloadGetCacheConfigArgType = CacheConfigCreate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateDistributionPayloadGetCacheConfigRetType = CacheConfigCreate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateDistributionPayloadGetCacheConfigAttributeTypeOk(arg CreateDistributionPayloadGetCacheConfigAttributeType) (ret CreateDistributionPayloadGetCacheConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateDistributionPayloadGetCacheConfigAttributeType(arg *CreateDistributionPayloadGetCacheConfigAttributeType, val CreateDistributionPayloadGetCacheConfigRetType) { + *arg = &val +} + /* types and functions for defaultCacheDuration */ @@ -431,7 +458,8 @@ type CreateDistributionPayload struct { // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. BlockedCountries CreateDistributionPayloadGetBlockedCountriesAttributeType `json:"blockedCountries,omitempty"` // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIps CreateDistributionPayloadGetBlockedIpsAttributeType `json:"blockedIps,omitempty"` + BlockedIps CreateDistributionPayloadGetBlockedIpsAttributeType `json:"blockedIps,omitempty"` + CacheConfig CreateDistributionPayloadGetCacheConfigAttributeType `json:"cacheConfig,omitempty"` // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) DefaultCacheDuration CreateDistributionPayloadGetDefaultCacheDurationAttributeType `json:"defaultCacheDuration,omitempty"` // Enabling this allows the 'Host' header to be passed through to the origin. @@ -552,6 +580,33 @@ func (o *CreateDistributionPayload) SetBlockedIps(v CreateDistributionPayloadGet setCreateDistributionPayloadGetBlockedIpsAttributeType(&o.BlockedIps, v) } +// GetCacheConfig returns the CacheConfig field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateDistributionPayload) GetCacheConfig() (res CreateDistributionPayloadGetCacheConfigRetType) { + res, _ = o.GetCacheConfigOk() + return +} + +// GetCacheConfigOk returns a tuple with the CacheConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateDistributionPayload) GetCacheConfigOk() (ret CreateDistributionPayloadGetCacheConfigRetType, ok bool) { + return getCreateDistributionPayloadGetCacheConfigAttributeTypeOk(o.CacheConfig) +} + +// HasCacheConfig returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateDistributionPayload) HasCacheConfig() bool { + _, ok := o.GetCacheConfigOk() + return ok +} + +// SetCacheConfig gets a reference to the given CacheConfigCreate and assigns it to the CacheConfig field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateDistributionPayload) SetCacheConfig(v CreateDistributionPayloadGetCacheConfigRetType) { + setCreateDistributionPayloadGetCacheConfigAttributeType(&o.CacheConfig, v) +} + // GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetDefaultCacheDuration() (res CreateDistributionPayloadGetDefaultCacheDurationRetType) { @@ -881,6 +936,9 @@ func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { if val, ok := getCreateDistributionPayloadGetBlockedIpsAttributeTypeOk(o.BlockedIps); ok { toSerialize["BlockedIps"] = val } + if val, ok := getCreateDistributionPayloadGetCacheConfigAttributeTypeOk(o.CacheConfig); ok { + toSerialize["CacheConfig"] = val + } if val, ok := getCreateDistributionPayloadGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration); ok { toSerialize["DefaultCacheDuration"] = val } diff --git a/services/cdn/model_create_distribution_payload_log_sink.go b/services/cdn/model_create_distribution_payload_log_sink.go index 6dfcf59ff..1b49021f0 100644 --- a/services/cdn/model_create_distribution_payload_log_sink.go +++ b/services/cdn/model_create_distribution_payload_log_sink.go @@ -20,6 +20,7 @@ import ( // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadLogSink struct { LokiLogSinkCreate *LokiLogSinkCreate + OtlpLogSinkCreate *OtlpLogSinkCreate } // LokiLogSinkCreateAsCreateDistributionPayloadLogSink is a convenience function that returns LokiLogSinkCreate wrapped in CreateDistributionPayloadLogSink @@ -30,6 +31,14 @@ func LokiLogSinkCreateAsCreateDistributionPayloadLogSink(v *LokiLogSinkCreate) C } } +// OtlpLogSinkCreateAsCreateDistributionPayloadLogSink is a convenience function that returns OtlpLogSinkCreate wrapped in CreateDistributionPayloadLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func OtlpLogSinkCreateAsCreateDistributionPayloadLogSink(v *OtlpLogSinkCreate) CreateDistributionPayloadLogSink { + return CreateDistributionPayloadLogSink{ + OtlpLogSinkCreate: v, + } +} + // Unmarshal JSON data into one of the pointers in the struct // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *CreateDistributionPayloadLogSink) UnmarshalJSON(data []byte) error { @@ -53,6 +62,18 @@ func (dst *CreateDistributionPayloadLogSink) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'OtlpLogSinkCreate' + if jsonDict["type"] == "OtlpLogSinkCreate" { + // try to unmarshal JSON data into OtlpLogSinkCreate + err = json.Unmarshal(data, &dst.OtlpLogSinkCreate) + if err == nil { + return nil // data stored in dst.OtlpLogSinkCreate, return on the first match + } else { + dst.OtlpLogSinkCreate = nil + return fmt.Errorf("failed to unmarshal CreateDistributionPayloadLogSink as OtlpLogSinkCreate: %s", err.Error()) + } + } + // check if the discriminator value is 'loki' if jsonDict["type"] == "loki" { // try to unmarshal JSON data into LokiLogSinkCreate @@ -65,6 +86,18 @@ func (dst *CreateDistributionPayloadLogSink) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'otlp' + if jsonDict["type"] == "otlp" { + // try to unmarshal JSON data into OtlpLogSinkCreate + err = json.Unmarshal(data, &dst.OtlpLogSinkCreate) + if err == nil { + return nil // data stored in dst.OtlpLogSinkCreate, return on the first match + } else { + dst.OtlpLogSinkCreate = nil + return fmt.Errorf("failed to unmarshal CreateDistributionPayloadLogSink as OtlpLogSinkCreate: %s", err.Error()) + } + } + return nil } @@ -75,6 +108,10 @@ func (src CreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(&src.LokiLogSinkCreate) } + if src.OtlpLogSinkCreate != nil { + return json.Marshal(&src.OtlpLogSinkCreate) + } + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object } @@ -88,6 +125,10 @@ func (obj *CreateDistributionPayloadLogSink) GetActualInstance() interface{} { return obj.LokiLogSinkCreate } + if obj.OtlpLogSinkCreate != nil { + return obj.OtlpLogSinkCreate + } + // all schemas are nil return nil } diff --git a/services/cdn/model_otlp_log_sink.go b/services/cdn/model_otlp_log_sink.go new file mode 100644 index 000000000..eb2a9c256 --- /dev/null +++ b/services/cdn/model_otlp_log_sink.go @@ -0,0 +1,322 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package cdn + +import ( + "encoding/json" + "fmt" +) + +// checks if the OtlpLogSink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OtlpLogSink{} + +/* + types and functions for pushUrl +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkGetPushUrlAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkGetPushUrlAttributeTypeOk(arg OtlpLogSinkGetPushUrlAttributeType) (ret OtlpLogSinkGetPushUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkGetPushUrlAttributeType(arg *OtlpLogSinkGetPushUrlAttributeType, val OtlpLogSinkGetPushUrlRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkGetPushUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkGetPushUrlRetType = string + +/* + types and functions for type +*/ + +// isEnum + +// OtlpLogSinkTypes Defines the type of the log sink. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + OTLPLOGSINKTYPE_OTLP OtlpLogSinkTypes = "otlp" +) + +// All allowed values of OtlpLogSink enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedOtlpLogSinkTypesEnumValues = []OtlpLogSinkTypes{ + "otlp", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *OtlpLogSinkTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson OtlpLogSinkTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := OtlpLogSinkTypes(value) + for _, existing := range AllowedOtlpLogSinkTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OtlpLogSink", value) +} + +// NewOtlpLogSinkTypesFromValue returns a pointer to a valid OtlpLogSinkTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkTypesFromValue(v OtlpLogSinkTypes) (*OtlpLogSinkTypes, error) { + ev := OtlpLogSinkTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OtlpLogSinkTypes: valid values are %v", v, AllowedOtlpLogSinkTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v OtlpLogSinkTypes) IsValid() bool { + for _, existing := range AllowedOtlpLogSinkTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v OtlpLogSinkTypes) Ptr() *OtlpLogSinkTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkTypes struct { + value *OtlpLogSinkTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkTypes) Get() *OtlpLogSinkTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkTypes) Set(val *OtlpLogSinkTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkTypes(val *OtlpLogSinkTypes) *NullableOtlpLogSinkTypes { + return &NullableOtlpLogSinkTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkGetTypeAttributeType = *OtlpLogSinkTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkGetTypeArgType = OtlpLogSinkTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkGetTypeRetType = OtlpLogSinkTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkGetTypeAttributeTypeOk(arg OtlpLogSinkGetTypeAttributeType) (ret OtlpLogSinkGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkGetTypeAttributeType(arg *OtlpLogSinkGetTypeAttributeType, val OtlpLogSinkGetTypeRetType) { + *arg = &val +} + +// OtlpLogSink struct for OtlpLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSink struct { + // The fully qualified URL where the CDN should push logs to your OTLP endpoint (for example, `https://otlp.example.com/otlp/v1/logs`). + // REQUIRED + PushUrl OtlpLogSinkGetPushUrlAttributeType `json:"pushUrl" required:"true"` + // Defines the type of the log sink. + // REQUIRED + Type OtlpLogSinkGetTypeAttributeType `json:"type" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _OtlpLogSink OtlpLogSink + +// NewOtlpLogSink instantiates a new OtlpLogSink 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSink(pushUrl OtlpLogSinkGetPushUrlArgType, types OtlpLogSinkGetTypeArgType) *OtlpLogSink { + this := OtlpLogSink{} + setOtlpLogSinkGetPushUrlAttributeType(&this.PushUrl, pushUrl) + setOtlpLogSinkGetTypeAttributeType(&this.Type, types) + return &this +} + +// NewOtlpLogSinkWithDefaults instantiates a new OtlpLogSink 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkWithDefaults() *OtlpLogSink { + this := OtlpLogSink{} + return &this +} + +// GetPushUrl returns the PushUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSink) GetPushUrl() (ret OtlpLogSinkGetPushUrlRetType) { + ret, _ = o.GetPushUrlOk() + return ret +} + +// GetPushUrlOk returns a tuple with the PushUrl field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSink) GetPushUrlOk() (ret OtlpLogSinkGetPushUrlRetType, ok bool) { + return getOtlpLogSinkGetPushUrlAttributeTypeOk(o.PushUrl) +} + +// SetPushUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSink) SetPushUrl(v OtlpLogSinkGetPushUrlRetType) { + setOtlpLogSinkGetPushUrlAttributeType(&o.PushUrl, v) +} + +// GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSink) GetType() (ret OtlpLogSinkGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSink) GetTypeOk() (ret OtlpLogSinkGetTypeRetType, ok bool) { + return getOtlpLogSinkGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSink) SetType(v OtlpLogSinkGetTypeRetType) { + setOtlpLogSinkGetTypeAttributeType(&o.Type, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o OtlpLogSink) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getOtlpLogSinkGetPushUrlAttributeTypeOk(o.PushUrl); ok { + toSerialize["PushUrl"] = val + } + if val, ok := getOtlpLogSinkGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSink struct { + value *OtlpLogSink + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSink) Get() *OtlpLogSink { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSink) Set(val *OtlpLogSink) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSink) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSink) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSink(val *OtlpLogSink) *NullableOtlpLogSink { + return &NullableOtlpLogSink{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/model_otlp_log_sink_basic_credentials.go b/services/cdn/model_otlp_log_sink_basic_credentials.go new file mode 100644 index 000000000..372a0a074 --- /dev/null +++ b/services/cdn/model_otlp_log_sink_basic_credentials.go @@ -0,0 +1,376 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package cdn + +import ( + "encoding/json" + "fmt" +) + +// checks if the OtlpLogSinkBasicCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OtlpLogSinkBasicCredentials{} + +/* + types and functions for password +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentialsGetPasswordAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkBasicCredentialsGetPasswordAttributeTypeOk(arg OtlpLogSinkBasicCredentialsGetPasswordAttributeType) (ret OtlpLogSinkBasicCredentialsGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkBasicCredentialsGetPasswordAttributeType(arg *OtlpLogSinkBasicCredentialsGetPasswordAttributeType, val OtlpLogSinkBasicCredentialsGetPasswordRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentialsGetPasswordArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentialsGetPasswordRetType = string + +/* + types and functions for type +*/ + +// isEnum + +// OtlpLogSinkBasicCredentialsTypes Defines basic authentication. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentialsTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + OTLPLOGSINKBASICCREDENTIALSTYPE_BASIC OtlpLogSinkBasicCredentialsTypes = "basic" +) + +// All allowed values of OtlpLogSinkBasicCredentials enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedOtlpLogSinkBasicCredentialsTypesEnumValues = []OtlpLogSinkBasicCredentialsTypes{ + "basic", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *OtlpLogSinkBasicCredentialsTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson OtlpLogSinkBasicCredentialsTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := OtlpLogSinkBasicCredentialsTypes(value) + for _, existing := range AllowedOtlpLogSinkBasicCredentialsTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OtlpLogSinkBasicCredentials", value) +} + +// NewOtlpLogSinkBasicCredentialsTypesFromValue returns a pointer to a valid OtlpLogSinkBasicCredentialsTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkBasicCredentialsTypesFromValue(v OtlpLogSinkBasicCredentialsTypes) (*OtlpLogSinkBasicCredentialsTypes, error) { + ev := OtlpLogSinkBasicCredentialsTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OtlpLogSinkBasicCredentialsTypes: valid values are %v", v, AllowedOtlpLogSinkBasicCredentialsTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v OtlpLogSinkBasicCredentialsTypes) IsValid() bool { + for _, existing := range AllowedOtlpLogSinkBasicCredentialsTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v OtlpLogSinkBasicCredentialsTypes) Ptr() *OtlpLogSinkBasicCredentialsTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkBasicCredentialsTypes struct { + value *OtlpLogSinkBasicCredentialsTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBasicCredentialsTypes) Get() *OtlpLogSinkBasicCredentialsTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBasicCredentialsTypes) Set(val *OtlpLogSinkBasicCredentialsTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBasicCredentialsTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBasicCredentialsTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkBasicCredentialsTypes(val *OtlpLogSinkBasicCredentialsTypes) *NullableOtlpLogSinkBasicCredentialsTypes { + return &NullableOtlpLogSinkBasicCredentialsTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBasicCredentialsTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBasicCredentialsTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentialsGetTypeAttributeType = *OtlpLogSinkBasicCredentialsTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentialsGetTypeArgType = OtlpLogSinkBasicCredentialsTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentialsGetTypeRetType = OtlpLogSinkBasicCredentialsTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkBasicCredentialsGetTypeAttributeTypeOk(arg OtlpLogSinkBasicCredentialsGetTypeAttributeType) (ret OtlpLogSinkBasicCredentialsGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkBasicCredentialsGetTypeAttributeType(arg *OtlpLogSinkBasicCredentialsGetTypeAttributeType, val OtlpLogSinkBasicCredentialsGetTypeRetType) { + *arg = &val +} + +/* + types and functions for username +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentialsGetUsernameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkBasicCredentialsGetUsernameAttributeTypeOk(arg OtlpLogSinkBasicCredentialsGetUsernameAttributeType) (ret OtlpLogSinkBasicCredentialsGetUsernameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkBasicCredentialsGetUsernameAttributeType(arg *OtlpLogSinkBasicCredentialsGetUsernameAttributeType, val OtlpLogSinkBasicCredentialsGetUsernameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentialsGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentialsGetUsernameRetType = string + +// OtlpLogSinkBasicCredentials Basic authentication credentials for OTLP. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBasicCredentials struct { + // The password corresponding to your username. + // REQUIRED + Password OtlpLogSinkBasicCredentialsGetPasswordAttributeType `json:"password" required:"true"` + // Defines basic authentication. + // REQUIRED + Type OtlpLogSinkBasicCredentialsGetTypeAttributeType `json:"type" required:"true"` + // The username used to authenticate against your OTLP endpoint. + // REQUIRED + Username OtlpLogSinkBasicCredentialsGetUsernameAttributeType `json:"username" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _OtlpLogSinkBasicCredentials OtlpLogSinkBasicCredentials + +// NewOtlpLogSinkBasicCredentials instantiates a new OtlpLogSinkBasicCredentials 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkBasicCredentials(password OtlpLogSinkBasicCredentialsGetPasswordArgType, types OtlpLogSinkBasicCredentialsGetTypeArgType, username OtlpLogSinkBasicCredentialsGetUsernameArgType) *OtlpLogSinkBasicCredentials { + this := OtlpLogSinkBasicCredentials{} + setOtlpLogSinkBasicCredentialsGetPasswordAttributeType(&this.Password, password) + setOtlpLogSinkBasicCredentialsGetTypeAttributeType(&this.Type, types) + setOtlpLogSinkBasicCredentialsGetUsernameAttributeType(&this.Username, username) + return &this +} + +// NewOtlpLogSinkBasicCredentialsWithDefaults instantiates a new OtlpLogSinkBasicCredentials 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkBasicCredentialsWithDefaults() *OtlpLogSinkBasicCredentials { + this := OtlpLogSinkBasicCredentials{} + return &this +} + +// GetPassword returns the Password field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBasicCredentials) GetPassword() (ret OtlpLogSinkBasicCredentialsGetPasswordRetType) { + ret, _ = o.GetPasswordOk() + return ret +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBasicCredentials) GetPasswordOk() (ret OtlpLogSinkBasicCredentialsGetPasswordRetType, ok bool) { + return getOtlpLogSinkBasicCredentialsGetPasswordAttributeTypeOk(o.Password) +} + +// SetPassword sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBasicCredentials) SetPassword(v OtlpLogSinkBasicCredentialsGetPasswordRetType) { + setOtlpLogSinkBasicCredentialsGetPasswordAttributeType(&o.Password, v) +} + +// GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBasicCredentials) GetType() (ret OtlpLogSinkBasicCredentialsGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBasicCredentials) GetTypeOk() (ret OtlpLogSinkBasicCredentialsGetTypeRetType, ok bool) { + return getOtlpLogSinkBasicCredentialsGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBasicCredentials) SetType(v OtlpLogSinkBasicCredentialsGetTypeRetType) { + setOtlpLogSinkBasicCredentialsGetTypeAttributeType(&o.Type, v) +} + +// GetUsername returns the Username field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBasicCredentials) GetUsername() (ret OtlpLogSinkBasicCredentialsGetUsernameRetType) { + ret, _ = o.GetUsernameOk() + return ret +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBasicCredentials) GetUsernameOk() (ret OtlpLogSinkBasicCredentialsGetUsernameRetType, ok bool) { + return getOtlpLogSinkBasicCredentialsGetUsernameAttributeTypeOk(o.Username) +} + +// SetUsername sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBasicCredentials) SetUsername(v OtlpLogSinkBasicCredentialsGetUsernameRetType) { + setOtlpLogSinkBasicCredentialsGetUsernameAttributeType(&o.Username, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o OtlpLogSinkBasicCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getOtlpLogSinkBasicCredentialsGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getOtlpLogSinkBasicCredentialsGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + if val, ok := getOtlpLogSinkBasicCredentialsGetUsernameAttributeTypeOk(o.Username); ok { + toSerialize["Username"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkBasicCredentials struct { + value *OtlpLogSinkBasicCredentials + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBasicCredentials) Get() *OtlpLogSinkBasicCredentials { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBasicCredentials) Set(val *OtlpLogSinkBasicCredentials) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBasicCredentials) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBasicCredentials) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkBasicCredentials(val *OtlpLogSinkBasicCredentials) *NullableOtlpLogSinkBasicCredentials { + return &NullableOtlpLogSinkBasicCredentials{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBasicCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBasicCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/model_otlp_log_sink_basic_credentials_test.go b/services/cdn/model_otlp_log_sink_basic_credentials_test.go new file mode 100644 index 000000000..3400e3ee7 --- /dev/null +++ b/services/cdn/model_otlp_log_sink_basic_credentials_test.go @@ -0,0 +1,51 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cdn + +import ( + "testing" +) + +// isEnum + +func TestOtlpLogSinkBasicCredentialsTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"basic"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := OtlpLogSinkBasicCredentialsTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_otlp_log_sink_bearer_credentials.go b/services/cdn/model_otlp_log_sink_bearer_credentials.go new file mode 100644 index 000000000..700c633cf --- /dev/null +++ b/services/cdn/model_otlp_log_sink_bearer_credentials.go @@ -0,0 +1,322 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package cdn + +import ( + "encoding/json" + "fmt" +) + +// checks if the OtlpLogSinkBearerCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OtlpLogSinkBearerCredentials{} + +/* + types and functions for token +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBearerCredentialsGetTokenAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkBearerCredentialsGetTokenAttributeTypeOk(arg OtlpLogSinkBearerCredentialsGetTokenAttributeType) (ret OtlpLogSinkBearerCredentialsGetTokenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkBearerCredentialsGetTokenAttributeType(arg *OtlpLogSinkBearerCredentialsGetTokenAttributeType, val OtlpLogSinkBearerCredentialsGetTokenRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBearerCredentialsGetTokenArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBearerCredentialsGetTokenRetType = string + +/* + types and functions for type +*/ + +// isEnum + +// OtlpLogSinkBearerCredentialsTypes Defines bearer token authentication. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBearerCredentialsTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + OTLPLOGSINKBEARERCREDENTIALSTYPE_BEARER OtlpLogSinkBearerCredentialsTypes = "bearer" +) + +// All allowed values of OtlpLogSinkBearerCredentials enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedOtlpLogSinkBearerCredentialsTypesEnumValues = []OtlpLogSinkBearerCredentialsTypes{ + "bearer", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *OtlpLogSinkBearerCredentialsTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson OtlpLogSinkBearerCredentialsTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := OtlpLogSinkBearerCredentialsTypes(value) + for _, existing := range AllowedOtlpLogSinkBearerCredentialsTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OtlpLogSinkBearerCredentials", value) +} + +// NewOtlpLogSinkBearerCredentialsTypesFromValue returns a pointer to a valid OtlpLogSinkBearerCredentialsTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkBearerCredentialsTypesFromValue(v OtlpLogSinkBearerCredentialsTypes) (*OtlpLogSinkBearerCredentialsTypes, error) { + ev := OtlpLogSinkBearerCredentialsTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OtlpLogSinkBearerCredentialsTypes: valid values are %v", v, AllowedOtlpLogSinkBearerCredentialsTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v OtlpLogSinkBearerCredentialsTypes) IsValid() bool { + for _, existing := range AllowedOtlpLogSinkBearerCredentialsTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v OtlpLogSinkBearerCredentialsTypes) Ptr() *OtlpLogSinkBearerCredentialsTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkBearerCredentialsTypes struct { + value *OtlpLogSinkBearerCredentialsTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBearerCredentialsTypes) Get() *OtlpLogSinkBearerCredentialsTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBearerCredentialsTypes) Set(val *OtlpLogSinkBearerCredentialsTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBearerCredentialsTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBearerCredentialsTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkBearerCredentialsTypes(val *OtlpLogSinkBearerCredentialsTypes) *NullableOtlpLogSinkBearerCredentialsTypes { + return &NullableOtlpLogSinkBearerCredentialsTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBearerCredentialsTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBearerCredentialsTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBearerCredentialsGetTypeAttributeType = *OtlpLogSinkBearerCredentialsTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBearerCredentialsGetTypeArgType = OtlpLogSinkBearerCredentialsTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBearerCredentialsGetTypeRetType = OtlpLogSinkBearerCredentialsTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkBearerCredentialsGetTypeAttributeTypeOk(arg OtlpLogSinkBearerCredentialsGetTypeAttributeType) (ret OtlpLogSinkBearerCredentialsGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkBearerCredentialsGetTypeAttributeType(arg *OtlpLogSinkBearerCredentialsGetTypeAttributeType, val OtlpLogSinkBearerCredentialsGetTypeRetType) { + *arg = &val +} + +// OtlpLogSinkBearerCredentials Bearer token authentication credentials for OTLP. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkBearerCredentials struct { + // The bearer token used to authenticate against your OTLP endpoint. + // REQUIRED + Token OtlpLogSinkBearerCredentialsGetTokenAttributeType `json:"token" required:"true"` + // Defines bearer token authentication. + // REQUIRED + Type OtlpLogSinkBearerCredentialsGetTypeAttributeType `json:"type" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _OtlpLogSinkBearerCredentials OtlpLogSinkBearerCredentials + +// NewOtlpLogSinkBearerCredentials instantiates a new OtlpLogSinkBearerCredentials 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkBearerCredentials(token OtlpLogSinkBearerCredentialsGetTokenArgType, types OtlpLogSinkBearerCredentialsGetTypeArgType) *OtlpLogSinkBearerCredentials { + this := OtlpLogSinkBearerCredentials{} + setOtlpLogSinkBearerCredentialsGetTokenAttributeType(&this.Token, token) + setOtlpLogSinkBearerCredentialsGetTypeAttributeType(&this.Type, types) + return &this +} + +// NewOtlpLogSinkBearerCredentialsWithDefaults instantiates a new OtlpLogSinkBearerCredentials 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkBearerCredentialsWithDefaults() *OtlpLogSinkBearerCredentials { + this := OtlpLogSinkBearerCredentials{} + return &this +} + +// GetToken returns the Token field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBearerCredentials) GetToken() (ret OtlpLogSinkBearerCredentialsGetTokenRetType) { + ret, _ = o.GetTokenOk() + return ret +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBearerCredentials) GetTokenOk() (ret OtlpLogSinkBearerCredentialsGetTokenRetType, ok bool) { + return getOtlpLogSinkBearerCredentialsGetTokenAttributeTypeOk(o.Token) +} + +// SetToken sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBearerCredentials) SetToken(v OtlpLogSinkBearerCredentialsGetTokenRetType) { + setOtlpLogSinkBearerCredentialsGetTokenAttributeType(&o.Token, v) +} + +// GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBearerCredentials) GetType() (ret OtlpLogSinkBearerCredentialsGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBearerCredentials) GetTypeOk() (ret OtlpLogSinkBearerCredentialsGetTypeRetType, ok bool) { + return getOtlpLogSinkBearerCredentialsGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkBearerCredentials) SetType(v OtlpLogSinkBearerCredentialsGetTypeRetType) { + setOtlpLogSinkBearerCredentialsGetTypeAttributeType(&o.Type, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o OtlpLogSinkBearerCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getOtlpLogSinkBearerCredentialsGetTokenAttributeTypeOk(o.Token); ok { + toSerialize["Token"] = val + } + if val, ok := getOtlpLogSinkBearerCredentialsGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkBearerCredentials struct { + value *OtlpLogSinkBearerCredentials + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBearerCredentials) Get() *OtlpLogSinkBearerCredentials { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBearerCredentials) Set(val *OtlpLogSinkBearerCredentials) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBearerCredentials) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBearerCredentials) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkBearerCredentials(val *OtlpLogSinkBearerCredentials) *NullableOtlpLogSinkBearerCredentials { + return &NullableOtlpLogSinkBearerCredentials{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkBearerCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkBearerCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/model_otlp_log_sink_bearer_credentials_test.go b/services/cdn/model_otlp_log_sink_bearer_credentials_test.go new file mode 100644 index 000000000..78ca2c67f --- /dev/null +++ b/services/cdn/model_otlp_log_sink_bearer_credentials_test.go @@ -0,0 +1,51 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cdn + +import ( + "testing" +) + +// isEnum + +func TestOtlpLogSinkBearerCredentialsTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"bearer"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := OtlpLogSinkBearerCredentialsTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_otlp_log_sink_create.go b/services/cdn/model_otlp_log_sink_create.go new file mode 100644 index 000000000..5e96ecfce --- /dev/null +++ b/services/cdn/model_otlp_log_sink_create.go @@ -0,0 +1,375 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package cdn + +import ( + "encoding/json" + "fmt" +) + +// checks if the OtlpLogSinkCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OtlpLogSinkCreate{} + +/* + types and functions for credentials +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateGetCredentialsAttributeType = *OtlpLogSinkCreateCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateGetCredentialsArgType = OtlpLogSinkCreateCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateGetCredentialsRetType = OtlpLogSinkCreateCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkCreateGetCredentialsAttributeTypeOk(arg OtlpLogSinkCreateGetCredentialsAttributeType) (ret OtlpLogSinkCreateGetCredentialsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkCreateGetCredentialsAttributeType(arg *OtlpLogSinkCreateGetCredentialsAttributeType, val OtlpLogSinkCreateGetCredentialsRetType) { + *arg = &val +} + +/* + types and functions for pushUrl +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateGetPushUrlAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkCreateGetPushUrlAttributeTypeOk(arg OtlpLogSinkCreateGetPushUrlAttributeType) (ret OtlpLogSinkCreateGetPushUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkCreateGetPushUrlAttributeType(arg *OtlpLogSinkCreateGetPushUrlAttributeType, val OtlpLogSinkCreateGetPushUrlRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateGetPushUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateGetPushUrlRetType = string + +/* + types and functions for type +*/ + +// isEnum + +// OtlpLogSinkCreateTypes Defines the type of the log sink. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + OTLPLOGSINKCREATETYPE_OTLP OtlpLogSinkCreateTypes = "otlp" +) + +// All allowed values of OtlpLogSinkCreate enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedOtlpLogSinkCreateTypesEnumValues = []OtlpLogSinkCreateTypes{ + "otlp", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *OtlpLogSinkCreateTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson OtlpLogSinkCreateTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := OtlpLogSinkCreateTypes(value) + for _, existing := range AllowedOtlpLogSinkCreateTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OtlpLogSinkCreate", value) +} + +// NewOtlpLogSinkCreateTypesFromValue returns a pointer to a valid OtlpLogSinkCreateTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkCreateTypesFromValue(v OtlpLogSinkCreateTypes) (*OtlpLogSinkCreateTypes, error) { + ev := OtlpLogSinkCreateTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OtlpLogSinkCreateTypes: valid values are %v", v, AllowedOtlpLogSinkCreateTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v OtlpLogSinkCreateTypes) IsValid() bool { + for _, existing := range AllowedOtlpLogSinkCreateTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v OtlpLogSinkCreateTypes) Ptr() *OtlpLogSinkCreateTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkCreateTypes struct { + value *OtlpLogSinkCreateTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkCreateTypes) Get() *OtlpLogSinkCreateTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkCreateTypes) Set(val *OtlpLogSinkCreateTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkCreateTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkCreateTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkCreateTypes(val *OtlpLogSinkCreateTypes) *NullableOtlpLogSinkCreateTypes { + return &NullableOtlpLogSinkCreateTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkCreateTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkCreateTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateGetTypeAttributeType = *OtlpLogSinkCreateTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateGetTypeArgType = OtlpLogSinkCreateTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateGetTypeRetType = OtlpLogSinkCreateTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkCreateGetTypeAttributeTypeOk(arg OtlpLogSinkCreateGetTypeAttributeType) (ret OtlpLogSinkCreateGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkCreateGetTypeAttributeType(arg *OtlpLogSinkCreateGetTypeAttributeType, val OtlpLogSinkCreateGetTypeRetType) { + *arg = &val +} + +// OtlpLogSinkCreate struct for OtlpLogSinkCreate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreate struct { + // REQUIRED + Credentials OtlpLogSinkCreateGetCredentialsAttributeType `json:"credentials" required:"true"` + // The fully qualified URL where the CDN should push logs to your OTLP endpoint (for example, `https://otlp.example.com/otlp/v1/logs`). + // REQUIRED + PushUrl OtlpLogSinkCreateGetPushUrlAttributeType `json:"pushUrl" required:"true"` + // Defines the type of the log sink. + // REQUIRED + Type OtlpLogSinkCreateGetTypeAttributeType `json:"type" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _OtlpLogSinkCreate OtlpLogSinkCreate + +// NewOtlpLogSinkCreate instantiates a new OtlpLogSinkCreate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkCreate(credentials OtlpLogSinkCreateGetCredentialsArgType, pushUrl OtlpLogSinkCreateGetPushUrlArgType, types OtlpLogSinkCreateGetTypeArgType) *OtlpLogSinkCreate { + this := OtlpLogSinkCreate{} + setOtlpLogSinkCreateGetCredentialsAttributeType(&this.Credentials, credentials) + setOtlpLogSinkCreateGetPushUrlAttributeType(&this.PushUrl, pushUrl) + setOtlpLogSinkCreateGetTypeAttributeType(&this.Type, types) + return &this +} + +// NewOtlpLogSinkCreateWithDefaults instantiates a new OtlpLogSinkCreate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkCreateWithDefaults() *OtlpLogSinkCreate { + this := OtlpLogSinkCreate{} + return &this +} + +// GetCredentials returns the Credentials field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkCreate) GetCredentials() (ret OtlpLogSinkCreateGetCredentialsRetType) { + ret, _ = o.GetCredentialsOk() + return ret +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkCreate) GetCredentialsOk() (ret OtlpLogSinkCreateGetCredentialsRetType, ok bool) { + return getOtlpLogSinkCreateGetCredentialsAttributeTypeOk(o.Credentials) +} + +// SetCredentials sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkCreate) SetCredentials(v OtlpLogSinkCreateGetCredentialsRetType) { + setOtlpLogSinkCreateGetCredentialsAttributeType(&o.Credentials, v) +} + +// GetPushUrl returns the PushUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkCreate) GetPushUrl() (ret OtlpLogSinkCreateGetPushUrlRetType) { + ret, _ = o.GetPushUrlOk() + return ret +} + +// GetPushUrlOk returns a tuple with the PushUrl field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkCreate) GetPushUrlOk() (ret OtlpLogSinkCreateGetPushUrlRetType, ok bool) { + return getOtlpLogSinkCreateGetPushUrlAttributeTypeOk(o.PushUrl) +} + +// SetPushUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkCreate) SetPushUrl(v OtlpLogSinkCreateGetPushUrlRetType) { + setOtlpLogSinkCreateGetPushUrlAttributeType(&o.PushUrl, v) +} + +// GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkCreate) GetType() (ret OtlpLogSinkCreateGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkCreate) GetTypeOk() (ret OtlpLogSinkCreateGetTypeRetType, ok bool) { + return getOtlpLogSinkCreateGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkCreate) SetType(v OtlpLogSinkCreateGetTypeRetType) { + setOtlpLogSinkCreateGetTypeAttributeType(&o.Type, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o OtlpLogSinkCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getOtlpLogSinkCreateGetCredentialsAttributeTypeOk(o.Credentials); ok { + toSerialize["Credentials"] = val + } + if val, ok := getOtlpLogSinkCreateGetPushUrlAttributeTypeOk(o.PushUrl); ok { + toSerialize["PushUrl"] = val + } + if val, ok := getOtlpLogSinkCreateGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkCreate struct { + value *OtlpLogSinkCreate + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkCreate) Get() *OtlpLogSinkCreate { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkCreate) Set(val *OtlpLogSinkCreate) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkCreate) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkCreate) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkCreate(val *OtlpLogSinkCreate) *NullableOtlpLogSinkCreate { + return &NullableOtlpLogSinkCreate{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/model_otlp_log_sink_create_credentials.go b/services/cdn/model_otlp_log_sink_create_credentials.go new file mode 100644 index 000000000..ab225b5ea --- /dev/null +++ b/services/cdn/model_otlp_log_sink_create_credentials.go @@ -0,0 +1,178 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package cdn + +import ( + "encoding/json" + "fmt" +) + +// OtlpLogSinkCreateCredentials - The authentication credentials required for the CDN to push logs to your OTLP endpoint. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkCreateCredentials struct { + OtlpLogSinkBasicCredentials *OtlpLogSinkBasicCredentials + OtlpLogSinkBearerCredentials *OtlpLogSinkBearerCredentials +} + +// OtlpLogSinkBasicCredentialsAsOtlpLogSinkCreateCredentials is a convenience function that returns OtlpLogSinkBasicCredentials wrapped in OtlpLogSinkCreateCredentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func OtlpLogSinkBasicCredentialsAsOtlpLogSinkCreateCredentials(v *OtlpLogSinkBasicCredentials) OtlpLogSinkCreateCredentials { + return OtlpLogSinkCreateCredentials{ + OtlpLogSinkBasicCredentials: v, + } +} + +// OtlpLogSinkBearerCredentialsAsOtlpLogSinkCreateCredentials is a convenience function that returns OtlpLogSinkBearerCredentials wrapped in OtlpLogSinkCreateCredentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func OtlpLogSinkBearerCredentialsAsOtlpLogSinkCreateCredentials(v *OtlpLogSinkBearerCredentials) OtlpLogSinkCreateCredentials { + return OtlpLogSinkCreateCredentials{ + OtlpLogSinkBearerCredentials: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (dst *OtlpLogSinkCreateCredentials) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'OtlpLogSinkBasicCredentials' + if jsonDict["type"] == "OtlpLogSinkBasicCredentials" { + // try to unmarshal JSON data into OtlpLogSinkBasicCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBasicCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBasicCredentials, return on the first match + } else { + dst.OtlpLogSinkBasicCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkCreateCredentials as OtlpLogSinkBasicCredentials: %s", err.Error()) + } + } + + // check if the discriminator value is 'OtlpLogSinkBearerCredentials' + if jsonDict["type"] == "OtlpLogSinkBearerCredentials" { + // try to unmarshal JSON data into OtlpLogSinkBearerCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBearerCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBearerCredentials, return on the first match + } else { + dst.OtlpLogSinkBearerCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkCreateCredentials as OtlpLogSinkBearerCredentials: %s", err.Error()) + } + } + + // check if the discriminator value is 'basic' + if jsonDict["type"] == "basic" { + // try to unmarshal JSON data into OtlpLogSinkBasicCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBasicCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBasicCredentials, return on the first match + } else { + dst.OtlpLogSinkBasicCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkCreateCredentials as OtlpLogSinkBasicCredentials: %s", err.Error()) + } + } + + // check if the discriminator value is 'bearer' + if jsonDict["type"] == "bearer" { + // try to unmarshal JSON data into OtlpLogSinkBearerCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBearerCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBearerCredentials, return on the first match + } else { + dst.OtlpLogSinkBearerCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkCreateCredentials as OtlpLogSinkBearerCredentials: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src OtlpLogSinkCreateCredentials) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + if src.OtlpLogSinkBasicCredentials != nil { + return json.Marshal(&src.OtlpLogSinkBasicCredentials) + } + + if src.OtlpLogSinkBearerCredentials != nil { + return json.Marshal(&src.OtlpLogSinkBearerCredentials) + } + + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object +} + +// Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (obj *OtlpLogSinkCreateCredentials) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.OtlpLogSinkBasicCredentials != nil { + return obj.OtlpLogSinkBasicCredentials + } + + if obj.OtlpLogSinkBearerCredentials != nil { + return obj.OtlpLogSinkBearerCredentials + } + + // all schemas are nil + return nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkCreateCredentials struct { + value *OtlpLogSinkCreateCredentials + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkCreateCredentials) Get() *OtlpLogSinkCreateCredentials { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkCreateCredentials) Set(val *OtlpLogSinkCreateCredentials) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkCreateCredentials) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkCreateCredentials) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkCreateCredentials(val *OtlpLogSinkCreateCredentials) *NullableOtlpLogSinkCreateCredentials { + return &NullableOtlpLogSinkCreateCredentials{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkCreateCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkCreateCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/model_otlp_log_sink_create_credentials_test.go b/services/cdn/model_otlp_log_sink_create_credentials_test.go new file mode 100644 index 000000000..424823139 --- /dev/null +++ b/services/cdn/model_otlp_log_sink_create_credentials_test.go @@ -0,0 +1,11 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cdn diff --git a/services/cdn/model_otlp_log_sink_create_test.go b/services/cdn/model_otlp_log_sink_create_test.go new file mode 100644 index 000000000..91f531fbc --- /dev/null +++ b/services/cdn/model_otlp_log_sink_create_test.go @@ -0,0 +1,51 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cdn + +import ( + "testing" +) + +// isEnum + +func TestOtlpLogSinkCreateTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"otlp"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := OtlpLogSinkCreateTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_otlp_log_sink_patch.go b/services/cdn/model_otlp_log_sink_patch.go new file mode 100644 index 000000000..240064249 --- /dev/null +++ b/services/cdn/model_otlp_log_sink_patch.go @@ -0,0 +1,385 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package cdn + +import ( + "encoding/json" + "fmt" +) + +// checks if the OtlpLogSinkPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OtlpLogSinkPatch{} + +/* + types and functions for credentials +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchGetCredentialsAttributeType = *OtlpLogSinkPatchCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchGetCredentialsArgType = OtlpLogSinkPatchCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchGetCredentialsRetType = OtlpLogSinkPatchCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkPatchGetCredentialsAttributeTypeOk(arg OtlpLogSinkPatchGetCredentialsAttributeType) (ret OtlpLogSinkPatchGetCredentialsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkPatchGetCredentialsAttributeType(arg *OtlpLogSinkPatchGetCredentialsAttributeType, val OtlpLogSinkPatchGetCredentialsRetType) { + *arg = &val +} + +/* + types and functions for pushUrl +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchGetPushUrlAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkPatchGetPushUrlAttributeTypeOk(arg OtlpLogSinkPatchGetPushUrlAttributeType) (ret OtlpLogSinkPatchGetPushUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkPatchGetPushUrlAttributeType(arg *OtlpLogSinkPatchGetPushUrlAttributeType, val OtlpLogSinkPatchGetPushUrlRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchGetPushUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchGetPushUrlRetType = string + +/* + types and functions for type +*/ + +// isEnum + +// OtlpLogSinkPatchTypes Defines the type of the log sink. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + OTLPLOGSINKPATCHTYPE_OTLP OtlpLogSinkPatchTypes = "otlp" +) + +// All allowed values of OtlpLogSinkPatch enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedOtlpLogSinkPatchTypesEnumValues = []OtlpLogSinkPatchTypes{ + "otlp", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *OtlpLogSinkPatchTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson OtlpLogSinkPatchTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := OtlpLogSinkPatchTypes(value) + for _, existing := range AllowedOtlpLogSinkPatchTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OtlpLogSinkPatch", value) +} + +// NewOtlpLogSinkPatchTypesFromValue returns a pointer to a valid OtlpLogSinkPatchTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkPatchTypesFromValue(v OtlpLogSinkPatchTypes) (*OtlpLogSinkPatchTypes, error) { + ev := OtlpLogSinkPatchTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OtlpLogSinkPatchTypes: valid values are %v", v, AllowedOtlpLogSinkPatchTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v OtlpLogSinkPatchTypes) IsValid() bool { + for _, existing := range AllowedOtlpLogSinkPatchTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v OtlpLogSinkPatchTypes) Ptr() *OtlpLogSinkPatchTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkPatchTypes struct { + value *OtlpLogSinkPatchTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkPatchTypes) Get() *OtlpLogSinkPatchTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkPatchTypes) Set(val *OtlpLogSinkPatchTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkPatchTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkPatchTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkPatchTypes(val *OtlpLogSinkPatchTypes) *NullableOtlpLogSinkPatchTypes { + return &NullableOtlpLogSinkPatchTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkPatchTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkPatchTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchGetTypeAttributeType = *OtlpLogSinkPatchTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchGetTypeArgType = OtlpLogSinkPatchTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchGetTypeRetType = OtlpLogSinkPatchTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getOtlpLogSinkPatchGetTypeAttributeTypeOk(arg OtlpLogSinkPatchGetTypeAttributeType) (ret OtlpLogSinkPatchGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setOtlpLogSinkPatchGetTypeAttributeType(arg *OtlpLogSinkPatchGetTypeAttributeType, val OtlpLogSinkPatchGetTypeRetType) { + *arg = &val +} + +// OtlpLogSinkPatch struct for OtlpLogSinkPatch +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatch struct { + Credentials OtlpLogSinkPatchGetCredentialsAttributeType `json:"credentials,omitempty"` + // The fully qualified URL where the CDN should push logs to your OTLP endpoint (for example, `https://otlp.example.com/otlp/v1/logs`). + PushUrl OtlpLogSinkPatchGetPushUrlAttributeType `json:"pushUrl,omitempty"` + // Defines the type of the log sink. + // REQUIRED + Type OtlpLogSinkPatchGetTypeAttributeType `json:"type" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _OtlpLogSinkPatch OtlpLogSinkPatch + +// NewOtlpLogSinkPatch instantiates a new OtlpLogSinkPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkPatch(types OtlpLogSinkPatchGetTypeArgType) *OtlpLogSinkPatch { + this := OtlpLogSinkPatch{} + setOtlpLogSinkPatchGetTypeAttributeType(&this.Type, types) + return &this +} + +// NewOtlpLogSinkPatchWithDefaults instantiates a new OtlpLogSinkPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewOtlpLogSinkPatchWithDefaults() *OtlpLogSinkPatch { + this := OtlpLogSinkPatch{} + return &this +} + +// GetCredentials returns the Credentials field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) GetCredentials() (res OtlpLogSinkPatchGetCredentialsRetType) { + res, _ = o.GetCredentialsOk() + return +} + +// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) GetCredentialsOk() (ret OtlpLogSinkPatchGetCredentialsRetType, ok bool) { + return getOtlpLogSinkPatchGetCredentialsAttributeTypeOk(o.Credentials) +} + +// HasCredentials returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) HasCredentials() bool { + _, ok := o.GetCredentialsOk() + return ok +} + +// SetCredentials gets a reference to the given OtlpLogSinkPatchCredentials and assigns it to the Credentials field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) SetCredentials(v OtlpLogSinkPatchGetCredentialsRetType) { + setOtlpLogSinkPatchGetCredentialsAttributeType(&o.Credentials, v) +} + +// GetPushUrl returns the PushUrl field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) GetPushUrl() (res OtlpLogSinkPatchGetPushUrlRetType) { + res, _ = o.GetPushUrlOk() + return +} + +// GetPushUrlOk returns a tuple with the PushUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) GetPushUrlOk() (ret OtlpLogSinkPatchGetPushUrlRetType, ok bool) { + return getOtlpLogSinkPatchGetPushUrlAttributeTypeOk(o.PushUrl) +} + +// HasPushUrl returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) HasPushUrl() bool { + _, ok := o.GetPushUrlOk() + return ok +} + +// SetPushUrl gets a reference to the given string and assigns it to the PushUrl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) SetPushUrl(v OtlpLogSinkPatchGetPushUrlRetType) { + setOtlpLogSinkPatchGetPushUrlAttributeType(&o.PushUrl, v) +} + +// GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) GetType() (ret OtlpLogSinkPatchGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) GetTypeOk() (ret OtlpLogSinkPatchGetTypeRetType, ok bool) { + return getOtlpLogSinkPatchGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *OtlpLogSinkPatch) SetType(v OtlpLogSinkPatchGetTypeRetType) { + setOtlpLogSinkPatchGetTypeAttributeType(&o.Type, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o OtlpLogSinkPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getOtlpLogSinkPatchGetCredentialsAttributeTypeOk(o.Credentials); ok { + toSerialize["Credentials"] = val + } + if val, ok := getOtlpLogSinkPatchGetPushUrlAttributeTypeOk(o.PushUrl); ok { + toSerialize["PushUrl"] = val + } + if val, ok := getOtlpLogSinkPatchGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkPatch struct { + value *OtlpLogSinkPatch + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkPatch) Get() *OtlpLogSinkPatch { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkPatch) Set(val *OtlpLogSinkPatch) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkPatch) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkPatch) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkPatch(val *OtlpLogSinkPatch) *NullableOtlpLogSinkPatch { + return &NullableOtlpLogSinkPatch{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/model_otlp_log_sink_patch_credentials.go b/services/cdn/model_otlp_log_sink_patch_credentials.go new file mode 100644 index 000000000..5466a57d0 --- /dev/null +++ b/services/cdn/model_otlp_log_sink_patch_credentials.go @@ -0,0 +1,178 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package cdn + +import ( + "encoding/json" + "fmt" +) + +// OtlpLogSinkPatchCredentials - The authentication credentials required for the CDN to push logs to your OTLP endpoint. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type OtlpLogSinkPatchCredentials struct { + OtlpLogSinkBasicCredentials *OtlpLogSinkBasicCredentials + OtlpLogSinkBearerCredentials *OtlpLogSinkBearerCredentials +} + +// OtlpLogSinkBasicCredentialsAsOtlpLogSinkPatchCredentials is a convenience function that returns OtlpLogSinkBasicCredentials wrapped in OtlpLogSinkPatchCredentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func OtlpLogSinkBasicCredentialsAsOtlpLogSinkPatchCredentials(v *OtlpLogSinkBasicCredentials) OtlpLogSinkPatchCredentials { + return OtlpLogSinkPatchCredentials{ + OtlpLogSinkBasicCredentials: v, + } +} + +// OtlpLogSinkBearerCredentialsAsOtlpLogSinkPatchCredentials is a convenience function that returns OtlpLogSinkBearerCredentials wrapped in OtlpLogSinkPatchCredentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func OtlpLogSinkBearerCredentialsAsOtlpLogSinkPatchCredentials(v *OtlpLogSinkBearerCredentials) OtlpLogSinkPatchCredentials { + return OtlpLogSinkPatchCredentials{ + OtlpLogSinkBearerCredentials: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (dst *OtlpLogSinkPatchCredentials) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'OtlpLogSinkBasicCredentials' + if jsonDict["type"] == "OtlpLogSinkBasicCredentials" { + // try to unmarshal JSON data into OtlpLogSinkBasicCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBasicCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBasicCredentials, return on the first match + } else { + dst.OtlpLogSinkBasicCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkPatchCredentials as OtlpLogSinkBasicCredentials: %s", err.Error()) + } + } + + // check if the discriminator value is 'OtlpLogSinkBearerCredentials' + if jsonDict["type"] == "OtlpLogSinkBearerCredentials" { + // try to unmarshal JSON data into OtlpLogSinkBearerCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBearerCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBearerCredentials, return on the first match + } else { + dst.OtlpLogSinkBearerCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkPatchCredentials as OtlpLogSinkBearerCredentials: %s", err.Error()) + } + } + + // check if the discriminator value is 'basic' + if jsonDict["type"] == "basic" { + // try to unmarshal JSON data into OtlpLogSinkBasicCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBasicCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBasicCredentials, return on the first match + } else { + dst.OtlpLogSinkBasicCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkPatchCredentials as OtlpLogSinkBasicCredentials: %s", err.Error()) + } + } + + // check if the discriminator value is 'bearer' + if jsonDict["type"] == "bearer" { + // try to unmarshal JSON data into OtlpLogSinkBearerCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBearerCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBearerCredentials, return on the first match + } else { + dst.OtlpLogSinkBearerCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkPatchCredentials as OtlpLogSinkBearerCredentials: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src OtlpLogSinkPatchCredentials) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + if src.OtlpLogSinkBasicCredentials != nil { + return json.Marshal(&src.OtlpLogSinkBasicCredentials) + } + + if src.OtlpLogSinkBearerCredentials != nil { + return json.Marshal(&src.OtlpLogSinkBearerCredentials) + } + + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object +} + +// Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (obj *OtlpLogSinkPatchCredentials) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.OtlpLogSinkBasicCredentials != nil { + return obj.OtlpLogSinkBasicCredentials + } + + if obj.OtlpLogSinkBearerCredentials != nil { + return obj.OtlpLogSinkBearerCredentials + } + + // all schemas are nil + return nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableOtlpLogSinkPatchCredentials struct { + value *OtlpLogSinkPatchCredentials + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkPatchCredentials) Get() *OtlpLogSinkPatchCredentials { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkPatchCredentials) Set(val *OtlpLogSinkPatchCredentials) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkPatchCredentials) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkPatchCredentials) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableOtlpLogSinkPatchCredentials(val *OtlpLogSinkPatchCredentials) *NullableOtlpLogSinkPatchCredentials { + return &NullableOtlpLogSinkPatchCredentials{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableOtlpLogSinkPatchCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableOtlpLogSinkPatchCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/model_otlp_log_sink_patch_credentials_test.go b/services/cdn/model_otlp_log_sink_patch_credentials_test.go new file mode 100644 index 000000000..424823139 --- /dev/null +++ b/services/cdn/model_otlp_log_sink_patch_credentials_test.go @@ -0,0 +1,11 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cdn diff --git a/services/cdn/model_otlp_log_sink_patch_test.go b/services/cdn/model_otlp_log_sink_patch_test.go new file mode 100644 index 000000000..e87564d75 --- /dev/null +++ b/services/cdn/model_otlp_log_sink_patch_test.go @@ -0,0 +1,51 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cdn + +import ( + "testing" +) + +// isEnum + +func TestOtlpLogSinkPatchTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"otlp"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := OtlpLogSinkPatchTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_otlp_log_sink_test.go b/services/cdn/model_otlp_log_sink_test.go new file mode 100644 index 000000000..70b292dc9 --- /dev/null +++ b/services/cdn/model_otlp_log_sink_test.go @@ -0,0 +1,51 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cdn + +import ( + "testing" +) + +// isEnum + +func TestOtlpLogSinkTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"otlp"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := OtlpLogSinkTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/oas_commit b/services/cdn/oas_commit index 0af22f1b2..d5d15003c 100644 --- a/services/cdn/oas_commit +++ b/services/cdn/oas_commit @@ -1 +1 @@ -dba2b6e065de87745d57269c1eaba07e3833f709 +f385f3b154cb566b3c9e5156c29b28150f2af4a2 diff --git a/services/cdn/v1api/model_cache_config.go b/services/cdn/v1api/model_cache_config.go new file mode 100644 index 000000000..4d3ef14e6 --- /dev/null +++ b/services/cdn/v1api/model_cache_config.go @@ -0,0 +1,227 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CacheConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CacheConfig{} + +// CacheConfig Groups the cache options that influence how the CDN builds its cache key. **Cache cardinality warning:** enabling query-string vary produces one cache entry per unique query-string combination (**unbounded** when `queryStringVaryParameters` is empty). Each entry in `cacheKeyHeaders` multiplies the number of cache variants by the number of distinct values observed for that header. Use these settings sparingly. `queryStringVaryParameters` is stored independently of `queryStringVaryEnabled` so that this feature can be toggled on and off without losing the configured allowlist. Only `queryStringVaryEnabled` gates whether the parameter allowlist actually varies the cache. **Optimizer interaction:** when the Optimizer is enabled, the CDN automatically enables query-string vary for image responses regardless of this setting. +type CacheConfig struct { + // HTTP request header names whose values participate in the cache key. Each entry multiplies the number of cache variants by the number of distinct values observed for that header. + CacheKeyHeaders []string `json:"cacheKeyHeaders"` + // When true, the CDN varies its cache by the request query string. If `queryStringVaryParameters` is empty, every unique query-string combination produces its own cache entry; if non-empty, only the listed parameters influence the cache key. + QueryStringVaryEnabled bool `json:"queryStringVaryEnabled"` + // Allowlist of query-string parameter names that participate in the cache key when `queryStringVaryEnabled` is true. Ignored while `queryStringVaryEnabled` is false, but still stored so it can be re-activated without losing the list. + QueryStringVaryParameters []string `json:"queryStringVaryParameters"` + AdditionalProperties map[string]interface{} +} + +type _CacheConfig CacheConfig + +// NewCacheConfig instantiates a new CacheConfig 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 NewCacheConfig(cacheKeyHeaders []string, queryStringVaryEnabled bool, queryStringVaryParameters []string) *CacheConfig { + this := CacheConfig{} + this.CacheKeyHeaders = cacheKeyHeaders + this.QueryStringVaryEnabled = queryStringVaryEnabled + this.QueryStringVaryParameters = queryStringVaryParameters + return &this +} + +// NewCacheConfigWithDefaults instantiates a new CacheConfig 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 NewCacheConfigWithDefaults() *CacheConfig { + this := CacheConfig{} + return &this +} + +// GetCacheKeyHeaders returns the CacheKeyHeaders field value +func (o *CacheConfig) GetCacheKeyHeaders() []string { + if o == nil { + var ret []string + return ret + } + + return o.CacheKeyHeaders +} + +// GetCacheKeyHeadersOk returns a tuple with the CacheKeyHeaders field value +// and a boolean to check if the value has been set. +func (o *CacheConfig) GetCacheKeyHeadersOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.CacheKeyHeaders, true +} + +// SetCacheKeyHeaders sets field value +func (o *CacheConfig) SetCacheKeyHeaders(v []string) { + o.CacheKeyHeaders = v +} + +// GetQueryStringVaryEnabled returns the QueryStringVaryEnabled field value +func (o *CacheConfig) GetQueryStringVaryEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.QueryStringVaryEnabled +} + +// GetQueryStringVaryEnabledOk returns a tuple with the QueryStringVaryEnabled field value +// and a boolean to check if the value has been set. +func (o *CacheConfig) GetQueryStringVaryEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.QueryStringVaryEnabled, true +} + +// SetQueryStringVaryEnabled sets field value +func (o *CacheConfig) SetQueryStringVaryEnabled(v bool) { + o.QueryStringVaryEnabled = v +} + +// GetQueryStringVaryParameters returns the QueryStringVaryParameters field value +func (o *CacheConfig) GetQueryStringVaryParameters() []string { + if o == nil { + var ret []string + return ret + } + + return o.QueryStringVaryParameters +} + +// GetQueryStringVaryParametersOk returns a tuple with the QueryStringVaryParameters field value +// and a boolean to check if the value has been set. +func (o *CacheConfig) GetQueryStringVaryParametersOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.QueryStringVaryParameters, true +} + +// SetQueryStringVaryParameters sets field value +func (o *CacheConfig) SetQueryStringVaryParameters(v []string) { + o.QueryStringVaryParameters = v +} + +func (o CacheConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CacheConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cacheKeyHeaders"] = o.CacheKeyHeaders + toSerialize["queryStringVaryEnabled"] = o.QueryStringVaryEnabled + toSerialize["queryStringVaryParameters"] = o.QueryStringVaryParameters + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CacheConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cacheKeyHeaders", + "queryStringVaryEnabled", + "queryStringVaryParameters", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCacheConfig := _CacheConfig{} + + err = json.Unmarshal(data, &varCacheConfig) + + if err != nil { + return err + } + + *o = CacheConfig(varCacheConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cacheKeyHeaders") + delete(additionalProperties, "queryStringVaryEnabled") + delete(additionalProperties, "queryStringVaryParameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCacheConfig struct { + value *CacheConfig + isSet bool +} + +func (v NullableCacheConfig) Get() *CacheConfig { + return v.value +} + +func (v *NullableCacheConfig) Set(val *CacheConfig) { + v.value = val + v.isSet = true +} + +func (v NullableCacheConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableCacheConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCacheConfig(val *CacheConfig) *NullableCacheConfig { + return &NullableCacheConfig{value: val, isSet: true} +} + +func (v NullableCacheConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCacheConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_cache_config_create.go b/services/cdn/v1api/model_cache_config_create.go new file mode 100644 index 000000000..ee72ab6d2 --- /dev/null +++ b/services/cdn/v1api/model_cache_config_create.go @@ -0,0 +1,234 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CacheConfigCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CacheConfigCreate{} + +// CacheConfigCreate Groups the cache options that influence how the CDN builds its cache key on distribution creation. **Cache cardinality warning:** enabling query-string vary produces one cache entry per unique query-string combination (**unbounded** when `queryStringVaryParameters` is empty). Each entry in `cacheKeyHeaders` multiplies the number of cache variants by the number of distinct values observed for that header. Use these settings sparingly. `queryStringVaryParameters` is stored independently of `queryStringVaryEnabled` so that this feature can be toggled on and off without losing the configured allowlist. Only `queryStringVaryEnabled` gates whether the parameter allowlist actually varies the cache. **Optimizer interaction:** when the Optimizer is enabled, the CDN automatically enables query-string vary for image responses regardless of this setting. +type CacheConfigCreate struct { + // HTTP request header names whose values participate in the cache key. Each entry multiplies the number of cache variants by the number of distinct values observed for that header. + CacheKeyHeaders []string `json:"cacheKeyHeaders,omitempty"` + // When true, the CDN varies its cache by the request query string. If `queryStringVaryParameters` is empty, every unique query-string combination produces its own cache entry; if non-empty, only the listed parameters influence the cache key. + QueryStringVaryEnabled *bool `json:"queryStringVaryEnabled,omitempty"` + // Allowlist of query-string parameter names that participate in the cache key when `queryStringVaryEnabled` is true. Ignored while `queryStringVaryEnabled` is false, but still stored so it can be re-activated without losing the list. + QueryStringVaryParameters []string `json:"queryStringVaryParameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CacheConfigCreate CacheConfigCreate + +// NewCacheConfigCreate instantiates a new CacheConfigCreate 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 NewCacheConfigCreate() *CacheConfigCreate { + this := CacheConfigCreate{} + var queryStringVaryEnabled bool = false + this.QueryStringVaryEnabled = &queryStringVaryEnabled + return &this +} + +// NewCacheConfigCreateWithDefaults instantiates a new CacheConfigCreate 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 NewCacheConfigCreateWithDefaults() *CacheConfigCreate { + this := CacheConfigCreate{} + var queryStringVaryEnabled bool = false + this.QueryStringVaryEnabled = &queryStringVaryEnabled + return &this +} + +// GetCacheKeyHeaders returns the CacheKeyHeaders field value if set, zero value otherwise. +func (o *CacheConfigCreate) GetCacheKeyHeaders() []string { + if o == nil || IsNil(o.CacheKeyHeaders) { + var ret []string + return ret + } + return o.CacheKeyHeaders +} + +// GetCacheKeyHeadersOk returns a tuple with the CacheKeyHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CacheConfigCreate) GetCacheKeyHeadersOk() ([]string, bool) { + if o == nil || IsNil(o.CacheKeyHeaders) { + return nil, false + } + return o.CacheKeyHeaders, true +} + +// HasCacheKeyHeaders returns a boolean if a field has been set. +func (o *CacheConfigCreate) HasCacheKeyHeaders() bool { + if o != nil && !IsNil(o.CacheKeyHeaders) { + return true + } + + return false +} + +// SetCacheKeyHeaders gets a reference to the given []string and assigns it to the CacheKeyHeaders field. +func (o *CacheConfigCreate) SetCacheKeyHeaders(v []string) { + o.CacheKeyHeaders = v +} + +// GetQueryStringVaryEnabled returns the QueryStringVaryEnabled field value if set, zero value otherwise. +func (o *CacheConfigCreate) GetQueryStringVaryEnabled() bool { + if o == nil || IsNil(o.QueryStringVaryEnabled) { + var ret bool + return ret + } + return *o.QueryStringVaryEnabled +} + +// GetQueryStringVaryEnabledOk returns a tuple with the QueryStringVaryEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CacheConfigCreate) GetQueryStringVaryEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.QueryStringVaryEnabled) { + return nil, false + } + return o.QueryStringVaryEnabled, true +} + +// HasQueryStringVaryEnabled returns a boolean if a field has been set. +func (o *CacheConfigCreate) HasQueryStringVaryEnabled() bool { + if o != nil && !IsNil(o.QueryStringVaryEnabled) { + return true + } + + return false +} + +// SetQueryStringVaryEnabled gets a reference to the given bool and assigns it to the QueryStringVaryEnabled field. +func (o *CacheConfigCreate) SetQueryStringVaryEnabled(v bool) { + o.QueryStringVaryEnabled = &v +} + +// GetQueryStringVaryParameters returns the QueryStringVaryParameters field value if set, zero value otherwise. +func (o *CacheConfigCreate) GetQueryStringVaryParameters() []string { + if o == nil || IsNil(o.QueryStringVaryParameters) { + var ret []string + return ret + } + return o.QueryStringVaryParameters +} + +// GetQueryStringVaryParametersOk returns a tuple with the QueryStringVaryParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CacheConfigCreate) GetQueryStringVaryParametersOk() ([]string, bool) { + if o == nil || IsNil(o.QueryStringVaryParameters) { + return nil, false + } + return o.QueryStringVaryParameters, true +} + +// HasQueryStringVaryParameters returns a boolean if a field has been set. +func (o *CacheConfigCreate) HasQueryStringVaryParameters() bool { + if o != nil && !IsNil(o.QueryStringVaryParameters) { + return true + } + + return false +} + +// SetQueryStringVaryParameters gets a reference to the given []string and assigns it to the QueryStringVaryParameters field. +func (o *CacheConfigCreate) SetQueryStringVaryParameters(v []string) { + o.QueryStringVaryParameters = v +} + +func (o CacheConfigCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CacheConfigCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CacheKeyHeaders) { + toSerialize["cacheKeyHeaders"] = o.CacheKeyHeaders + } + if !IsNil(o.QueryStringVaryEnabled) { + toSerialize["queryStringVaryEnabled"] = o.QueryStringVaryEnabled + } + if !IsNil(o.QueryStringVaryParameters) { + toSerialize["queryStringVaryParameters"] = o.QueryStringVaryParameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CacheConfigCreate) UnmarshalJSON(data []byte) (err error) { + varCacheConfigCreate := _CacheConfigCreate{} + + err = json.Unmarshal(data, &varCacheConfigCreate) + + if err != nil { + return err + } + + *o = CacheConfigCreate(varCacheConfigCreate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cacheKeyHeaders") + delete(additionalProperties, "queryStringVaryEnabled") + delete(additionalProperties, "queryStringVaryParameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCacheConfigCreate struct { + value *CacheConfigCreate + isSet bool +} + +func (v NullableCacheConfigCreate) Get() *CacheConfigCreate { + return v.value +} + +func (v *NullableCacheConfigCreate) Set(val *CacheConfigCreate) { + v.value = val + v.isSet = true +} + +func (v NullableCacheConfigCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableCacheConfigCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCacheConfigCreate(val *CacheConfigCreate) *NullableCacheConfigCreate { + return &NullableCacheConfigCreate{value: val, isSet: true} +} + +func (v NullableCacheConfigCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCacheConfigCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_cache_config_patch.go b/services/cdn/v1api/model_cache_config_patch.go new file mode 100644 index 000000000..72e7817fc --- /dev/null +++ b/services/cdn/v1api/model_cache_config_patch.go @@ -0,0 +1,230 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CacheConfigPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CacheConfigPatch{} + +// CacheConfigPatch PATCH variant of `CacheConfig`. Follows the standard PATCH conventions for this API: - Field omitted from the request: current value is left unchanged. - Array field sent as `[]`: current list is cleared. - `queryStringVaryEnabled` is a plain boolean (non-nullable); omit it to leave unchanged. `queryStringVaryParameters` is stored independently of `queryStringVaryEnabled`. Sending a non-empty `queryStringVaryParameters` together with `queryStringVaryEnabled=false` is accepted: the list is persisted for later re-activation but does not affect the cache while the flag is false. +type CacheConfigPatch struct { + // HTTP request header names that participate in the cache key. Omit to leave unchanged; send `[]` to clear. + CacheKeyHeaders []string `json:"cacheKeyHeaders,omitempty"` + // When true, the CDN varies its cache by the request query string. Omit to leave unchanged. + QueryStringVaryEnabled *bool `json:"queryStringVaryEnabled,omitempty"` + // Allowlist of query-string parameter names. Omit to leave unchanged; send `[]` to clear. + QueryStringVaryParameters []string `json:"queryStringVaryParameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CacheConfigPatch CacheConfigPatch + +// NewCacheConfigPatch instantiates a new CacheConfigPatch 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 NewCacheConfigPatch() *CacheConfigPatch { + this := CacheConfigPatch{} + return &this +} + +// NewCacheConfigPatchWithDefaults instantiates a new CacheConfigPatch 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 NewCacheConfigPatchWithDefaults() *CacheConfigPatch { + this := CacheConfigPatch{} + return &this +} + +// GetCacheKeyHeaders returns the CacheKeyHeaders field value if set, zero value otherwise. +func (o *CacheConfigPatch) GetCacheKeyHeaders() []string { + if o == nil || IsNil(o.CacheKeyHeaders) { + var ret []string + return ret + } + return o.CacheKeyHeaders +} + +// GetCacheKeyHeadersOk returns a tuple with the CacheKeyHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CacheConfigPatch) GetCacheKeyHeadersOk() ([]string, bool) { + if o == nil || IsNil(o.CacheKeyHeaders) { + return nil, false + } + return o.CacheKeyHeaders, true +} + +// HasCacheKeyHeaders returns a boolean if a field has been set. +func (o *CacheConfigPatch) HasCacheKeyHeaders() bool { + if o != nil && !IsNil(o.CacheKeyHeaders) { + return true + } + + return false +} + +// SetCacheKeyHeaders gets a reference to the given []string and assigns it to the CacheKeyHeaders field. +func (o *CacheConfigPatch) SetCacheKeyHeaders(v []string) { + o.CacheKeyHeaders = v +} + +// GetQueryStringVaryEnabled returns the QueryStringVaryEnabled field value if set, zero value otherwise. +func (o *CacheConfigPatch) GetQueryStringVaryEnabled() bool { + if o == nil || IsNil(o.QueryStringVaryEnabled) { + var ret bool + return ret + } + return *o.QueryStringVaryEnabled +} + +// GetQueryStringVaryEnabledOk returns a tuple with the QueryStringVaryEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CacheConfigPatch) GetQueryStringVaryEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.QueryStringVaryEnabled) { + return nil, false + } + return o.QueryStringVaryEnabled, true +} + +// HasQueryStringVaryEnabled returns a boolean if a field has been set. +func (o *CacheConfigPatch) HasQueryStringVaryEnabled() bool { + if o != nil && !IsNil(o.QueryStringVaryEnabled) { + return true + } + + return false +} + +// SetQueryStringVaryEnabled gets a reference to the given bool and assigns it to the QueryStringVaryEnabled field. +func (o *CacheConfigPatch) SetQueryStringVaryEnabled(v bool) { + o.QueryStringVaryEnabled = &v +} + +// GetQueryStringVaryParameters returns the QueryStringVaryParameters field value if set, zero value otherwise. +func (o *CacheConfigPatch) GetQueryStringVaryParameters() []string { + if o == nil || IsNil(o.QueryStringVaryParameters) { + var ret []string + return ret + } + return o.QueryStringVaryParameters +} + +// GetQueryStringVaryParametersOk returns a tuple with the QueryStringVaryParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CacheConfigPatch) GetQueryStringVaryParametersOk() ([]string, bool) { + if o == nil || IsNil(o.QueryStringVaryParameters) { + return nil, false + } + return o.QueryStringVaryParameters, true +} + +// HasQueryStringVaryParameters returns a boolean if a field has been set. +func (o *CacheConfigPatch) HasQueryStringVaryParameters() bool { + if o != nil && !IsNil(o.QueryStringVaryParameters) { + return true + } + + return false +} + +// SetQueryStringVaryParameters gets a reference to the given []string and assigns it to the QueryStringVaryParameters field. +func (o *CacheConfigPatch) SetQueryStringVaryParameters(v []string) { + o.QueryStringVaryParameters = v +} + +func (o CacheConfigPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CacheConfigPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CacheKeyHeaders) { + toSerialize["cacheKeyHeaders"] = o.CacheKeyHeaders + } + if !IsNil(o.QueryStringVaryEnabled) { + toSerialize["queryStringVaryEnabled"] = o.QueryStringVaryEnabled + } + if !IsNil(o.QueryStringVaryParameters) { + toSerialize["queryStringVaryParameters"] = o.QueryStringVaryParameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CacheConfigPatch) UnmarshalJSON(data []byte) (err error) { + varCacheConfigPatch := _CacheConfigPatch{} + + err = json.Unmarshal(data, &varCacheConfigPatch) + + if err != nil { + return err + } + + *o = CacheConfigPatch(varCacheConfigPatch) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cacheKeyHeaders") + delete(additionalProperties, "queryStringVaryEnabled") + delete(additionalProperties, "queryStringVaryParameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCacheConfigPatch struct { + value *CacheConfigPatch + isSet bool +} + +func (v NullableCacheConfigPatch) Get() *CacheConfigPatch { + return v.value +} + +func (v *NullableCacheConfigPatch) Set(val *CacheConfigPatch) { + v.value = val + v.isSet = true +} + +func (v NullableCacheConfigPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableCacheConfigPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCacheConfigPatch(val *CacheConfigPatch) *NullableCacheConfigPatch { + return &NullableCacheConfigPatch{value: val, isSet: true} +} + +func (v NullableCacheConfigPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCacheConfigPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_config.go b/services/cdn/v1api/model_config.go index 2b878078e..c1642f167 100644 --- a/services/cdn/v1api/model_config.go +++ b/services/cdn/v1api/model_config.go @@ -24,7 +24,8 @@ type Config struct { // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g. DE, ES, GB). This setting blocks users from the specified countries. BlockedCountries []string `json:"blockedCountries"` // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIps []string `json:"blockedIps"` + BlockedIps []string `json:"blockedIps"` + CacheConfig CacheConfig `json:"cacheConfig"` // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` // Enabling this allows the 'Host' header to be passed through to the origin. @@ -50,11 +51,12 @@ type _Config Config // 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 NewConfig(backend ConfigBackend, blockedCountries []string, blockedIps []string, forwardHostHeader bool, regions []Region, stripResponseCookies bool, tls TlsConfig, waf WafConfig) *Config { +func NewConfig(backend ConfigBackend, blockedCountries []string, blockedIps []string, cacheConfig CacheConfig, forwardHostHeader bool, regions []Region, stripResponseCookies bool, tls TlsConfig, waf WafConfig) *Config { this := Config{} this.Backend = backend this.BlockedCountries = blockedCountries this.BlockedIps = blockedIps + this.CacheConfig = cacheConfig this.ForwardHostHeader = forwardHostHeader this.Regions = regions this.StripResponseCookies = stripResponseCookies @@ -143,6 +145,30 @@ func (o *Config) SetBlockedIps(v []string) { o.BlockedIps = v } +// GetCacheConfig returns the CacheConfig field value +func (o *Config) GetCacheConfig() CacheConfig { + if o == nil { + var ret CacheConfig + return ret + } + + return o.CacheConfig +} + +// GetCacheConfigOk returns a tuple with the CacheConfig field value +// and a boolean to check if the value has been set. +func (o *Config) GetCacheConfigOk() (*CacheConfig, bool) { + if o == nil { + return nil, false + } + return &o.CacheConfig, true +} + +// SetCacheConfig sets field value +func (o *Config) SetCacheConfig(v CacheConfig) { + o.CacheConfig = v +} + // GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Config) GetDefaultCacheDuration() string { if o == nil || IsNil(o.DefaultCacheDuration.Get()) { @@ -490,6 +516,7 @@ func (o Config) ToMap() (map[string]interface{}, error) { toSerialize["backend"] = o.Backend toSerialize["blockedCountries"] = o.BlockedCountries toSerialize["blockedIps"] = o.BlockedIps + toSerialize["cacheConfig"] = o.CacheConfig if o.DefaultCacheDuration.IsSet() { toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() } @@ -529,6 +556,7 @@ func (o *Config) UnmarshalJSON(data []byte) (err error) { "backend", "blockedCountries", "blockedIps", + "cacheConfig", "forwardHostHeader", "regions", "stripResponseCookies", @@ -566,6 +594,7 @@ func (o *Config) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "backend") delete(additionalProperties, "blockedCountries") delete(additionalProperties, "blockedIps") + delete(additionalProperties, "cacheConfig") delete(additionalProperties, "defaultCacheDuration") delete(additionalProperties, "forwardHostHeader") delete(additionalProperties, "labels") diff --git a/services/cdn/v1api/model_config_log_sink.go b/services/cdn/v1api/model_config_log_sink.go index ea72c6619..6d3f27ec2 100644 --- a/services/cdn/v1api/model_config_log_sink.go +++ b/services/cdn/v1api/model_config_log_sink.go @@ -18,6 +18,7 @@ import ( // ConfigLogSink - struct for ConfigLogSink type ConfigLogSink struct { LokiLogSink *LokiLogSink + OtlpLogSink *OtlpLogSink } // LokiLogSinkAsConfigLogSink is a convenience function that returns LokiLogSink wrapped in ConfigLogSink @@ -27,6 +28,13 @@ func LokiLogSinkAsConfigLogSink(v *LokiLogSink) ConfigLogSink { } } +// OtlpLogSinkAsConfigLogSink is a convenience function that returns OtlpLogSink wrapped in ConfigLogSink +func OtlpLogSinkAsConfigLogSink(v *OtlpLogSink) ConfigLogSink { + return ConfigLogSink{ + OtlpLogSink: v, + } +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *ConfigLogSink) UnmarshalJSON(data []byte) error { var err error @@ -49,6 +57,18 @@ func (dst *ConfigLogSink) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'otlp' + if jsonDict["type"] == "otlp" { + // try to unmarshal JSON data into OtlpLogSink + err = json.Unmarshal(data, &dst.OtlpLogSink) + if err == nil { + return nil // data stored in dst.OtlpLogSink, return on the first match + } else { + dst.OtlpLogSink = nil + return fmt.Errorf("failed to unmarshal ConfigLogSink as OtlpLogSink: %s", err.Error()) + } + } + return nil } @@ -58,6 +78,10 @@ func (src ConfigLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(&src.LokiLogSink) } + if src.OtlpLogSink != nil { + return json.Marshal(&src.OtlpLogSink) + } + return nil, nil // no data in oneOf schemas } @@ -70,6 +94,10 @@ func (obj *ConfigLogSink) GetActualInstance() interface{} { return obj.LokiLogSink } + if obj.OtlpLogSink != nil { + return obj.OtlpLogSink + } + // all schemas are nil return nil } @@ -80,6 +108,10 @@ func (obj ConfigLogSink) GetActualInstanceValue() interface{} { return *obj.LokiLogSink } + if obj.OtlpLogSink != nil { + return *obj.OtlpLogSink + } + // all schemas are nil return nil } diff --git a/services/cdn/v1api/model_config_patch.go b/services/cdn/v1api/model_config_patch.go index d5e64b4dc..5c3b78481 100644 --- a/services/cdn/v1api/model_config_patch.go +++ b/services/cdn/v1api/model_config_patch.go @@ -23,7 +23,8 @@ type ConfigPatch struct { // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. BlockedCountries []string `json:"blockedCountries,omitempty"` // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIps []string `json:"blockedIps,omitempty"` + BlockedIps []string `json:"blockedIps,omitempty"` + CacheConfig *CacheConfigPatch `json:"cacheConfig,omitempty"` // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` // Enabling this allows the 'Host' header to be passed through to the origin. @@ -158,6 +159,38 @@ func (o *ConfigPatch) SetBlockedIps(v []string) { o.BlockedIps = v } +// GetCacheConfig returns the CacheConfig field value if set, zero value otherwise. +func (o *ConfigPatch) GetCacheConfig() CacheConfigPatch { + if o == nil || IsNil(o.CacheConfig) { + var ret CacheConfigPatch + return ret + } + return *o.CacheConfig +} + +// GetCacheConfigOk returns a tuple with the CacheConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetCacheConfigOk() (*CacheConfigPatch, bool) { + if o == nil || IsNil(o.CacheConfig) { + return nil, false + } + return o.CacheConfig, true +} + +// HasCacheConfig returns a boolean if a field has been set. +func (o *ConfigPatch) HasCacheConfig() bool { + if o != nil && !IsNil(o.CacheConfig) { + return true + } + + return false +} + +// SetCacheConfig gets a reference to the given CacheConfigPatch and assigns it to the CacheConfig field. +func (o *ConfigPatch) SetCacheConfig(v CacheConfigPatch) { + o.CacheConfig = &v +} + // GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConfigPatch) GetDefaultCacheDuration() string { if o == nil || IsNil(o.DefaultCacheDuration.Get()) { @@ -562,6 +595,9 @@ func (o ConfigPatch) ToMap() (map[string]interface{}, error) { if !IsNil(o.BlockedIps) { toSerialize["blockedIps"] = o.BlockedIps } + if !IsNil(o.CacheConfig) { + toSerialize["cacheConfig"] = o.CacheConfig + } if o.DefaultCacheDuration.IsSet() { toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() } @@ -620,6 +656,7 @@ func (o *ConfigPatch) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "backend") delete(additionalProperties, "blockedCountries") delete(additionalProperties, "blockedIps") + delete(additionalProperties, "cacheConfig") delete(additionalProperties, "defaultCacheDuration") delete(additionalProperties, "forwardHostHeader") delete(additionalProperties, "labels") diff --git a/services/cdn/v1api/model_config_patch_log_sink.go b/services/cdn/v1api/model_config_patch_log_sink.go index 94faac626..74d2965c0 100644 --- a/services/cdn/v1api/model_config_patch_log_sink.go +++ b/services/cdn/v1api/model_config_patch_log_sink.go @@ -18,6 +18,7 @@ import ( // ConfigPatchLogSink - struct for ConfigPatchLogSink type ConfigPatchLogSink struct { LokiLogSinkPatch *LokiLogSinkPatch + OtlpLogSinkPatch *OtlpLogSinkPatch } // LokiLogSinkPatchAsConfigPatchLogSink is a convenience function that returns LokiLogSinkPatch wrapped in ConfigPatchLogSink @@ -27,6 +28,13 @@ func LokiLogSinkPatchAsConfigPatchLogSink(v *LokiLogSinkPatch) ConfigPatchLogSin } } +// OtlpLogSinkPatchAsConfigPatchLogSink is a convenience function that returns OtlpLogSinkPatch wrapped in ConfigPatchLogSink +func OtlpLogSinkPatchAsConfigPatchLogSink(v *OtlpLogSinkPatch) ConfigPatchLogSink { + return ConfigPatchLogSink{ + OtlpLogSinkPatch: v, + } +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *ConfigPatchLogSink) UnmarshalJSON(data []byte) error { var err error @@ -54,6 +62,18 @@ func (dst *ConfigPatchLogSink) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'otlp' + if jsonDict["type"] == "otlp" { + // try to unmarshal JSON data into OtlpLogSinkPatch + err = json.Unmarshal(data, &dst.OtlpLogSinkPatch) + if err == nil { + return nil // data stored in dst.OtlpLogSinkPatch, return on the first match + } else { + dst.OtlpLogSinkPatch = nil + return fmt.Errorf("failed to unmarshal ConfigPatchLogSink as OtlpLogSinkPatch: %s", err.Error()) + } + } + return nil } @@ -63,6 +83,10 @@ func (src ConfigPatchLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(&src.LokiLogSinkPatch) } + if src.OtlpLogSinkPatch != nil { + return json.Marshal(&src.OtlpLogSinkPatch) + } + return nil, nil // no data in oneOf schemas } @@ -75,6 +99,10 @@ func (obj *ConfigPatchLogSink) GetActualInstance() interface{} { return obj.LokiLogSinkPatch } + if obj.OtlpLogSinkPatch != nil { + return obj.OtlpLogSinkPatch + } + // all schemas are nil return nil } @@ -85,6 +113,10 @@ func (obj ConfigPatchLogSink) GetActualInstanceValue() interface{} { return *obj.LokiLogSinkPatch } + if obj.OtlpLogSinkPatch != nil { + return *obj.OtlpLogSinkPatch + } + // all schemas are nil return nil } diff --git a/services/cdn/v1api/model_create_distribution_payload.go b/services/cdn/v1api/model_create_distribution_payload.go index b56d01340..f2734a4d7 100644 --- a/services/cdn/v1api/model_create_distribution_payload.go +++ b/services/cdn/v1api/model_create_distribution_payload.go @@ -24,7 +24,8 @@ type CreateDistributionPayload struct { // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. BlockedCountries []string `json:"blockedCountries,omitempty"` // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIps []string `json:"blockedIps,omitempty"` + BlockedIps []string `json:"blockedIps,omitempty"` + CacheConfig *CacheConfigCreate `json:"cacheConfig,omitempty"` // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) DefaultCacheDuration *string `json:"defaultCacheDuration,omitempty"` // Enabling this allows the 'Host' header to be passed through to the origin. @@ -156,6 +157,38 @@ func (o *CreateDistributionPayload) SetBlockedIps(v []string) { o.BlockedIps = v } +// GetCacheConfig returns the CacheConfig field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetCacheConfig() CacheConfigCreate { + if o == nil || IsNil(o.CacheConfig) { + var ret CacheConfigCreate + return ret + } + return *o.CacheConfig +} + +// GetCacheConfigOk returns a tuple with the CacheConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetCacheConfigOk() (*CacheConfigCreate, bool) { + if o == nil || IsNil(o.CacheConfig) { + return nil, false + } + return o.CacheConfig, true +} + +// HasCacheConfig returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasCacheConfig() bool { + if o != nil && !IsNil(o.CacheConfig) { + return true + } + + return false +} + +// SetCacheConfig gets a reference to the given CacheConfigCreate and assigns it to the CacheConfig field. +func (o *CreateDistributionPayload) SetCacheConfig(v CacheConfigCreate) { + o.CacheConfig = &v +} + // GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetDefaultCacheDuration() string { if o == nil || IsNil(o.DefaultCacheDuration) { @@ -549,6 +582,9 @@ func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.BlockedIps) { toSerialize["blockedIps"] = o.BlockedIps } + if !IsNil(o.CacheConfig) { + toSerialize["cacheConfig"] = o.CacheConfig + } if !IsNil(o.DefaultCacheDuration) { toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration } @@ -630,6 +666,7 @@ func (o *CreateDistributionPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "backend") delete(additionalProperties, "blockedCountries") delete(additionalProperties, "blockedIps") + delete(additionalProperties, "cacheConfig") delete(additionalProperties, "defaultCacheDuration") delete(additionalProperties, "forwardHostHeader") delete(additionalProperties, "intentId") diff --git a/services/cdn/v1api/model_create_distribution_payload_log_sink.go b/services/cdn/v1api/model_create_distribution_payload_log_sink.go index bc85d39bf..19c794b47 100644 --- a/services/cdn/v1api/model_create_distribution_payload_log_sink.go +++ b/services/cdn/v1api/model_create_distribution_payload_log_sink.go @@ -18,6 +18,7 @@ import ( // CreateDistributionPayloadLogSink - struct for CreateDistributionPayloadLogSink type CreateDistributionPayloadLogSink struct { LokiLogSinkCreate *LokiLogSinkCreate + OtlpLogSinkCreate *OtlpLogSinkCreate } // LokiLogSinkCreateAsCreateDistributionPayloadLogSink is a convenience function that returns LokiLogSinkCreate wrapped in CreateDistributionPayloadLogSink @@ -27,6 +28,13 @@ func LokiLogSinkCreateAsCreateDistributionPayloadLogSink(v *LokiLogSinkCreate) C } } +// OtlpLogSinkCreateAsCreateDistributionPayloadLogSink is a convenience function that returns OtlpLogSinkCreate wrapped in CreateDistributionPayloadLogSink +func OtlpLogSinkCreateAsCreateDistributionPayloadLogSink(v *OtlpLogSinkCreate) CreateDistributionPayloadLogSink { + return CreateDistributionPayloadLogSink{ + OtlpLogSinkCreate: v, + } +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *CreateDistributionPayloadLogSink) UnmarshalJSON(data []byte) error { var err error @@ -49,6 +57,18 @@ func (dst *CreateDistributionPayloadLogSink) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'otlp' + if jsonDict["type"] == "otlp" { + // try to unmarshal JSON data into OtlpLogSinkCreate + err = json.Unmarshal(data, &dst.OtlpLogSinkCreate) + if err == nil { + return nil // data stored in dst.OtlpLogSinkCreate, return on the first match + } else { + dst.OtlpLogSinkCreate = nil + return fmt.Errorf("failed to unmarshal CreateDistributionPayloadLogSink as OtlpLogSinkCreate: %s", err.Error()) + } + } + return nil } @@ -58,6 +78,10 @@ func (src CreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(&src.LokiLogSinkCreate) } + if src.OtlpLogSinkCreate != nil { + return json.Marshal(&src.OtlpLogSinkCreate) + } + return nil, nil // no data in oneOf schemas } @@ -70,6 +94,10 @@ func (obj *CreateDistributionPayloadLogSink) GetActualInstance() interface{} { return obj.LokiLogSinkCreate } + if obj.OtlpLogSinkCreate != nil { + return obj.OtlpLogSinkCreate + } + // all schemas are nil return nil } @@ -80,6 +108,10 @@ func (obj CreateDistributionPayloadLogSink) GetActualInstanceValue() interface{} return *obj.LokiLogSinkCreate } + if obj.OtlpLogSinkCreate != nil { + return *obj.OtlpLogSinkCreate + } + // all schemas are nil return nil } diff --git a/services/cdn/v1beta2api/model_loki_log_sink.go b/services/cdn/v1api/model_otlp_log_sink.go similarity index 59% rename from services/cdn/v1beta2api/model_loki_log_sink.go rename to services/cdn/v1api/model_otlp_log_sink.go index c6dd2831e..8977b1e37 100644 --- a/services/cdn/v1beta2api/model_loki_log_sink.go +++ b/services/cdn/v1api/model_otlp_log_sink.go @@ -1,53 +1,54 @@ /* STACKIT CDN API -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. +API used to create and manage your CDN distributions. -API version: 1beta2.0.0 +API version: 1.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1beta2api +package v1api import ( "encoding/json" "fmt" ) -// checks if the LokiLogSink type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &LokiLogSink{} +// checks if the OtlpLogSink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OtlpLogSink{} -// LokiLogSink struct for LokiLogSink -type LokiLogSink struct { - PushUrl string `json:"pushUrl"` - Type string `json:"type"` +// OtlpLogSink struct for OtlpLogSink +type OtlpLogSink struct { + // The fully qualified URL where the CDN should push logs to your OTLP endpoint (for example, `https://otlp.example.com/otlp/v1/logs`). + PushUrl string `json:"pushUrl"` + Type OtlpLogSinkType `json:"type"` AdditionalProperties map[string]interface{} } -type _LokiLogSink LokiLogSink +type _OtlpLogSink OtlpLogSink -// NewLokiLogSink instantiates a new LokiLogSink object +// NewOtlpLogSink instantiates a new OtlpLogSink 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 NewLokiLogSink(pushUrl string, types string) *LokiLogSink { - this := LokiLogSink{} +func NewOtlpLogSink(pushUrl string, types OtlpLogSinkType) *OtlpLogSink { + this := OtlpLogSink{} this.PushUrl = pushUrl this.Type = types return &this } -// NewLokiLogSinkWithDefaults instantiates a new LokiLogSink object +// NewOtlpLogSinkWithDefaults instantiates a new OtlpLogSink 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 NewLokiLogSinkWithDefaults() *LokiLogSink { - this := LokiLogSink{} +func NewOtlpLogSinkWithDefaults() *OtlpLogSink { + this := OtlpLogSink{} return &this } // GetPushUrl returns the PushUrl field value -func (o *LokiLogSink) GetPushUrl() string { +func (o *OtlpLogSink) GetPushUrl() string { if o == nil { var ret string return ret @@ -58,7 +59,7 @@ func (o *LokiLogSink) GetPushUrl() string { // GetPushUrlOk returns a tuple with the PushUrl field value // and a boolean to check if the value has been set. -func (o *LokiLogSink) GetPushUrlOk() (*string, bool) { +func (o *OtlpLogSink) GetPushUrlOk() (*string, bool) { if o == nil { return nil, false } @@ -66,14 +67,14 @@ func (o *LokiLogSink) GetPushUrlOk() (*string, bool) { } // SetPushUrl sets field value -func (o *LokiLogSink) SetPushUrl(v string) { +func (o *OtlpLogSink) SetPushUrl(v string) { o.PushUrl = v } // GetType returns the Type field value -func (o *LokiLogSink) GetType() string { +func (o *OtlpLogSink) GetType() OtlpLogSinkType { if o == nil { - var ret string + var ret OtlpLogSinkType return ret } @@ -82,7 +83,7 @@ func (o *LokiLogSink) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *LokiLogSink) GetTypeOk() (*string, bool) { +func (o *OtlpLogSink) GetTypeOk() (*OtlpLogSinkType, bool) { if o == nil { return nil, false } @@ -90,11 +91,11 @@ func (o *LokiLogSink) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *LokiLogSink) SetType(v string) { +func (o *OtlpLogSink) SetType(v OtlpLogSinkType) { o.Type = v } -func (o LokiLogSink) MarshalJSON() ([]byte, error) { +func (o OtlpLogSink) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -102,7 +103,7 @@ func (o LokiLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o LokiLogSink) ToMap() (map[string]interface{}, error) { +func (o OtlpLogSink) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["pushUrl"] = o.PushUrl toSerialize["type"] = o.Type @@ -114,7 +115,7 @@ func (o LokiLogSink) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *LokiLogSink) UnmarshalJSON(data []byte) (err error) { +func (o *OtlpLogSink) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. @@ -137,15 +138,15 @@ func (o *LokiLogSink) UnmarshalJSON(data []byte) (err error) { } } - varLokiLogSink := _LokiLogSink{} + varOtlpLogSink := _OtlpLogSink{} - err = json.Unmarshal(data, &varLokiLogSink) + err = json.Unmarshal(data, &varOtlpLogSink) if err != nil { return err } - *o = LokiLogSink(varLokiLogSink) + *o = OtlpLogSink(varOtlpLogSink) additionalProperties := make(map[string]interface{}) @@ -158,38 +159,38 @@ func (o *LokiLogSink) UnmarshalJSON(data []byte) (err error) { return err } -type NullableLokiLogSink struct { - value *LokiLogSink +type NullableOtlpLogSink struct { + value *OtlpLogSink isSet bool } -func (v NullableLokiLogSink) Get() *LokiLogSink { +func (v NullableOtlpLogSink) Get() *OtlpLogSink { return v.value } -func (v *NullableLokiLogSink) Set(val *LokiLogSink) { +func (v *NullableOtlpLogSink) Set(val *OtlpLogSink) { v.value = val v.isSet = true } -func (v NullableLokiLogSink) IsSet() bool { +func (v NullableOtlpLogSink) IsSet() bool { return v.isSet } -func (v *NullableLokiLogSink) Unset() { +func (v *NullableOtlpLogSink) Unset() { v.value = nil v.isSet = false } -func NewNullableLokiLogSink(val *LokiLogSink) *NullableLokiLogSink { - return &NullableLokiLogSink{value: val, isSet: true} +func NewNullableOtlpLogSink(val *OtlpLogSink) *NullableOtlpLogSink { + return &NullableOtlpLogSink{value: val, isSet: true} } -func (v NullableLokiLogSink) MarshalJSON() ([]byte, error) { +func (v NullableOtlpLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableLokiLogSink) UnmarshalJSON(src []byte) error { +func (v *NullableOtlpLogSink) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/cdn/v1betaapi/model_patch_loki_log_sink.go b/services/cdn/v1api/model_otlp_log_sink_basic_credentials.go similarity index 52% rename from services/cdn/v1betaapi/model_patch_loki_log_sink.go rename to services/cdn/v1api/model_otlp_log_sink_basic_credentials.go index 0c9230c74..888e50ca6 100644 --- a/services/cdn/v1betaapi/model_patch_loki_log_sink.go +++ b/services/cdn/v1api/model_otlp_log_sink_basic_credentials.go @@ -1,57 +1,57 @@ /* -STACKIT CDN API (DEPRECATED) +STACKIT CDN API -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. +API used to create and manage your CDN distributions. -API version: 1beta.0.0 +API version: 1.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1betaapi +package v1api import ( "encoding/json" "fmt" ) -// checks if the PatchLokiLogSink type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PatchLokiLogSink{} +// checks if the OtlpLogSinkBasicCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OtlpLogSinkBasicCredentials{} -// PatchLokiLogSink struct for PatchLokiLogSink -type PatchLokiLogSink struct { - Password string `json:"password"` - PushUrl string `json:"pushUrl"` - Type string `json:"type"` +// OtlpLogSinkBasicCredentials Basic authentication credentials for OTLP. +type OtlpLogSinkBasicCredentials struct { + // The password corresponding to your username. + Password string `json:"password"` + Type OtlpLogSinkBasicCredentialsType `json:"type"` + // The username used to authenticate against your OTLP endpoint. Username string `json:"username"` AdditionalProperties map[string]interface{} } -type _PatchLokiLogSink PatchLokiLogSink +type _OtlpLogSinkBasicCredentials OtlpLogSinkBasicCredentials -// NewPatchLokiLogSink instantiates a new PatchLokiLogSink object +// NewOtlpLogSinkBasicCredentials instantiates a new OtlpLogSinkBasicCredentials 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 NewPatchLokiLogSink(password string, pushUrl string, types string, username string) *PatchLokiLogSink { - this := PatchLokiLogSink{} +func NewOtlpLogSinkBasicCredentials(password string, types OtlpLogSinkBasicCredentialsType, username string) *OtlpLogSinkBasicCredentials { + this := OtlpLogSinkBasicCredentials{} this.Password = password - this.PushUrl = pushUrl this.Type = types this.Username = username return &this } -// NewPatchLokiLogSinkWithDefaults instantiates a new PatchLokiLogSink object +// NewOtlpLogSinkBasicCredentialsWithDefaults instantiates a new OtlpLogSinkBasicCredentials 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 NewPatchLokiLogSinkWithDefaults() *PatchLokiLogSink { - this := PatchLokiLogSink{} +func NewOtlpLogSinkBasicCredentialsWithDefaults() *OtlpLogSinkBasicCredentials { + this := OtlpLogSinkBasicCredentials{} return &this } // GetPassword returns the Password field value -func (o *PatchLokiLogSink) GetPassword() string { +func (o *OtlpLogSinkBasicCredentials) GetPassword() string { if o == nil { var ret string return ret @@ -62,7 +62,7 @@ func (o *PatchLokiLogSink) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value // and a boolean to check if the value has been set. -func (o *PatchLokiLogSink) GetPasswordOk() (*string, bool) { +func (o *OtlpLogSinkBasicCredentials) GetPasswordOk() (*string, bool) { if o == nil { return nil, false } @@ -70,38 +70,14 @@ func (o *PatchLokiLogSink) GetPasswordOk() (*string, bool) { } // SetPassword sets field value -func (o *PatchLokiLogSink) SetPassword(v string) { +func (o *OtlpLogSinkBasicCredentials) SetPassword(v string) { o.Password = v } -// GetPushUrl returns the PushUrl field value -func (o *PatchLokiLogSink) GetPushUrl() string { - if o == nil { - var ret string - return ret - } - - return o.PushUrl -} - -// GetPushUrlOk returns a tuple with the PushUrl field value -// and a boolean to check if the value has been set. -func (o *PatchLokiLogSink) GetPushUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PushUrl, true -} - -// SetPushUrl sets field value -func (o *PatchLokiLogSink) SetPushUrl(v string) { - o.PushUrl = v -} - // GetType returns the Type field value -func (o *PatchLokiLogSink) GetType() string { +func (o *OtlpLogSinkBasicCredentials) GetType() OtlpLogSinkBasicCredentialsType { if o == nil { - var ret string + var ret OtlpLogSinkBasicCredentialsType return ret } @@ -110,7 +86,7 @@ func (o *PatchLokiLogSink) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *PatchLokiLogSink) GetTypeOk() (*string, bool) { +func (o *OtlpLogSinkBasicCredentials) GetTypeOk() (*OtlpLogSinkBasicCredentialsType, bool) { if o == nil { return nil, false } @@ -118,12 +94,12 @@ func (o *PatchLokiLogSink) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *PatchLokiLogSink) SetType(v string) { +func (o *OtlpLogSinkBasicCredentials) SetType(v OtlpLogSinkBasicCredentialsType) { o.Type = v } // GetUsername returns the Username field value -func (o *PatchLokiLogSink) GetUsername() string { +func (o *OtlpLogSinkBasicCredentials) GetUsername() string { if o == nil { var ret string return ret @@ -134,7 +110,7 @@ func (o *PatchLokiLogSink) GetUsername() string { // GetUsernameOk returns a tuple with the Username field value // and a boolean to check if the value has been set. -func (o *PatchLokiLogSink) GetUsernameOk() (*string, bool) { +func (o *OtlpLogSinkBasicCredentials) GetUsernameOk() (*string, bool) { if o == nil { return nil, false } @@ -142,11 +118,11 @@ func (o *PatchLokiLogSink) GetUsernameOk() (*string, bool) { } // SetUsername sets field value -func (o *PatchLokiLogSink) SetUsername(v string) { +func (o *OtlpLogSinkBasicCredentials) SetUsername(v string) { o.Username = v } -func (o PatchLokiLogSink) MarshalJSON() ([]byte, error) { +func (o OtlpLogSinkBasicCredentials) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -154,10 +130,9 @@ func (o PatchLokiLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o PatchLokiLogSink) ToMap() (map[string]interface{}, error) { +func (o OtlpLogSinkBasicCredentials) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["password"] = o.Password - toSerialize["pushUrl"] = o.PushUrl toSerialize["type"] = o.Type toSerialize["username"] = o.Username @@ -168,13 +143,12 @@ func (o PatchLokiLogSink) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *PatchLokiLogSink) UnmarshalJSON(data []byte) (err error) { +func (o *OtlpLogSinkBasicCredentials) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "password", - "pushUrl", "type", "username", } @@ -193,21 +167,20 @@ func (o *PatchLokiLogSink) UnmarshalJSON(data []byte) (err error) { } } - varPatchLokiLogSink := _PatchLokiLogSink{} + varOtlpLogSinkBasicCredentials := _OtlpLogSinkBasicCredentials{} - err = json.Unmarshal(data, &varPatchLokiLogSink) + err = json.Unmarshal(data, &varOtlpLogSinkBasicCredentials) if err != nil { return err } - *o = PatchLokiLogSink(varPatchLokiLogSink) + *o = OtlpLogSinkBasicCredentials(varOtlpLogSinkBasicCredentials) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "password") - delete(additionalProperties, "pushUrl") delete(additionalProperties, "type") delete(additionalProperties, "username") o.AdditionalProperties = additionalProperties @@ -216,38 +189,38 @@ func (o *PatchLokiLogSink) UnmarshalJSON(data []byte) (err error) { return err } -type NullablePatchLokiLogSink struct { - value *PatchLokiLogSink +type NullableOtlpLogSinkBasicCredentials struct { + value *OtlpLogSinkBasicCredentials isSet bool } -func (v NullablePatchLokiLogSink) Get() *PatchLokiLogSink { +func (v NullableOtlpLogSinkBasicCredentials) Get() *OtlpLogSinkBasicCredentials { return v.value } -func (v *NullablePatchLokiLogSink) Set(val *PatchLokiLogSink) { +func (v *NullableOtlpLogSinkBasicCredentials) Set(val *OtlpLogSinkBasicCredentials) { v.value = val v.isSet = true } -func (v NullablePatchLokiLogSink) IsSet() bool { +func (v NullableOtlpLogSinkBasicCredentials) IsSet() bool { return v.isSet } -func (v *NullablePatchLokiLogSink) Unset() { +func (v *NullableOtlpLogSinkBasicCredentials) Unset() { v.value = nil v.isSet = false } -func NewNullablePatchLokiLogSink(val *PatchLokiLogSink) *NullablePatchLokiLogSink { - return &NullablePatchLokiLogSink{value: val, isSet: true} +func NewNullableOtlpLogSinkBasicCredentials(val *OtlpLogSinkBasicCredentials) *NullableOtlpLogSinkBasicCredentials { + return &NullableOtlpLogSinkBasicCredentials{value: val, isSet: true} } -func (v NullablePatchLokiLogSink) MarshalJSON() ([]byte, error) { +func (v NullableOtlpLogSinkBasicCredentials) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullablePatchLokiLogSink) UnmarshalJSON(src []byte) error { +func (v *NullableOtlpLogSinkBasicCredentials) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/cdn/v1api/model_otlp_log_sink_basic_credentials_type.go b/services/cdn/v1api/model_otlp_log_sink_basic_credentials_type.go new file mode 100644 index 000000000..f4cf8d9f5 --- /dev/null +++ b/services/cdn/v1api/model_otlp_log_sink_basic_credentials_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// OtlpLogSinkBasicCredentialsType Defines basic authentication. +type OtlpLogSinkBasicCredentialsType string + +// List of OtlpLogSinkBasicCredentials_type +const ( + OTLPLOGSINKBASICCREDENTIALSTYPE_BASIC OtlpLogSinkBasicCredentialsType = "basic" + OTLPLOGSINKBASICCREDENTIALSTYPE_UNKNOWN_DEFAULT_OPEN_API OtlpLogSinkBasicCredentialsType = "unknown_default_open_api" +) + +// All allowed values of OtlpLogSinkBasicCredentialsType enum +var AllowedOtlpLogSinkBasicCredentialsTypeEnumValues = []OtlpLogSinkBasicCredentialsType{ + "basic", + "unknown_default_open_api", +} + +func (v *OtlpLogSinkBasicCredentialsType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OtlpLogSinkBasicCredentialsType(value) + for _, existing := range AllowedOtlpLogSinkBasicCredentialsTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = OTLPLOGSINKBASICCREDENTIALSTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewOtlpLogSinkBasicCredentialsTypeFromValue returns a pointer to a valid OtlpLogSinkBasicCredentialsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOtlpLogSinkBasicCredentialsTypeFromValue(v string) (*OtlpLogSinkBasicCredentialsType, error) { + ev := OtlpLogSinkBasicCredentialsType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OtlpLogSinkBasicCredentialsType: valid values are %v", v, AllowedOtlpLogSinkBasicCredentialsTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OtlpLogSinkBasicCredentialsType) IsValid() bool { + for _, existing := range AllowedOtlpLogSinkBasicCredentialsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OtlpLogSinkBasicCredentials_type value +func (v OtlpLogSinkBasicCredentialsType) Ptr() *OtlpLogSinkBasicCredentialsType { + return &v +} + +type NullableOtlpLogSinkBasicCredentialsType struct { + value *OtlpLogSinkBasicCredentialsType + isSet bool +} + +func (v NullableOtlpLogSinkBasicCredentialsType) Get() *OtlpLogSinkBasicCredentialsType { + return v.value +} + +func (v *NullableOtlpLogSinkBasicCredentialsType) Set(val *OtlpLogSinkBasicCredentialsType) { + v.value = val + v.isSet = true +} + +func (v NullableOtlpLogSinkBasicCredentialsType) IsSet() bool { + return v.isSet +} + +func (v *NullableOtlpLogSinkBasicCredentialsType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOtlpLogSinkBasicCredentialsType(val *OtlpLogSinkBasicCredentialsType) *NullableOtlpLogSinkBasicCredentialsType { + return &NullableOtlpLogSinkBasicCredentialsType{value: val, isSet: true} +} + +func (v NullableOtlpLogSinkBasicCredentialsType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOtlpLogSinkBasicCredentialsType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_otlp_log_sink_bearer_credentials.go b/services/cdn/v1api/model_otlp_log_sink_bearer_credentials.go new file mode 100644 index 000000000..f4c294c7b --- /dev/null +++ b/services/cdn/v1api/model_otlp_log_sink_bearer_credentials.go @@ -0,0 +1,196 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OtlpLogSinkBearerCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OtlpLogSinkBearerCredentials{} + +// OtlpLogSinkBearerCredentials Bearer token authentication credentials for OTLP. +type OtlpLogSinkBearerCredentials struct { + // The bearer token used to authenticate against your OTLP endpoint. + Token string `json:"token"` + Type OtlpLogSinkBearerCredentialsType `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _OtlpLogSinkBearerCredentials OtlpLogSinkBearerCredentials + +// NewOtlpLogSinkBearerCredentials instantiates a new OtlpLogSinkBearerCredentials 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 NewOtlpLogSinkBearerCredentials(token string, types OtlpLogSinkBearerCredentialsType) *OtlpLogSinkBearerCredentials { + this := OtlpLogSinkBearerCredentials{} + this.Token = token + this.Type = types + return &this +} + +// NewOtlpLogSinkBearerCredentialsWithDefaults instantiates a new OtlpLogSinkBearerCredentials 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 NewOtlpLogSinkBearerCredentialsWithDefaults() *OtlpLogSinkBearerCredentials { + this := OtlpLogSinkBearerCredentials{} + return &this +} + +// GetToken returns the Token field value +func (o *OtlpLogSinkBearerCredentials) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *OtlpLogSinkBearerCredentials) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *OtlpLogSinkBearerCredentials) SetToken(v string) { + o.Token = v +} + +// GetType returns the Type field value +func (o *OtlpLogSinkBearerCredentials) GetType() OtlpLogSinkBearerCredentialsType { + if o == nil { + var ret OtlpLogSinkBearerCredentialsType + 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 *OtlpLogSinkBearerCredentials) GetTypeOk() (*OtlpLogSinkBearerCredentialsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *OtlpLogSinkBearerCredentials) SetType(v OtlpLogSinkBearerCredentialsType) { + o.Type = v +} + +func (o OtlpLogSinkBearerCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OtlpLogSinkBearerCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["token"] = o.Token + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OtlpLogSinkBearerCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "token", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOtlpLogSinkBearerCredentials := _OtlpLogSinkBearerCredentials{} + + err = json.Unmarshal(data, &varOtlpLogSinkBearerCredentials) + + if err != nil { + return err + } + + *o = OtlpLogSinkBearerCredentials(varOtlpLogSinkBearerCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "token") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOtlpLogSinkBearerCredentials struct { + value *OtlpLogSinkBearerCredentials + isSet bool +} + +func (v NullableOtlpLogSinkBearerCredentials) Get() *OtlpLogSinkBearerCredentials { + return v.value +} + +func (v *NullableOtlpLogSinkBearerCredentials) Set(val *OtlpLogSinkBearerCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableOtlpLogSinkBearerCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableOtlpLogSinkBearerCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOtlpLogSinkBearerCredentials(val *OtlpLogSinkBearerCredentials) *NullableOtlpLogSinkBearerCredentials { + return &NullableOtlpLogSinkBearerCredentials{value: val, isSet: true} +} + +func (v NullableOtlpLogSinkBearerCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOtlpLogSinkBearerCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_otlp_log_sink_bearer_credentials_type.go b/services/cdn/v1api/model_otlp_log_sink_bearer_credentials_type.go new file mode 100644 index 000000000..471285cf4 --- /dev/null +++ b/services/cdn/v1api/model_otlp_log_sink_bearer_credentials_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// OtlpLogSinkBearerCredentialsType Defines bearer token authentication. +type OtlpLogSinkBearerCredentialsType string + +// List of OtlpLogSinkBearerCredentials_type +const ( + OTLPLOGSINKBEARERCREDENTIALSTYPE_BEARER OtlpLogSinkBearerCredentialsType = "bearer" + OTLPLOGSINKBEARERCREDENTIALSTYPE_UNKNOWN_DEFAULT_OPEN_API OtlpLogSinkBearerCredentialsType = "unknown_default_open_api" +) + +// All allowed values of OtlpLogSinkBearerCredentialsType enum +var AllowedOtlpLogSinkBearerCredentialsTypeEnumValues = []OtlpLogSinkBearerCredentialsType{ + "bearer", + "unknown_default_open_api", +} + +func (v *OtlpLogSinkBearerCredentialsType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OtlpLogSinkBearerCredentialsType(value) + for _, existing := range AllowedOtlpLogSinkBearerCredentialsTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = OTLPLOGSINKBEARERCREDENTIALSTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewOtlpLogSinkBearerCredentialsTypeFromValue returns a pointer to a valid OtlpLogSinkBearerCredentialsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOtlpLogSinkBearerCredentialsTypeFromValue(v string) (*OtlpLogSinkBearerCredentialsType, error) { + ev := OtlpLogSinkBearerCredentialsType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OtlpLogSinkBearerCredentialsType: valid values are %v", v, AllowedOtlpLogSinkBearerCredentialsTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OtlpLogSinkBearerCredentialsType) IsValid() bool { + for _, existing := range AllowedOtlpLogSinkBearerCredentialsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OtlpLogSinkBearerCredentials_type value +func (v OtlpLogSinkBearerCredentialsType) Ptr() *OtlpLogSinkBearerCredentialsType { + return &v +} + +type NullableOtlpLogSinkBearerCredentialsType struct { + value *OtlpLogSinkBearerCredentialsType + isSet bool +} + +func (v NullableOtlpLogSinkBearerCredentialsType) Get() *OtlpLogSinkBearerCredentialsType { + return v.value +} + +func (v *NullableOtlpLogSinkBearerCredentialsType) Set(val *OtlpLogSinkBearerCredentialsType) { + v.value = val + v.isSet = true +} + +func (v NullableOtlpLogSinkBearerCredentialsType) IsSet() bool { + return v.isSet +} + +func (v *NullableOtlpLogSinkBearerCredentialsType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOtlpLogSinkBearerCredentialsType(val *OtlpLogSinkBearerCredentialsType) *NullableOtlpLogSinkBearerCredentialsType { + return &NullableOtlpLogSinkBearerCredentialsType{value: val, isSet: true} +} + +func (v NullableOtlpLogSinkBearerCredentialsType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOtlpLogSinkBearerCredentialsType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_loki_log_sink_create.go b/services/cdn/v1api/model_otlp_log_sink_create.go similarity index 56% rename from services/cdn/v1beta2api/model_loki_log_sink_create.go rename to services/cdn/v1api/model_otlp_log_sink_create.go index fbb85ad44..e1f9fa1eb 100644 --- a/services/cdn/v1beta2api/model_loki_log_sink_create.go +++ b/services/cdn/v1api/model_otlp_log_sink_create.go @@ -1,57 +1,58 @@ /* STACKIT CDN API -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. +API used to create and manage your CDN distributions. -API version: 1beta2.0.0 +API version: 1.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1beta2api +package v1api import ( "encoding/json" "fmt" ) -// checks if the LokiLogSinkCreate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &LokiLogSinkCreate{} +// checks if the OtlpLogSinkCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OtlpLogSinkCreate{} -// LokiLogSinkCreate struct for LokiLogSinkCreate -type LokiLogSinkCreate struct { - Credentials LokiLogSinkCredentials `json:"credentials"` - PushUrl string `json:"pushUrl"` - Type string `json:"type"` +// OtlpLogSinkCreate struct for OtlpLogSinkCreate +type OtlpLogSinkCreate struct { + Credentials OtlpLogSinkCreateCredentials `json:"credentials"` + // The fully qualified URL where the CDN should push logs to your OTLP endpoint (for example, `https://otlp.example.com/otlp/v1/logs`). + PushUrl string `json:"pushUrl"` + Type OtlpLogSinkCreateType `json:"type"` AdditionalProperties map[string]interface{} } -type _LokiLogSinkCreate LokiLogSinkCreate +type _OtlpLogSinkCreate OtlpLogSinkCreate -// NewLokiLogSinkCreate instantiates a new LokiLogSinkCreate object +// NewOtlpLogSinkCreate instantiates a new OtlpLogSinkCreate 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 NewLokiLogSinkCreate(credentials LokiLogSinkCredentials, pushUrl string, types string) *LokiLogSinkCreate { - this := LokiLogSinkCreate{} +func NewOtlpLogSinkCreate(credentials OtlpLogSinkCreateCredentials, pushUrl string, types OtlpLogSinkCreateType) *OtlpLogSinkCreate { + this := OtlpLogSinkCreate{} this.Credentials = credentials this.PushUrl = pushUrl this.Type = types return &this } -// NewLokiLogSinkCreateWithDefaults instantiates a new LokiLogSinkCreate object +// NewOtlpLogSinkCreateWithDefaults instantiates a new OtlpLogSinkCreate 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 NewLokiLogSinkCreateWithDefaults() *LokiLogSinkCreate { - this := LokiLogSinkCreate{} +func NewOtlpLogSinkCreateWithDefaults() *OtlpLogSinkCreate { + this := OtlpLogSinkCreate{} return &this } // GetCredentials returns the Credentials field value -func (o *LokiLogSinkCreate) GetCredentials() LokiLogSinkCredentials { +func (o *OtlpLogSinkCreate) GetCredentials() OtlpLogSinkCreateCredentials { if o == nil { - var ret LokiLogSinkCredentials + var ret OtlpLogSinkCreateCredentials return ret } @@ -60,7 +61,7 @@ func (o *LokiLogSinkCreate) GetCredentials() LokiLogSinkCredentials { // GetCredentialsOk returns a tuple with the Credentials field value // and a boolean to check if the value has been set. -func (o *LokiLogSinkCreate) GetCredentialsOk() (*LokiLogSinkCredentials, bool) { +func (o *OtlpLogSinkCreate) GetCredentialsOk() (*OtlpLogSinkCreateCredentials, bool) { if o == nil { return nil, false } @@ -68,12 +69,12 @@ func (o *LokiLogSinkCreate) GetCredentialsOk() (*LokiLogSinkCredentials, bool) { } // SetCredentials sets field value -func (o *LokiLogSinkCreate) SetCredentials(v LokiLogSinkCredentials) { +func (o *OtlpLogSinkCreate) SetCredentials(v OtlpLogSinkCreateCredentials) { o.Credentials = v } // GetPushUrl returns the PushUrl field value -func (o *LokiLogSinkCreate) GetPushUrl() string { +func (o *OtlpLogSinkCreate) GetPushUrl() string { if o == nil { var ret string return ret @@ -84,7 +85,7 @@ func (o *LokiLogSinkCreate) GetPushUrl() string { // GetPushUrlOk returns a tuple with the PushUrl field value // and a boolean to check if the value has been set. -func (o *LokiLogSinkCreate) GetPushUrlOk() (*string, bool) { +func (o *OtlpLogSinkCreate) GetPushUrlOk() (*string, bool) { if o == nil { return nil, false } @@ -92,14 +93,14 @@ func (o *LokiLogSinkCreate) GetPushUrlOk() (*string, bool) { } // SetPushUrl sets field value -func (o *LokiLogSinkCreate) SetPushUrl(v string) { +func (o *OtlpLogSinkCreate) SetPushUrl(v string) { o.PushUrl = v } // GetType returns the Type field value -func (o *LokiLogSinkCreate) GetType() string { +func (o *OtlpLogSinkCreate) GetType() OtlpLogSinkCreateType { if o == nil { - var ret string + var ret OtlpLogSinkCreateType return ret } @@ -108,7 +109,7 @@ func (o *LokiLogSinkCreate) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *LokiLogSinkCreate) GetTypeOk() (*string, bool) { +func (o *OtlpLogSinkCreate) GetTypeOk() (*OtlpLogSinkCreateType, bool) { if o == nil { return nil, false } @@ -116,11 +117,11 @@ func (o *LokiLogSinkCreate) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *LokiLogSinkCreate) SetType(v string) { +func (o *OtlpLogSinkCreate) SetType(v OtlpLogSinkCreateType) { o.Type = v } -func (o LokiLogSinkCreate) MarshalJSON() ([]byte, error) { +func (o OtlpLogSinkCreate) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -128,7 +129,7 @@ func (o LokiLogSinkCreate) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o LokiLogSinkCreate) ToMap() (map[string]interface{}, error) { +func (o OtlpLogSinkCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["credentials"] = o.Credentials toSerialize["pushUrl"] = o.PushUrl @@ -141,7 +142,7 @@ func (o LokiLogSinkCreate) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *LokiLogSinkCreate) UnmarshalJSON(data []byte) (err error) { +func (o *OtlpLogSinkCreate) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. @@ -165,15 +166,15 @@ func (o *LokiLogSinkCreate) UnmarshalJSON(data []byte) (err error) { } } - varLokiLogSinkCreate := _LokiLogSinkCreate{} + varOtlpLogSinkCreate := _OtlpLogSinkCreate{} - err = json.Unmarshal(data, &varLokiLogSinkCreate) + err = json.Unmarshal(data, &varOtlpLogSinkCreate) if err != nil { return err } - *o = LokiLogSinkCreate(varLokiLogSinkCreate) + *o = OtlpLogSinkCreate(varOtlpLogSinkCreate) additionalProperties := make(map[string]interface{}) @@ -187,38 +188,38 @@ func (o *LokiLogSinkCreate) UnmarshalJSON(data []byte) (err error) { return err } -type NullableLokiLogSinkCreate struct { - value *LokiLogSinkCreate +type NullableOtlpLogSinkCreate struct { + value *OtlpLogSinkCreate isSet bool } -func (v NullableLokiLogSinkCreate) Get() *LokiLogSinkCreate { +func (v NullableOtlpLogSinkCreate) Get() *OtlpLogSinkCreate { return v.value } -func (v *NullableLokiLogSinkCreate) Set(val *LokiLogSinkCreate) { +func (v *NullableOtlpLogSinkCreate) Set(val *OtlpLogSinkCreate) { v.value = val v.isSet = true } -func (v NullableLokiLogSinkCreate) IsSet() bool { +func (v NullableOtlpLogSinkCreate) IsSet() bool { return v.isSet } -func (v *NullableLokiLogSinkCreate) Unset() { +func (v *NullableOtlpLogSinkCreate) Unset() { v.value = nil v.isSet = false } -func NewNullableLokiLogSinkCreate(val *LokiLogSinkCreate) *NullableLokiLogSinkCreate { - return &NullableLokiLogSinkCreate{value: val, isSet: true} +func NewNullableOtlpLogSinkCreate(val *OtlpLogSinkCreate) *NullableOtlpLogSinkCreate { + return &NullableOtlpLogSinkCreate{value: val, isSet: true} } -func (v NullableLokiLogSinkCreate) MarshalJSON() ([]byte, error) { +func (v NullableOtlpLogSinkCreate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableLokiLogSinkCreate) UnmarshalJSON(src []byte) error { +func (v *NullableOtlpLogSinkCreate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/cdn/v1api/model_otlp_log_sink_create_credentials.go b/services/cdn/v1api/model_otlp_log_sink_create_credentials.go new file mode 100644 index 000000000..26a0f3212 --- /dev/null +++ b/services/cdn/v1api/model_otlp_log_sink_create_credentials.go @@ -0,0 +1,153 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// OtlpLogSinkCreateCredentials - The authentication credentials required for the CDN to push logs to your OTLP endpoint. +type OtlpLogSinkCreateCredentials struct { + OtlpLogSinkBasicCredentials *OtlpLogSinkBasicCredentials + OtlpLogSinkBearerCredentials *OtlpLogSinkBearerCredentials +} + +// OtlpLogSinkBasicCredentialsAsOtlpLogSinkCreateCredentials is a convenience function that returns OtlpLogSinkBasicCredentials wrapped in OtlpLogSinkCreateCredentials +func OtlpLogSinkBasicCredentialsAsOtlpLogSinkCreateCredentials(v *OtlpLogSinkBasicCredentials) OtlpLogSinkCreateCredentials { + return OtlpLogSinkCreateCredentials{ + OtlpLogSinkBasicCredentials: v, + } +} + +// OtlpLogSinkBearerCredentialsAsOtlpLogSinkCreateCredentials is a convenience function that returns OtlpLogSinkBearerCredentials wrapped in OtlpLogSinkCreateCredentials +func OtlpLogSinkBearerCredentialsAsOtlpLogSinkCreateCredentials(v *OtlpLogSinkBearerCredentials) OtlpLogSinkCreateCredentials { + return OtlpLogSinkCreateCredentials{ + OtlpLogSinkBearerCredentials: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *OtlpLogSinkCreateCredentials) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'basic' + if jsonDict["type"] == "basic" { + // try to unmarshal JSON data into OtlpLogSinkBasicCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBasicCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBasicCredentials, return on the first match + } else { + dst.OtlpLogSinkBasicCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkCreateCredentials as OtlpLogSinkBasicCredentials: %s", err.Error()) + } + } + + // check if the discriminator value is 'bearer' + if jsonDict["type"] == "bearer" { + // try to unmarshal JSON data into OtlpLogSinkBearerCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBearerCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBearerCredentials, return on the first match + } else { + dst.OtlpLogSinkBearerCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkCreateCredentials as OtlpLogSinkBearerCredentials: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src OtlpLogSinkCreateCredentials) MarshalJSON() ([]byte, error) { + if src.OtlpLogSinkBasicCredentials != nil { + return json.Marshal(&src.OtlpLogSinkBasicCredentials) + } + + if src.OtlpLogSinkBearerCredentials != nil { + return json.Marshal(&src.OtlpLogSinkBearerCredentials) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *OtlpLogSinkCreateCredentials) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.OtlpLogSinkBasicCredentials != nil { + return obj.OtlpLogSinkBasicCredentials + } + + if obj.OtlpLogSinkBearerCredentials != nil { + return obj.OtlpLogSinkBearerCredentials + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj OtlpLogSinkCreateCredentials) GetActualInstanceValue() interface{} { + if obj.OtlpLogSinkBasicCredentials != nil { + return *obj.OtlpLogSinkBasicCredentials + } + + if obj.OtlpLogSinkBearerCredentials != nil { + return *obj.OtlpLogSinkBearerCredentials + } + + // all schemas are nil + return nil +} + +type NullableOtlpLogSinkCreateCredentials struct { + value *OtlpLogSinkCreateCredentials + isSet bool +} + +func (v NullableOtlpLogSinkCreateCredentials) Get() *OtlpLogSinkCreateCredentials { + return v.value +} + +func (v *NullableOtlpLogSinkCreateCredentials) Set(val *OtlpLogSinkCreateCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableOtlpLogSinkCreateCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableOtlpLogSinkCreateCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOtlpLogSinkCreateCredentials(val *OtlpLogSinkCreateCredentials) *NullableOtlpLogSinkCreateCredentials { + return &NullableOtlpLogSinkCreateCredentials{value: val, isSet: true} +} + +func (v NullableOtlpLogSinkCreateCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOtlpLogSinkCreateCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_otlp_log_sink_create_type.go b/services/cdn/v1api/model_otlp_log_sink_create_type.go new file mode 100644 index 000000000..12999df79 --- /dev/null +++ b/services/cdn/v1api/model_otlp_log_sink_create_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// OtlpLogSinkCreateType Defines the type of the log sink. +type OtlpLogSinkCreateType string + +// List of OtlpLogSinkCreate_type +const ( + OTLPLOGSINKCREATETYPE_OTLP OtlpLogSinkCreateType = "otlp" + OTLPLOGSINKCREATETYPE_UNKNOWN_DEFAULT_OPEN_API OtlpLogSinkCreateType = "unknown_default_open_api" +) + +// All allowed values of OtlpLogSinkCreateType enum +var AllowedOtlpLogSinkCreateTypeEnumValues = []OtlpLogSinkCreateType{ + "otlp", + "unknown_default_open_api", +} + +func (v *OtlpLogSinkCreateType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OtlpLogSinkCreateType(value) + for _, existing := range AllowedOtlpLogSinkCreateTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = OTLPLOGSINKCREATETYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewOtlpLogSinkCreateTypeFromValue returns a pointer to a valid OtlpLogSinkCreateType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOtlpLogSinkCreateTypeFromValue(v string) (*OtlpLogSinkCreateType, error) { + ev := OtlpLogSinkCreateType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OtlpLogSinkCreateType: valid values are %v", v, AllowedOtlpLogSinkCreateTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OtlpLogSinkCreateType) IsValid() bool { + for _, existing := range AllowedOtlpLogSinkCreateTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OtlpLogSinkCreate_type value +func (v OtlpLogSinkCreateType) Ptr() *OtlpLogSinkCreateType { + return &v +} + +type NullableOtlpLogSinkCreateType struct { + value *OtlpLogSinkCreateType + isSet bool +} + +func (v NullableOtlpLogSinkCreateType) Get() *OtlpLogSinkCreateType { + return v.value +} + +func (v *NullableOtlpLogSinkCreateType) Set(val *OtlpLogSinkCreateType) { + v.value = val + v.isSet = true +} + +func (v NullableOtlpLogSinkCreateType) IsSet() bool { + return v.isSet +} + +func (v *NullableOtlpLogSinkCreateType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOtlpLogSinkCreateType(val *OtlpLogSinkCreateType) *NullableOtlpLogSinkCreateType { + return &NullableOtlpLogSinkCreateType{value: val, isSet: true} +} + +func (v NullableOtlpLogSinkCreateType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOtlpLogSinkCreateType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_loki_log_sink_patch.go b/services/cdn/v1api/model_otlp_log_sink_patch.go similarity index 58% rename from services/cdn/v1beta2api/model_loki_log_sink_patch.go rename to services/cdn/v1api/model_otlp_log_sink_patch.go index b60f5e140..3f72fedbc 100644 --- a/services/cdn/v1beta2api/model_loki_log_sink_patch.go +++ b/services/cdn/v1api/model_otlp_log_sink_patch.go @@ -1,55 +1,56 @@ /* STACKIT CDN API -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. +API used to create and manage your CDN distributions. -API version: 1beta2.0.0 +API version: 1.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1beta2api +package v1api import ( "encoding/json" "fmt" ) -// checks if the LokiLogSinkPatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &LokiLogSinkPatch{} +// checks if the OtlpLogSinkPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OtlpLogSinkPatch{} -// LokiLogSinkPatch struct for LokiLogSinkPatch -type LokiLogSinkPatch struct { - Credentials *LokiLogSinkCredentials `json:"credentials,omitempty"` - PushUrl *string `json:"pushUrl,omitempty"` - Type string `json:"type"` +// OtlpLogSinkPatch struct for OtlpLogSinkPatch +type OtlpLogSinkPatch struct { + Credentials *OtlpLogSinkPatchCredentials `json:"credentials,omitempty"` + // The fully qualified URL where the CDN should push logs to your OTLP endpoint (for example, `https://otlp.example.com/otlp/v1/logs`). + PushUrl *string `json:"pushUrl,omitempty"` + Type OtlpLogSinkPatchType `json:"type"` AdditionalProperties map[string]interface{} } -type _LokiLogSinkPatch LokiLogSinkPatch +type _OtlpLogSinkPatch OtlpLogSinkPatch -// NewLokiLogSinkPatch instantiates a new LokiLogSinkPatch object +// NewOtlpLogSinkPatch instantiates a new OtlpLogSinkPatch 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 NewLokiLogSinkPatch(types string) *LokiLogSinkPatch { - this := LokiLogSinkPatch{} +func NewOtlpLogSinkPatch(types OtlpLogSinkPatchType) *OtlpLogSinkPatch { + this := OtlpLogSinkPatch{} this.Type = types return &this } -// NewLokiLogSinkPatchWithDefaults instantiates a new LokiLogSinkPatch object +// NewOtlpLogSinkPatchWithDefaults instantiates a new OtlpLogSinkPatch 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 NewLokiLogSinkPatchWithDefaults() *LokiLogSinkPatch { - this := LokiLogSinkPatch{} +func NewOtlpLogSinkPatchWithDefaults() *OtlpLogSinkPatch { + this := OtlpLogSinkPatch{} return &this } // GetCredentials returns the Credentials field value if set, zero value otherwise. -func (o *LokiLogSinkPatch) GetCredentials() LokiLogSinkCredentials { +func (o *OtlpLogSinkPatch) GetCredentials() OtlpLogSinkPatchCredentials { if o == nil || IsNil(o.Credentials) { - var ret LokiLogSinkCredentials + var ret OtlpLogSinkPatchCredentials return ret } return *o.Credentials @@ -57,7 +58,7 @@ func (o *LokiLogSinkPatch) GetCredentials() LokiLogSinkCredentials { // GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LokiLogSinkPatch) GetCredentialsOk() (*LokiLogSinkCredentials, bool) { +func (o *OtlpLogSinkPatch) GetCredentialsOk() (*OtlpLogSinkPatchCredentials, bool) { if o == nil || IsNil(o.Credentials) { return nil, false } @@ -65,7 +66,7 @@ func (o *LokiLogSinkPatch) GetCredentialsOk() (*LokiLogSinkCredentials, bool) { } // HasCredentials returns a boolean if a field has been set. -func (o *LokiLogSinkPatch) HasCredentials() bool { +func (o *OtlpLogSinkPatch) HasCredentials() bool { if o != nil && !IsNil(o.Credentials) { return true } @@ -73,13 +74,13 @@ func (o *LokiLogSinkPatch) HasCredentials() bool { return false } -// SetCredentials gets a reference to the given LokiLogSinkCredentials and assigns it to the Credentials field. -func (o *LokiLogSinkPatch) SetCredentials(v LokiLogSinkCredentials) { +// SetCredentials gets a reference to the given OtlpLogSinkPatchCredentials and assigns it to the Credentials field. +func (o *OtlpLogSinkPatch) SetCredentials(v OtlpLogSinkPatchCredentials) { o.Credentials = &v } // GetPushUrl returns the PushUrl field value if set, zero value otherwise. -func (o *LokiLogSinkPatch) GetPushUrl() string { +func (o *OtlpLogSinkPatch) GetPushUrl() string { if o == nil || IsNil(o.PushUrl) { var ret string return ret @@ -89,7 +90,7 @@ func (o *LokiLogSinkPatch) GetPushUrl() string { // GetPushUrlOk returns a tuple with the PushUrl field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LokiLogSinkPatch) GetPushUrlOk() (*string, bool) { +func (o *OtlpLogSinkPatch) GetPushUrlOk() (*string, bool) { if o == nil || IsNil(o.PushUrl) { return nil, false } @@ -97,7 +98,7 @@ func (o *LokiLogSinkPatch) GetPushUrlOk() (*string, bool) { } // HasPushUrl returns a boolean if a field has been set. -func (o *LokiLogSinkPatch) HasPushUrl() bool { +func (o *OtlpLogSinkPatch) HasPushUrl() bool { if o != nil && !IsNil(o.PushUrl) { return true } @@ -106,14 +107,14 @@ func (o *LokiLogSinkPatch) HasPushUrl() bool { } // SetPushUrl gets a reference to the given string and assigns it to the PushUrl field. -func (o *LokiLogSinkPatch) SetPushUrl(v string) { +func (o *OtlpLogSinkPatch) SetPushUrl(v string) { o.PushUrl = &v } // GetType returns the Type field value -func (o *LokiLogSinkPatch) GetType() string { +func (o *OtlpLogSinkPatch) GetType() OtlpLogSinkPatchType { if o == nil { - var ret string + var ret OtlpLogSinkPatchType return ret } @@ -122,7 +123,7 @@ func (o *LokiLogSinkPatch) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *LokiLogSinkPatch) GetTypeOk() (*string, bool) { +func (o *OtlpLogSinkPatch) GetTypeOk() (*OtlpLogSinkPatchType, bool) { if o == nil { return nil, false } @@ -130,11 +131,11 @@ func (o *LokiLogSinkPatch) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *LokiLogSinkPatch) SetType(v string) { +func (o *OtlpLogSinkPatch) SetType(v OtlpLogSinkPatchType) { o.Type = v } -func (o LokiLogSinkPatch) MarshalJSON() ([]byte, error) { +func (o OtlpLogSinkPatch) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -142,7 +143,7 @@ func (o LokiLogSinkPatch) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o LokiLogSinkPatch) ToMap() (map[string]interface{}, error) { +func (o OtlpLogSinkPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.Credentials) { toSerialize["credentials"] = o.Credentials @@ -159,7 +160,7 @@ func (o LokiLogSinkPatch) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *LokiLogSinkPatch) UnmarshalJSON(data []byte) (err error) { +func (o *OtlpLogSinkPatch) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. @@ -181,15 +182,15 @@ func (o *LokiLogSinkPatch) UnmarshalJSON(data []byte) (err error) { } } - varLokiLogSinkPatch := _LokiLogSinkPatch{} + varOtlpLogSinkPatch := _OtlpLogSinkPatch{} - err = json.Unmarshal(data, &varLokiLogSinkPatch) + err = json.Unmarshal(data, &varOtlpLogSinkPatch) if err != nil { return err } - *o = LokiLogSinkPatch(varLokiLogSinkPatch) + *o = OtlpLogSinkPatch(varOtlpLogSinkPatch) additionalProperties := make(map[string]interface{}) @@ -203,38 +204,38 @@ func (o *LokiLogSinkPatch) UnmarshalJSON(data []byte) (err error) { return err } -type NullableLokiLogSinkPatch struct { - value *LokiLogSinkPatch +type NullableOtlpLogSinkPatch struct { + value *OtlpLogSinkPatch isSet bool } -func (v NullableLokiLogSinkPatch) Get() *LokiLogSinkPatch { +func (v NullableOtlpLogSinkPatch) Get() *OtlpLogSinkPatch { return v.value } -func (v *NullableLokiLogSinkPatch) Set(val *LokiLogSinkPatch) { +func (v *NullableOtlpLogSinkPatch) Set(val *OtlpLogSinkPatch) { v.value = val v.isSet = true } -func (v NullableLokiLogSinkPatch) IsSet() bool { +func (v NullableOtlpLogSinkPatch) IsSet() bool { return v.isSet } -func (v *NullableLokiLogSinkPatch) Unset() { +func (v *NullableOtlpLogSinkPatch) Unset() { v.value = nil v.isSet = false } -func NewNullableLokiLogSinkPatch(val *LokiLogSinkPatch) *NullableLokiLogSinkPatch { - return &NullableLokiLogSinkPatch{value: val, isSet: true} +func NewNullableOtlpLogSinkPatch(val *OtlpLogSinkPatch) *NullableOtlpLogSinkPatch { + return &NullableOtlpLogSinkPatch{value: val, isSet: true} } -func (v NullableLokiLogSinkPatch) MarshalJSON() ([]byte, error) { +func (v NullableOtlpLogSinkPatch) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableLokiLogSinkPatch) UnmarshalJSON(src []byte) error { +func (v *NullableOtlpLogSinkPatch) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/cdn/v1api/model_otlp_log_sink_patch_credentials.go b/services/cdn/v1api/model_otlp_log_sink_patch_credentials.go new file mode 100644 index 000000000..fc79f08c9 --- /dev/null +++ b/services/cdn/v1api/model_otlp_log_sink_patch_credentials.go @@ -0,0 +1,153 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// OtlpLogSinkPatchCredentials - The authentication credentials required for the CDN to push logs to your OTLP endpoint. +type OtlpLogSinkPatchCredentials struct { + OtlpLogSinkBasicCredentials *OtlpLogSinkBasicCredentials + OtlpLogSinkBearerCredentials *OtlpLogSinkBearerCredentials +} + +// OtlpLogSinkBasicCredentialsAsOtlpLogSinkPatchCredentials is a convenience function that returns OtlpLogSinkBasicCredentials wrapped in OtlpLogSinkPatchCredentials +func OtlpLogSinkBasicCredentialsAsOtlpLogSinkPatchCredentials(v *OtlpLogSinkBasicCredentials) OtlpLogSinkPatchCredentials { + return OtlpLogSinkPatchCredentials{ + OtlpLogSinkBasicCredentials: v, + } +} + +// OtlpLogSinkBearerCredentialsAsOtlpLogSinkPatchCredentials is a convenience function that returns OtlpLogSinkBearerCredentials wrapped in OtlpLogSinkPatchCredentials +func OtlpLogSinkBearerCredentialsAsOtlpLogSinkPatchCredentials(v *OtlpLogSinkBearerCredentials) OtlpLogSinkPatchCredentials { + return OtlpLogSinkPatchCredentials{ + OtlpLogSinkBearerCredentials: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *OtlpLogSinkPatchCredentials) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'basic' + if jsonDict["type"] == "basic" { + // try to unmarshal JSON data into OtlpLogSinkBasicCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBasicCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBasicCredentials, return on the first match + } else { + dst.OtlpLogSinkBasicCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkPatchCredentials as OtlpLogSinkBasicCredentials: %s", err.Error()) + } + } + + // check if the discriminator value is 'bearer' + if jsonDict["type"] == "bearer" { + // try to unmarshal JSON data into OtlpLogSinkBearerCredentials + err = json.Unmarshal(data, &dst.OtlpLogSinkBearerCredentials) + if err == nil { + return nil // data stored in dst.OtlpLogSinkBearerCredentials, return on the first match + } else { + dst.OtlpLogSinkBearerCredentials = nil + return fmt.Errorf("failed to unmarshal OtlpLogSinkPatchCredentials as OtlpLogSinkBearerCredentials: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src OtlpLogSinkPatchCredentials) MarshalJSON() ([]byte, error) { + if src.OtlpLogSinkBasicCredentials != nil { + return json.Marshal(&src.OtlpLogSinkBasicCredentials) + } + + if src.OtlpLogSinkBearerCredentials != nil { + return json.Marshal(&src.OtlpLogSinkBearerCredentials) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *OtlpLogSinkPatchCredentials) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.OtlpLogSinkBasicCredentials != nil { + return obj.OtlpLogSinkBasicCredentials + } + + if obj.OtlpLogSinkBearerCredentials != nil { + return obj.OtlpLogSinkBearerCredentials + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj OtlpLogSinkPatchCredentials) GetActualInstanceValue() interface{} { + if obj.OtlpLogSinkBasicCredentials != nil { + return *obj.OtlpLogSinkBasicCredentials + } + + if obj.OtlpLogSinkBearerCredentials != nil { + return *obj.OtlpLogSinkBearerCredentials + } + + // all schemas are nil + return nil +} + +type NullableOtlpLogSinkPatchCredentials struct { + value *OtlpLogSinkPatchCredentials + isSet bool +} + +func (v NullableOtlpLogSinkPatchCredentials) Get() *OtlpLogSinkPatchCredentials { + return v.value +} + +func (v *NullableOtlpLogSinkPatchCredentials) Set(val *OtlpLogSinkPatchCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableOtlpLogSinkPatchCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableOtlpLogSinkPatchCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOtlpLogSinkPatchCredentials(val *OtlpLogSinkPatchCredentials) *NullableOtlpLogSinkPatchCredentials { + return &NullableOtlpLogSinkPatchCredentials{value: val, isSet: true} +} + +func (v NullableOtlpLogSinkPatchCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOtlpLogSinkPatchCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_otlp_log_sink_patch_type.go b/services/cdn/v1api/model_otlp_log_sink_patch_type.go new file mode 100644 index 000000000..01de8c57f --- /dev/null +++ b/services/cdn/v1api/model_otlp_log_sink_patch_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// OtlpLogSinkPatchType Defines the type of the log sink. +type OtlpLogSinkPatchType string + +// List of OtlpLogSinkPatch_type +const ( + OTLPLOGSINKPATCHTYPE_OTLP OtlpLogSinkPatchType = "otlp" + OTLPLOGSINKPATCHTYPE_UNKNOWN_DEFAULT_OPEN_API OtlpLogSinkPatchType = "unknown_default_open_api" +) + +// All allowed values of OtlpLogSinkPatchType enum +var AllowedOtlpLogSinkPatchTypeEnumValues = []OtlpLogSinkPatchType{ + "otlp", + "unknown_default_open_api", +} + +func (v *OtlpLogSinkPatchType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OtlpLogSinkPatchType(value) + for _, existing := range AllowedOtlpLogSinkPatchTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = OTLPLOGSINKPATCHTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewOtlpLogSinkPatchTypeFromValue returns a pointer to a valid OtlpLogSinkPatchType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOtlpLogSinkPatchTypeFromValue(v string) (*OtlpLogSinkPatchType, error) { + ev := OtlpLogSinkPatchType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OtlpLogSinkPatchType: valid values are %v", v, AllowedOtlpLogSinkPatchTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OtlpLogSinkPatchType) IsValid() bool { + for _, existing := range AllowedOtlpLogSinkPatchTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OtlpLogSinkPatch_type value +func (v OtlpLogSinkPatchType) Ptr() *OtlpLogSinkPatchType { + return &v +} + +type NullableOtlpLogSinkPatchType struct { + value *OtlpLogSinkPatchType + isSet bool +} + +func (v NullableOtlpLogSinkPatchType) Get() *OtlpLogSinkPatchType { + return v.value +} + +func (v *NullableOtlpLogSinkPatchType) Set(val *OtlpLogSinkPatchType) { + v.value = val + v.isSet = true +} + +func (v NullableOtlpLogSinkPatchType) IsSet() bool { + return v.isSet +} + +func (v *NullableOtlpLogSinkPatchType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOtlpLogSinkPatchType(val *OtlpLogSinkPatchType) *NullableOtlpLogSinkPatchType { + return &NullableOtlpLogSinkPatchType{value: val, isSet: true} +} + +func (v NullableOtlpLogSinkPatchType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOtlpLogSinkPatchType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_otlp_log_sink_type.go b/services/cdn/v1api/model_otlp_log_sink_type.go new file mode 100644 index 000000000..e6ad6f186 --- /dev/null +++ b/services/cdn/v1api/model_otlp_log_sink_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// OtlpLogSinkType Defines the type of the log sink. +type OtlpLogSinkType string + +// List of OtlpLogSink_type +const ( + OTLPLOGSINKTYPE_OTLP OtlpLogSinkType = "otlp" + OTLPLOGSINKTYPE_UNKNOWN_DEFAULT_OPEN_API OtlpLogSinkType = "unknown_default_open_api" +) + +// All allowed values of OtlpLogSinkType enum +var AllowedOtlpLogSinkTypeEnumValues = []OtlpLogSinkType{ + "otlp", + "unknown_default_open_api", +} + +func (v *OtlpLogSinkType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OtlpLogSinkType(value) + for _, existing := range AllowedOtlpLogSinkTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = OTLPLOGSINKTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewOtlpLogSinkTypeFromValue returns a pointer to a valid OtlpLogSinkType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOtlpLogSinkTypeFromValue(v string) (*OtlpLogSinkType, error) { + ev := OtlpLogSinkType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OtlpLogSinkType: valid values are %v", v, AllowedOtlpLogSinkTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OtlpLogSinkType) IsValid() bool { + for _, existing := range AllowedOtlpLogSinkTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OtlpLogSink_type value +func (v OtlpLogSinkType) Ptr() *OtlpLogSinkType { + return &v +} + +type NullableOtlpLogSinkType struct { + value *OtlpLogSinkType + isSet bool +} + +func (v NullableOtlpLogSinkType) Get() *OtlpLogSinkType { + return v.value +} + +func (v *NullableOtlpLogSinkType) Set(val *OtlpLogSinkType) { + v.value = val + v.isSet = true +} + +func (v NullableOtlpLogSinkType) IsSet() bool { + return v.isSet +} + +func (v *NullableOtlpLogSinkType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOtlpLogSinkType(val *OtlpLogSinkType) *NullableOtlpLogSinkType { + return &NullableOtlpLogSinkType{value: val, isSet: true} +} + +func (v NullableOtlpLogSinkType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOtlpLogSinkType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/api_default.go b/services/cdn/v1beta2api/api_default.go deleted file mode 100644 index 44ed04481..000000000 --- a/services/cdn/v1beta2api/api_default.go +++ /dev/null @@ -1,3191 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1beta2api - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" - "time" - - "github.com/stackitcloud/stackit-sdk-go/core/config" - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" -) - -type DefaultAPI interface { - - /* - CreateDistribution Create new distribution - - CreateDistribution will create a new CDN distribution - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @return ApiCreateDistributionRequest - - Deprecated - */ - CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest - - // CreateDistributionExecute executes the request - // @return CreateDistributionResponse - // Deprecated - CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) - - /* - DeleteCustomDomain Delete a custom domain - - Removes a custom domain - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @param domain - @return ApiDeleteCustomDomainRequest - - Deprecated - */ - DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest - - // DeleteCustomDomainExecute executes the request - // @return DeleteCustomDomainResponse - // Deprecated - DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) - - /* - DeleteDistribution Delete distribution - - DeleteDistribution accepts a project- and distribution-Id and will delete a distribution. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiDeleteDistributionRequest - - Deprecated - */ - DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest - - // DeleteDistributionExecute executes the request - // @return DeleteDistributionResponse - // Deprecated - DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) - - /* - FindCachePaths Return Paths that were purged - - This returns paths that are present in the cache purging history. - Only substrings of the provided input are returned. - The response is sorted in descending order by the most recent purge. - - So, assuming you have have the following purged for a distribution - - `/test/1` at `2025-01-01` - - `/test/2` at `2025-01-02` - - `/someOtherPath/1` at `2025-01-03` - - `/test/1` at `2025-01-04` - - `/test/3` at `2025-01-05`, - this would return the following paths, in the following order, assuming `/te` was the search parameter: - - `/test/3` - - `/test/1` - - `/test/2` - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiFindCachePathsRequest - - Deprecated - */ - FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest - - // FindCachePathsExecute executes the request - // @return FindCachePathsResponse - // Deprecated - FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) - - /* - GetCacheInfo Get Infos about the Caching State - - Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. - - If (and only if) you provide the path query parameter, the history will also contain granular cache purges. - The request will not fail if no data about a path is found. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiGetCacheInfoRequest - - Deprecated - */ - GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest - - // GetCacheInfoExecute executes the request - // @return GetCacheInfoResponse - // Deprecated - GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) - - /* - GetCustomDomain Retrieve a specific custom domain - - Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @param domain - @return ApiGetCustomDomainRequest - - Deprecated - */ - GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest - - // GetCustomDomainExecute executes the request - // @return GetCustomDomainResponse - // Deprecated - GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) - - /* - GetDistribution Get distribution by Id - - This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiGetDistributionRequest - - Deprecated - */ - GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest - - // GetDistributionExecute executes the request - // @return GetDistributionResponse - // Deprecated - GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) - - /* - GetLogs Retrieve distribution logs - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId Your CDN distribution Id - @return ApiGetLogsRequest - - Deprecated - */ - GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest - - // GetLogsExecute executes the request - // @return GetLogsResponse - // Deprecated - GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) - - /* - GetLogsSearchFilters Get relevant search filters for this distribution based on user input. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID. - @param distributionId Your CDN distribution ID. - @return ApiGetLogsSearchFiltersRequest - - Deprecated - */ - GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest - - // GetLogsSearchFiltersExecute executes the request - // @return GetLogsSearchFiltersResponse - // Deprecated - GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) - - /* - GetStatistics Retrieve the statistics of a distribution - - Returns the statistics of the distribution in the given - time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. - In case no statistics for a time interval exist, no record is returned. - The time range for which statistics should be returned can be configured using query parameters. - - Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. - - **Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. - - The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. - Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiGetStatisticsRequest - - Deprecated - */ - GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest - - // GetStatisticsExecute executes the request - // @return GetStatisticsResponse - // Deprecated - GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) - - /* - ListDistributions List all distributions belonging to a specific project - - ListDistributions returns a list of all CDN distributions associated with - a given project, ordered by their distribution Id. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @return ApiListDistributionsRequest - - Deprecated - */ - ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest - - // ListDistributionsExecute executes the request - // @return ListDistributionsResponse - // Deprecated - ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) - - /* - ListWafCollections List all WAF rule collections of the project - - Returns all WAF rule collections available to the project - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @return ApiListWafCollectionsRequest - - Deprecated - */ - ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest - - // ListWafCollectionsExecute executes the request - // @return ListWafCollectionsResponse - // Deprecated - ListWafCollectionsExecute(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) - - /* - PatchDistribution Update existing distribution - - Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiPatchDistributionRequest - - Deprecated - */ - PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest - - // PatchDistributionExecute executes the request - // @return PatchDistributionResponse - // Deprecated - PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) - - /* - PurgeCache Clear distribution cache - - Clear the cache for this distribution. - All content, regardless of its staleness, will get refetched from the host. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiPurgeCacheRequest - - Deprecated - */ - PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest - - // PurgeCacheExecute executes the request - // @return map[string]interface{} - // Deprecated - PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) - - /* - PutCustomDomain Create or update a custom domain - - Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @param domain - @return ApiPutCustomDomainRequest - - Deprecated - */ - PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest - - // PutCustomDomainExecute executes the request - // @return PutCustomDomainResponse - // Deprecated - PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) -} - -// DefaultAPIService DefaultAPI service -type DefaultAPIService service - -type ApiCreateDistributionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - createDistributionPayload *CreateDistributionPayload -} - -func (r ApiCreateDistributionRequest) CreateDistributionPayload(createDistributionPayload CreateDistributionPayload) ApiCreateDistributionRequest { - r.createDistributionPayload = &createDistributionPayload - return r -} - -func (r ApiCreateDistributionRequest) Execute() (*CreateDistributionResponse, error) { - return r.ApiService.CreateDistributionExecute(r) -} - -/* -CreateDistribution Create new distribution - -CreateDistribution will create a new CDN distribution - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @return ApiCreateDistributionRequest - -Deprecated -*/ -func (a *DefaultAPIService) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { - return ApiCreateDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Execute executes the request -// -// @return CreateDistributionResponse -// -// Deprecated -func (a *DefaultAPIService) CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *CreateDistributionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDistribution") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.createDistributionPayload == nil { - return localVarReturnValue, reportError("createDistributionPayload is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createDistributionPayload - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiDeleteCustomDomainRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - domain string - intentId *string -} - -func (r ApiDeleteCustomDomainRequest) IntentId(intentId string) ApiDeleteCustomDomainRequest { - r.intentId = &intentId - return r -} - -func (r ApiDeleteCustomDomainRequest) Execute() (*DeleteCustomDomainResponse, error) { - return r.ApiService.DeleteCustomDomainExecute(r) -} - -/* -DeleteCustomDomain Delete a custom domain - -# Removes a custom domain - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @param domain - @return ApiDeleteCustomDomainRequest - -Deprecated -*/ -func (a *DefaultAPIService) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest { - return ApiDeleteCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Execute executes the request -// -// @return DeleteCustomDomainResponse -// -// Deprecated -func (a *DefaultAPIService) DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DeleteCustomDomainResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCustomDomain") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.domain) > 72 { - return localVarReturnValue, reportError("domain must have less than 72 elements") - } - - if r.intentId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiDeleteDistributionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - intentId *string -} - -// While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped. -func (r ApiDeleteDistributionRequest) IntentId(intentId string) ApiDeleteDistributionRequest { - r.intentId = &intentId - return r -} - -func (r ApiDeleteDistributionRequest) Execute() (*DeleteDistributionResponse, error) { - return r.ApiService.DeleteDistributionExecute(r) -} - -/* -DeleteDistribution Delete distribution - -DeleteDistribution accepts a project- and distribution-Id and will delete a distribution. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiDeleteDistributionRequest - -Deprecated -*/ -func (a *DefaultAPIService) DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest { - return ApiDeleteDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return DeleteDistributionResponse -// -// Deprecated -func (a *DefaultAPIService) DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DeleteDistributionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDistribution") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.intentId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiFindCachePathsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - path *string -} - -// A substring of the search query. -func (r ApiFindCachePathsRequest) Path(path string) ApiFindCachePathsRequest { - r.path = &path - return r -} - -func (r ApiFindCachePathsRequest) Execute() (*FindCachePathsResponse, error) { - return r.ApiService.FindCachePathsExecute(r) -} - -/* -FindCachePaths Return Paths that were purged - -This returns paths that are present in the cache purging history. -Only substrings of the provided input are returned. -The response is sorted in descending order by the most recent purge. - -So, assuming you have have the following purged for a distribution -- `/test/1` at `2025-01-01` -- `/test/2` at `2025-01-02` -- `/someOtherPath/1` at `2025-01-03` -- `/test/1` at `2025-01-04` -- `/test/3` at `2025-01-05`, -this would return the following paths, in the following order, assuming `/te` was the search parameter: -- `/test/3` -- `/test/1` -- `/test/2` - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiFindCachePathsRequest - -Deprecated -*/ -func (a *DefaultAPIService) FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest { - return ApiFindCachePathsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return FindCachePathsResponse -// -// Deprecated -func (a *DefaultAPIService) FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *FindCachePathsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.FindCachePaths") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/cache/paths" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.path == nil { - return localVarReturnValue, reportError("path is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "path", r.path, "form", "") - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetCacheInfoRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - purgePath *string -} - -func (r ApiGetCacheInfoRequest) PurgePath(purgePath string) ApiGetCacheInfoRequest { - r.purgePath = &purgePath - return r -} - -func (r ApiGetCacheInfoRequest) Execute() (*GetCacheInfoResponse, error) { - return r.ApiService.GetCacheInfoExecute(r) -} - -/* -GetCacheInfo Get Infos about the Caching State - -Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. - -If (and only if) you provide the path query parameter, the history will also contain granular cache purges. -The request will not fail if no data about a path is found. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiGetCacheInfoRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest { - return ApiGetCacheInfoRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return GetCacheInfoResponse -// -// Deprecated -func (a *DefaultAPIService) GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetCacheInfoResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCacheInfo") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/cache" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.purgePath != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "purgePath", r.purgePath, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetCustomDomainRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - domain string -} - -func (r ApiGetCustomDomainRequest) Execute() (*GetCustomDomainResponse, error) { - return r.ApiService.GetCustomDomainExecute(r) -} - -/* -GetCustomDomain Retrieve a specific custom domain - -# Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @param domain - @return ApiGetCustomDomainRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest { - return ApiGetCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Execute executes the request -// -// @return GetCustomDomainResponse -// -// Deprecated -func (a *DefaultAPIService) GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetCustomDomainResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCustomDomain") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.domain) > 72 { - return localVarReturnValue, reportError("domain must have less than 72 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetDistributionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - withWafStatus *bool -} - -// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. -func (r ApiGetDistributionRequest) WithWafStatus(withWafStatus bool) ApiGetDistributionRequest { - r.withWafStatus = &withWafStatus - return r -} - -func (r ApiGetDistributionRequest) Execute() (*GetDistributionResponse, error) { - return r.ApiService.GetDistributionExecute(r) -} - -/* -GetDistribution Get distribution by Id - -This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiGetDistributionRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest { - return ApiGetDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return GetDistributionResponse -// -// Deprecated -func (a *DefaultAPIService) GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetDistributionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDistribution") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.withWafStatus != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", r.withWafStatus, "form", "") - } else { - var defaultValue bool = false - parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", defaultValue, "form", "") - r.withWafStatus = &defaultValue - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetLogsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - from *time.Time - to *time.Time - pageSize *int32 - pageIdentifier *string - sortBy *GetLogsSortByParameter - sortOrder *GetLogsSortOrderParameter - wafAction *WAFRuleAction - dataCenterRegion *string - requestCountryCode *string - statusCode *int32 - cacheHit *bool -} - -// the start of the time range for which logs should be returned -func (r ApiGetLogsRequest) From(from time.Time) ApiGetLogsRequest { - r.from = &from - return r -} - -// the end of the time range for which logs should be returned. If not specified, \"now\" is used. -func (r ApiGetLogsRequest) To(to time.Time) ApiGetLogsRequest { - r.to = &to - return r -} - -// Quantifies how many log entries should be returned on this page. Must be a natural number between 1 and 1000 (inclusive) -func (r ApiGetLogsRequest) PageSize(pageSize int32) ApiGetLogsRequest { - r.pageSize = &pageSize - return r -} - -// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. -func (r ApiGetLogsRequest) PageIdentifier(pageIdentifier string) ApiGetLogsRequest { - r.pageIdentifier = &pageIdentifier - return r -} - -// Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host` -func (r ApiGetLogsRequest) SortBy(sortBy GetLogsSortByParameter) ApiGetLogsRequest { - r.sortBy = &sortBy - return r -} - -func (r ApiGetLogsRequest) SortOrder(sortOrder GetLogsSortOrderParameter) ApiGetLogsRequest { - r.sortOrder = &sortOrder - return r -} - -// If this is set then only log entries with the chosen WAF rule action/outcome are returned. Specifically, if `ALLOWED` then all requests with no violation are returned. If `BLOCKED` then those where a WAF rule blocked a request and if `LOGGED` then only those requests where the WAF violation was only logged but the request not blocked -func (r ApiGetLogsRequest) WafAction(wafAction WAFRuleAction) ApiGetLogsRequest { - r.wafAction = &wafAction - return r -} - -// Filters by the CDN data center region that served the request. Can be combined with other filters -func (r ApiGetLogsRequest) DataCenterRegion(dataCenterRegion string) ApiGetLogsRequest { - r.dataCenterRegion = &dataCenterRegion - return r -} - -// Filters by the originating country of the user request. Can be combined with other filters -func (r ApiGetLogsRequest) RequestCountryCode(requestCountryCode string) ApiGetLogsRequest { - r.requestCountryCode = &requestCountryCode - return r -} - -// Filters by the HTTP status code returned to the client. Can be combined with other filters -func (r ApiGetLogsRequest) StatusCode(statusCode int32) ApiGetLogsRequest { - r.statusCode = &statusCode - return r -} - -// Filters based on whether the request was served from the CDN cache. Can be combined with other filters -func (r ApiGetLogsRequest) CacheHit(cacheHit bool) ApiGetLogsRequest { - r.cacheHit = &cacheHit - return r -} - -func (r ApiGetLogsRequest) Execute() (*GetLogsResponse, error) { - return r.ApiService.GetLogsExecute(r) -} - -/* -GetLogs Retrieve distribution logs - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId Your CDN distribution Id - @return ApiGetLogsRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { - return ApiGetLogsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return GetLogsResponse -// -// Deprecated -func (a *DefaultAPIService) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetLogsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetLogs") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/logs" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.from != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") - } - if r.to != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") - } - if r.pageSize != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") - } else { - var defaultValue int32 = 20 - parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", defaultValue, "form", "") - r.pageSize = &defaultValue - } - if r.pageIdentifier != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "form", "") - } - if r.sortBy != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") - } else { - var defaultValue GetLogsSortByParameter = "timestamp" - parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") - r.sortBy = &defaultValue - } - if r.sortOrder != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") - } - if r.wafAction != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "wafAction", r.wafAction, "form", "") - } - if r.dataCenterRegion != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "dataCenterRegion", r.dataCenterRegion, "form", "") - } - if r.requestCountryCode != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "requestCountryCode", r.requestCountryCode, "form", "") - } - if r.statusCode != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "statusCode", r.statusCode, "form", "") - } - if r.cacheHit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cacheHit", r.cacheHit, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetLogsSearchFiltersRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - filter *string -} - -// Optional search string. Will search the **values** for the text input. -func (r ApiGetLogsSearchFiltersRequest) Filter(filter string) ApiGetLogsSearchFiltersRequest { - r.filter = &filter - return r -} - -func (r ApiGetLogsSearchFiltersRequest) Execute() (*GetLogsSearchFiltersResponse, error) { - return r.ApiService.GetLogsSearchFiltersExecute(r) -} - -/* -GetLogsSearchFilters Get relevant search filters for this distribution based on user input. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID. - @param distributionId Your CDN distribution ID. - @return ApiGetLogsSearchFiltersRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest { - return ApiGetLogsSearchFiltersRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return GetLogsSearchFiltersResponse -// -// Deprecated -func (a *DefaultAPIService) GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetLogsSearchFiltersResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetLogsSearchFilters") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/logs/searchFilters" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.filter != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetStatisticsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - from *time.Time - to *time.Time - interval *GetStatisticsIntervalParameter -} - -// the start of the time range for which statistics should be returned -func (r ApiGetStatisticsRequest) From(from time.Time) ApiGetStatisticsRequest { - r.from = &from - return r -} - -// the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on. -func (r ApiGetStatisticsRequest) To(to time.Time) ApiGetStatisticsRequest { - r.to = &to - return r -} - -// Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z` -func (r ApiGetStatisticsRequest) Interval(interval GetStatisticsIntervalParameter) ApiGetStatisticsRequest { - r.interval = &interval - return r -} - -func (r ApiGetStatisticsRequest) Execute() (*GetStatisticsResponse, error) { - return r.ApiService.GetStatisticsExecute(r) -} - -/* -GetStatistics Retrieve the statistics of a distribution - -Returns the statistics of the distribution in the given -time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. -In case no statistics for a time interval exist, no record is returned. -The time range for which statistics should be returned can be configured using query parameters. - -Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. - -**Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. - -The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. -Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiGetStatisticsRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest { - return ApiGetStatisticsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return GetStatisticsResponse -// -// Deprecated -func (a *DefaultAPIService) GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetStatisticsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetStatistics") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/statistics" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.from == nil { - return localVarReturnValue, reportError("from is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") - if r.to != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") - } - if r.interval != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "interval", r.interval, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiListDistributionsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - pageSize *int32 - withWafStatus *bool - pageIdentifier *string - sortBy *ListDistributionsSortByParameter - sortOrder *ListDistributionsSortOrderParameter -} - -// Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) -func (r ApiListDistributionsRequest) PageSize(pageSize int32) ApiListDistributionsRequest { - r.pageSize = &pageSize - return r -} - -// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. -func (r ApiListDistributionsRequest) WithWafStatus(withWafStatus bool) ApiListDistributionsRequest { - r.withWafStatus = &withWafStatus - return r -} - -// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. -func (r ApiListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiListDistributionsRequest { - r.pageIdentifier = &pageIdentifier - return r -} - -// The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. -func (r ApiListDistributionsRequest) SortBy(sortBy ListDistributionsSortByParameter) ApiListDistributionsRequest { - r.sortBy = &sortBy - return r -} - -func (r ApiListDistributionsRequest) SortOrder(sortOrder ListDistributionsSortOrderParameter) ApiListDistributionsRequest { - r.sortOrder = &sortOrder - return r -} - -func (r ApiListDistributionsRequest) Execute() (*ListDistributionsResponse, error) { - return r.ApiService.ListDistributionsExecute(r) -} - -/* -ListDistributions List all distributions belonging to a specific project - -ListDistributions returns a list of all CDN distributions associated with -a given project, ordered by their distribution Id. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @return ApiListDistributionsRequest - -Deprecated -*/ -func (a *DefaultAPIService) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { - return ApiListDistributionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Execute executes the request -// -// @return ListDistributionsResponse -// -// Deprecated -func (a *DefaultAPIService) ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListDistributionsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDistributions") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.pageSize != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") - } else { - var defaultValue int32 = 20 - parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", defaultValue, "form", "") - r.pageSize = &defaultValue - } - if r.withWafStatus != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", r.withWafStatus, "form", "") - } else { - var defaultValue bool = false - parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", defaultValue, "form", "") - r.withWafStatus = &defaultValue - } - if r.pageIdentifier != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "form", "") - } - if r.sortBy != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") - } else { - var defaultValue ListDistributionsSortByParameter = "createdAt" - parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") - r.sortBy = &defaultValue - } - if r.sortOrder != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiListWafCollectionsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string -} - -func (r ApiListWafCollectionsRequest) Execute() (*ListWafCollectionsResponse, error) { - return r.ApiService.ListWafCollectionsExecute(r) -} - -/* -ListWafCollections List all WAF rule collections of the project - -Returns all WAF rule collections available to the project - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @return ApiListWafCollectionsRequest - -Deprecated -*/ -func (a *DefaultAPIService) ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest { - return ApiListWafCollectionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Execute executes the request -// -// @return ListWafCollectionsResponse -// -// Deprecated -func (a *DefaultAPIService) ListWafCollectionsExecute(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListWafCollectionsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListWafCollections") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/waf/collections" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiPatchDistributionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - patchDistributionPayload *PatchDistributionPayload -} - -func (r ApiPatchDistributionRequest) PatchDistributionPayload(patchDistributionPayload PatchDistributionPayload) ApiPatchDistributionRequest { - r.patchDistributionPayload = &patchDistributionPayload - return r -} - -func (r ApiPatchDistributionRequest) Execute() (*PatchDistributionResponse, error) { - return r.ApiService.PatchDistributionExecute(r) -} - -/* -PatchDistribution Update existing distribution - -Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiPatchDistributionRequest - -Deprecated -*/ -func (a *DefaultAPIService) PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest { - return ApiPatchDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return PatchDistributionResponse -// -// Deprecated -func (a *DefaultAPIService) PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PatchDistributionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PatchDistribution") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.patchDistributionPayload - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiPurgeCacheRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - purgeCachePayload *PurgeCachePayload -} - -func (r ApiPurgeCacheRequest) PurgeCachePayload(purgeCachePayload PurgeCachePayload) ApiPurgeCacheRequest { - r.purgeCachePayload = &purgeCachePayload - return r -} - -func (r ApiPurgeCacheRequest) Execute() (map[string]interface{}, error) { - return r.ApiService.PurgeCacheExecute(r) -} - -/* -PurgeCache Clear distribution cache - -Clear the cache for this distribution. -All content, regardless of its staleness, will get refetched from the host. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @return ApiPurgeCacheRequest - -Deprecated -*/ -func (a *DefaultAPIService) PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest { - return ApiPurgeCacheRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return map[string]interface{} -// -// Deprecated -func (a *DefaultAPIService) PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PurgeCache") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/cache/purge" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.purgeCachePayload - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiPutCustomDomainRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - domain string - putCustomDomainPayload *PutCustomDomainPayload -} - -func (r ApiPutCustomDomainRequest) PutCustomDomainPayload(putCustomDomainPayload PutCustomDomainPayload) ApiPutCustomDomainRequest { - r.putCustomDomainPayload = &putCustomDomainPayload - return r -} - -func (r ApiPutCustomDomainRequest) Execute() (*PutCustomDomainResponse, error) { - return r.ApiService.PutCustomDomainExecute(r) -} - -/* -PutCustomDomain Create or update a custom domain - -Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project Id - @param distributionId - @param domain - @return ApiPutCustomDomainRequest - -Deprecated -*/ -func (a *DefaultAPIService) PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest { - return ApiPutCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Execute executes the request -// -// @return PutCustomDomainResponse -// -// Deprecated -func (a *DefaultAPIService) PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PutCustomDomainResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PutCustomDomain") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.domain) > 72 { - return localVarReturnValue, reportError("domain must have less than 72 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.putCustomDomainPayload - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJsonResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} diff --git a/services/cdn/v1beta2api/api_default_mock.go b/services/cdn/v1beta2api/api_default_mock.go deleted file mode 100644 index aa4196336..000000000 --- a/services/cdn/v1beta2api/api_default_mock.go +++ /dev/null @@ -1,353 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "context" -) - -// assert the implementation matches the interface -var _ DefaultAPI = &DefaultAPIServiceMock{} - -// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. -// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. -type DefaultAPIServiceMock struct { - // Deprecated: CreateDistributionExecuteMock can be populated to implement the behavior of the CreateDistributionExecute function of this mock - CreateDistributionExecuteMock *func(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) - // Deprecated: DeleteCustomDomainExecuteMock can be populated to implement the behavior of the DeleteCustomDomainExecute function of this mock - DeleteCustomDomainExecuteMock *func(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) - // Deprecated: DeleteDistributionExecuteMock can be populated to implement the behavior of the DeleteDistributionExecute function of this mock - DeleteDistributionExecuteMock *func(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) - // Deprecated: FindCachePathsExecuteMock can be populated to implement the behavior of the FindCachePathsExecute function of this mock - FindCachePathsExecuteMock *func(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) - // Deprecated: GetCacheInfoExecuteMock can be populated to implement the behavior of the GetCacheInfoExecute function of this mock - GetCacheInfoExecuteMock *func(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) - // Deprecated: GetCustomDomainExecuteMock can be populated to implement the behavior of the GetCustomDomainExecute function of this mock - GetCustomDomainExecuteMock *func(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) - // Deprecated: GetDistributionExecuteMock can be populated to implement the behavior of the GetDistributionExecute function of this mock - GetDistributionExecuteMock *func(r ApiGetDistributionRequest) (*GetDistributionResponse, error) - // Deprecated: GetLogsExecuteMock can be populated to implement the behavior of the GetLogsExecute function of this mock - GetLogsExecuteMock *func(r ApiGetLogsRequest) (*GetLogsResponse, error) - // Deprecated: GetLogsSearchFiltersExecuteMock can be populated to implement the behavior of the GetLogsSearchFiltersExecute function of this mock - GetLogsSearchFiltersExecuteMock *func(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) - // Deprecated: GetStatisticsExecuteMock can be populated to implement the behavior of the GetStatisticsExecute function of this mock - GetStatisticsExecuteMock *func(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) - // Deprecated: ListDistributionsExecuteMock can be populated to implement the behavior of the ListDistributionsExecute function of this mock - ListDistributionsExecuteMock *func(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) - // Deprecated: ListWafCollectionsExecuteMock can be populated to implement the behavior of the ListWafCollectionsExecute function of this mock - ListWafCollectionsExecuteMock *func(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) - // Deprecated: PatchDistributionExecuteMock can be populated to implement the behavior of the PatchDistributionExecute function of this mock - PatchDistributionExecuteMock *func(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) - // Deprecated: PurgeCacheExecuteMock can be populated to implement the behavior of the PurgeCacheExecute function of this mock - PurgeCacheExecuteMock *func(r ApiPurgeCacheRequest) (map[string]interface{}, error) - // Deprecated: PutCustomDomainExecuteMock can be populated to implement the behavior of the PutCustomDomainExecute function of this mock - PutCustomDomainExecuteMock *func(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) -} - -// Deprecated -func (a DefaultAPIServiceMock) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { - return ApiCreateDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Deprecated: CreateDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateDistributionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) { - if a.CreateDistributionExecuteMock == nil { - var localVarReturnValue *CreateDistributionResponse - return localVarReturnValue, nil - } - - return (*a.CreateDistributionExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest { - return ApiDeleteCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Deprecated: DeleteCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) { - if a.DeleteCustomDomainExecuteMock == nil { - var localVarReturnValue *DeleteCustomDomainResponse - return localVarReturnValue, nil - } - - return (*a.DeleteCustomDomainExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest { - return ApiDeleteDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: DeleteDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteDistributionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) { - if a.DeleteDistributionExecuteMock == nil { - var localVarReturnValue *DeleteDistributionResponse - return localVarReturnValue, nil - } - - return (*a.DeleteDistributionExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest { - return ApiFindCachePathsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: FindCachePathsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the FindCachePathsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) { - if a.FindCachePathsExecuteMock == nil { - var localVarReturnValue *FindCachePathsResponse - return localVarReturnValue, nil - } - - return (*a.FindCachePathsExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest { - return ApiGetCacheInfoRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: GetCacheInfoExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCacheInfoExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) { - if a.GetCacheInfoExecuteMock == nil { - var localVarReturnValue *GetCacheInfoResponse - return localVarReturnValue, nil - } - - return (*a.GetCacheInfoExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest { - return ApiGetCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Deprecated: GetCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) { - if a.GetCustomDomainExecuteMock == nil { - var localVarReturnValue *GetCustomDomainResponse - return localVarReturnValue, nil - } - - return (*a.GetCustomDomainExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest { - return ApiGetDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: GetDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetDistributionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) { - if a.GetDistributionExecuteMock == nil { - var localVarReturnValue *GetDistributionResponse - return localVarReturnValue, nil - } - - return (*a.GetDistributionExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { - return ApiGetLogsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: GetLogsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetLogsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) { - if a.GetLogsExecuteMock == nil { - var localVarReturnValue *GetLogsResponse - return localVarReturnValue, nil - } - - return (*a.GetLogsExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest { - return ApiGetLogsSearchFiltersRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: GetLogsSearchFiltersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetLogsSearchFiltersExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) { - if a.GetLogsSearchFiltersExecuteMock == nil { - var localVarReturnValue *GetLogsSearchFiltersResponse - return localVarReturnValue, nil - } - - return (*a.GetLogsSearchFiltersExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest { - return ApiGetStatisticsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: GetStatisticsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetStatisticsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) { - if a.GetStatisticsExecuteMock == nil { - var localVarReturnValue *GetStatisticsResponse - return localVarReturnValue, nil - } - - return (*a.GetStatisticsExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { - return ApiListDistributionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Deprecated: ListDistributionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDistributionsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) { - if a.ListDistributionsExecuteMock == nil { - var localVarReturnValue *ListDistributionsResponse - return localVarReturnValue, nil - } - - return (*a.ListDistributionsExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest { - return ApiListWafCollectionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Deprecated: ListWafCollectionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListWafCollectionsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListWafCollectionsExecute(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) { - if a.ListWafCollectionsExecuteMock == nil { - var localVarReturnValue *ListWafCollectionsResponse - return localVarReturnValue, nil - } - - return (*a.ListWafCollectionsExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest { - return ApiPatchDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: PatchDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PatchDistributionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) { - if a.PatchDistributionExecuteMock == nil { - var localVarReturnValue *PatchDistributionResponse - return localVarReturnValue, nil - } - - return (*a.PatchDistributionExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest { - return ApiPurgeCacheRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: PurgeCacheExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PurgeCacheExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) { - if a.PurgeCacheExecuteMock == nil { - var localVarReturnValue map[string]interface{} - return localVarReturnValue, nil - } - - return (*a.PurgeCacheExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest { - return ApiPutCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Deprecated: PutCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PutCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) { - if a.PutCustomDomainExecuteMock == nil { - var localVarReturnValue *PutCustomDomainResponse - return localVarReturnValue, nil - } - - return (*a.PutCustomDomainExecuteMock)(r) -} diff --git a/services/cdn/v1beta2api/client.go b/services/cdn/v1beta2api/client.go deleted file mode 100644 index 81bd55374..000000000 --- a/services/cdn/v1beta2api/client.go +++ /dev/null @@ -1,667 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1beta2api - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "github.com/stackitcloud/stackit-sdk-go/core/auth" - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -var ( - JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) - XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) - queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) - queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") -) - -// APIClient manages communication with the STACKIT CDN API API v1beta2.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *config.Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - DefaultAPI DefaultAPI -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { - cfg := NewConfiguration() - - for _, option := range opts { - err := option(cfg) - if err != nil { - return nil, fmt.Errorf("configuring the client: %w", err) - } - } - - err := config.ConfigureRegion(cfg) - if err != nil { - return nil, fmt.Errorf("configuring region: %w", err) - } - - if cfg.HTTPClient == nil { - cfg.HTTPClient = &http.Client{} - } - - authRoundTripper, err := auth.SetupAuth(cfg) - if err != nil { - return nil, fmt.Errorf("setting up authentication: %w", err) - } - - roundTripper := authRoundTripper - if cfg.Middleware != nil { - roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) - } - - cfg.HTTPClient.Transport = roundTripper - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.DefaultAPI = (*DefaultAPIService)(&c.common) - - return c, nil -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insensitive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.EqualFold(a, needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -func parameterValueToString(obj interface{}, key string) string { - if reflect.TypeOf(obj).Kind() != reflect.Ptr { - if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { - return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) - } - - return fmt.Sprintf("%v", obj) - } - var param, ok = obj.(MappedNullable) - if !ok { - return "" - } - dataMap, err := param.ToMap() - if err != nil { - return "" - } - return fmt.Sprintf("%v", dataMap[key]) -} - -// parameterAddToHeaderOrQuery adds the provided object to the request header or url query -// supporting deep object syntax -func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { - var v = reflect.ValueOf(obj) - var value = "" - if v == reflect.ValueOf(nil) { - value = "null" - } else { - switch v.Kind() { - case reflect.Invalid: - value = "invalid" - - case reflect.Struct: - if t, ok := obj.(MappedNullable); ok { - dataMap, err := t.ToMap() - if err != nil { - return - } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) - return - } - if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) - return - } - value = v.Type().String() + " value" - case reflect.Slice: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - var lenIndValue = indValue.Len() - for i := 0; i < lenIndValue; i++ { - var arrayValue = indValue.Index(i) - var keyPrefixForCollectionType = keyPrefix - if style == "deepObject" { - keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" - } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) - } - return - - case reflect.Map: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - iter := indValue.MapRange() - for iter.Next() { - k, v := iter.Key(), iter.Value() - parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) - } - return - - case reflect.Interface: - fallthrough - case reflect.Ptr: - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) - return - - case reflect.Int, reflect.Int8, reflect.Int16, - reflect.Int32, reflect.Int64: - value = strconv.FormatInt(v.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, - reflect.Uint32, reflect.Uint64, reflect.Uintptr: - value = strconv.FormatUint(v.Uint(), 10) - case reflect.Float32, reflect.Float64: - value = strconv.FormatFloat(v.Float(), 'g', -1, 32) - case reflect.Bool: - value = strconv.FormatBool(v.Bool()) - case reflect.String: - value = v.String() - default: - value = v.Type().String() + " value" - } - } - - switch valuesMap := headerOrQueryParams.(type) { - case url.Values: - if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { - valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) - } else { - valuesMap.Add(keyPrefix, value) - } - break - case map[string]string: - valuesMap[keyPrefix] = value - break - } -} - -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, err -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfig() *config.Configuration { - return c.cfg -} - -type formFile struct { - fileBytes []byte - fileName string - formFileName string -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFiles []formFile) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - for _, formFile := range formFiles { - if len(formFile.fileBytes) > 0 && formFile.fileName != "" { - w.Boundary() - part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(formFile.fileBytes) - if err != nil { - return nil, err - } - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } - - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { - pieces := strings.Split(s, "=") - pieces[0] = queryDescape.Replace(pieces[0]) - return strings.Join(pieces, "=") - }) - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers[h] = []string{v} - } - localVarRequest.Header = headers - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - return localVarRequest, nil -} - -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if r, ok := v.(*io.Reader); ok { - *r = bytes.NewReader(b) - return nil - } - // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. - if p, ok := v.(*[]byte); ok { - *p = b - return nil - } - if f, ok := v.(*os.File); ok { - f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = f.Write(b) - if err != nil { - return - } - _, err = f.Seek(0, io.SeekStart) - return - } - if f, ok := v.(**os.File); ok { - *f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - if err != nil { - return - } - _, err = (*f).Seek(0, io.SeekStart) - return - } - if XmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if JsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err != nil { - return err - } - } else { - return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return errors.New("undefined response type") -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(filepath.Clean(path)) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if fp, ok := body.(*os.File); ok { - _, err = bodyBuf.ReadFrom(fp) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if JsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if XmlCheck.MatchString(contentType) { - var bs []byte - bs, err = xml.Marshal(body) - if err == nil { - bodyBuf.Write(bs) - } - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} - -// format error message using title and detail when model implements rfc7807 -func formatErrorMessage(status string, v interface{}) string { - str := "" - metaValue := reflect.ValueOf(v).Elem() - - if metaValue.Kind() == reflect.Struct { - field := metaValue.FieldByName("Title") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s", field.Interface()) - } - - field = metaValue.FieldByName("Detail") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s (%s)", str, field.Interface()) - } - } - - return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) -} diff --git a/services/cdn/v1beta2api/configuration.go b/services/cdn/v1beta2api/configuration.go deleted file mode 100644 index 47ac66e27..000000000 --- a/services/cdn/v1beta2api/configuration.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1beta2api - -import ( - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -// NewConfiguration returns a new Configuration object -func NewConfiguration() *config.Configuration { - cfg := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "stackit-sdk-go/cdn", - Debug: false, - Servers: config.ServerConfigurations{ - { - URL: "https://cdn.api.stackit.cloud", - Description: "No description provided", - Variables: map[string]config.ServerVariable{ - "region": { - Description: "No description provided", - DefaultValue: "global", - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - return cfg -} diff --git a/services/cdn/v1beta2api/model_bucket_backend.go b/services/cdn/v1beta2api/model_bucket_backend.go deleted file mode 100644 index daf081964..000000000 --- a/services/cdn/v1beta2api/model_bucket_backend.go +++ /dev/null @@ -1,224 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the BucketBackend type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BucketBackend{} - -// BucketBackend struct for BucketBackend -type BucketBackend struct { - BucketUrl string `json:"bucketUrl"` - Region string `json:"region"` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _BucketBackend BucketBackend - -// NewBucketBackend instantiates a new BucketBackend 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 NewBucketBackend(bucketUrl string, region string, types string) *BucketBackend { - this := BucketBackend{} - this.BucketUrl = bucketUrl - this.Region = region - this.Type = types - return &this -} - -// NewBucketBackendWithDefaults instantiates a new BucketBackend 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 NewBucketBackendWithDefaults() *BucketBackend { - this := BucketBackend{} - return &this -} - -// GetBucketUrl returns the BucketUrl field value -func (o *BucketBackend) GetBucketUrl() string { - if o == nil { - var ret string - return ret - } - - return o.BucketUrl -} - -// GetBucketUrlOk returns a tuple with the BucketUrl field value -// and a boolean to check if the value has been set. -func (o *BucketBackend) GetBucketUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BucketUrl, true -} - -// SetBucketUrl sets field value -func (o *BucketBackend) SetBucketUrl(v string) { - o.BucketUrl = v -} - -// GetRegion returns the Region field value -func (o *BucketBackend) 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 *BucketBackend) GetRegionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Region, true -} - -// SetRegion sets field value -func (o *BucketBackend) SetRegion(v string) { - o.Region = v -} - -// GetType returns the Type field value -func (o *BucketBackend) 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 *BucketBackend) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *BucketBackend) SetType(v string) { - o.Type = v -} - -func (o BucketBackend) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BucketBackend) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["bucketUrl"] = o.BucketUrl - toSerialize["region"] = o.Region - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *BucketBackend) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "bucketUrl", - "region", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBucketBackend := _BucketBackend{} - - err = json.Unmarshal(data, &varBucketBackend) - - if err != nil { - return err - } - - *o = BucketBackend(varBucketBackend) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "bucketUrl") - delete(additionalProperties, "region") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableBucketBackend struct { - value *BucketBackend - isSet bool -} - -func (v NullableBucketBackend) Get() *BucketBackend { - return v.value -} - -func (v *NullableBucketBackend) Set(val *BucketBackend) { - v.value = val - v.isSet = true -} - -func (v NullableBucketBackend) IsSet() bool { - return v.isSet -} - -func (v *NullableBucketBackend) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBucketBackend(val *BucketBackend) *NullableBucketBackend { - return &NullableBucketBackend{value: val, isSet: true} -} - -func (v NullableBucketBackend) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBucketBackend) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_bucket_backend_create.go b/services/cdn/v1beta2api/model_bucket_backend_create.go deleted file mode 100644 index 2693cbe0f..000000000 --- a/services/cdn/v1beta2api/model_bucket_backend_create.go +++ /dev/null @@ -1,253 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the BucketBackendCreate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BucketBackendCreate{} - -// BucketBackendCreate struct for BucketBackendCreate -type BucketBackendCreate struct { - BucketUrl string `json:"bucketUrl"` - Credentials BucketCredentials `json:"credentials"` - Region string `json:"region"` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _BucketBackendCreate BucketBackendCreate - -// NewBucketBackendCreate instantiates a new BucketBackendCreate 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 NewBucketBackendCreate(bucketUrl string, credentials BucketCredentials, region string, types string) *BucketBackendCreate { - this := BucketBackendCreate{} - this.BucketUrl = bucketUrl - this.Credentials = credentials - this.Region = region - this.Type = types - return &this -} - -// NewBucketBackendCreateWithDefaults instantiates a new BucketBackendCreate 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 NewBucketBackendCreateWithDefaults() *BucketBackendCreate { - this := BucketBackendCreate{} - return &this -} - -// GetBucketUrl returns the BucketUrl field value -func (o *BucketBackendCreate) GetBucketUrl() string { - if o == nil { - var ret string - return ret - } - - return o.BucketUrl -} - -// GetBucketUrlOk returns a tuple with the BucketUrl field value -// and a boolean to check if the value has been set. -func (o *BucketBackendCreate) GetBucketUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BucketUrl, true -} - -// SetBucketUrl sets field value -func (o *BucketBackendCreate) SetBucketUrl(v string) { - o.BucketUrl = v -} - -// GetCredentials returns the Credentials field value -func (o *BucketBackendCreate) GetCredentials() BucketCredentials { - if o == nil { - var ret BucketCredentials - 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 *BucketBackendCreate) GetCredentialsOk() (*BucketCredentials, bool) { - if o == nil { - return nil, false - } - return &o.Credentials, true -} - -// SetCredentials sets field value -func (o *BucketBackendCreate) SetCredentials(v BucketCredentials) { - o.Credentials = v -} - -// GetRegion returns the Region field value -func (o *BucketBackendCreate) 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 *BucketBackendCreate) GetRegionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Region, true -} - -// SetRegion sets field value -func (o *BucketBackendCreate) SetRegion(v string) { - o.Region = v -} - -// GetType returns the Type field value -func (o *BucketBackendCreate) 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 *BucketBackendCreate) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *BucketBackendCreate) SetType(v string) { - o.Type = v -} - -func (o BucketBackendCreate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BucketBackendCreate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["bucketUrl"] = o.BucketUrl - toSerialize["credentials"] = o.Credentials - toSerialize["region"] = o.Region - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *BucketBackendCreate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "bucketUrl", - "credentials", - "region", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBucketBackendCreate := _BucketBackendCreate{} - - err = json.Unmarshal(data, &varBucketBackendCreate) - - if err != nil { - return err - } - - *o = BucketBackendCreate(varBucketBackendCreate) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "bucketUrl") - delete(additionalProperties, "credentials") - delete(additionalProperties, "region") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableBucketBackendCreate struct { - value *BucketBackendCreate - isSet bool -} - -func (v NullableBucketBackendCreate) Get() *BucketBackendCreate { - return v.value -} - -func (v *NullableBucketBackendCreate) Set(val *BucketBackendCreate) { - v.value = val - v.isSet = true -} - -func (v NullableBucketBackendCreate) IsSet() bool { - return v.isSet -} - -func (v *NullableBucketBackendCreate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBucketBackendCreate(val *BucketBackendCreate) *NullableBucketBackendCreate { - return &NullableBucketBackendCreate{value: val, isSet: true} -} - -func (v NullableBucketBackendCreate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBucketBackendCreate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_bucket_backend_patch.go b/services/cdn/v1beta2api/model_bucket_backend_patch.go deleted file mode 100644 index bbcd2310b..000000000 --- a/services/cdn/v1beta2api/model_bucket_backend_patch.go +++ /dev/null @@ -1,277 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the BucketBackendPatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BucketBackendPatch{} - -// BucketBackendPatch struct for BucketBackendPatch -type BucketBackendPatch struct { - BucketUrl *string `json:"bucketUrl,omitempty"` - Credentials *BucketCredentials `json:"credentials,omitempty"` - Region *string `json:"region,omitempty"` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _BucketBackendPatch BucketBackendPatch - -// NewBucketBackendPatch instantiates a new BucketBackendPatch 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 NewBucketBackendPatch(types string) *BucketBackendPatch { - this := BucketBackendPatch{} - this.Type = types - return &this -} - -// NewBucketBackendPatchWithDefaults instantiates a new BucketBackendPatch 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 NewBucketBackendPatchWithDefaults() *BucketBackendPatch { - this := BucketBackendPatch{} - return &this -} - -// GetBucketUrl returns the BucketUrl field value if set, zero value otherwise. -func (o *BucketBackendPatch) GetBucketUrl() string { - if o == nil || IsNil(o.BucketUrl) { - var ret string - return ret - } - return *o.BucketUrl -} - -// GetBucketUrlOk returns a tuple with the BucketUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BucketBackendPatch) GetBucketUrlOk() (*string, bool) { - if o == nil || IsNil(o.BucketUrl) { - return nil, false - } - return o.BucketUrl, true -} - -// HasBucketUrl returns a boolean if a field has been set. -func (o *BucketBackendPatch) HasBucketUrl() bool { - if o != nil && !IsNil(o.BucketUrl) { - return true - } - - return false -} - -// SetBucketUrl gets a reference to the given string and assigns it to the BucketUrl field. -func (o *BucketBackendPatch) SetBucketUrl(v string) { - o.BucketUrl = &v -} - -// GetCredentials returns the Credentials field value if set, zero value otherwise. -func (o *BucketBackendPatch) GetCredentials() BucketCredentials { - if o == nil || IsNil(o.Credentials) { - var ret BucketCredentials - return ret - } - return *o.Credentials -} - -// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BucketBackendPatch) GetCredentialsOk() (*BucketCredentials, bool) { - if o == nil || IsNil(o.Credentials) { - return nil, false - } - return o.Credentials, true -} - -// HasCredentials returns a boolean if a field has been set. -func (o *BucketBackendPatch) HasCredentials() bool { - if o != nil && !IsNil(o.Credentials) { - return true - } - - return false -} - -// SetCredentials gets a reference to the given BucketCredentials and assigns it to the Credentials field. -func (o *BucketBackendPatch) SetCredentials(v BucketCredentials) { - o.Credentials = &v -} - -// GetRegion returns the Region field value if set, zero value otherwise. -func (o *BucketBackendPatch) GetRegion() string { - if o == nil || IsNil(o.Region) { - var ret string - return ret - } - return *o.Region -} - -// GetRegionOk returns a tuple with the Region field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BucketBackendPatch) GetRegionOk() (*string, bool) { - if o == nil || IsNil(o.Region) { - return nil, false - } - return o.Region, true -} - -// HasRegion returns a boolean if a field has been set. -func (o *BucketBackendPatch) HasRegion() bool { - if o != nil && !IsNil(o.Region) { - return true - } - - return false -} - -// SetRegion gets a reference to the given string and assigns it to the Region field. -func (o *BucketBackendPatch) SetRegion(v string) { - o.Region = &v -} - -// GetType returns the Type field value -func (o *BucketBackendPatch) 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 *BucketBackendPatch) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *BucketBackendPatch) SetType(v string) { - o.Type = v -} - -func (o BucketBackendPatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BucketBackendPatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.BucketUrl) { - toSerialize["bucketUrl"] = o.BucketUrl - } - if !IsNil(o.Credentials) { - toSerialize["credentials"] = o.Credentials - } - if !IsNil(o.Region) { - toSerialize["region"] = o.Region - } - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *BucketBackendPatch) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBucketBackendPatch := _BucketBackendPatch{} - - err = json.Unmarshal(data, &varBucketBackendPatch) - - if err != nil { - return err - } - - *o = BucketBackendPatch(varBucketBackendPatch) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "bucketUrl") - delete(additionalProperties, "credentials") - delete(additionalProperties, "region") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableBucketBackendPatch struct { - value *BucketBackendPatch - isSet bool -} - -func (v NullableBucketBackendPatch) Get() *BucketBackendPatch { - return v.value -} - -func (v *NullableBucketBackendPatch) Set(val *BucketBackendPatch) { - v.value = val - v.isSet = true -} - -func (v NullableBucketBackendPatch) IsSet() bool { - return v.isSet -} - -func (v *NullableBucketBackendPatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBucketBackendPatch(val *BucketBackendPatch) *NullableBucketBackendPatch { - return &NullableBucketBackendPatch{value: val, isSet: true} -} - -func (v NullableBucketBackendPatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBucketBackendPatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_bucket_credentials.go b/services/cdn/v1beta2api/model_bucket_credentials.go deleted file mode 100644 index 9f50bda02..000000000 --- a/services/cdn/v1beta2api/model_bucket_credentials.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the BucketCredentials type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BucketCredentials{} - -// BucketCredentials struct for BucketCredentials -type BucketCredentials struct { - AccessKeyId string `json:"accessKeyId"` - SecretAccessKey string `json:"secretAccessKey"` - AdditionalProperties map[string]interface{} -} - -type _BucketCredentials BucketCredentials - -// NewBucketCredentials instantiates a new BucketCredentials 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 NewBucketCredentials(accessKeyId string, secretAccessKey string) *BucketCredentials { - this := BucketCredentials{} - this.AccessKeyId = accessKeyId - this.SecretAccessKey = secretAccessKey - return &this -} - -// NewBucketCredentialsWithDefaults instantiates a new BucketCredentials 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 NewBucketCredentialsWithDefaults() *BucketCredentials { - this := BucketCredentials{} - return &this -} - -// GetAccessKeyId returns the AccessKeyId field value -func (o *BucketCredentials) 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 *BucketCredentials) GetAccessKeyIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.AccessKeyId, true -} - -// SetAccessKeyId sets field value -func (o *BucketCredentials) SetAccessKeyId(v string) { - o.AccessKeyId = v -} - -// GetSecretAccessKey returns the SecretAccessKey field value -func (o *BucketCredentials) 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 *BucketCredentials) GetSecretAccessKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.SecretAccessKey, true -} - -// SetSecretAccessKey sets field value -func (o *BucketCredentials) SetSecretAccessKey(v string) { - o.SecretAccessKey = v -} - -func (o BucketCredentials) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BucketCredentials) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["accessKeyId"] = o.AccessKeyId - toSerialize["secretAccessKey"] = o.SecretAccessKey - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *BucketCredentials) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "accessKeyId", - "secretAccessKey", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varBucketCredentials := _BucketCredentials{} - - err = json.Unmarshal(data, &varBucketCredentials) - - if err != nil { - return err - } - - *o = BucketCredentials(varBucketCredentials) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "accessKeyId") - delete(additionalProperties, "secretAccessKey") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableBucketCredentials struct { - value *BucketCredentials - isSet bool -} - -func (v NullableBucketCredentials) Get() *BucketCredentials { - return v.value -} - -func (v *NullableBucketCredentials) Set(val *BucketCredentials) { - v.value = val - v.isSet = true -} - -func (v NullableBucketCredentials) IsSet() bool { - return v.isSet -} - -func (v *NullableBucketCredentials) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBucketCredentials(val *BucketCredentials) *NullableBucketCredentials { - return &NullableBucketCredentials{value: val, isSet: true} -} - -func (v NullableBucketCredentials) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBucketCredentials) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_config.go b/services/cdn/v1beta2api/model_config.go deleted file mode 100644 index 8b49abd1d..000000000 --- a/services/cdn/v1beta2api/model_config.go +++ /dev/null @@ -1,456 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the Config type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Config{} - -// Config struct for Config -type Config struct { - Backend ConfigBackend `json:"backend"` - // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g. DE, ES, GB). This setting blocks users from the specified countries. - BlockedCountries []string `json:"blockedCountries"` - // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIps []string `json:"blockedIps"` - // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) - DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` - LogSink *ConfigLogSink `json:"logSink,omitempty"` - // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. - MonthlyLimitBytes NullableInt64 `json:"monthlyLimitBytes,omitempty"` - Optimizer *Optimizer `json:"optimizer,omitempty"` - Regions []Region `json:"regions"` - Waf WafConfig `json:"waf"` - AdditionalProperties map[string]interface{} -} - -type _Config Config - -// NewConfig instantiates a new Config 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 NewConfig(backend ConfigBackend, blockedCountries []string, blockedIps []string, regions []Region, waf WafConfig) *Config { - this := Config{} - this.Backend = backend - this.BlockedCountries = blockedCountries - this.BlockedIps = blockedIps - this.Regions = regions - this.Waf = waf - return &this -} - -// NewConfigWithDefaults instantiates a new Config 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 NewConfigWithDefaults() *Config { - this := Config{} - return &this -} - -// GetBackend returns the Backend field value -func (o *Config) GetBackend() ConfigBackend { - if o == nil { - var ret ConfigBackend - return ret - } - - return o.Backend -} - -// GetBackendOk returns a tuple with the Backend field value -// and a boolean to check if the value has been set. -func (o *Config) GetBackendOk() (*ConfigBackend, bool) { - if o == nil { - return nil, false - } - return &o.Backend, true -} - -// SetBackend sets field value -func (o *Config) SetBackend(v ConfigBackend) { - o.Backend = v -} - -// GetBlockedCountries returns the BlockedCountries field value -func (o *Config) GetBlockedCountries() []string { - if o == nil { - var ret []string - return ret - } - - return o.BlockedCountries -} - -// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value -// and a boolean to check if the value has been set. -func (o *Config) GetBlockedCountriesOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.BlockedCountries, true -} - -// SetBlockedCountries sets field value -func (o *Config) SetBlockedCountries(v []string) { - o.BlockedCountries = v -} - -// GetBlockedIps returns the BlockedIps field value -func (o *Config) GetBlockedIps() []string { - if o == nil { - var ret []string - return ret - } - - return o.BlockedIps -} - -// GetBlockedIpsOk returns a tuple with the BlockedIps field value -// and a boolean to check if the value has been set. -func (o *Config) GetBlockedIpsOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.BlockedIps, true -} - -// SetBlockedIps sets field value -func (o *Config) SetBlockedIps(v []string) { - o.BlockedIps = v -} - -// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Config) GetDefaultCacheDuration() string { - if o == nil || IsNil(o.DefaultCacheDuration.Get()) { - var ret string - return ret - } - return *o.DefaultCacheDuration.Get() -} - -// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 *Config) GetDefaultCacheDurationOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DefaultCacheDuration.Get(), o.DefaultCacheDuration.IsSet() -} - -// HasDefaultCacheDuration returns a boolean if a field has been set. -func (o *Config) HasDefaultCacheDuration() bool { - if o != nil && o.DefaultCacheDuration.IsSet() { - return true - } - - return false -} - -// SetDefaultCacheDuration gets a reference to the given NullableString and assigns it to the DefaultCacheDuration field. -func (o *Config) SetDefaultCacheDuration(v string) { - o.DefaultCacheDuration.Set(&v) -} - -// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil -func (o *Config) SetDefaultCacheDurationNil() { - o.DefaultCacheDuration.Set(nil) -} - -// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil -func (o *Config) UnsetDefaultCacheDuration() { - o.DefaultCacheDuration.Unset() -} - -// GetLogSink returns the LogSink field value if set, zero value otherwise. -func (o *Config) GetLogSink() ConfigLogSink { - if o == nil || IsNil(o.LogSink) { - var ret ConfigLogSink - return ret - } - return *o.LogSink -} - -// GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Config) GetLogSinkOk() (*ConfigLogSink, bool) { - if o == nil || IsNil(o.LogSink) { - return nil, false - } - return o.LogSink, true -} - -// HasLogSink returns a boolean if a field has been set. -func (o *Config) HasLogSink() bool { - if o != nil && !IsNil(o.LogSink) { - return true - } - - return false -} - -// SetLogSink gets a reference to the given ConfigLogSink and assigns it to the LogSink field. -func (o *Config) SetLogSink(v ConfigLogSink) { - o.LogSink = &v -} - -// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Config) GetMonthlyLimitBytes() int64 { - if o == nil || IsNil(o.MonthlyLimitBytes.Get()) { - var ret int64 - return ret - } - return *o.MonthlyLimitBytes.Get() -} - -// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 *Config) GetMonthlyLimitBytesOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.MonthlyLimitBytes.Get(), o.MonthlyLimitBytes.IsSet() -} - -// HasMonthlyLimitBytes returns a boolean if a field has been set. -func (o *Config) HasMonthlyLimitBytes() bool { - if o != nil && o.MonthlyLimitBytes.IsSet() { - return true - } - - return false -} - -// SetMonthlyLimitBytes gets a reference to the given NullableInt64 and assigns it to the MonthlyLimitBytes field. -func (o *Config) SetMonthlyLimitBytes(v int64) { - o.MonthlyLimitBytes.Set(&v) -} - -// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil -func (o *Config) SetMonthlyLimitBytesNil() { - o.MonthlyLimitBytes.Set(nil) -} - -// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil -func (o *Config) UnsetMonthlyLimitBytes() { - o.MonthlyLimitBytes.Unset() -} - -// GetOptimizer returns the Optimizer field value if set, zero value otherwise. -func (o *Config) GetOptimizer() Optimizer { - if o == nil || IsNil(o.Optimizer) { - var ret Optimizer - return ret - } - return *o.Optimizer -} - -// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Config) GetOptimizerOk() (*Optimizer, bool) { - if o == nil || IsNil(o.Optimizer) { - return nil, false - } - return o.Optimizer, true -} - -// HasOptimizer returns a boolean if a field has been set. -func (o *Config) HasOptimizer() bool { - if o != nil && !IsNil(o.Optimizer) { - return true - } - - return false -} - -// SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. -func (o *Config) SetOptimizer(v Optimizer) { - o.Optimizer = &v -} - -// GetRegions returns the Regions field value -func (o *Config) GetRegions() []Region { - if o == nil { - var ret []Region - return ret - } - - return o.Regions -} - -// GetRegionsOk returns a tuple with the Regions field value -// and a boolean to check if the value has been set. -func (o *Config) GetRegionsOk() ([]Region, bool) { - if o == nil { - return nil, false - } - return o.Regions, true -} - -// SetRegions sets field value -func (o *Config) SetRegions(v []Region) { - o.Regions = v -} - -// GetWaf returns the Waf field value -func (o *Config) GetWaf() WafConfig { - if o == nil { - var ret WafConfig - return ret - } - - return o.Waf -} - -// GetWafOk returns a tuple with the Waf field value -// and a boolean to check if the value has been set. -func (o *Config) GetWafOk() (*WafConfig, bool) { - if o == nil { - return nil, false - } - return &o.Waf, true -} - -// SetWaf sets field value -func (o *Config) SetWaf(v WafConfig) { - o.Waf = v -} - -func (o Config) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Config) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["backend"] = o.Backend - toSerialize["blockedCountries"] = o.BlockedCountries - toSerialize["blockedIps"] = o.BlockedIps - if o.DefaultCacheDuration.IsSet() { - toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() - } - if !IsNil(o.LogSink) { - toSerialize["logSink"] = o.LogSink - } - if o.MonthlyLimitBytes.IsSet() { - toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes.Get() - } - if !IsNil(o.Optimizer) { - toSerialize["optimizer"] = o.Optimizer - } - toSerialize["regions"] = o.Regions - toSerialize["waf"] = o.Waf - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Config) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "backend", - "blockedCountries", - "blockedIps", - "regions", - "waf", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varConfig := _Config{} - - err = json.Unmarshal(data, &varConfig) - - if err != nil { - return err - } - - *o = Config(varConfig) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "backend") - delete(additionalProperties, "blockedCountries") - delete(additionalProperties, "blockedIps") - delete(additionalProperties, "defaultCacheDuration") - delete(additionalProperties, "logSink") - delete(additionalProperties, "monthlyLimitBytes") - delete(additionalProperties, "optimizer") - delete(additionalProperties, "regions") - delete(additionalProperties, "waf") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableConfig struct { - value *Config - isSet bool -} - -func (v NullableConfig) Get() *Config { - return v.value -} - -func (v *NullableConfig) Set(val *Config) { - v.value = val - v.isSet = true -} - -func (v NullableConfig) IsSet() bool { - return v.isSet -} - -func (v *NullableConfig) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfig(val *Config) *NullableConfig { - return &NullableConfig{value: val, isSet: true} -} - -func (v NullableConfig) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfig) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_config_backend.go b/services/cdn/v1beta2api/model_config_backend.go deleted file mode 100644 index 34ce88416..000000000 --- a/services/cdn/v1beta2api/model_config_backend.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// ConfigBackend - struct for ConfigBackend -type ConfigBackend struct { - BucketBackend *BucketBackend - HttpBackend *HttpBackend -} - -// BucketBackendAsConfigBackend is a convenience function that returns BucketBackend wrapped in ConfigBackend -func BucketBackendAsConfigBackend(v *BucketBackend) ConfigBackend { - return ConfigBackend{ - BucketBackend: v, - } -} - -// HttpBackendAsConfigBackend is a convenience function that returns HttpBackend wrapped in ConfigBackend -func HttpBackendAsConfigBackend(v *HttpBackend) ConfigBackend { - return ConfigBackend{ - HttpBackend: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ConfigBackend) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'bucket' - if jsonDict["type"] == "bucket" { - // try to unmarshal JSON data into BucketBackend - err = json.Unmarshal(data, &dst.BucketBackend) - if err == nil { - return nil // data stored in dst.BucketBackend, return on the first match - } else { - dst.BucketBackend = nil - return fmt.Errorf("failed to unmarshal ConfigBackend as BucketBackend: %s", err.Error()) - } - } - - // check if the discriminator value is 'http' - if jsonDict["type"] == "http" { - // try to unmarshal JSON data into HttpBackend - err = json.Unmarshal(data, &dst.HttpBackend) - if err == nil { - return nil // data stored in dst.HttpBackend, return on the first match - } else { - dst.HttpBackend = nil - return fmt.Errorf("failed to unmarshal ConfigBackend as HttpBackend: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ConfigBackend) MarshalJSON() ([]byte, error) { - if src.BucketBackend != nil { - return json.Marshal(&src.BucketBackend) - } - - if src.HttpBackend != nil { - return json.Marshal(&src.HttpBackend) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ConfigBackend) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.BucketBackend != nil { - return obj.BucketBackend - } - - if obj.HttpBackend != nil { - return obj.HttpBackend - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ConfigBackend) GetActualInstanceValue() interface{} { - if obj.BucketBackend != nil { - return *obj.BucketBackend - } - - if obj.HttpBackend != nil { - return *obj.HttpBackend - } - - // all schemas are nil - return nil -} - -type NullableConfigBackend struct { - value *ConfigBackend - isSet bool -} - -func (v NullableConfigBackend) Get() *ConfigBackend { - return v.value -} - -func (v *NullableConfigBackend) Set(val *ConfigBackend) { - v.value = val - v.isSet = true -} - -func (v NullableConfigBackend) IsSet() bool { - return v.isSet -} - -func (v *NullableConfigBackend) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfigBackend(val *ConfigBackend) *NullableConfigBackend { - return &NullableConfigBackend{value: val, isSet: true} -} - -func (v NullableConfigBackend) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfigBackend) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_config_log_sink.go b/services/cdn/v1beta2api/model_config_log_sink.go deleted file mode 100644 index d668f2a1c..000000000 --- a/services/cdn/v1beta2api/model_config_log_sink.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// ConfigLogSink - struct for ConfigLogSink -type ConfigLogSink struct { - LokiLogSink *LokiLogSink -} - -// LokiLogSinkAsConfigLogSink is a convenience function that returns LokiLogSink wrapped in ConfigLogSink -func LokiLogSinkAsConfigLogSink(v *LokiLogSink) ConfigLogSink { - return ConfigLogSink{ - LokiLogSink: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ConfigLogSink) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'loki' - if jsonDict["type"] == "loki" { - // try to unmarshal JSON data into LokiLogSink - err = json.Unmarshal(data, &dst.LokiLogSink) - if err == nil { - return nil // data stored in dst.LokiLogSink, return on the first match - } else { - dst.LokiLogSink = nil - return fmt.Errorf("failed to unmarshal ConfigLogSink as LokiLogSink: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ConfigLogSink) MarshalJSON() ([]byte, error) { - if src.LokiLogSink != nil { - return json.Marshal(&src.LokiLogSink) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ConfigLogSink) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.LokiLogSink != nil { - return obj.LokiLogSink - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ConfigLogSink) GetActualInstanceValue() interface{} { - if obj.LokiLogSink != nil { - return *obj.LokiLogSink - } - - // all schemas are nil - return nil -} - -type NullableConfigLogSink struct { - value *ConfigLogSink - isSet bool -} - -func (v NullableConfigLogSink) Get() *ConfigLogSink { - return v.value -} - -func (v *NullableConfigLogSink) Set(val *ConfigLogSink) { - v.value = val - v.isSet = true -} - -func (v NullableConfigLogSink) IsSet() bool { - return v.isSet -} - -func (v *NullableConfigLogSink) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfigLogSink(val *ConfigLogSink) *NullableConfigLogSink { - return &NullableConfigLogSink{value: val, isSet: true} -} - -func (v NullableConfigLogSink) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfigLogSink) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_config_patch.go b/services/cdn/v1beta2api/model_config_patch.go deleted file mode 100644 index 11e0c888f..000000000 --- a/services/cdn/v1beta2api/model_config_patch.go +++ /dev/null @@ -1,486 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" -) - -// checks if the ConfigPatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ConfigPatch{} - -// ConfigPatch struct for ConfigPatch -type ConfigPatch struct { - Backend *ConfigPatchBackend `json:"backend,omitempty"` - // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. - BlockedCountries []string `json:"blockedCountries,omitempty"` - // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIps []string `json:"blockedIps,omitempty"` - // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) - DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` - LogSink NullableConfigPatchLogSink `json:"logSink,omitempty"` - // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. - MonthlyLimitBytes NullableInt64 `json:"monthlyLimitBytes,omitempty"` - Optimizer *OptimizerPatch `json:"optimizer,omitempty"` - Regions []Region `json:"regions,omitempty"` - Waf *WafConfigPatch `json:"waf,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ConfigPatch ConfigPatch - -// NewConfigPatch instantiates a new ConfigPatch 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 NewConfigPatch() *ConfigPatch { - this := ConfigPatch{} - return &this -} - -// NewConfigPatchWithDefaults instantiates a new ConfigPatch 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 NewConfigPatchWithDefaults() *ConfigPatch { - this := ConfigPatch{} - return &this -} - -// GetBackend returns the Backend field value if set, zero value otherwise. -func (o *ConfigPatch) GetBackend() ConfigPatchBackend { - if o == nil || IsNil(o.Backend) { - var ret ConfigPatchBackend - return ret - } - return *o.Backend -} - -// GetBackendOk returns a tuple with the Backend field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetBackendOk() (*ConfigPatchBackend, bool) { - if o == nil || IsNil(o.Backend) { - return nil, false - } - return o.Backend, true -} - -// HasBackend returns a boolean if a field has been set. -func (o *ConfigPatch) HasBackend() bool { - if o != nil && !IsNil(o.Backend) { - return true - } - - return false -} - -// SetBackend gets a reference to the given ConfigPatchBackend and assigns it to the Backend field. -func (o *ConfigPatch) SetBackend(v ConfigPatchBackend) { - o.Backend = &v -} - -// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. -func (o *ConfigPatch) GetBlockedCountries() []string { - if o == nil || IsNil(o.BlockedCountries) { - var ret []string - return ret - } - return o.BlockedCountries -} - -// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetBlockedCountriesOk() ([]string, bool) { - if o == nil || IsNil(o.BlockedCountries) { - return nil, false - } - return o.BlockedCountries, true -} - -// HasBlockedCountries returns a boolean if a field has been set. -func (o *ConfigPatch) HasBlockedCountries() bool { - if o != nil && !IsNil(o.BlockedCountries) { - return true - } - - return false -} - -// SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. -func (o *ConfigPatch) SetBlockedCountries(v []string) { - o.BlockedCountries = v -} - -// GetBlockedIps returns the BlockedIps field value if set, zero value otherwise. -func (o *ConfigPatch) GetBlockedIps() []string { - if o == nil || IsNil(o.BlockedIps) { - var ret []string - return ret - } - return o.BlockedIps -} - -// GetBlockedIpsOk returns a tuple with the BlockedIps field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetBlockedIpsOk() ([]string, bool) { - if o == nil || IsNil(o.BlockedIps) { - return nil, false - } - return o.BlockedIps, true -} - -// HasBlockedIps returns a boolean if a field has been set. -func (o *ConfigPatch) HasBlockedIps() bool { - if o != nil && !IsNil(o.BlockedIps) { - return true - } - - return false -} - -// SetBlockedIps gets a reference to the given []string and assigns it to the BlockedIps field. -func (o *ConfigPatch) SetBlockedIps(v []string) { - o.BlockedIps = v -} - -// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ConfigPatch) GetDefaultCacheDuration() string { - if o == nil || IsNil(o.DefaultCacheDuration.Get()) { - var ret string - return ret - } - return *o.DefaultCacheDuration.Get() -} - -// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 *ConfigPatch) GetDefaultCacheDurationOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DefaultCacheDuration.Get(), o.DefaultCacheDuration.IsSet() -} - -// HasDefaultCacheDuration returns a boolean if a field has been set. -func (o *ConfigPatch) HasDefaultCacheDuration() bool { - if o != nil && o.DefaultCacheDuration.IsSet() { - return true - } - - return false -} - -// SetDefaultCacheDuration gets a reference to the given NullableString and assigns it to the DefaultCacheDuration field. -func (o *ConfigPatch) SetDefaultCacheDuration(v string) { - o.DefaultCacheDuration.Set(&v) -} - -// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil -func (o *ConfigPatch) SetDefaultCacheDurationNil() { - o.DefaultCacheDuration.Set(nil) -} - -// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil -func (o *ConfigPatch) UnsetDefaultCacheDuration() { - o.DefaultCacheDuration.Unset() -} - -// GetLogSink returns the LogSink field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ConfigPatch) GetLogSink() ConfigPatchLogSink { - if o == nil || IsNil(o.LogSink.Get()) { - var ret ConfigPatchLogSink - return ret - } - return *o.LogSink.Get() -} - -// GetLogSinkOk returns a tuple with the LogSink 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 *ConfigPatch) GetLogSinkOk() (*ConfigPatchLogSink, bool) { - if o == nil { - return nil, false - } - return o.LogSink.Get(), o.LogSink.IsSet() -} - -// HasLogSink returns a boolean if a field has been set. -func (o *ConfigPatch) HasLogSink() bool { - if o != nil && o.LogSink.IsSet() { - return true - } - - return false -} - -// SetLogSink gets a reference to the given NullableConfigPatchLogSink and assigns it to the LogSink field. -func (o *ConfigPatch) SetLogSink(v ConfigPatchLogSink) { - o.LogSink.Set(&v) -} - -// SetLogSinkNil sets the value for LogSink to be an explicit nil -func (o *ConfigPatch) SetLogSinkNil() { - o.LogSink.Set(nil) -} - -// UnsetLogSink ensures that no value is present for LogSink, not even an explicit nil -func (o *ConfigPatch) UnsetLogSink() { - o.LogSink.Unset() -} - -// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ConfigPatch) GetMonthlyLimitBytes() int64 { - if o == nil || IsNil(o.MonthlyLimitBytes.Get()) { - var ret int64 - return ret - } - return *o.MonthlyLimitBytes.Get() -} - -// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 *ConfigPatch) GetMonthlyLimitBytesOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.MonthlyLimitBytes.Get(), o.MonthlyLimitBytes.IsSet() -} - -// HasMonthlyLimitBytes returns a boolean if a field has been set. -func (o *ConfigPatch) HasMonthlyLimitBytes() bool { - if o != nil && o.MonthlyLimitBytes.IsSet() { - return true - } - - return false -} - -// SetMonthlyLimitBytes gets a reference to the given NullableInt64 and assigns it to the MonthlyLimitBytes field. -func (o *ConfigPatch) SetMonthlyLimitBytes(v int64) { - o.MonthlyLimitBytes.Set(&v) -} - -// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil -func (o *ConfigPatch) SetMonthlyLimitBytesNil() { - o.MonthlyLimitBytes.Set(nil) -} - -// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil -func (o *ConfigPatch) UnsetMonthlyLimitBytes() { - o.MonthlyLimitBytes.Unset() -} - -// GetOptimizer returns the Optimizer field value if set, zero value otherwise. -func (o *ConfigPatch) GetOptimizer() OptimizerPatch { - if o == nil || IsNil(o.Optimizer) { - var ret OptimizerPatch - return ret - } - return *o.Optimizer -} - -// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetOptimizerOk() (*OptimizerPatch, bool) { - if o == nil || IsNil(o.Optimizer) { - return nil, false - } - return o.Optimizer, true -} - -// HasOptimizer returns a boolean if a field has been set. -func (o *ConfigPatch) HasOptimizer() bool { - if o != nil && !IsNil(o.Optimizer) { - return true - } - - return false -} - -// SetOptimizer gets a reference to the given OptimizerPatch and assigns it to the Optimizer field. -func (o *ConfigPatch) SetOptimizer(v OptimizerPatch) { - o.Optimizer = &v -} - -// GetRegions returns the Regions field value if set, zero value otherwise. -func (o *ConfigPatch) GetRegions() []Region { - if o == nil || IsNil(o.Regions) { - var ret []Region - return ret - } - return o.Regions -} - -// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetRegionsOk() ([]Region, bool) { - if o == nil || IsNil(o.Regions) { - return nil, false - } - return o.Regions, true -} - -// HasRegions returns a boolean if a field has been set. -func (o *ConfigPatch) HasRegions() bool { - if o != nil && !IsNil(o.Regions) { - return true - } - - return false -} - -// SetRegions gets a reference to the given []Region and assigns it to the Regions field. -func (o *ConfigPatch) SetRegions(v []Region) { - o.Regions = v -} - -// GetWaf returns the Waf field value if set, zero value otherwise. -func (o *ConfigPatch) GetWaf() WafConfigPatch { - if o == nil || IsNil(o.Waf) { - var ret WafConfigPatch - return ret - } - return *o.Waf -} - -// GetWafOk returns a tuple with the Waf field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetWafOk() (*WafConfigPatch, bool) { - if o == nil || IsNil(o.Waf) { - return nil, false - } - return o.Waf, true -} - -// HasWaf returns a boolean if a field has been set. -func (o *ConfigPatch) HasWaf() bool { - if o != nil && !IsNil(o.Waf) { - return true - } - - return false -} - -// SetWaf gets a reference to the given WafConfigPatch and assigns it to the Waf field. -func (o *ConfigPatch) SetWaf(v WafConfigPatch) { - o.Waf = &v -} - -func (o ConfigPatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ConfigPatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Backend) { - toSerialize["backend"] = o.Backend - } - if !IsNil(o.BlockedCountries) { - toSerialize["blockedCountries"] = o.BlockedCountries - } - if !IsNil(o.BlockedIps) { - toSerialize["blockedIps"] = o.BlockedIps - } - if o.DefaultCacheDuration.IsSet() { - toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() - } - if o.LogSink.IsSet() { - toSerialize["logSink"] = o.LogSink.Get() - } - if o.MonthlyLimitBytes.IsSet() { - toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes.Get() - } - if !IsNil(o.Optimizer) { - toSerialize["optimizer"] = o.Optimizer - } - if !IsNil(o.Regions) { - toSerialize["regions"] = o.Regions - } - if !IsNil(o.Waf) { - toSerialize["waf"] = o.Waf - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ConfigPatch) UnmarshalJSON(data []byte) (err error) { - varConfigPatch := _ConfigPatch{} - - err = json.Unmarshal(data, &varConfigPatch) - - if err != nil { - return err - } - - *o = ConfigPatch(varConfigPatch) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "backend") - delete(additionalProperties, "blockedCountries") - delete(additionalProperties, "blockedIps") - delete(additionalProperties, "defaultCacheDuration") - delete(additionalProperties, "logSink") - delete(additionalProperties, "monthlyLimitBytes") - delete(additionalProperties, "optimizer") - delete(additionalProperties, "regions") - delete(additionalProperties, "waf") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableConfigPatch struct { - value *ConfigPatch - isSet bool -} - -func (v NullableConfigPatch) Get() *ConfigPatch { - return v.value -} - -func (v *NullableConfigPatch) Set(val *ConfigPatch) { - v.value = val - v.isSet = true -} - -func (v NullableConfigPatch) IsSet() bool { - return v.isSet -} - -func (v *NullableConfigPatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfigPatch(val *ConfigPatch) *NullableConfigPatch { - return &NullableConfigPatch{value: val, isSet: true} -} - -func (v NullableConfigPatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfigPatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_config_patch_backend.go b/services/cdn/v1beta2api/model_config_patch_backend.go deleted file mode 100644 index f016fa845..000000000 --- a/services/cdn/v1beta2api/model_config_patch_backend.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// ConfigPatchBackend - struct for ConfigPatchBackend -type ConfigPatchBackend struct { - BucketBackendPatch *BucketBackendPatch - HttpBackendPatch *HttpBackendPatch -} - -// BucketBackendPatchAsConfigPatchBackend is a convenience function that returns BucketBackendPatch wrapped in ConfigPatchBackend -func BucketBackendPatchAsConfigPatchBackend(v *BucketBackendPatch) ConfigPatchBackend { - return ConfigPatchBackend{ - BucketBackendPatch: v, - } -} - -// HttpBackendPatchAsConfigPatchBackend is a convenience function that returns HttpBackendPatch wrapped in ConfigPatchBackend -func HttpBackendPatchAsConfigPatchBackend(v *HttpBackendPatch) ConfigPatchBackend { - return ConfigPatchBackend{ - HttpBackendPatch: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ConfigPatchBackend) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'bucket' - if jsonDict["type"] == "bucket" { - // try to unmarshal JSON data into BucketBackendPatch - err = json.Unmarshal(data, &dst.BucketBackendPatch) - if err == nil { - return nil // data stored in dst.BucketBackendPatch, return on the first match - } else { - dst.BucketBackendPatch = nil - return fmt.Errorf("failed to unmarshal ConfigPatchBackend as BucketBackendPatch: %s", err.Error()) - } - } - - // check if the discriminator value is 'http' - if jsonDict["type"] == "http" { - // try to unmarshal JSON data into HttpBackendPatch - err = json.Unmarshal(data, &dst.HttpBackendPatch) - if err == nil { - return nil // data stored in dst.HttpBackendPatch, return on the first match - } else { - dst.HttpBackendPatch = nil - return fmt.Errorf("failed to unmarshal ConfigPatchBackend as HttpBackendPatch: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ConfigPatchBackend) MarshalJSON() ([]byte, error) { - if src.BucketBackendPatch != nil { - return json.Marshal(&src.BucketBackendPatch) - } - - if src.HttpBackendPatch != nil { - return json.Marshal(&src.HttpBackendPatch) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ConfigPatchBackend) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.BucketBackendPatch != nil { - return obj.BucketBackendPatch - } - - if obj.HttpBackendPatch != nil { - return obj.HttpBackendPatch - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ConfigPatchBackend) GetActualInstanceValue() interface{} { - if obj.BucketBackendPatch != nil { - return *obj.BucketBackendPatch - } - - if obj.HttpBackendPatch != nil { - return *obj.HttpBackendPatch - } - - // all schemas are nil - return nil -} - -type NullableConfigPatchBackend struct { - value *ConfigPatchBackend - isSet bool -} - -func (v NullableConfigPatchBackend) Get() *ConfigPatchBackend { - return v.value -} - -func (v *NullableConfigPatchBackend) Set(val *ConfigPatchBackend) { - v.value = val - v.isSet = true -} - -func (v NullableConfigPatchBackend) IsSet() bool { - return v.isSet -} - -func (v *NullableConfigPatchBackend) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfigPatchBackend(val *ConfigPatchBackend) *NullableConfigPatchBackend { - return &NullableConfigPatchBackend{value: val, isSet: true} -} - -func (v NullableConfigPatchBackend) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfigPatchBackend) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_config_patch_log_sink.go b/services/cdn/v1beta2api/model_config_patch_log_sink.go deleted file mode 100644 index b54ebe67a..000000000 --- a/services/cdn/v1beta2api/model_config_patch_log_sink.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// ConfigPatchLogSink - struct for ConfigPatchLogSink -type ConfigPatchLogSink struct { - LokiLogSinkPatch *LokiLogSinkPatch -} - -// LokiLogSinkPatchAsConfigPatchLogSink is a convenience function that returns LokiLogSinkPatch wrapped in ConfigPatchLogSink -func LokiLogSinkPatchAsConfigPatchLogSink(v *LokiLogSinkPatch) ConfigPatchLogSink { - return ConfigPatchLogSink{ - LokiLogSinkPatch: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ConfigPatchLogSink) UnmarshalJSON(data []byte) error { - var err error - // this object is nullable so check if the payload is null or empty string - if string(data) == "" || string(data) == "{}" { - return nil - } - - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'loki' - if jsonDict["type"] == "loki" { - // try to unmarshal JSON data into LokiLogSinkPatch - err = json.Unmarshal(data, &dst.LokiLogSinkPatch) - if err == nil { - return nil // data stored in dst.LokiLogSinkPatch, return on the first match - } else { - dst.LokiLogSinkPatch = nil - return fmt.Errorf("failed to unmarshal ConfigPatchLogSink as LokiLogSinkPatch: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ConfigPatchLogSink) MarshalJSON() ([]byte, error) { - if src.LokiLogSinkPatch != nil { - return json.Marshal(&src.LokiLogSinkPatch) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ConfigPatchLogSink) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.LokiLogSinkPatch != nil { - return obj.LokiLogSinkPatch - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ConfigPatchLogSink) GetActualInstanceValue() interface{} { - if obj.LokiLogSinkPatch != nil { - return *obj.LokiLogSinkPatch - } - - // all schemas are nil - return nil -} - -type NullableConfigPatchLogSink struct { - value *ConfigPatchLogSink - isSet bool -} - -func (v NullableConfigPatchLogSink) Get() *ConfigPatchLogSink { - return v.value -} - -func (v *NullableConfigPatchLogSink) Set(val *ConfigPatchLogSink) { - v.value = val - v.isSet = true -} - -func (v NullableConfigPatchLogSink) IsSet() bool { - return v.isSet -} - -func (v *NullableConfigPatchLogSink) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfigPatchLogSink(val *ConfigPatchLogSink) *NullableConfigPatchLogSink { - return &NullableConfigPatchLogSink{value: val, isSet: true} -} - -func (v NullableConfigPatchLogSink) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfigPatchLogSink) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_create_distribution_payload.go b/services/cdn/v1beta2api/model_create_distribution_payload.go deleted file mode 100644 index 745bebef7..000000000 --- a/services/cdn/v1beta2api/model_create_distribution_payload.go +++ /dev/null @@ -1,497 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateDistributionPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateDistributionPayload{} - -// CreateDistributionPayload struct for CreateDistributionPayload -type CreateDistributionPayload struct { - Backend CreateDistributionPayloadBackend `json:"backend"` - // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. - BlockedCountries []string `json:"blockedCountries,omitempty"` - // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIps []string `json:"blockedIps,omitempty"` - // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) - DefaultCacheDuration *string `json:"defaultCacheDuration,omitempty"` - // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple POST-Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. - IntentId *string `json:"intentId,omitempty"` - LogSink *CreateDistributionPayloadLogSink `json:"logSink,omitempty"` - // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. - MonthlyLimitBytes *int64 `json:"monthlyLimitBytes,omitempty"` - Optimizer *Optimizer `json:"optimizer,omitempty"` - // Define in which regions you would like your content to be cached. - Regions []Region `json:"regions"` - Waf *WafConfig `json:"waf,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _CreateDistributionPayload CreateDistributionPayload - -// NewCreateDistributionPayload instantiates a new CreateDistributionPayload 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 NewCreateDistributionPayload(backend CreateDistributionPayloadBackend, regions []Region) *CreateDistributionPayload { - this := CreateDistributionPayload{} - this.Backend = backend - this.Regions = regions - return &this -} - -// NewCreateDistributionPayloadWithDefaults instantiates a new CreateDistributionPayload 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 NewCreateDistributionPayloadWithDefaults() *CreateDistributionPayload { - this := CreateDistributionPayload{} - return &this -} - -// GetBackend returns the Backend field value -func (o *CreateDistributionPayload) GetBackend() CreateDistributionPayloadBackend { - if o == nil { - var ret CreateDistributionPayloadBackend - return ret - } - - return o.Backend -} - -// GetBackendOk returns a tuple with the Backend field value -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetBackendOk() (*CreateDistributionPayloadBackend, bool) { - if o == nil { - return nil, false - } - return &o.Backend, true -} - -// SetBackend sets field value -func (o *CreateDistributionPayload) SetBackend(v CreateDistributionPayloadBackend) { - o.Backend = v -} - -// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetBlockedCountries() []string { - if o == nil || IsNil(o.BlockedCountries) { - var ret []string - return ret - } - return o.BlockedCountries -} - -// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetBlockedCountriesOk() ([]string, bool) { - if o == nil || IsNil(o.BlockedCountries) { - return nil, false - } - return o.BlockedCountries, true -} - -// HasBlockedCountries returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasBlockedCountries() bool { - if o != nil && !IsNil(o.BlockedCountries) { - return true - } - - return false -} - -// SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. -func (o *CreateDistributionPayload) SetBlockedCountries(v []string) { - o.BlockedCountries = v -} - -// GetBlockedIps returns the BlockedIps field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetBlockedIps() []string { - if o == nil || IsNil(o.BlockedIps) { - var ret []string - return ret - } - return o.BlockedIps -} - -// GetBlockedIpsOk returns a tuple with the BlockedIps field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetBlockedIpsOk() ([]string, bool) { - if o == nil || IsNil(o.BlockedIps) { - return nil, false - } - return o.BlockedIps, true -} - -// HasBlockedIps returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasBlockedIps() bool { - if o != nil && !IsNil(o.BlockedIps) { - return true - } - - return false -} - -// SetBlockedIps gets a reference to the given []string and assigns it to the BlockedIps field. -func (o *CreateDistributionPayload) SetBlockedIps(v []string) { - o.BlockedIps = v -} - -// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetDefaultCacheDuration() string { - if o == nil || IsNil(o.DefaultCacheDuration) { - var ret string - return ret - } - return *o.DefaultCacheDuration -} - -// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetDefaultCacheDurationOk() (*string, bool) { - if o == nil || IsNil(o.DefaultCacheDuration) { - return nil, false - } - return o.DefaultCacheDuration, true -} - -// HasDefaultCacheDuration returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasDefaultCacheDuration() bool { - if o != nil && !IsNil(o.DefaultCacheDuration) { - return true - } - - return false -} - -// SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. -func (o *CreateDistributionPayload) SetDefaultCacheDuration(v string) { - o.DefaultCacheDuration = &v -} - -// GetIntentId returns the IntentId field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetIntentId() string { - if o == nil || IsNil(o.IntentId) { - var ret string - return ret - } - return *o.IntentId -} - -// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetIntentIdOk() (*string, bool) { - if o == nil || IsNil(o.IntentId) { - return nil, false - } - return o.IntentId, true -} - -// HasIntentId returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasIntentId() bool { - if o != nil && !IsNil(o.IntentId) { - return true - } - - return false -} - -// SetIntentId gets a reference to the given string and assigns it to the IntentId field. -func (o *CreateDistributionPayload) SetIntentId(v string) { - o.IntentId = &v -} - -// GetLogSink returns the LogSink field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetLogSink() CreateDistributionPayloadLogSink { - if o == nil || IsNil(o.LogSink) { - var ret CreateDistributionPayloadLogSink - return ret - } - return *o.LogSink -} - -// GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetLogSinkOk() (*CreateDistributionPayloadLogSink, bool) { - if o == nil || IsNil(o.LogSink) { - return nil, false - } - return o.LogSink, true -} - -// HasLogSink returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasLogSink() bool { - if o != nil && !IsNil(o.LogSink) { - return true - } - - return false -} - -// SetLogSink gets a reference to the given CreateDistributionPayloadLogSink and assigns it to the LogSink field. -func (o *CreateDistributionPayload) SetLogSink(v CreateDistributionPayloadLogSink) { - o.LogSink = &v -} - -// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetMonthlyLimitBytes() int64 { - if o == nil || IsNil(o.MonthlyLimitBytes) { - var ret int64 - return ret - } - return *o.MonthlyLimitBytes -} - -// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetMonthlyLimitBytesOk() (*int64, bool) { - if o == nil || IsNil(o.MonthlyLimitBytes) { - return nil, false - } - return o.MonthlyLimitBytes, true -} - -// HasMonthlyLimitBytes returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasMonthlyLimitBytes() bool { - if o != nil && !IsNil(o.MonthlyLimitBytes) { - return true - } - - return false -} - -// SetMonthlyLimitBytes gets a reference to the given int64 and assigns it to the MonthlyLimitBytes field. -func (o *CreateDistributionPayload) SetMonthlyLimitBytes(v int64) { - o.MonthlyLimitBytes = &v -} - -// GetOptimizer returns the Optimizer field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetOptimizer() Optimizer { - if o == nil || IsNil(o.Optimizer) { - var ret Optimizer - return ret - } - return *o.Optimizer -} - -// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetOptimizerOk() (*Optimizer, bool) { - if o == nil || IsNil(o.Optimizer) { - return nil, false - } - return o.Optimizer, true -} - -// HasOptimizer returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasOptimizer() bool { - if o != nil && !IsNil(o.Optimizer) { - return true - } - - return false -} - -// SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. -func (o *CreateDistributionPayload) SetOptimizer(v Optimizer) { - o.Optimizer = &v -} - -// GetRegions returns the Regions field value -func (o *CreateDistributionPayload) GetRegions() []Region { - if o == nil { - var ret []Region - return ret - } - - return o.Regions -} - -// GetRegionsOk returns a tuple with the Regions field value -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetRegionsOk() ([]Region, bool) { - if o == nil { - return nil, false - } - return o.Regions, true -} - -// SetRegions sets field value -func (o *CreateDistributionPayload) SetRegions(v []Region) { - o.Regions = v -} - -// GetWaf returns the Waf field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetWaf() WafConfig { - if o == nil || IsNil(o.Waf) { - var ret WafConfig - return ret - } - return *o.Waf -} - -// GetWafOk returns a tuple with the Waf field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetWafOk() (*WafConfig, bool) { - if o == nil || IsNil(o.Waf) { - return nil, false - } - return o.Waf, true -} - -// HasWaf returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasWaf() bool { - if o != nil && !IsNil(o.Waf) { - return true - } - - return false -} - -// SetWaf gets a reference to the given WafConfig and assigns it to the Waf field. -func (o *CreateDistributionPayload) SetWaf(v WafConfig) { - o.Waf = &v -} - -func (o CreateDistributionPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["backend"] = o.Backend - if !IsNil(o.BlockedCountries) { - toSerialize["blockedCountries"] = o.BlockedCountries - } - if !IsNil(o.BlockedIps) { - toSerialize["blockedIps"] = o.BlockedIps - } - if !IsNil(o.DefaultCacheDuration) { - toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration - } - if !IsNil(o.IntentId) { - toSerialize["intentId"] = o.IntentId - } - if !IsNil(o.LogSink) { - toSerialize["logSink"] = o.LogSink - } - if !IsNil(o.MonthlyLimitBytes) { - toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes - } - if !IsNil(o.Optimizer) { - toSerialize["optimizer"] = o.Optimizer - } - toSerialize["regions"] = o.Regions - if !IsNil(o.Waf) { - toSerialize["waf"] = o.Waf - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateDistributionPayload) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "backend", - "regions", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateDistributionPayload := _CreateDistributionPayload{} - - err = json.Unmarshal(data, &varCreateDistributionPayload) - - if err != nil { - return err - } - - *o = CreateDistributionPayload(varCreateDistributionPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "backend") - delete(additionalProperties, "blockedCountries") - delete(additionalProperties, "blockedIps") - delete(additionalProperties, "defaultCacheDuration") - delete(additionalProperties, "intentId") - delete(additionalProperties, "logSink") - delete(additionalProperties, "monthlyLimitBytes") - delete(additionalProperties, "optimizer") - delete(additionalProperties, "regions") - delete(additionalProperties, "waf") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateDistributionPayload struct { - value *CreateDistributionPayload - isSet bool -} - -func (v NullableCreateDistributionPayload) Get() *CreateDistributionPayload { - return v.value -} - -func (v *NullableCreateDistributionPayload) Set(val *CreateDistributionPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateDistributionPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateDistributionPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateDistributionPayload(val *CreateDistributionPayload) *NullableCreateDistributionPayload { - return &NullableCreateDistributionPayload{value: val, isSet: true} -} - -func (v NullableCreateDistributionPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateDistributionPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_create_distribution_payload_backend.go b/services/cdn/v1beta2api/model_create_distribution_payload_backend.go deleted file mode 100644 index 830dc2cff..000000000 --- a/services/cdn/v1beta2api/model_create_distribution_payload_backend.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// CreateDistributionPayloadBackend - Configuration for the content origin backend. -type CreateDistributionPayloadBackend struct { - BucketBackendCreate *BucketBackendCreate - HttpBackendCreate *HttpBackendCreate -} - -// BucketBackendCreateAsCreateDistributionPayloadBackend is a convenience function that returns BucketBackendCreate wrapped in CreateDistributionPayloadBackend -func BucketBackendCreateAsCreateDistributionPayloadBackend(v *BucketBackendCreate) CreateDistributionPayloadBackend { - return CreateDistributionPayloadBackend{ - BucketBackendCreate: v, - } -} - -// HttpBackendCreateAsCreateDistributionPayloadBackend is a convenience function that returns HttpBackendCreate wrapped in CreateDistributionPayloadBackend -func HttpBackendCreateAsCreateDistributionPayloadBackend(v *HttpBackendCreate) CreateDistributionPayloadBackend { - return CreateDistributionPayloadBackend{ - HttpBackendCreate: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *CreateDistributionPayloadBackend) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'bucket' - if jsonDict["type"] == "bucket" { - // try to unmarshal JSON data into BucketBackendCreate - err = json.Unmarshal(data, &dst.BucketBackendCreate) - if err == nil { - return nil // data stored in dst.BucketBackendCreate, return on the first match - } else { - dst.BucketBackendCreate = nil - return fmt.Errorf("failed to unmarshal CreateDistributionPayloadBackend as BucketBackendCreate: %s", err.Error()) - } - } - - // check if the discriminator value is 'http' - if jsonDict["type"] == "http" { - // try to unmarshal JSON data into HttpBackendCreate - err = json.Unmarshal(data, &dst.HttpBackendCreate) - if err == nil { - return nil // data stored in dst.HttpBackendCreate, return on the first match - } else { - dst.HttpBackendCreate = nil - return fmt.Errorf("failed to unmarshal CreateDistributionPayloadBackend as HttpBackendCreate: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src CreateDistributionPayloadBackend) MarshalJSON() ([]byte, error) { - if src.BucketBackendCreate != nil { - return json.Marshal(&src.BucketBackendCreate) - } - - if src.HttpBackendCreate != nil { - return json.Marshal(&src.HttpBackendCreate) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *CreateDistributionPayloadBackend) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.BucketBackendCreate != nil { - return obj.BucketBackendCreate - } - - if obj.HttpBackendCreate != nil { - return obj.HttpBackendCreate - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj CreateDistributionPayloadBackend) GetActualInstanceValue() interface{} { - if obj.BucketBackendCreate != nil { - return *obj.BucketBackendCreate - } - - if obj.HttpBackendCreate != nil { - return *obj.HttpBackendCreate - } - - // all schemas are nil - return nil -} - -type NullableCreateDistributionPayloadBackend struct { - value *CreateDistributionPayloadBackend - isSet bool -} - -func (v NullableCreateDistributionPayloadBackend) Get() *CreateDistributionPayloadBackend { - return v.value -} - -func (v *NullableCreateDistributionPayloadBackend) Set(val *CreateDistributionPayloadBackend) { - v.value = val - v.isSet = true -} - -func (v NullableCreateDistributionPayloadBackend) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateDistributionPayloadBackend) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateDistributionPayloadBackend(val *CreateDistributionPayloadBackend) *NullableCreateDistributionPayloadBackend { - return &NullableCreateDistributionPayloadBackend{value: val, isSet: true} -} - -func (v NullableCreateDistributionPayloadBackend) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateDistributionPayloadBackend) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_create_distribution_payload_log_sink.go b/services/cdn/v1beta2api/model_create_distribution_payload_log_sink.go deleted file mode 100644 index 4240356c6..000000000 --- a/services/cdn/v1beta2api/model_create_distribution_payload_log_sink.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// CreateDistributionPayloadLogSink - struct for CreateDistributionPayloadLogSink -type CreateDistributionPayloadLogSink struct { - LokiLogSinkCreate *LokiLogSinkCreate -} - -// LokiLogSinkCreateAsCreateDistributionPayloadLogSink is a convenience function that returns LokiLogSinkCreate wrapped in CreateDistributionPayloadLogSink -func LokiLogSinkCreateAsCreateDistributionPayloadLogSink(v *LokiLogSinkCreate) CreateDistributionPayloadLogSink { - return CreateDistributionPayloadLogSink{ - LokiLogSinkCreate: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *CreateDistributionPayloadLogSink) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'loki' - if jsonDict["type"] == "loki" { - // try to unmarshal JSON data into LokiLogSinkCreate - err = json.Unmarshal(data, &dst.LokiLogSinkCreate) - if err == nil { - return nil // data stored in dst.LokiLogSinkCreate, return on the first match - } else { - dst.LokiLogSinkCreate = nil - return fmt.Errorf("failed to unmarshal CreateDistributionPayloadLogSink as LokiLogSinkCreate: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src CreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) { - if src.LokiLogSinkCreate != nil { - return json.Marshal(&src.LokiLogSinkCreate) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *CreateDistributionPayloadLogSink) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.LokiLogSinkCreate != nil { - return obj.LokiLogSinkCreate - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj CreateDistributionPayloadLogSink) GetActualInstanceValue() interface{} { - if obj.LokiLogSinkCreate != nil { - return *obj.LokiLogSinkCreate - } - - // all schemas are nil - return nil -} - -type NullableCreateDistributionPayloadLogSink struct { - value *CreateDistributionPayloadLogSink - isSet bool -} - -func (v NullableCreateDistributionPayloadLogSink) Get() *CreateDistributionPayloadLogSink { - return v.value -} - -func (v *NullableCreateDistributionPayloadLogSink) Set(val *CreateDistributionPayloadLogSink) { - v.value = val - v.isSet = true -} - -func (v NullableCreateDistributionPayloadLogSink) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateDistributionPayloadLogSink) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateDistributionPayloadLogSink(val *CreateDistributionPayloadLogSink) *NullableCreateDistributionPayloadLogSink { - return &NullableCreateDistributionPayloadLogSink{value: val, isSet: true} -} - -func (v NullableCreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateDistributionPayloadLogSink) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_create_distribution_response.go b/services/cdn/v1beta2api/model_create_distribution_response.go deleted file mode 100644 index 12a5cf585..000000000 --- a/services/cdn/v1beta2api/model_create_distribution_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateDistributionResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateDistributionResponse{} - -// CreateDistributionResponse struct for CreateDistributionResponse -type CreateDistributionResponse struct { - Distribution Distribution `json:"distribution"` - AdditionalProperties map[string]interface{} -} - -type _CreateDistributionResponse CreateDistributionResponse - -// NewCreateDistributionResponse instantiates a new CreateDistributionResponse 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 NewCreateDistributionResponse(distribution Distribution) *CreateDistributionResponse { - this := CreateDistributionResponse{} - this.Distribution = distribution - return &this -} - -// NewCreateDistributionResponseWithDefaults instantiates a new CreateDistributionResponse 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 NewCreateDistributionResponseWithDefaults() *CreateDistributionResponse { - this := CreateDistributionResponse{} - return &this -} - -// GetDistribution returns the Distribution field value -func (o *CreateDistributionResponse) GetDistribution() Distribution { - if o == nil { - var ret Distribution - return ret - } - - return o.Distribution -} - -// GetDistributionOk returns a tuple with the Distribution field value -// and a boolean to check if the value has been set. -func (o *CreateDistributionResponse) GetDistributionOk() (*Distribution, bool) { - if o == nil { - return nil, false - } - return &o.Distribution, true -} - -// SetDistribution sets field value -func (o *CreateDistributionResponse) SetDistribution(v Distribution) { - o.Distribution = v -} - -func (o CreateDistributionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateDistributionResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["distribution"] = o.Distribution - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateDistributionResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "distribution", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateDistributionResponse := _CreateDistributionResponse{} - - err = json.Unmarshal(data, &varCreateDistributionResponse) - - if err != nil { - return err - } - - *o = CreateDistributionResponse(varCreateDistributionResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "distribution") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateDistributionResponse struct { - value *CreateDistributionResponse - isSet bool -} - -func (v NullableCreateDistributionResponse) Get() *CreateDistributionResponse { - return v.value -} - -func (v *NullableCreateDistributionResponse) Set(val *CreateDistributionResponse) { - v.value = val - v.isSet = true -} - -func (v NullableCreateDistributionResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateDistributionResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateDistributionResponse(val *CreateDistributionResponse) *NullableCreateDistributionResponse { - return &NullableCreateDistributionResponse{value: val, isSet: true} -} - -func (v NullableCreateDistributionResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateDistributionResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_custom_domain.go b/services/cdn/v1beta2api/model_custom_domain.go deleted file mode 100644 index 7c8571f39..000000000 --- a/services/cdn/v1beta2api/model_custom_domain.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the CustomDomain type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CustomDomain{} - -// CustomDomain Definition of a custom domain -type CustomDomain struct { - // This object is present if the custom domain has errors. - Errors []StatusError `json:"errors,omitempty"` - // The domain. Can be used as input for the GetCustomDomain endpoint - Name string `json:"name"` - Status DomainStatus `json:"status"` - AdditionalProperties map[string]interface{} -} - -type _CustomDomain CustomDomain - -// NewCustomDomain instantiates a new CustomDomain 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 NewCustomDomain(name string, status DomainStatus) *CustomDomain { - this := CustomDomain{} - this.Name = name - this.Status = status - return &this -} - -// NewCustomDomainWithDefaults instantiates a new CustomDomain 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 NewCustomDomainWithDefaults() *CustomDomain { - this := CustomDomain{} - return &this -} - -// GetErrors returns the Errors field value if set, zero value otherwise. -func (o *CustomDomain) GetErrors() []StatusError { - if o == nil || IsNil(o.Errors) { - var ret []StatusError - return ret - } - return o.Errors -} - -// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CustomDomain) GetErrorsOk() ([]StatusError, bool) { - if o == nil || IsNil(o.Errors) { - return nil, false - } - return o.Errors, true -} - -// HasErrors returns a boolean if a field has been set. -func (o *CustomDomain) HasErrors() bool { - if o != nil && !IsNil(o.Errors) { - return true - } - - return false -} - -// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. -func (o *CustomDomain) SetErrors(v []StatusError) { - o.Errors = v -} - -// GetName returns the Name field value -func (o *CustomDomain) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *CustomDomain) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *CustomDomain) SetName(v string) { - o.Name = v -} - -// GetStatus returns the Status field value -func (o *CustomDomain) GetStatus() DomainStatus { - if o == nil { - var ret DomainStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *CustomDomain) GetStatusOk() (*DomainStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *CustomDomain) SetStatus(v DomainStatus) { - o.Status = v -} - -func (o CustomDomain) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CustomDomain) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Errors) { - toSerialize["errors"] = o.Errors - } - toSerialize["name"] = o.Name - toSerialize["status"] = o.Status - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CustomDomain) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - "status", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCustomDomain := _CustomDomain{} - - err = json.Unmarshal(data, &varCustomDomain) - - if err != nil { - return err - } - - *o = CustomDomain(varCustomDomain) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "errors") - delete(additionalProperties, "name") - delete(additionalProperties, "status") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCustomDomain struct { - value *CustomDomain - isSet bool -} - -func (v NullableCustomDomain) Get() *CustomDomain { - return v.value -} - -func (v *NullableCustomDomain) Set(val *CustomDomain) { - v.value = val - v.isSet = true -} - -func (v NullableCustomDomain) IsSet() bool { - return v.isSet -} - -func (v *NullableCustomDomain) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCustomDomain(val *CustomDomain) *NullableCustomDomain { - return &NullableCustomDomain{value: val, isSet: true} -} - -func (v NullableCustomDomain) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCustomDomain) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_delete_custom_domain_response.go b/services/cdn/v1beta2api/model_delete_custom_domain_response.go deleted file mode 100644 index 6c1079f7f..000000000 --- a/services/cdn/v1beta2api/model_delete_custom_domain_response.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" -) - -// checks if the DeleteCustomDomainResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DeleteCustomDomainResponse{} - -// DeleteCustomDomainResponse Returns the custom domain that was deleted while the deletion has not completed yet. After the deletion was successful the response will be empty. -type DeleteCustomDomainResponse struct { - CustomDomain *CustomDomain `json:"customDomain,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _DeleteCustomDomainResponse DeleteCustomDomainResponse - -// NewDeleteCustomDomainResponse instantiates a new DeleteCustomDomainResponse 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 NewDeleteCustomDomainResponse() *DeleteCustomDomainResponse { - this := DeleteCustomDomainResponse{} - return &this -} - -// NewDeleteCustomDomainResponseWithDefaults instantiates a new DeleteCustomDomainResponse 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 NewDeleteCustomDomainResponseWithDefaults() *DeleteCustomDomainResponse { - this := DeleteCustomDomainResponse{} - return &this -} - -// GetCustomDomain returns the CustomDomain field value if set, zero value otherwise. -func (o *DeleteCustomDomainResponse) GetCustomDomain() CustomDomain { - if o == nil || IsNil(o.CustomDomain) { - var ret CustomDomain - return ret - } - return *o.CustomDomain -} - -// GetCustomDomainOk returns a tuple with the CustomDomain field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeleteCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { - if o == nil || IsNil(o.CustomDomain) { - return nil, false - } - return o.CustomDomain, true -} - -// HasCustomDomain returns a boolean if a field has been set. -func (o *DeleteCustomDomainResponse) HasCustomDomain() bool { - if o != nil && !IsNil(o.CustomDomain) { - return true - } - - return false -} - -// SetCustomDomain gets a reference to the given CustomDomain and assigns it to the CustomDomain field. -func (o *DeleteCustomDomainResponse) SetCustomDomain(v CustomDomain) { - o.CustomDomain = &v -} - -func (o DeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DeleteCustomDomainResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CustomDomain) { - toSerialize["customDomain"] = o.CustomDomain - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DeleteCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { - varDeleteCustomDomainResponse := _DeleteCustomDomainResponse{} - - err = json.Unmarshal(data, &varDeleteCustomDomainResponse) - - if err != nil { - return err - } - - *o = DeleteCustomDomainResponse(varDeleteCustomDomainResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "customDomain") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDeleteCustomDomainResponse struct { - value *DeleteCustomDomainResponse - isSet bool -} - -func (v NullableDeleteCustomDomainResponse) Get() *DeleteCustomDomainResponse { - return v.value -} - -func (v *NullableDeleteCustomDomainResponse) Set(val *DeleteCustomDomainResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDeleteCustomDomainResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDeleteCustomDomainResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeleteCustomDomainResponse(val *DeleteCustomDomainResponse) *NullableDeleteCustomDomainResponse { - return &NullableDeleteCustomDomainResponse{value: val, isSet: true} -} - -func (v NullableDeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeleteCustomDomainResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_delete_distribution_response.go b/services/cdn/v1beta2api/model_delete_distribution_response.go deleted file mode 100644 index b2188b2c7..000000000 --- a/services/cdn/v1beta2api/model_delete_distribution_response.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" -) - -// checks if the DeleteDistributionResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DeleteDistributionResponse{} - -// DeleteDistributionResponse struct for DeleteDistributionResponse -type DeleteDistributionResponse struct { - Distribution *Distribution `json:"distribution,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _DeleteDistributionResponse DeleteDistributionResponse - -// NewDeleteDistributionResponse instantiates a new DeleteDistributionResponse 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 NewDeleteDistributionResponse() *DeleteDistributionResponse { - this := DeleteDistributionResponse{} - return &this -} - -// NewDeleteDistributionResponseWithDefaults instantiates a new DeleteDistributionResponse 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 NewDeleteDistributionResponseWithDefaults() *DeleteDistributionResponse { - this := DeleteDistributionResponse{} - return &this -} - -// GetDistribution returns the Distribution field value if set, zero value otherwise. -func (o *DeleteDistributionResponse) GetDistribution() Distribution { - if o == nil || IsNil(o.Distribution) { - var ret Distribution - return ret - } - return *o.Distribution -} - -// GetDistributionOk returns a tuple with the Distribution field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeleteDistributionResponse) GetDistributionOk() (*Distribution, bool) { - if o == nil || IsNil(o.Distribution) { - return nil, false - } - return o.Distribution, true -} - -// HasDistribution returns a boolean if a field has been set. -func (o *DeleteDistributionResponse) HasDistribution() bool { - if o != nil && !IsNil(o.Distribution) { - return true - } - - return false -} - -// SetDistribution gets a reference to the given Distribution and assigns it to the Distribution field. -func (o *DeleteDistributionResponse) SetDistribution(v Distribution) { - o.Distribution = &v -} - -func (o DeleteDistributionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DeleteDistributionResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Distribution) { - toSerialize["distribution"] = o.Distribution - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DeleteDistributionResponse) UnmarshalJSON(data []byte) (err error) { - varDeleteDistributionResponse := _DeleteDistributionResponse{} - - err = json.Unmarshal(data, &varDeleteDistributionResponse) - - if err != nil { - return err - } - - *o = DeleteDistributionResponse(varDeleteDistributionResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "distribution") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDeleteDistributionResponse struct { - value *DeleteDistributionResponse - isSet bool -} - -func (v NullableDeleteDistributionResponse) Get() *DeleteDistributionResponse { - return v.value -} - -func (v *NullableDeleteDistributionResponse) Set(val *DeleteDistributionResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDeleteDistributionResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDeleteDistributionResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeleteDistributionResponse(val *DeleteDistributionResponse) *NullableDeleteDistributionResponse { - return &NullableDeleteDistributionResponse{value: val, isSet: true} -} - -func (v NullableDeleteDistributionResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeleteDistributionResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_distribution.go b/services/cdn/v1beta2api/model_distribution.go deleted file mode 100644 index faa833bd5..000000000 --- a/services/cdn/v1beta2api/model_distribution.go +++ /dev/null @@ -1,418 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the Distribution type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Distribution{} - -// Distribution struct for Distribution -type Distribution struct { - Config Config `json:"config"` - // RFC3339 string defining when the distribution was created - CreatedAt time.Time `json:"createdAt"` - Domains []Domain `json:"domains"` - // This object may be present if, and only if the distribution has encountered an error state. - Errors []StatusError `json:"errors,omitempty"` - Id string `json:"id"` - ProjectId string `json:"projectId"` - Status DistributionStatus `json:"status"` - // RFC3339 string which returns the last time the distribution configuration was modified. - UpdatedAt time.Time `json:"updatedAt"` - Waf *DistributionWaf `json:"waf,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Distribution Distribution - -// NewDistribution instantiates a new Distribution 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 NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status DistributionStatus, updatedAt time.Time) *Distribution { - this := Distribution{} - this.Config = config - this.CreatedAt = createdAt - this.Domains = domains - this.Id = id - this.ProjectId = projectId - this.Status = status - this.UpdatedAt = updatedAt - return &this -} - -// NewDistributionWithDefaults instantiates a new Distribution 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 NewDistributionWithDefaults() *Distribution { - this := Distribution{} - return &this -} - -// GetConfig returns the Config field value -func (o *Distribution) GetConfig() Config { - if o == nil { - var ret Config - 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 *Distribution) GetConfigOk() (*Config, bool) { - if o == nil { - return nil, false - } - return &o.Config, true -} - -// SetConfig sets field value -func (o *Distribution) SetConfig(v Config) { - o.Config = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *Distribution) 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 *Distribution) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *Distribution) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetDomains returns the Domains field value -func (o *Distribution) GetDomains() []Domain { - if o == nil { - var ret []Domain - return ret - } - - return o.Domains -} - -// GetDomainsOk returns a tuple with the Domains field value -// and a boolean to check if the value has been set. -func (o *Distribution) GetDomainsOk() ([]Domain, bool) { - if o == nil { - return nil, false - } - return o.Domains, true -} - -// SetDomains sets field value -func (o *Distribution) SetDomains(v []Domain) { - o.Domains = v -} - -// GetErrors returns the Errors field value if set, zero value otherwise. -func (o *Distribution) GetErrors() []StatusError { - if o == nil || IsNil(o.Errors) { - var ret []StatusError - return ret - } - return o.Errors -} - -// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Distribution) GetErrorsOk() ([]StatusError, bool) { - if o == nil || IsNil(o.Errors) { - return nil, false - } - return o.Errors, true -} - -// HasErrors returns a boolean if a field has been set. -func (o *Distribution) HasErrors() bool { - if o != nil && !IsNil(o.Errors) { - return true - } - - return false -} - -// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. -func (o *Distribution) SetErrors(v []StatusError) { - o.Errors = v -} - -// GetId returns the Id field value -func (o *Distribution) 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 *Distribution) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Distribution) SetId(v string) { - o.Id = v -} - -// GetProjectId returns the ProjectId field value -func (o *Distribution) GetProjectId() string { - if o == nil { - var ret string - return ret - } - - return o.ProjectId -} - -// GetProjectIdOk returns a tuple with the ProjectId field value -// and a boolean to check if the value has been set. -func (o *Distribution) GetProjectIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ProjectId, true -} - -// SetProjectId sets field value -func (o *Distribution) SetProjectId(v string) { - o.ProjectId = v -} - -// GetStatus returns the Status field value -func (o *Distribution) GetStatus() DistributionStatus { - if o == nil { - var ret DistributionStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *Distribution) GetStatusOk() (*DistributionStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *Distribution) SetStatus(v DistributionStatus) { - o.Status = v -} - -// GetUpdatedAt returns the UpdatedAt field value -func (o *Distribution) 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 *Distribution) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.UpdatedAt, true -} - -// SetUpdatedAt sets field value -func (o *Distribution) SetUpdatedAt(v time.Time) { - o.UpdatedAt = v -} - -// GetWaf returns the Waf field value if set, zero value otherwise. -func (o *Distribution) GetWaf() DistributionWaf { - if o == nil || IsNil(o.Waf) { - var ret DistributionWaf - return ret - } - return *o.Waf -} - -// GetWafOk returns a tuple with the Waf field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Distribution) GetWafOk() (*DistributionWaf, bool) { - if o == nil || IsNil(o.Waf) { - return nil, false - } - return o.Waf, true -} - -// HasWaf returns a boolean if a field has been set. -func (o *Distribution) HasWaf() bool { - if o != nil && !IsNil(o.Waf) { - return true - } - - return false -} - -// SetWaf gets a reference to the given DistributionWaf and assigns it to the Waf field. -func (o *Distribution) SetWaf(v DistributionWaf) { - o.Waf = &v -} - -func (o Distribution) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Distribution) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["config"] = o.Config - toSerialize["createdAt"] = o.CreatedAt - toSerialize["domains"] = o.Domains - if !IsNil(o.Errors) { - toSerialize["errors"] = o.Errors - } - toSerialize["id"] = o.Id - toSerialize["projectId"] = o.ProjectId - toSerialize["status"] = o.Status - toSerialize["updatedAt"] = o.UpdatedAt - if !IsNil(o.Waf) { - toSerialize["waf"] = o.Waf - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Distribution) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "config", - "createdAt", - "domains", - "id", - "projectId", - "status", - "updatedAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistribution := _Distribution{} - - err = json.Unmarshal(data, &varDistribution) - - if err != nil { - return err - } - - *o = Distribution(varDistribution) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "config") - delete(additionalProperties, "createdAt") - delete(additionalProperties, "domains") - delete(additionalProperties, "errors") - delete(additionalProperties, "id") - delete(additionalProperties, "projectId") - delete(additionalProperties, "status") - delete(additionalProperties, "updatedAt") - delete(additionalProperties, "waf") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistribution struct { - value *Distribution - isSet bool -} - -func (v NullableDistribution) Get() *Distribution { - return v.value -} - -func (v *NullableDistribution) Set(val *Distribution) { - v.value = val - v.isSet = true -} - -func (v NullableDistribution) IsSet() bool { - return v.isSet -} - -func (v *NullableDistribution) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistribution(val *Distribution) *NullableDistribution { - return &NullableDistribution{value: val, isSet: true} -} - -func (v NullableDistribution) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistribution) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_distribution_logs_record.go b/services/cdn/v1beta2api/model_distribution_logs_record.go deleted file mode 100644 index 07e3fafb5..000000000 --- a/services/cdn/v1beta2api/model_distribution_logs_record.go +++ /dev/null @@ -1,437 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the DistributionLogsRecord type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DistributionLogsRecord{} - -// DistributionLogsRecord struct for DistributionLogsRecord -type DistributionLogsRecord struct { - CacheHit bool `json:"cacheHit"` - DataCenterRegion string `json:"dataCenterRegion"` - DistributionId string `json:"distributionId"` - Host string `json:"host"` - Path string `json:"path"` - // ISO 3166-1 A2 compliant country code - RequestCountryCode string `json:"requestCountryCode"` - Size int64 `json:"size"` - StatusCode int32 `json:"statusCode"` - Timestamp time.Time `json:"timestamp"` - WafViolation *WAFViolation `json:"wafViolation,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _DistributionLogsRecord DistributionLogsRecord - -// NewDistributionLogsRecord instantiates a new DistributionLogsRecord 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 NewDistributionLogsRecord(cacheHit bool, dataCenterRegion string, distributionId string, host string, path string, requestCountryCode string, size int64, statusCode int32, timestamp time.Time) *DistributionLogsRecord { - this := DistributionLogsRecord{} - this.CacheHit = cacheHit - this.DataCenterRegion = dataCenterRegion - this.DistributionId = distributionId - this.Host = host - this.Path = path - this.RequestCountryCode = requestCountryCode - this.Size = size - this.StatusCode = statusCode - this.Timestamp = timestamp - return &this -} - -// NewDistributionLogsRecordWithDefaults instantiates a new DistributionLogsRecord 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 NewDistributionLogsRecordWithDefaults() *DistributionLogsRecord { - this := DistributionLogsRecord{} - return &this -} - -// GetCacheHit returns the CacheHit field value -func (o *DistributionLogsRecord) GetCacheHit() bool { - if o == nil { - var ret bool - return ret - } - - return o.CacheHit -} - -// GetCacheHitOk returns a tuple with the CacheHit field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetCacheHitOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.CacheHit, true -} - -// SetCacheHit sets field value -func (o *DistributionLogsRecord) SetCacheHit(v bool) { - o.CacheHit = v -} - -// GetDataCenterRegion returns the DataCenterRegion field value -func (o *DistributionLogsRecord) GetDataCenterRegion() string { - if o == nil { - var ret string - return ret - } - - return o.DataCenterRegion -} - -// GetDataCenterRegionOk returns a tuple with the DataCenterRegion field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetDataCenterRegionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DataCenterRegion, true -} - -// SetDataCenterRegion sets field value -func (o *DistributionLogsRecord) SetDataCenterRegion(v string) { - o.DataCenterRegion = v -} - -// GetDistributionId returns the DistributionId field value -func (o *DistributionLogsRecord) GetDistributionId() string { - if o == nil { - var ret string - return ret - } - - return o.DistributionId -} - -// GetDistributionIdOk returns a tuple with the DistributionId field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetDistributionIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DistributionId, true -} - -// SetDistributionId sets field value -func (o *DistributionLogsRecord) SetDistributionId(v string) { - o.DistributionId = v -} - -// GetHost returns the Host field value -func (o *DistributionLogsRecord) GetHost() string { - if o == nil { - var ret string - return ret - } - - return o.Host -} - -// GetHostOk returns a tuple with the Host field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetHostOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Host, true -} - -// SetHost sets field value -func (o *DistributionLogsRecord) SetHost(v string) { - o.Host = v -} - -// GetPath returns the Path field value -func (o *DistributionLogsRecord) GetPath() string { - if o == nil { - var ret string - return ret - } - - return o.Path -} - -// GetPathOk returns a tuple with the Path field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetPathOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Path, true -} - -// SetPath sets field value -func (o *DistributionLogsRecord) SetPath(v string) { - o.Path = v -} - -// GetRequestCountryCode returns the RequestCountryCode field value -func (o *DistributionLogsRecord) GetRequestCountryCode() string { - if o == nil { - var ret string - return ret - } - - return o.RequestCountryCode -} - -// GetRequestCountryCodeOk returns a tuple with the RequestCountryCode field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetRequestCountryCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RequestCountryCode, true -} - -// SetRequestCountryCode sets field value -func (o *DistributionLogsRecord) SetRequestCountryCode(v string) { - o.RequestCountryCode = v -} - -// GetSize returns the Size field value -func (o *DistributionLogsRecord) GetSize() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.Size -} - -// GetSizeOk returns a tuple with the Size field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetSizeOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.Size, true -} - -// SetSize sets field value -func (o *DistributionLogsRecord) SetSize(v int64) { - o.Size = v -} - -// GetStatusCode returns the StatusCode field value -func (o *DistributionLogsRecord) GetStatusCode() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.StatusCode -} - -// GetStatusCodeOk returns a tuple with the StatusCode field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetStatusCodeOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.StatusCode, true -} - -// SetStatusCode sets field value -func (o *DistributionLogsRecord) SetStatusCode(v int32) { - o.StatusCode = v -} - -// GetTimestamp returns the Timestamp field value -func (o *DistributionLogsRecord) GetTimestamp() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.Timestamp -} - -// GetTimestampOk returns a tuple with the Timestamp field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetTimestampOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.Timestamp, true -} - -// SetTimestamp sets field value -func (o *DistributionLogsRecord) SetTimestamp(v time.Time) { - o.Timestamp = v -} - -// GetWafViolation returns the WafViolation field value if set, zero value otherwise. -func (o *DistributionLogsRecord) GetWafViolation() WAFViolation { - if o == nil || IsNil(o.WafViolation) { - var ret WAFViolation - return ret - } - return *o.WafViolation -} - -// GetWafViolationOk returns a tuple with the WafViolation field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetWafViolationOk() (*WAFViolation, bool) { - if o == nil || IsNil(o.WafViolation) { - return nil, false - } - return o.WafViolation, true -} - -// HasWafViolation returns a boolean if a field has been set. -func (o *DistributionLogsRecord) HasWafViolation() bool { - if o != nil && !IsNil(o.WafViolation) { - return true - } - - return false -} - -// SetWafViolation gets a reference to the given WAFViolation and assigns it to the WafViolation field. -func (o *DistributionLogsRecord) SetWafViolation(v WAFViolation) { - o.WafViolation = &v -} - -func (o DistributionLogsRecord) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DistributionLogsRecord) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["cacheHit"] = o.CacheHit - toSerialize["dataCenterRegion"] = o.DataCenterRegion - toSerialize["distributionId"] = o.DistributionId - toSerialize["host"] = o.Host - toSerialize["path"] = o.Path - toSerialize["requestCountryCode"] = o.RequestCountryCode - toSerialize["size"] = o.Size - toSerialize["statusCode"] = o.StatusCode - toSerialize["timestamp"] = o.Timestamp - if !IsNil(o.WafViolation) { - toSerialize["wafViolation"] = o.WafViolation - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DistributionLogsRecord) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "cacheHit", - "dataCenterRegion", - "distributionId", - "host", - "path", - "requestCountryCode", - "size", - "statusCode", - "timestamp", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistributionLogsRecord := _DistributionLogsRecord{} - - err = json.Unmarshal(data, &varDistributionLogsRecord) - - if err != nil { - return err - } - - *o = DistributionLogsRecord(varDistributionLogsRecord) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "cacheHit") - delete(additionalProperties, "dataCenterRegion") - delete(additionalProperties, "distributionId") - delete(additionalProperties, "host") - delete(additionalProperties, "path") - delete(additionalProperties, "requestCountryCode") - delete(additionalProperties, "size") - delete(additionalProperties, "statusCode") - delete(additionalProperties, "timestamp") - delete(additionalProperties, "wafViolation") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistributionLogsRecord struct { - value *DistributionLogsRecord - isSet bool -} - -func (v NullableDistributionLogsRecord) Get() *DistributionLogsRecord { - return v.value -} - -func (v *NullableDistributionLogsRecord) Set(val *DistributionLogsRecord) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionLogsRecord) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionLogsRecord) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionLogsRecord(val *DistributionLogsRecord) *NullableDistributionLogsRecord { - return &NullableDistributionLogsRecord{value: val, isSet: true} -} - -func (v NullableDistributionLogsRecord) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionLogsRecord) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_distribution_statistics_record.go b/services/cdn/v1beta2api/model_distribution_statistics_record.go deleted file mode 100644 index 3e663aaef..000000000 --- a/services/cdn/v1beta2api/model_distribution_statistics_record.go +++ /dev/null @@ -1,317 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the DistributionStatisticsRecord type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DistributionStatisticsRecord{} - -// DistributionStatisticsRecord Aggregated statistics of a distribution during a time interval -type DistributionStatisticsRecord struct { - // Number of cached requests that were served - CachedRequests int64 `json:"cachedRequests"` - // Total number of requests that were served - TotalRequests int64 `json:"totalRequests"` - // Total traffic in bytes that occurred during the time interval - TotalTrafficBytes int64 `json:"totalTrafficBytes"` - // Exclusive end of the time interval the statistics refer to - End time.Time `json:"end"` - Regions DistributionStatisticsRecordRegions `json:"regions"` - // Start of the time interval the statistics refer to - Start time.Time `json:"start"` - AdditionalProperties map[string]interface{} -} - -type _DistributionStatisticsRecord DistributionStatisticsRecord - -// NewDistributionStatisticsRecord instantiates a new DistributionStatisticsRecord 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 NewDistributionStatisticsRecord(cachedRequests int64, totalRequests int64, totalTrafficBytes int64, end time.Time, regions DistributionStatisticsRecordRegions, start time.Time) *DistributionStatisticsRecord { - this := DistributionStatisticsRecord{} - this.CachedRequests = cachedRequests - this.TotalRequests = totalRequests - this.TotalTrafficBytes = totalTrafficBytes - this.End = end - this.Regions = regions - this.Start = start - return &this -} - -// NewDistributionStatisticsRecordWithDefaults instantiates a new DistributionStatisticsRecord 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 NewDistributionStatisticsRecordWithDefaults() *DistributionStatisticsRecord { - this := DistributionStatisticsRecord{} - return &this -} - -// GetCachedRequests returns the CachedRequests field value -func (o *DistributionStatisticsRecord) GetCachedRequests() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.CachedRequests -} - -// GetCachedRequestsOk returns a tuple with the CachedRequests field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetCachedRequestsOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.CachedRequests, true -} - -// SetCachedRequests sets field value -func (o *DistributionStatisticsRecord) SetCachedRequests(v int64) { - o.CachedRequests = v -} - -// GetTotalRequests returns the TotalRequests field value -func (o *DistributionStatisticsRecord) GetTotalRequests() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.TotalRequests -} - -// GetTotalRequestsOk returns a tuple with the TotalRequests field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetTotalRequestsOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.TotalRequests, true -} - -// SetTotalRequests sets field value -func (o *DistributionStatisticsRecord) SetTotalRequests(v int64) { - o.TotalRequests = v -} - -// GetTotalTrafficBytes returns the TotalTrafficBytes field value -func (o *DistributionStatisticsRecord) GetTotalTrafficBytes() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.TotalTrafficBytes -} - -// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetTotalTrafficBytesOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.TotalTrafficBytes, true -} - -// SetTotalTrafficBytes sets field value -func (o *DistributionStatisticsRecord) SetTotalTrafficBytes(v int64) { - o.TotalTrafficBytes = v -} - -// GetEnd returns the End field value -func (o *DistributionStatisticsRecord) GetEnd() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.End -} - -// GetEndOk returns a tuple with the End field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetEndOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.End, true -} - -// SetEnd sets field value -func (o *DistributionStatisticsRecord) SetEnd(v time.Time) { - o.End = v -} - -// GetRegions returns the Regions field value -func (o *DistributionStatisticsRecord) GetRegions() DistributionStatisticsRecordRegions { - if o == nil { - var ret DistributionStatisticsRecordRegions - return ret - } - - return o.Regions -} - -// GetRegionsOk returns a tuple with the Regions field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetRegionsOk() (*DistributionStatisticsRecordRegions, bool) { - if o == nil { - return nil, false - } - return &o.Regions, true -} - -// SetRegions sets field value -func (o *DistributionStatisticsRecord) SetRegions(v DistributionStatisticsRecordRegions) { - o.Regions = v -} - -// GetStart returns the Start field value -func (o *DistributionStatisticsRecord) GetStart() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.Start -} - -// GetStartOk returns a tuple with the Start field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetStartOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.Start, true -} - -// SetStart sets field value -func (o *DistributionStatisticsRecord) SetStart(v time.Time) { - o.Start = v -} - -func (o DistributionStatisticsRecord) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DistributionStatisticsRecord) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["cachedRequests"] = o.CachedRequests - toSerialize["totalRequests"] = o.TotalRequests - toSerialize["totalTrafficBytes"] = o.TotalTrafficBytes - toSerialize["end"] = o.End - toSerialize["regions"] = o.Regions - toSerialize["start"] = o.Start - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DistributionStatisticsRecord) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "cachedRequests", - "totalRequests", - "totalTrafficBytes", - "end", - "regions", - "start", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistributionStatisticsRecord := _DistributionStatisticsRecord{} - - err = json.Unmarshal(data, &varDistributionStatisticsRecord) - - if err != nil { - return err - } - - *o = DistributionStatisticsRecord(varDistributionStatisticsRecord) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "cachedRequests") - delete(additionalProperties, "totalRequests") - delete(additionalProperties, "totalTrafficBytes") - delete(additionalProperties, "end") - delete(additionalProperties, "regions") - delete(additionalProperties, "start") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistributionStatisticsRecord struct { - value *DistributionStatisticsRecord - isSet bool -} - -func (v NullableDistributionStatisticsRecord) Get() *DistributionStatisticsRecord { - return v.value -} - -func (v *NullableDistributionStatisticsRecord) Set(val *DistributionStatisticsRecord) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionStatisticsRecord) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionStatisticsRecord) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionStatisticsRecord(val *DistributionStatisticsRecord) *NullableDistributionStatisticsRecord { - return &NullableDistributionStatisticsRecord{value: val, isSet: true} -} - -func (v NullableDistributionStatisticsRecord) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionStatisticsRecord) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_distribution_statistics_record_entry.go b/services/cdn/v1beta2api/model_distribution_statistics_record_entry.go deleted file mode 100644 index 08107a104..000000000 --- a/services/cdn/v1beta2api/model_distribution_statistics_record_entry.go +++ /dev/null @@ -1,227 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the DistributionStatisticsRecordEntry type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DistributionStatisticsRecordEntry{} - -// DistributionStatisticsRecordEntry struct for DistributionStatisticsRecordEntry -type DistributionStatisticsRecordEntry struct { - // Number of cached requests that were served - CachedRequests int64 `json:"cachedRequests"` - // Total number of requests that were served - TotalRequests int64 `json:"totalRequests"` - // Total traffic in bytes that occurred during the time interval - TotalTrafficBytes int64 `json:"totalTrafficBytes"` - AdditionalProperties map[string]interface{} -} - -type _DistributionStatisticsRecordEntry DistributionStatisticsRecordEntry - -// NewDistributionStatisticsRecordEntry instantiates a new DistributionStatisticsRecordEntry 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 NewDistributionStatisticsRecordEntry(cachedRequests int64, totalRequests int64, totalTrafficBytes int64) *DistributionStatisticsRecordEntry { - this := DistributionStatisticsRecordEntry{} - this.CachedRequests = cachedRequests - this.TotalRequests = totalRequests - this.TotalTrafficBytes = totalTrafficBytes - return &this -} - -// NewDistributionStatisticsRecordEntryWithDefaults instantiates a new DistributionStatisticsRecordEntry 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 NewDistributionStatisticsRecordEntryWithDefaults() *DistributionStatisticsRecordEntry { - this := DistributionStatisticsRecordEntry{} - return &this -} - -// GetCachedRequests returns the CachedRequests field value -func (o *DistributionStatisticsRecordEntry) GetCachedRequests() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.CachedRequests -} - -// GetCachedRequestsOk returns a tuple with the CachedRequests field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordEntry) GetCachedRequestsOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.CachedRequests, true -} - -// SetCachedRequests sets field value -func (o *DistributionStatisticsRecordEntry) SetCachedRequests(v int64) { - o.CachedRequests = v -} - -// GetTotalRequests returns the TotalRequests field value -func (o *DistributionStatisticsRecordEntry) GetTotalRequests() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.TotalRequests -} - -// GetTotalRequestsOk returns a tuple with the TotalRequests field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordEntry) GetTotalRequestsOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.TotalRequests, true -} - -// SetTotalRequests sets field value -func (o *DistributionStatisticsRecordEntry) SetTotalRequests(v int64) { - o.TotalRequests = v -} - -// GetTotalTrafficBytes returns the TotalTrafficBytes field value -func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytes() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.TotalTrafficBytes -} - -// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytesOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.TotalTrafficBytes, true -} - -// SetTotalTrafficBytes sets field value -func (o *DistributionStatisticsRecordEntry) SetTotalTrafficBytes(v int64) { - o.TotalTrafficBytes = v -} - -func (o DistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DistributionStatisticsRecordEntry) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["cachedRequests"] = o.CachedRequests - toSerialize["totalRequests"] = o.TotalRequests - toSerialize["totalTrafficBytes"] = o.TotalTrafficBytes - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DistributionStatisticsRecordEntry) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "cachedRequests", - "totalRequests", - "totalTrafficBytes", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistributionStatisticsRecordEntry := _DistributionStatisticsRecordEntry{} - - err = json.Unmarshal(data, &varDistributionStatisticsRecordEntry) - - if err != nil { - return err - } - - *o = DistributionStatisticsRecordEntry(varDistributionStatisticsRecordEntry) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "cachedRequests") - delete(additionalProperties, "totalRequests") - delete(additionalProperties, "totalTrafficBytes") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistributionStatisticsRecordEntry struct { - value *DistributionStatisticsRecordEntry - isSet bool -} - -func (v NullableDistributionStatisticsRecordEntry) Get() *DistributionStatisticsRecordEntry { - return v.value -} - -func (v *NullableDistributionStatisticsRecordEntry) Set(val *DistributionStatisticsRecordEntry) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionStatisticsRecordEntry) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionStatisticsRecordEntry) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionStatisticsRecordEntry(val *DistributionStatisticsRecordEntry) *NullableDistributionStatisticsRecordEntry { - return &NullableDistributionStatisticsRecordEntry{value: val, isSet: true} -} - -func (v NullableDistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionStatisticsRecordEntry) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_distribution_statistics_record_regions.go b/services/cdn/v1beta2api/model_distribution_statistics_record_regions.go deleted file mode 100644 index 31a546e8f..000000000 --- a/services/cdn/v1beta2api/model_distribution_statistics_record_regions.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the DistributionStatisticsRecordRegions type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DistributionStatisticsRecordRegions{} - -// DistributionStatisticsRecordRegions Mapping of regions to the metrics for this region for the defined time interval All regions are always present. If no traffic was reported for a region, it will still contain 0-filled properties -type DistributionStatisticsRecordRegions struct { - AF DistributionStatisticsRecordEntry `json:"AF"` - ASIA DistributionStatisticsRecordEntry `json:"ASIA"` - EU DistributionStatisticsRecordEntry `json:"EU"` - SA DistributionStatisticsRecordEntry `json:"SA"` - US DistributionStatisticsRecordEntry `json:"US"` - AdditionalProperties map[string]interface{} -} - -type _DistributionStatisticsRecordRegions DistributionStatisticsRecordRegions - -// NewDistributionStatisticsRecordRegions instantiates a new DistributionStatisticsRecordRegions 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 NewDistributionStatisticsRecordRegions(aF DistributionStatisticsRecordEntry, aSIA DistributionStatisticsRecordEntry, eU DistributionStatisticsRecordEntry, sA DistributionStatisticsRecordEntry, uS DistributionStatisticsRecordEntry) *DistributionStatisticsRecordRegions { - this := DistributionStatisticsRecordRegions{} - this.AF = aF - this.ASIA = aSIA - this.EU = eU - this.SA = sA - this.US = uS - return &this -} - -// NewDistributionStatisticsRecordRegionsWithDefaults instantiates a new DistributionStatisticsRecordRegions 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 NewDistributionStatisticsRecordRegionsWithDefaults() *DistributionStatisticsRecordRegions { - this := DistributionStatisticsRecordRegions{} - return &this -} - -// GetAF returns the AF field value -func (o *DistributionStatisticsRecordRegions) GetAF() DistributionStatisticsRecordEntry { - if o == nil { - var ret DistributionStatisticsRecordEntry - return ret - } - - return o.AF -} - -// GetAFOk returns a tuple with the AF field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordRegions) GetAFOk() (*DistributionStatisticsRecordEntry, bool) { - if o == nil { - return nil, false - } - return &o.AF, true -} - -// SetAF sets field value -func (o *DistributionStatisticsRecordRegions) SetAF(v DistributionStatisticsRecordEntry) { - o.AF = v -} - -// GetASIA returns the ASIA field value -func (o *DistributionStatisticsRecordRegions) GetASIA() DistributionStatisticsRecordEntry { - if o == nil { - var ret DistributionStatisticsRecordEntry - return ret - } - - return o.ASIA -} - -// GetASIAOk returns a tuple with the ASIA field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordRegions) GetASIAOk() (*DistributionStatisticsRecordEntry, bool) { - if o == nil { - return nil, false - } - return &o.ASIA, true -} - -// SetASIA sets field value -func (o *DistributionStatisticsRecordRegions) SetASIA(v DistributionStatisticsRecordEntry) { - o.ASIA = v -} - -// GetEU returns the EU field value -func (o *DistributionStatisticsRecordRegions) GetEU() DistributionStatisticsRecordEntry { - if o == nil { - var ret DistributionStatisticsRecordEntry - return ret - } - - return o.EU -} - -// GetEUOk returns a tuple with the EU field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordRegions) GetEUOk() (*DistributionStatisticsRecordEntry, bool) { - if o == nil { - return nil, false - } - return &o.EU, true -} - -// SetEU sets field value -func (o *DistributionStatisticsRecordRegions) SetEU(v DistributionStatisticsRecordEntry) { - o.EU = v -} - -// GetSA returns the SA field value -func (o *DistributionStatisticsRecordRegions) GetSA() DistributionStatisticsRecordEntry { - if o == nil { - var ret DistributionStatisticsRecordEntry - return ret - } - - return o.SA -} - -// GetSAOk returns a tuple with the SA field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordRegions) GetSAOk() (*DistributionStatisticsRecordEntry, bool) { - if o == nil { - return nil, false - } - return &o.SA, true -} - -// SetSA sets field value -func (o *DistributionStatisticsRecordRegions) SetSA(v DistributionStatisticsRecordEntry) { - o.SA = v -} - -// GetUS returns the US field value -func (o *DistributionStatisticsRecordRegions) GetUS() DistributionStatisticsRecordEntry { - if o == nil { - var ret DistributionStatisticsRecordEntry - return ret - } - - return o.US -} - -// GetUSOk returns a tuple with the US field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordRegions) GetUSOk() (*DistributionStatisticsRecordEntry, bool) { - if o == nil { - return nil, false - } - return &o.US, true -} - -// SetUS sets field value -func (o *DistributionStatisticsRecordRegions) SetUS(v DistributionStatisticsRecordEntry) { - o.US = v -} - -func (o DistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DistributionStatisticsRecordRegions) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["AF"] = o.AF - toSerialize["ASIA"] = o.ASIA - toSerialize["EU"] = o.EU - toSerialize["SA"] = o.SA - toSerialize["US"] = o.US - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DistributionStatisticsRecordRegions) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "AF", - "ASIA", - "EU", - "SA", - "US", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistributionStatisticsRecordRegions := _DistributionStatisticsRecordRegions{} - - err = json.Unmarshal(data, &varDistributionStatisticsRecordRegions) - - if err != nil { - return err - } - - *o = DistributionStatisticsRecordRegions(varDistributionStatisticsRecordRegions) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "AF") - delete(additionalProperties, "ASIA") - delete(additionalProperties, "EU") - delete(additionalProperties, "SA") - delete(additionalProperties, "US") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistributionStatisticsRecordRegions struct { - value *DistributionStatisticsRecordRegions - isSet bool -} - -func (v NullableDistributionStatisticsRecordRegions) Get() *DistributionStatisticsRecordRegions { - return v.value -} - -func (v *NullableDistributionStatisticsRecordRegions) Set(val *DistributionStatisticsRecordRegions) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionStatisticsRecordRegions) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionStatisticsRecordRegions) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionStatisticsRecordRegions(val *DistributionStatisticsRecordRegions) *NullableDistributionStatisticsRecordRegions { - return &NullableDistributionStatisticsRecordRegions{value: val, isSet: true} -} - -func (v NullableDistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionStatisticsRecordRegions) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_distribution_status.go b/services/cdn/v1beta2api/model_distribution_status.go deleted file mode 100644 index eb49d463f..000000000 --- a/services/cdn/v1beta2api/model_distribution_status.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// DistributionStatus - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. -type DistributionStatus string - -// List of Distribution_status -const ( - DISTRIBUTIONSTATUS_CREATING DistributionStatus = "CREATING" - DISTRIBUTIONSTATUS_ACTIVE DistributionStatus = "ACTIVE" - DISTRIBUTIONSTATUS_UPDATING DistributionStatus = "UPDATING" - DISTRIBUTIONSTATUS_DELETING DistributionStatus = "DELETING" - DISTRIBUTIONSTATUS_ERROR DistributionStatus = "ERROR" - DISTRIBUTIONSTATUS_UNKNOWN_DEFAULT_OPEN_API DistributionStatus = "unknown_default_open_api" -) - -// All allowed values of DistributionStatus enum -var AllowedDistributionStatusEnumValues = []DistributionStatus{ - "CREATING", - "ACTIVE", - "UPDATING", - "DELETING", - "ERROR", - "unknown_default_open_api", -} - -func (v *DistributionStatus) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := DistributionStatus(value) - for _, existing := range AllowedDistributionStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = DISTRIBUTIONSTATUS_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewDistributionStatusFromValue returns a pointer to a valid DistributionStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewDistributionStatusFromValue(v string) (*DistributionStatus, error) { - ev := DistributionStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for DistributionStatus: valid values are %v", v, AllowedDistributionStatusEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v DistributionStatus) IsValid() bool { - for _, existing := range AllowedDistributionStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to Distribution_status value -func (v DistributionStatus) Ptr() *DistributionStatus { - return &v -} - -type NullableDistributionStatus struct { - value *DistributionStatus - isSet bool -} - -func (v NullableDistributionStatus) Get() *DistributionStatus { - return v.value -} - -func (v *NullableDistributionStatus) Set(val *DistributionStatus) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionStatus(val *DistributionStatus) *NullableDistributionStatus { - return &NullableDistributionStatus{value: val, isSet: true} -} - -func (v NullableDistributionStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_distribution_waf.go b/services/cdn/v1beta2api/model_distribution_waf.go deleted file mode 100644 index 1d23f5f5f..000000000 --- a/services/cdn/v1beta2api/model_distribution_waf.go +++ /dev/null @@ -1,224 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the DistributionWaf type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DistributionWaf{} - -// DistributionWaf For this property to be present two pre-conditions must be met: - the WAF was enabled at least once - the query parameter ?withWafStatus is truthy This property contains the waf Status. At this point in time, this contains all resolved rules. Rules are split into 3 groups: - enabledRules - logOnlyRules - disabledRules **Do note that the global waf mode (Disabled, LogOnly, Enabled) is *NOT* reflected in this list!** -type DistributionWaf struct { - DisabledRules []WafStatusRuleBlock `json:"disabledRules"` - EnabledRules []WafStatusRuleBlock `json:"enabledRules"` - LogOnlyRules []WafStatusRuleBlock `json:"logOnlyRules"` - AdditionalProperties map[string]interface{} -} - -type _DistributionWaf DistributionWaf - -// NewDistributionWaf instantiates a new DistributionWaf 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 NewDistributionWaf(disabledRules []WafStatusRuleBlock, enabledRules []WafStatusRuleBlock, logOnlyRules []WafStatusRuleBlock) *DistributionWaf { - this := DistributionWaf{} - this.DisabledRules = disabledRules - this.EnabledRules = enabledRules - this.LogOnlyRules = logOnlyRules - return &this -} - -// NewDistributionWafWithDefaults instantiates a new DistributionWaf 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 NewDistributionWafWithDefaults() *DistributionWaf { - this := DistributionWaf{} - return &this -} - -// GetDisabledRules returns the DisabledRules field value -func (o *DistributionWaf) GetDisabledRules() []WafStatusRuleBlock { - if o == nil { - var ret []WafStatusRuleBlock - return ret - } - - return o.DisabledRules -} - -// GetDisabledRulesOk returns a tuple with the DisabledRules field value -// and a boolean to check if the value has been set. -func (o *DistributionWaf) GetDisabledRulesOk() ([]WafStatusRuleBlock, bool) { - if o == nil { - return nil, false - } - return o.DisabledRules, true -} - -// SetDisabledRules sets field value -func (o *DistributionWaf) SetDisabledRules(v []WafStatusRuleBlock) { - o.DisabledRules = v -} - -// GetEnabledRules returns the EnabledRules field value -func (o *DistributionWaf) GetEnabledRules() []WafStatusRuleBlock { - if o == nil { - var ret []WafStatusRuleBlock - return ret - } - - return o.EnabledRules -} - -// GetEnabledRulesOk returns a tuple with the EnabledRules field value -// and a boolean to check if the value has been set. -func (o *DistributionWaf) GetEnabledRulesOk() ([]WafStatusRuleBlock, bool) { - if o == nil { - return nil, false - } - return o.EnabledRules, true -} - -// SetEnabledRules sets field value -func (o *DistributionWaf) SetEnabledRules(v []WafStatusRuleBlock) { - o.EnabledRules = v -} - -// GetLogOnlyRules returns the LogOnlyRules field value -func (o *DistributionWaf) GetLogOnlyRules() []WafStatusRuleBlock { - if o == nil { - var ret []WafStatusRuleBlock - return ret - } - - return o.LogOnlyRules -} - -// GetLogOnlyRulesOk returns a tuple with the LogOnlyRules field value -// and a boolean to check if the value has been set. -func (o *DistributionWaf) GetLogOnlyRulesOk() ([]WafStatusRuleBlock, bool) { - if o == nil { - return nil, false - } - return o.LogOnlyRules, true -} - -// SetLogOnlyRules sets field value -func (o *DistributionWaf) SetLogOnlyRules(v []WafStatusRuleBlock) { - o.LogOnlyRules = v -} - -func (o DistributionWaf) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DistributionWaf) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["disabledRules"] = o.DisabledRules - toSerialize["enabledRules"] = o.EnabledRules - toSerialize["logOnlyRules"] = o.LogOnlyRules - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DistributionWaf) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "disabledRules", - "enabledRules", - "logOnlyRules", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistributionWaf := _DistributionWaf{} - - err = json.Unmarshal(data, &varDistributionWaf) - - if err != nil { - return err - } - - *o = DistributionWaf(varDistributionWaf) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "disabledRules") - delete(additionalProperties, "enabledRules") - delete(additionalProperties, "logOnlyRules") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistributionWaf struct { - value *DistributionWaf - isSet bool -} - -func (v NullableDistributionWaf) Get() *DistributionWaf { - return v.value -} - -func (v *NullableDistributionWaf) Set(val *DistributionWaf) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionWaf) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionWaf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionWaf(val *DistributionWaf) *NullableDistributionWaf { - return &NullableDistributionWaf{value: val, isSet: true} -} - -func (v NullableDistributionWaf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionWaf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_domain.go b/services/cdn/v1beta2api/model_domain.go deleted file mode 100644 index 0d74581a5..000000000 --- a/services/cdn/v1beta2api/model_domain.go +++ /dev/null @@ -1,263 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the Domain type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Domain{} - -// Domain Definition of a custom or managed domain without any certificates or keys -type Domain struct { - // This object is present if the custom domain has errors. - Errors []StatusError `json:"errors,omitempty"` - // The domain. If this is a custom domain, you can call the GetCustomDomain Endpoint - Name string `json:"name"` - Status DomainStatus `json:"status"` - Type DomainType `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _Domain Domain - -// NewDomain instantiates a new Domain 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 NewDomain(name string, status DomainStatus, types DomainType) *Domain { - this := Domain{} - this.Name = name - this.Status = status - this.Type = types - return &this -} - -// NewDomainWithDefaults instantiates a new Domain 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 NewDomainWithDefaults() *Domain { - this := Domain{} - return &this -} - -// GetErrors returns the Errors field value if set, zero value otherwise. -func (o *Domain) GetErrors() []StatusError { - if o == nil || IsNil(o.Errors) { - var ret []StatusError - return ret - } - return o.Errors -} - -// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Domain) GetErrorsOk() ([]StatusError, bool) { - if o == nil || IsNil(o.Errors) { - return nil, false - } - return o.Errors, true -} - -// HasErrors returns a boolean if a field has been set. -func (o *Domain) HasErrors() bool { - if o != nil && !IsNil(o.Errors) { - return true - } - - return false -} - -// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. -func (o *Domain) SetErrors(v []StatusError) { - o.Errors = v -} - -// GetName returns the Name field value -func (o *Domain) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Domain) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Domain) SetName(v string) { - o.Name = v -} - -// GetStatus returns the Status field value -func (o *Domain) GetStatus() DomainStatus { - if o == nil { - var ret DomainStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *Domain) GetStatusOk() (*DomainStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *Domain) SetStatus(v DomainStatus) { - o.Status = v -} - -// GetType returns the Type field value -func (o *Domain) GetType() DomainType { - if o == nil { - var ret DomainType - 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 *Domain) GetTypeOk() (*DomainType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *Domain) SetType(v DomainType) { - o.Type = v -} - -func (o Domain) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Domain) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Errors) { - toSerialize["errors"] = o.Errors - } - toSerialize["name"] = o.Name - toSerialize["status"] = o.Status - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Domain) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - "status", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDomain := _Domain{} - - err = json.Unmarshal(data, &varDomain) - - if err != nil { - return err - } - - *o = Domain(varDomain) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "errors") - delete(additionalProperties, "name") - delete(additionalProperties, "status") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDomain struct { - value *Domain - isSet bool -} - -func (v NullableDomain) Get() *Domain { - return v.value -} - -func (v *NullableDomain) Set(val *Domain) { - v.value = val - v.isSet = true -} - -func (v NullableDomain) IsSet() bool { - return v.isSet -} - -func (v *NullableDomain) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDomain(val *Domain) *NullableDomain { - return &NullableDomain{value: val, isSet: true} -} - -func (v NullableDomain) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDomain) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_domain_status.go b/services/cdn/v1beta2api/model_domain_status.go deleted file mode 100644 index 108eb34e4..000000000 --- a/services/cdn/v1beta2api/model_domain_status.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// DomainStatus The status of the domain: CREATING indicates that the custom domain is being set up. UPDATING means that requested changes are being applied to the custom domain. ACTIVE means the custom domain is currently configured and active. DELETING means that the domain is in the process of being removed from the distribution. In case the domain has the ERROR state, more information will be available in the errors list. -type DomainStatus string - -// List of DomainStatus -const ( - DOMAINSTATUS_CREATING DomainStatus = "CREATING" - DOMAINSTATUS_ACTIVE DomainStatus = "ACTIVE" - DOMAINSTATUS_UPDATING DomainStatus = "UPDATING" - DOMAINSTATUS_DELETING DomainStatus = "DELETING" - DOMAINSTATUS_ERROR DomainStatus = "ERROR" - DOMAINSTATUS_UNKNOWN_DEFAULT_OPEN_API DomainStatus = "unknown_default_open_api" -) - -// All allowed values of DomainStatus enum -var AllowedDomainStatusEnumValues = []DomainStatus{ - "CREATING", - "ACTIVE", - "UPDATING", - "DELETING", - "ERROR", - "unknown_default_open_api", -} - -func (v *DomainStatus) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := DomainStatus(value) - for _, existing := range AllowedDomainStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = DOMAINSTATUS_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewDomainStatusFromValue returns a pointer to a valid DomainStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewDomainStatusFromValue(v string) (*DomainStatus, error) { - ev := DomainStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for DomainStatus: valid values are %v", v, AllowedDomainStatusEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v DomainStatus) IsValid() bool { - for _, existing := range AllowedDomainStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DomainStatus value -func (v DomainStatus) Ptr() *DomainStatus { - return &v -} - -type NullableDomainStatus struct { - value *DomainStatus - isSet bool -} - -func (v NullableDomainStatus) Get() *DomainStatus { - return v.value -} - -func (v *NullableDomainStatus) Set(val *DomainStatus) { - v.value = val - v.isSet = true -} - -func (v NullableDomainStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableDomainStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDomainStatus(val *DomainStatus) *NullableDomainStatus { - return &NullableDomainStatus{value: val, isSet: true} -} - -func (v NullableDomainStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDomainStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_domain_type.go b/services/cdn/v1beta2api/model_domain_type.go deleted file mode 100644 index 349024ab1..000000000 --- a/services/cdn/v1beta2api/model_domain_type.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// DomainType Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint -type DomainType string - -// List of Domain_type -const ( - DOMAINTYPE_MANAGED DomainType = "managed" - DOMAINTYPE_CUSTOM DomainType = "custom" - DOMAINTYPE_UNKNOWN_DEFAULT_OPEN_API DomainType = "unknown_default_open_api" -) - -// All allowed values of DomainType enum -var AllowedDomainTypeEnumValues = []DomainType{ - "managed", - "custom", - "unknown_default_open_api", -} - -func (v *DomainType) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := DomainType(value) - for _, existing := range AllowedDomainTypeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = DOMAINTYPE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewDomainTypeFromValue returns a pointer to a valid DomainType -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewDomainTypeFromValue(v string) (*DomainType, error) { - ev := DomainType(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for DomainType: valid values are %v", v, AllowedDomainTypeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v DomainType) IsValid() bool { - for _, existing := range AllowedDomainTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to Domain_type value -func (v DomainType) Ptr() *DomainType { - return &v -} - -type NullableDomainType struct { - value *DomainType - isSet bool -} - -func (v NullableDomainType) Get() *DomainType { - return v.value -} - -func (v *NullableDomainType) Set(val *DomainType) { - v.value = val - v.isSet = true -} - -func (v NullableDomainType) IsSet() bool { - return v.isSet -} - -func (v *NullableDomainType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDomainType(val *DomainType) *NullableDomainType { - return &NullableDomainType{value: val, isSet: true} -} - -func (v NullableDomainType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDomainType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_error_details.go b/services/cdn/v1beta2api/model_error_details.go deleted file mode 100644 index 04bda03dd..000000000 --- a/services/cdn/v1beta2api/model_error_details.go +++ /dev/null @@ -1,272 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the ErrorDetails type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ErrorDetails{} - -// ErrorDetails struct for ErrorDetails -type ErrorDetails struct { - // German description of the error - De *string `json:"de,omitempty"` - // English description of the error - En string `json:"en"` - // Optional field in the request this error detail refers to - Field *string `json:"field,omitempty"` - Key ErrorDetailsKey `json:"key"` - AdditionalProperties map[string]interface{} -} - -type _ErrorDetails ErrorDetails - -// NewErrorDetails instantiates a new ErrorDetails 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 NewErrorDetails(en string, key ErrorDetailsKey) *ErrorDetails { - this := ErrorDetails{} - this.En = en - this.Key = key - return &this -} - -// NewErrorDetailsWithDefaults instantiates a new ErrorDetails 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 NewErrorDetailsWithDefaults() *ErrorDetails { - this := ErrorDetails{} - return &this -} - -// GetDe returns the De field value if set, zero value otherwise. -func (o *ErrorDetails) GetDe() string { - if o == nil || IsNil(o.De) { - var ret string - return ret - } - return *o.De -} - -// GetDeOk returns a tuple with the De field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorDetails) GetDeOk() (*string, bool) { - if o == nil || IsNil(o.De) { - return nil, false - } - return o.De, true -} - -// HasDe returns a boolean if a field has been set. -func (o *ErrorDetails) HasDe() bool { - if o != nil && !IsNil(o.De) { - return true - } - - return false -} - -// SetDe gets a reference to the given string and assigns it to the De field. -func (o *ErrorDetails) SetDe(v string) { - o.De = &v -} - -// GetEn returns the En field value -func (o *ErrorDetails) GetEn() string { - if o == nil { - var ret string - return ret - } - - return o.En -} - -// GetEnOk returns a tuple with the En field value -// and a boolean to check if the value has been set. -func (o *ErrorDetails) GetEnOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.En, true -} - -// SetEn sets field value -func (o *ErrorDetails) SetEn(v string) { - o.En = v -} - -// GetField returns the Field field value if set, zero value otherwise. -func (o *ErrorDetails) GetField() string { - if o == nil || IsNil(o.Field) { - var ret string - return ret - } - return *o.Field -} - -// GetFieldOk returns a tuple with the Field field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorDetails) GetFieldOk() (*string, bool) { - if o == nil || IsNil(o.Field) { - return nil, false - } - return o.Field, true -} - -// HasField returns a boolean if a field has been set. -func (o *ErrorDetails) HasField() bool { - if o != nil && !IsNil(o.Field) { - return true - } - - return false -} - -// SetField gets a reference to the given string and assigns it to the Field field. -func (o *ErrorDetails) SetField(v string) { - o.Field = &v -} - -// GetKey returns the Key field value -func (o *ErrorDetails) GetKey() ErrorDetailsKey { - if o == nil { - var ret ErrorDetailsKey - return ret - } - - return o.Key -} - -// GetKeyOk returns a tuple with the Key field value -// and a boolean to check if the value has been set. -func (o *ErrorDetails) GetKeyOk() (*ErrorDetailsKey, bool) { - if o == nil { - return nil, false - } - return &o.Key, true -} - -// SetKey sets field value -func (o *ErrorDetails) SetKey(v ErrorDetailsKey) { - o.Key = v -} - -func (o ErrorDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ErrorDetails) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.De) { - toSerialize["de"] = o.De - } - toSerialize["en"] = o.En - if !IsNil(o.Field) { - toSerialize["field"] = o.Field - } - toSerialize["key"] = o.Key - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ErrorDetails) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "en", - "key", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varErrorDetails := _ErrorDetails{} - - err = json.Unmarshal(data, &varErrorDetails) - - if err != nil { - return err - } - - *o = ErrorDetails(varErrorDetails) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "de") - delete(additionalProperties, "en") - delete(additionalProperties, "field") - delete(additionalProperties, "key") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableErrorDetails struct { - value *ErrorDetails - isSet bool -} - -func (v NullableErrorDetails) Get() *ErrorDetails { - return v.value -} - -func (v *NullableErrorDetails) Set(val *ErrorDetails) { - v.value = val - v.isSet = true -} - -func (v NullableErrorDetails) IsSet() bool { - return v.isSet -} - -func (v *NullableErrorDetails) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableErrorDetails(val *ErrorDetails) *NullableErrorDetails { - return &NullableErrorDetails{value: val, isSet: true} -} - -func (v NullableErrorDetails) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableErrorDetails) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_error_details_key.go b/services/cdn/v1beta2api/model_error_details_key.go deleted file mode 100644 index d1277f5bb..000000000 --- a/services/cdn/v1beta2api/model_error_details_key.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// ErrorDetailsKey the model 'ErrorDetailsKey' -type ErrorDetailsKey string - -// List of ErrorDetails_key -const ( - ERRORDETAILSKEY_UNKNOWN ErrorDetailsKey = "UNKNOWN" - ERRORDETAILSKEY_CUSTOM_DOMAIN_CNAME_MISSING ErrorDetailsKey = "CUSTOM_DOMAIN_CNAME_MISSING" - ERRORDETAILSKEY_INVALID_ARGUMENT ErrorDetailsKey = "INVALID_ARGUMENT" - ERRORDETAILSKEY_LOG_SINK_INSTANCE_UNAVAILABLE ErrorDetailsKey = "LOG_SINK_INSTANCE_UNAVAILABLE" - ERRORDETAILSKEY_UNKNOWN_DEFAULT_OPEN_API ErrorDetailsKey = "unknown_default_open_api" -) - -// All allowed values of ErrorDetailsKey enum -var AllowedErrorDetailsKeyEnumValues = []ErrorDetailsKey{ - "UNKNOWN", - "CUSTOM_DOMAIN_CNAME_MISSING", - "INVALID_ARGUMENT", - "LOG_SINK_INSTANCE_UNAVAILABLE", - "unknown_default_open_api", -} - -func (v *ErrorDetailsKey) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ErrorDetailsKey(value) - for _, existing := range AllowedErrorDetailsKeyEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = ERRORDETAILSKEY_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewErrorDetailsKeyFromValue returns a pointer to a valid ErrorDetailsKey -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewErrorDetailsKeyFromValue(v string) (*ErrorDetailsKey, error) { - ev := ErrorDetailsKey(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ErrorDetailsKey: valid values are %v", v, AllowedErrorDetailsKeyEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ErrorDetailsKey) IsValid() bool { - for _, existing := range AllowedErrorDetailsKeyEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ErrorDetails_key value -func (v ErrorDetailsKey) Ptr() *ErrorDetailsKey { - return &v -} - -type NullableErrorDetailsKey struct { - value *ErrorDetailsKey - isSet bool -} - -func (v NullableErrorDetailsKey) Get() *ErrorDetailsKey { - return v.value -} - -func (v *NullableErrorDetailsKey) Set(val *ErrorDetailsKey) { - v.value = val - v.isSet = true -} - -func (v NullableErrorDetailsKey) IsSet() bool { - return v.isSet -} - -func (v *NullableErrorDetailsKey) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableErrorDetailsKey(val *ErrorDetailsKey) *NullableErrorDetailsKey { - return &NullableErrorDetailsKey{value: val, isSet: true} -} - -func (v NullableErrorDetailsKey) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableErrorDetailsKey) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_find_cache_paths_response.go b/services/cdn/v1beta2api/model_find_cache_paths_response.go deleted file mode 100644 index 2f8019b9c..000000000 --- a/services/cdn/v1beta2api/model_find_cache_paths_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the FindCachePathsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &FindCachePathsResponse{} - -// FindCachePathsResponse struct for FindCachePathsResponse -type FindCachePathsResponse struct { - Response []FindCachePathsResponseEntry `json:"response"` - AdditionalProperties map[string]interface{} -} - -type _FindCachePathsResponse FindCachePathsResponse - -// NewFindCachePathsResponse instantiates a new FindCachePathsResponse 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 NewFindCachePathsResponse(response []FindCachePathsResponseEntry) *FindCachePathsResponse { - this := FindCachePathsResponse{} - this.Response = response - return &this -} - -// NewFindCachePathsResponseWithDefaults instantiates a new FindCachePathsResponse 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 NewFindCachePathsResponseWithDefaults() *FindCachePathsResponse { - this := FindCachePathsResponse{} - return &this -} - -// GetResponse returns the Response field value -func (o *FindCachePathsResponse) GetResponse() []FindCachePathsResponseEntry { - if o == nil { - var ret []FindCachePathsResponseEntry - return ret - } - - return o.Response -} - -// GetResponseOk returns a tuple with the Response field value -// and a boolean to check if the value has been set. -func (o *FindCachePathsResponse) GetResponseOk() ([]FindCachePathsResponseEntry, bool) { - if o == nil { - return nil, false - } - return o.Response, true -} - -// SetResponse sets field value -func (o *FindCachePathsResponse) SetResponse(v []FindCachePathsResponseEntry) { - o.Response = v -} - -func (o FindCachePathsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o FindCachePathsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["response"] = o.Response - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *FindCachePathsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "response", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varFindCachePathsResponse := _FindCachePathsResponse{} - - err = json.Unmarshal(data, &varFindCachePathsResponse) - - if err != nil { - return err - } - - *o = FindCachePathsResponse(varFindCachePathsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "response") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableFindCachePathsResponse struct { - value *FindCachePathsResponse - isSet bool -} - -func (v NullableFindCachePathsResponse) Get() *FindCachePathsResponse { - return v.value -} - -func (v *NullableFindCachePathsResponse) Set(val *FindCachePathsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableFindCachePathsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableFindCachePathsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFindCachePathsResponse(val *FindCachePathsResponse) *NullableFindCachePathsResponse { - return &NullableFindCachePathsResponse{value: val, isSet: true} -} - -func (v NullableFindCachePathsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFindCachePathsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_find_cache_paths_response_entry.go b/services/cdn/v1beta2api/model_find_cache_paths_response_entry.go deleted file mode 100644 index d7e1c57dc..000000000 --- a/services/cdn/v1beta2api/model_find_cache_paths_response_entry.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the FindCachePathsResponseEntry type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &FindCachePathsResponseEntry{} - -// FindCachePathsResponseEntry struct for FindCachePathsResponseEntry -type FindCachePathsResponseEntry struct { - // Defines one path that was previously used as part of a granular purge - Path string `json:"path"` - AdditionalProperties map[string]interface{} -} - -type _FindCachePathsResponseEntry FindCachePathsResponseEntry - -// NewFindCachePathsResponseEntry instantiates a new FindCachePathsResponseEntry 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 NewFindCachePathsResponseEntry(path string) *FindCachePathsResponseEntry { - this := FindCachePathsResponseEntry{} - this.Path = path - return &this -} - -// NewFindCachePathsResponseEntryWithDefaults instantiates a new FindCachePathsResponseEntry 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 NewFindCachePathsResponseEntryWithDefaults() *FindCachePathsResponseEntry { - this := FindCachePathsResponseEntry{} - return &this -} - -// GetPath returns the Path field value -func (o *FindCachePathsResponseEntry) GetPath() string { - if o == nil { - var ret string - return ret - } - - return o.Path -} - -// GetPathOk returns a tuple with the Path field value -// and a boolean to check if the value has been set. -func (o *FindCachePathsResponseEntry) GetPathOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Path, true -} - -// SetPath sets field value -func (o *FindCachePathsResponseEntry) SetPath(v string) { - o.Path = v -} - -func (o FindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o FindCachePathsResponseEntry) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["path"] = o.Path - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *FindCachePathsResponseEntry) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "path", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varFindCachePathsResponseEntry := _FindCachePathsResponseEntry{} - - err = json.Unmarshal(data, &varFindCachePathsResponseEntry) - - if err != nil { - return err - } - - *o = FindCachePathsResponseEntry(varFindCachePathsResponseEntry) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "path") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableFindCachePathsResponseEntry struct { - value *FindCachePathsResponseEntry - isSet bool -} - -func (v NullableFindCachePathsResponseEntry) Get() *FindCachePathsResponseEntry { - return v.value -} - -func (v *NullableFindCachePathsResponseEntry) Set(val *FindCachePathsResponseEntry) { - v.value = val - v.isSet = true -} - -func (v NullableFindCachePathsResponseEntry) IsSet() bool { - return v.isSet -} - -func (v *NullableFindCachePathsResponseEntry) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFindCachePathsResponseEntry(val *FindCachePathsResponseEntry) *NullableFindCachePathsResponseEntry { - return &NullableFindCachePathsResponseEntry{value: val, isSet: true} -} - -func (v NullableFindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFindCachePathsResponseEntry) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_generic_json_response.go b/services/cdn/v1beta2api/model_generic_json_response.go deleted file mode 100644 index 7612ee817..000000000 --- a/services/cdn/v1beta2api/model_generic_json_response.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GenericJsonResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GenericJsonResponse{} - -// GenericJsonResponse struct for GenericJsonResponse -type GenericJsonResponse struct { - // Listing of issues with your request - Details []ErrorDetails `json:"details,omitempty"` - Message string `json:"message"` - AdditionalProperties map[string]interface{} -} - -type _GenericJsonResponse GenericJsonResponse - -// NewGenericJsonResponse instantiates a new GenericJsonResponse 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 NewGenericJsonResponse(message string) *GenericJsonResponse { - this := GenericJsonResponse{} - this.Message = message - return &this -} - -// NewGenericJsonResponseWithDefaults instantiates a new GenericJsonResponse 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 NewGenericJsonResponseWithDefaults() *GenericJsonResponse { - this := GenericJsonResponse{} - return &this -} - -// GetDetails returns the Details field value if set, zero value otherwise. -func (o *GenericJsonResponse) GetDetails() []ErrorDetails { - if o == nil || IsNil(o.Details) { - var ret []ErrorDetails - return ret - } - return o.Details -} - -// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GenericJsonResponse) GetDetailsOk() ([]ErrorDetails, bool) { - if o == nil || IsNil(o.Details) { - return nil, false - } - return o.Details, true -} - -// HasDetails returns a boolean if a field has been set. -func (o *GenericJsonResponse) HasDetails() bool { - if o != nil && !IsNil(o.Details) { - return true - } - - return false -} - -// SetDetails gets a reference to the given []ErrorDetails and assigns it to the Details field. -func (o *GenericJsonResponse) SetDetails(v []ErrorDetails) { - o.Details = v -} - -// GetMessage returns the Message field value -func (o *GenericJsonResponse) GetMessage() string { - if o == nil { - var ret string - return ret - } - - return o.Message -} - -// GetMessageOk returns a tuple with the Message field value -// and a boolean to check if the value has been set. -func (o *GenericJsonResponse) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Message, true -} - -// SetMessage sets field value -func (o *GenericJsonResponse) SetMessage(v string) { - o.Message = v -} - -func (o GenericJsonResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GenericJsonResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Details) { - toSerialize["details"] = o.Details - } - toSerialize["message"] = o.Message - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GenericJsonResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "message", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGenericJsonResponse := _GenericJsonResponse{} - - err = json.Unmarshal(data, &varGenericJsonResponse) - - if err != nil { - return err - } - - *o = GenericJsonResponse(varGenericJsonResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "details") - delete(additionalProperties, "message") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGenericJsonResponse struct { - value *GenericJsonResponse - isSet bool -} - -func (v NullableGenericJsonResponse) Get() *GenericJsonResponse { - return v.value -} - -func (v *NullableGenericJsonResponse) Set(val *GenericJsonResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGenericJsonResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGenericJsonResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGenericJsonResponse(val *GenericJsonResponse) *NullableGenericJsonResponse { - return &NullableGenericJsonResponse{value: val, isSet: true} -} - -func (v NullableGenericJsonResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGenericJsonResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_cache_info_response.go b/services/cdn/v1beta2api/model_get_cache_info_response.go deleted file mode 100644 index 449e31896..000000000 --- a/services/cdn/v1beta2api/model_get_cache_info_response.go +++ /dev/null @@ -1,199 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the GetCacheInfoResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCacheInfoResponse{} - -// GetCacheInfoResponse struct for GetCacheInfoResponse -type GetCacheInfoResponse struct { - History []GetCacheInfoResponseHistoryEntry `json:"history"` - // Returns the last time the cache was purged by calling the PurgeCache endpoint. Time represented as RFC3339 compliant string. If the cache was never purged, this returns `null` - LastPurgeTime NullableTime `json:"lastPurgeTime"` - AdditionalProperties map[string]interface{} -} - -type _GetCacheInfoResponse GetCacheInfoResponse - -// NewGetCacheInfoResponse instantiates a new GetCacheInfoResponse 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 NewGetCacheInfoResponse(history []GetCacheInfoResponseHistoryEntry, lastPurgeTime NullableTime) *GetCacheInfoResponse { - this := GetCacheInfoResponse{} - this.History = history - this.LastPurgeTime = lastPurgeTime - return &this -} - -// NewGetCacheInfoResponseWithDefaults instantiates a new GetCacheInfoResponse 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 NewGetCacheInfoResponseWithDefaults() *GetCacheInfoResponse { - this := GetCacheInfoResponse{} - return &this -} - -// GetHistory returns the History field value -func (o *GetCacheInfoResponse) GetHistory() []GetCacheInfoResponseHistoryEntry { - if o == nil { - var ret []GetCacheInfoResponseHistoryEntry - return ret - } - - return o.History -} - -// GetHistoryOk returns a tuple with the History field value -// and a boolean to check if the value has been set. -func (o *GetCacheInfoResponse) GetHistoryOk() ([]GetCacheInfoResponseHistoryEntry, bool) { - if o == nil { - return nil, false - } - return o.History, true -} - -// SetHistory sets field value -func (o *GetCacheInfoResponse) SetHistory(v []GetCacheInfoResponseHistoryEntry) { - o.History = v -} - -// GetLastPurgeTime returns the LastPurgeTime field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *GetCacheInfoResponse) GetLastPurgeTime() time.Time { - if o == nil || o.LastPurgeTime.Get() == nil { - var ret time.Time - return ret - } - - return *o.LastPurgeTime.Get() -} - -// GetLastPurgeTimeOk returns a tuple with the LastPurgeTime field value -// 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 *GetCacheInfoResponse) GetLastPurgeTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.LastPurgeTime.Get(), o.LastPurgeTime.IsSet() -} - -// SetLastPurgeTime sets field value -func (o *GetCacheInfoResponse) SetLastPurgeTime(v time.Time) { - o.LastPurgeTime.Set(&v) -} - -func (o GetCacheInfoResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetCacheInfoResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["history"] = o.History - toSerialize["lastPurgeTime"] = o.LastPurgeTime.Get() - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetCacheInfoResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "history", - "lastPurgeTime", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetCacheInfoResponse := _GetCacheInfoResponse{} - - err = json.Unmarshal(data, &varGetCacheInfoResponse) - - if err != nil { - return err - } - - *o = GetCacheInfoResponse(varGetCacheInfoResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "history") - delete(additionalProperties, "lastPurgeTime") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetCacheInfoResponse struct { - value *GetCacheInfoResponse - isSet bool -} - -func (v NullableGetCacheInfoResponse) Get() *GetCacheInfoResponse { - return v.value -} - -func (v *NullableGetCacheInfoResponse) Set(val *GetCacheInfoResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetCacheInfoResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCacheInfoResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCacheInfoResponse(val *GetCacheInfoResponse) *NullableGetCacheInfoResponse { - return &NullableGetCacheInfoResponse{value: val, isSet: true} -} - -func (v NullableGetCacheInfoResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCacheInfoResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_cache_info_response_history_entry.go b/services/cdn/v1beta2api/model_get_cache_info_response_history_entry.go deleted file mode 100644 index b09909e70..000000000 --- a/services/cdn/v1beta2api/model_get_cache_info_response_history_entry.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the GetCacheInfoResponseHistoryEntry type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCacheInfoResponseHistoryEntry{} - -// GetCacheInfoResponseHistoryEntry struct for GetCacheInfoResponseHistoryEntry -type GetCacheInfoResponseHistoryEntry struct { - OccurredAt time.Time `json:"occurredAt"` - Type GetCacheInfoResponseHistoryEntryType `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _GetCacheInfoResponseHistoryEntry GetCacheInfoResponseHistoryEntry - -// NewGetCacheInfoResponseHistoryEntry instantiates a new GetCacheInfoResponseHistoryEntry 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 NewGetCacheInfoResponseHistoryEntry(occurredAt time.Time, types GetCacheInfoResponseHistoryEntryType) *GetCacheInfoResponseHistoryEntry { - this := GetCacheInfoResponseHistoryEntry{} - this.OccurredAt = occurredAt - this.Type = types - return &this -} - -// NewGetCacheInfoResponseHistoryEntryWithDefaults instantiates a new GetCacheInfoResponseHistoryEntry 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 NewGetCacheInfoResponseHistoryEntryWithDefaults() *GetCacheInfoResponseHistoryEntry { - this := GetCacheInfoResponseHistoryEntry{} - return &this -} - -// GetOccurredAt returns the OccurredAt field value -func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.OccurredAt -} - -// GetOccurredAtOk returns a tuple with the OccurredAt field value -// and a boolean to check if the value has been set. -func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.OccurredAt, true -} - -// SetOccurredAt sets field value -func (o *GetCacheInfoResponseHistoryEntry) SetOccurredAt(v time.Time) { - o.OccurredAt = v -} - -// GetType returns the Type field value -func (o *GetCacheInfoResponseHistoryEntry) GetType() GetCacheInfoResponseHistoryEntryType { - if o == nil { - var ret GetCacheInfoResponseHistoryEntryType - 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 *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*GetCacheInfoResponseHistoryEntryType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *GetCacheInfoResponseHistoryEntry) SetType(v GetCacheInfoResponseHistoryEntryType) { - o.Type = v -} - -func (o GetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetCacheInfoResponseHistoryEntry) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["occurredAt"] = o.OccurredAt - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetCacheInfoResponseHistoryEntry) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "occurredAt", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetCacheInfoResponseHistoryEntry := _GetCacheInfoResponseHistoryEntry{} - - err = json.Unmarshal(data, &varGetCacheInfoResponseHistoryEntry) - - if err != nil { - return err - } - - *o = GetCacheInfoResponseHistoryEntry(varGetCacheInfoResponseHistoryEntry) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "occurredAt") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetCacheInfoResponseHistoryEntry struct { - value *GetCacheInfoResponseHistoryEntry - isSet bool -} - -func (v NullableGetCacheInfoResponseHistoryEntry) Get() *GetCacheInfoResponseHistoryEntry { - return v.value -} - -func (v *NullableGetCacheInfoResponseHistoryEntry) Set(val *GetCacheInfoResponseHistoryEntry) { - v.value = val - v.isSet = true -} - -func (v NullableGetCacheInfoResponseHistoryEntry) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCacheInfoResponseHistoryEntry) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCacheInfoResponseHistoryEntry(val *GetCacheInfoResponseHistoryEntry) *NullableGetCacheInfoResponseHistoryEntry { - return &NullableGetCacheInfoResponseHistoryEntry{value: val, isSet: true} -} - -func (v NullableGetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCacheInfoResponseHistoryEntry) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_cache_info_response_history_entry_type.go b/services/cdn/v1beta2api/model_get_cache_info_response_history_entry_type.go deleted file mode 100644 index 9c4ec5a86..000000000 --- a/services/cdn/v1beta2api/model_get_cache_info_response_history_entry_type.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// GetCacheInfoResponseHistoryEntryType the model 'GetCacheInfoResponseHistoryEntryType' -type GetCacheInfoResponseHistoryEntryType string - -// List of GetCacheInfoResponseHistoryEntry_type -const ( - GETCACHEINFORESPONSEHISTORYENTRYTYPE_FULL GetCacheInfoResponseHistoryEntryType = "full" - GETCACHEINFORESPONSEHISTORYENTRYTYPE_GRANULAR GetCacheInfoResponseHistoryEntryType = "granular" - GETCACHEINFORESPONSEHISTORYENTRYTYPE_UNKNOWN_DEFAULT_OPEN_API GetCacheInfoResponseHistoryEntryType = "unknown_default_open_api" -) - -// All allowed values of GetCacheInfoResponseHistoryEntryType enum -var AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues = []GetCacheInfoResponseHistoryEntryType{ - "full", - "granular", - "unknown_default_open_api", -} - -func (v *GetCacheInfoResponseHistoryEntryType) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetCacheInfoResponseHistoryEntryType(value) - for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETCACHEINFORESPONSEHISTORYENTRYTYPE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetCacheInfoResponseHistoryEntryTypeFromValue returns a pointer to a valid GetCacheInfoResponseHistoryEntryType -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetCacheInfoResponseHistoryEntryTypeFromValue(v string) (*GetCacheInfoResponseHistoryEntryType, error) { - ev := GetCacheInfoResponseHistoryEntryType(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetCacheInfoResponseHistoryEntryType: valid values are %v", v, AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetCacheInfoResponseHistoryEntryType) IsValid() bool { - for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetCacheInfoResponseHistoryEntry_type value -func (v GetCacheInfoResponseHistoryEntryType) Ptr() *GetCacheInfoResponseHistoryEntryType { - return &v -} - -type NullableGetCacheInfoResponseHistoryEntryType struct { - value *GetCacheInfoResponseHistoryEntryType - isSet bool -} - -func (v NullableGetCacheInfoResponseHistoryEntryType) Get() *GetCacheInfoResponseHistoryEntryType { - return v.value -} - -func (v *NullableGetCacheInfoResponseHistoryEntryType) Set(val *GetCacheInfoResponseHistoryEntryType) { - v.value = val - v.isSet = true -} - -func (v NullableGetCacheInfoResponseHistoryEntryType) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCacheInfoResponseHistoryEntryType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCacheInfoResponseHistoryEntryType(val *GetCacheInfoResponseHistoryEntryType) *NullableGetCacheInfoResponseHistoryEntryType { - return &NullableGetCacheInfoResponseHistoryEntryType{value: val, isSet: true} -} - -func (v NullableGetCacheInfoResponseHistoryEntryType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCacheInfoResponseHistoryEntryType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_custom_domain_custom_certificate.go b/services/cdn/v1beta2api/model_get_custom_domain_custom_certificate.go deleted file mode 100644 index 34cf3ba8b..000000000 --- a/services/cdn/v1beta2api/model_get_custom_domain_custom_certificate.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCustomDomainCustomCertificate{} - -// GetCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. -type GetCustomDomainCustomCertificate struct { - Type string `json:"type"` - // Whenever a new custom certificate is added the version is increased by 1. - Version int32 `json:"version"` - AdditionalProperties map[string]interface{} -} - -type _GetCustomDomainCustomCertificate GetCustomDomainCustomCertificate - -// NewGetCustomDomainCustomCertificate instantiates a new GetCustomDomainCustomCertificate 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 NewGetCustomDomainCustomCertificate(types string, version int32) *GetCustomDomainCustomCertificate { - this := GetCustomDomainCustomCertificate{} - this.Type = types - this.Version = version - return &this -} - -// NewGetCustomDomainCustomCertificateWithDefaults instantiates a new GetCustomDomainCustomCertificate 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 NewGetCustomDomainCustomCertificateWithDefaults() *GetCustomDomainCustomCertificate { - this := GetCustomDomainCustomCertificate{} - return &this -} - -// GetType returns the Type field value -func (o *GetCustomDomainCustomCertificate) 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 *GetCustomDomainCustomCertificate) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *GetCustomDomainCustomCertificate) SetType(v string) { - o.Type = v -} - -// GetVersion returns the Version field value -func (o *GetCustomDomainCustomCertificate) GetVersion() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Version -} - -// GetVersionOk returns a tuple with the Version field value -// and a boolean to check if the value has been set. -func (o *GetCustomDomainCustomCertificate) GetVersionOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Version, true -} - -// SetVersion sets field value -func (o *GetCustomDomainCustomCertificate) SetVersion(v int32) { - o.Version = v -} - -func (o GetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - toSerialize["version"] = o.Version - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetCustomDomainCustomCertificate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - "version", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetCustomDomainCustomCertificate := _GetCustomDomainCustomCertificate{} - - err = json.Unmarshal(data, &varGetCustomDomainCustomCertificate) - - if err != nil { - return err - } - - *o = GetCustomDomainCustomCertificate(varGetCustomDomainCustomCertificate) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - delete(additionalProperties, "version") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetCustomDomainCustomCertificate struct { - value *GetCustomDomainCustomCertificate - isSet bool -} - -func (v NullableGetCustomDomainCustomCertificate) Get() *GetCustomDomainCustomCertificate { - return v.value -} - -func (v *NullableGetCustomDomainCustomCertificate) Set(val *GetCustomDomainCustomCertificate) { - v.value = val - v.isSet = true -} - -func (v NullableGetCustomDomainCustomCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCustomDomainCustomCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCustomDomainCustomCertificate(val *GetCustomDomainCustomCertificate) *NullableGetCustomDomainCustomCertificate { - return &NullableGetCustomDomainCustomCertificate{value: val, isSet: true} -} - -func (v NullableGetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_custom_domain_managed_certificate.go b/services/cdn/v1beta2api/model_get_custom_domain_managed_certificate.go deleted file mode 100644 index f50e1f15d..000000000 --- a/services/cdn/v1beta2api/model_get_custom_domain_managed_certificate.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCustomDomainManagedCertificate{} - -// GetCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you -type GetCustomDomainManagedCertificate struct { - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _GetCustomDomainManagedCertificate GetCustomDomainManagedCertificate - -// NewGetCustomDomainManagedCertificate instantiates a new GetCustomDomainManagedCertificate 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 NewGetCustomDomainManagedCertificate(types string) *GetCustomDomainManagedCertificate { - this := GetCustomDomainManagedCertificate{} - this.Type = types - return &this -} - -// NewGetCustomDomainManagedCertificateWithDefaults instantiates a new GetCustomDomainManagedCertificate 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 NewGetCustomDomainManagedCertificateWithDefaults() *GetCustomDomainManagedCertificate { - this := GetCustomDomainManagedCertificate{} - return &this -} - -// GetType returns the Type field value -func (o *GetCustomDomainManagedCertificate) 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 *GetCustomDomainManagedCertificate) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *GetCustomDomainManagedCertificate) SetType(v string) { - o.Type = v -} - -func (o GetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetCustomDomainManagedCertificate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetCustomDomainManagedCertificate := _GetCustomDomainManagedCertificate{} - - err = json.Unmarshal(data, &varGetCustomDomainManagedCertificate) - - if err != nil { - return err - } - - *o = GetCustomDomainManagedCertificate(varGetCustomDomainManagedCertificate) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetCustomDomainManagedCertificate struct { - value *GetCustomDomainManagedCertificate - isSet bool -} - -func (v NullableGetCustomDomainManagedCertificate) Get() *GetCustomDomainManagedCertificate { - return v.value -} - -func (v *NullableGetCustomDomainManagedCertificate) Set(val *GetCustomDomainManagedCertificate) { - v.value = val - v.isSet = true -} - -func (v NullableGetCustomDomainManagedCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCustomDomainManagedCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCustomDomainManagedCertificate(val *GetCustomDomainManagedCertificate) *NullableGetCustomDomainManagedCertificate { - return &NullableGetCustomDomainManagedCertificate{value: val, isSet: true} -} - -func (v NullableGetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_custom_domain_response.go b/services/cdn/v1beta2api/model_get_custom_domain_response.go deleted file mode 100644 index a4c51eeee..000000000 --- a/services/cdn/v1beta2api/model_get_custom_domain_response.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetCustomDomainResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCustomDomainResponse{} - -// GetCustomDomainResponse struct for GetCustomDomainResponse -type GetCustomDomainResponse struct { - Certificate GetCustomDomainResponseCertificate `json:"certificate"` - CustomDomain CustomDomain `json:"customDomain"` - AdditionalProperties map[string]interface{} -} - -type _GetCustomDomainResponse GetCustomDomainResponse - -// NewGetCustomDomainResponse instantiates a new GetCustomDomainResponse 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 NewGetCustomDomainResponse(certificate GetCustomDomainResponseCertificate, customDomain CustomDomain) *GetCustomDomainResponse { - this := GetCustomDomainResponse{} - this.Certificate = certificate - this.CustomDomain = customDomain - return &this -} - -// NewGetCustomDomainResponseWithDefaults instantiates a new GetCustomDomainResponse 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 NewGetCustomDomainResponseWithDefaults() *GetCustomDomainResponse { - this := GetCustomDomainResponse{} - return &this -} - -// GetCertificate returns the Certificate field value -func (o *GetCustomDomainResponse) GetCertificate() GetCustomDomainResponseCertificate { - if o == nil { - var ret GetCustomDomainResponseCertificate - return ret - } - - return o.Certificate -} - -// GetCertificateOk returns a tuple with the Certificate field value -// and a boolean to check if the value has been set. -func (o *GetCustomDomainResponse) GetCertificateOk() (*GetCustomDomainResponseCertificate, bool) { - if o == nil { - return nil, false - } - return &o.Certificate, true -} - -// SetCertificate sets field value -func (o *GetCustomDomainResponse) SetCertificate(v GetCustomDomainResponseCertificate) { - o.Certificate = v -} - -// GetCustomDomain returns the CustomDomain field value -func (o *GetCustomDomainResponse) GetCustomDomain() CustomDomain { - if o == nil { - var ret CustomDomain - return ret - } - - return o.CustomDomain -} - -// GetCustomDomainOk returns a tuple with the CustomDomain field value -// and a boolean to check if the value has been set. -func (o *GetCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { - if o == nil { - return nil, false - } - return &o.CustomDomain, true -} - -// SetCustomDomain sets field value -func (o *GetCustomDomainResponse) SetCustomDomain(v CustomDomain) { - o.CustomDomain = v -} - -func (o GetCustomDomainResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetCustomDomainResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["certificate"] = o.Certificate - toSerialize["customDomain"] = o.CustomDomain - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "certificate", - "customDomain", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetCustomDomainResponse := _GetCustomDomainResponse{} - - err = json.Unmarshal(data, &varGetCustomDomainResponse) - - if err != nil { - return err - } - - *o = GetCustomDomainResponse(varGetCustomDomainResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "certificate") - delete(additionalProperties, "customDomain") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetCustomDomainResponse struct { - value *GetCustomDomainResponse - isSet bool -} - -func (v NullableGetCustomDomainResponse) Get() *GetCustomDomainResponse { - return v.value -} - -func (v *NullableGetCustomDomainResponse) Set(val *GetCustomDomainResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetCustomDomainResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCustomDomainResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCustomDomainResponse(val *GetCustomDomainResponse) *NullableGetCustomDomainResponse { - return &NullableGetCustomDomainResponse{value: val, isSet: true} -} - -func (v NullableGetCustomDomainResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCustomDomainResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_custom_domain_response_certificate.go b/services/cdn/v1beta2api/model_get_custom_domain_response_certificate.go deleted file mode 100644 index 9b2d249c9..000000000 --- a/services/cdn/v1beta2api/model_get_custom_domain_response_certificate.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// GetCustomDomainResponseCertificate - struct for GetCustomDomainResponseCertificate -type GetCustomDomainResponseCertificate struct { - GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate - GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate -} - -// GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in GetCustomDomainResponseCertificate -func GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) GetCustomDomainResponseCertificate { - return GetCustomDomainResponseCertificate{ - GetCustomDomainCustomCertificate: v, - } -} - -// GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in GetCustomDomainResponseCertificate -func GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) GetCustomDomainResponseCertificate { - return GetCustomDomainResponseCertificate{ - GetCustomDomainManagedCertificate: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *GetCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'custom' - if jsonDict["type"] == "custom" { - // try to unmarshal JSON data into GetCustomDomainCustomCertificate - err = json.Unmarshal(data, &dst.GetCustomDomainCustomCertificate) - if err == nil { - return nil // data stored in dst.GetCustomDomainCustomCertificate, return on the first match - } else { - dst.GetCustomDomainCustomCertificate = nil - return fmt.Errorf("failed to unmarshal GetCustomDomainResponseCertificate as GetCustomDomainCustomCertificate: %s", err.Error()) - } - } - - // check if the discriminator value is 'managed' - if jsonDict["type"] == "managed" { - // try to unmarshal JSON data into GetCustomDomainManagedCertificate - err = json.Unmarshal(data, &dst.GetCustomDomainManagedCertificate) - if err == nil { - return nil // data stored in dst.GetCustomDomainManagedCertificate, return on the first match - } else { - dst.GetCustomDomainManagedCertificate = nil - return fmt.Errorf("failed to unmarshal GetCustomDomainResponseCertificate as GetCustomDomainManagedCertificate: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src GetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { - if src.GetCustomDomainCustomCertificate != nil { - return json.Marshal(&src.GetCustomDomainCustomCertificate) - } - - if src.GetCustomDomainManagedCertificate != nil { - return json.Marshal(&src.GetCustomDomainManagedCertificate) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *GetCustomDomainResponseCertificate) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.GetCustomDomainCustomCertificate != nil { - return obj.GetCustomDomainCustomCertificate - } - - if obj.GetCustomDomainManagedCertificate != nil { - return obj.GetCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj GetCustomDomainResponseCertificate) GetActualInstanceValue() interface{} { - if obj.GetCustomDomainCustomCertificate != nil { - return *obj.GetCustomDomainCustomCertificate - } - - if obj.GetCustomDomainManagedCertificate != nil { - return *obj.GetCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -type NullableGetCustomDomainResponseCertificate struct { - value *GetCustomDomainResponseCertificate - isSet bool -} - -func (v NullableGetCustomDomainResponseCertificate) Get() *GetCustomDomainResponseCertificate { - return v.value -} - -func (v *NullableGetCustomDomainResponseCertificate) Set(val *GetCustomDomainResponseCertificate) { - v.value = val - v.isSet = true -} - -func (v NullableGetCustomDomainResponseCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCustomDomainResponseCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCustomDomainResponseCertificate(val *GetCustomDomainResponseCertificate) *NullableGetCustomDomainResponseCertificate { - return &NullableGetCustomDomainResponseCertificate{value: val, isSet: true} -} - -func (v NullableGetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_distribution_response.go b/services/cdn/v1beta2api/model_get_distribution_response.go deleted file mode 100644 index f76237727..000000000 --- a/services/cdn/v1beta2api/model_get_distribution_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetDistributionResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetDistributionResponse{} - -// GetDistributionResponse struct for GetDistributionResponse -type GetDistributionResponse struct { - Distribution Distribution `json:"distribution"` - AdditionalProperties map[string]interface{} -} - -type _GetDistributionResponse GetDistributionResponse - -// NewGetDistributionResponse instantiates a new GetDistributionResponse 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 NewGetDistributionResponse(distribution Distribution) *GetDistributionResponse { - this := GetDistributionResponse{} - this.Distribution = distribution - return &this -} - -// NewGetDistributionResponseWithDefaults instantiates a new GetDistributionResponse 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 NewGetDistributionResponseWithDefaults() *GetDistributionResponse { - this := GetDistributionResponse{} - return &this -} - -// GetDistribution returns the Distribution field value -func (o *GetDistributionResponse) GetDistribution() Distribution { - if o == nil { - var ret Distribution - return ret - } - - return o.Distribution -} - -// GetDistributionOk returns a tuple with the Distribution field value -// and a boolean to check if the value has been set. -func (o *GetDistributionResponse) GetDistributionOk() (*Distribution, bool) { - if o == nil { - return nil, false - } - return &o.Distribution, true -} - -// SetDistribution sets field value -func (o *GetDistributionResponse) SetDistribution(v Distribution) { - o.Distribution = v -} - -func (o GetDistributionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetDistributionResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["distribution"] = o.Distribution - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetDistributionResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "distribution", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetDistributionResponse := _GetDistributionResponse{} - - err = json.Unmarshal(data, &varGetDistributionResponse) - - if err != nil { - return err - } - - *o = GetDistributionResponse(varGetDistributionResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "distribution") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetDistributionResponse struct { - value *GetDistributionResponse - isSet bool -} - -func (v NullableGetDistributionResponse) Get() *GetDistributionResponse { - return v.value -} - -func (v *NullableGetDistributionResponse) Set(val *GetDistributionResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetDistributionResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetDistributionResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetDistributionResponse(val *GetDistributionResponse) *NullableGetDistributionResponse { - return &NullableGetDistributionResponse{value: val, isSet: true} -} - -func (v NullableGetDistributionResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetDistributionResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_logs_response.go b/services/cdn/v1beta2api/model_get_logs_response.go deleted file mode 100644 index 276882069..000000000 --- a/services/cdn/v1beta2api/model_get_logs_response.go +++ /dev/null @@ -1,203 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetLogsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetLogsResponse{} - -// GetLogsResponse struct for GetLogsResponse -type GetLogsResponse struct { - Logs []DistributionLogsRecord `json:"logs"` - NextPageIdentifier *string `json:"nextPageIdentifier,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _GetLogsResponse GetLogsResponse - -// NewGetLogsResponse instantiates a new GetLogsResponse 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 NewGetLogsResponse(logs []DistributionLogsRecord) *GetLogsResponse { - this := GetLogsResponse{} - this.Logs = logs - return &this -} - -// NewGetLogsResponseWithDefaults instantiates a new GetLogsResponse 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 NewGetLogsResponseWithDefaults() *GetLogsResponse { - this := GetLogsResponse{} - return &this -} - -// GetLogs returns the Logs field value -func (o *GetLogsResponse) GetLogs() []DistributionLogsRecord { - if o == nil { - var ret []DistributionLogsRecord - return ret - } - - return o.Logs -} - -// GetLogsOk returns a tuple with the Logs field value -// and a boolean to check if the value has been set. -func (o *GetLogsResponse) GetLogsOk() ([]DistributionLogsRecord, bool) { - if o == nil { - return nil, false - } - return o.Logs, true -} - -// SetLogs sets field value -func (o *GetLogsResponse) SetLogs(v []DistributionLogsRecord) { - o.Logs = v -} - -// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. -func (o *GetLogsResponse) GetNextPageIdentifier() string { - if o == nil || IsNil(o.NextPageIdentifier) { - var ret string - return ret - } - return *o.NextPageIdentifier -} - -// GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetLogsResponse) GetNextPageIdentifierOk() (*string, bool) { - if o == nil || IsNil(o.NextPageIdentifier) { - return nil, false - } - return o.NextPageIdentifier, true -} - -// HasNextPageIdentifier returns a boolean if a field has been set. -func (o *GetLogsResponse) HasNextPageIdentifier() bool { - if o != nil && !IsNil(o.NextPageIdentifier) { - return true - } - - return false -} - -// SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. -func (o *GetLogsResponse) SetNextPageIdentifier(v string) { - o.NextPageIdentifier = &v -} - -func (o GetLogsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetLogsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["logs"] = o.Logs - if !IsNil(o.NextPageIdentifier) { - toSerialize["nextPageIdentifier"] = o.NextPageIdentifier - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetLogsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "logs", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetLogsResponse := _GetLogsResponse{} - - err = json.Unmarshal(data, &varGetLogsResponse) - - if err != nil { - return err - } - - *o = GetLogsResponse(varGetLogsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "logs") - delete(additionalProperties, "nextPageIdentifier") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetLogsResponse struct { - value *GetLogsResponse - isSet bool -} - -func (v NullableGetLogsResponse) Get() *GetLogsResponse { - return v.value -} - -func (v *NullableGetLogsResponse) Set(val *GetLogsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsResponse(val *GetLogsResponse) *NullableGetLogsResponse { - return &NullableGetLogsResponse{value: val, isSet: true} -} - -func (v NullableGetLogsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_logs_search_filters_response.go b/services/cdn/v1beta2api/model_get_logs_search_filters_response.go deleted file mode 100644 index a6277e84a..000000000 --- a/services/cdn/v1beta2api/model_get_logs_search_filters_response.go +++ /dev/null @@ -1,255 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetLogsSearchFiltersResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetLogsSearchFiltersResponse{} - -// GetLogsSearchFiltersResponse struct for GetLogsSearchFiltersResponse -type GetLogsSearchFiltersResponse struct { - Cache []GetLogsSearchFiltersResponseCacheInner `json:"cache"` - DataCenter GetLogsSearchFiltersResponseDatacenterBlock `json:"dataCenter"` - // List of ISO-3166 Alpha2 Country Codes matching the input filter. Response is ordered in ascending order. For more Info about the country codes, see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 - RemoteCountry []string `json:"remoteCountry"` - // List of Status Codes matching the input filter. Response is ordered in ascending order. - Status []int32 `json:"status"` - AdditionalProperties map[string]interface{} -} - -type _GetLogsSearchFiltersResponse GetLogsSearchFiltersResponse - -// NewGetLogsSearchFiltersResponse instantiates a new GetLogsSearchFiltersResponse 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 NewGetLogsSearchFiltersResponse(cache []GetLogsSearchFiltersResponseCacheInner, dataCenter GetLogsSearchFiltersResponseDatacenterBlock, remoteCountry []string, status []int32) *GetLogsSearchFiltersResponse { - this := GetLogsSearchFiltersResponse{} - this.Cache = cache - this.DataCenter = dataCenter - this.RemoteCountry = remoteCountry - this.Status = status - return &this -} - -// NewGetLogsSearchFiltersResponseWithDefaults instantiates a new GetLogsSearchFiltersResponse 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 NewGetLogsSearchFiltersResponseWithDefaults() *GetLogsSearchFiltersResponse { - this := GetLogsSearchFiltersResponse{} - return &this -} - -// GetCache returns the Cache field value -func (o *GetLogsSearchFiltersResponse) GetCache() []GetLogsSearchFiltersResponseCacheInner { - if o == nil { - var ret []GetLogsSearchFiltersResponseCacheInner - return ret - } - - return o.Cache -} - -// GetCacheOk returns a tuple with the Cache field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponse) GetCacheOk() ([]GetLogsSearchFiltersResponseCacheInner, bool) { - if o == nil { - return nil, false - } - return o.Cache, true -} - -// SetCache sets field value -func (o *GetLogsSearchFiltersResponse) SetCache(v []GetLogsSearchFiltersResponseCacheInner) { - o.Cache = v -} - -// GetDataCenter returns the DataCenter field value -func (o *GetLogsSearchFiltersResponse) GetDataCenter() GetLogsSearchFiltersResponseDatacenterBlock { - if o == nil { - var ret GetLogsSearchFiltersResponseDatacenterBlock - return ret - } - - return o.DataCenter -} - -// GetDataCenterOk returns a tuple with the DataCenter field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponse) GetDataCenterOk() (*GetLogsSearchFiltersResponseDatacenterBlock, bool) { - if o == nil { - return nil, false - } - return &o.DataCenter, true -} - -// SetDataCenter sets field value -func (o *GetLogsSearchFiltersResponse) SetDataCenter(v GetLogsSearchFiltersResponseDatacenterBlock) { - o.DataCenter = v -} - -// GetRemoteCountry returns the RemoteCountry field value -func (o *GetLogsSearchFiltersResponse) GetRemoteCountry() []string { - if o == nil { - var ret []string - return ret - } - - return o.RemoteCountry -} - -// GetRemoteCountryOk returns a tuple with the RemoteCountry field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponse) GetRemoteCountryOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.RemoteCountry, true -} - -// SetRemoteCountry sets field value -func (o *GetLogsSearchFiltersResponse) SetRemoteCountry(v []string) { - o.RemoteCountry = v -} - -// GetStatus returns the Status field value -func (o *GetLogsSearchFiltersResponse) GetStatus() []int32 { - if o == nil { - var ret []int32 - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponse) GetStatusOk() ([]int32, bool) { - if o == nil { - return nil, false - } - return o.Status, true -} - -// SetStatus sets field value -func (o *GetLogsSearchFiltersResponse) SetStatus(v []int32) { - o.Status = v -} - -func (o GetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetLogsSearchFiltersResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["cache"] = o.Cache - toSerialize["dataCenter"] = o.DataCenter - toSerialize["remoteCountry"] = o.RemoteCountry - toSerialize["status"] = o.Status - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetLogsSearchFiltersResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "cache", - "dataCenter", - "remoteCountry", - "status", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetLogsSearchFiltersResponse := _GetLogsSearchFiltersResponse{} - - err = json.Unmarshal(data, &varGetLogsSearchFiltersResponse) - - if err != nil { - return err - } - - *o = GetLogsSearchFiltersResponse(varGetLogsSearchFiltersResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "cache") - delete(additionalProperties, "dataCenter") - delete(additionalProperties, "remoteCountry") - delete(additionalProperties, "status") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetLogsSearchFiltersResponse struct { - value *GetLogsSearchFiltersResponse - isSet bool -} - -func (v NullableGetLogsSearchFiltersResponse) Get() *GetLogsSearchFiltersResponse { - return v.value -} - -func (v *NullableGetLogsSearchFiltersResponse) Set(val *GetLogsSearchFiltersResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsSearchFiltersResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsSearchFiltersResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsSearchFiltersResponse(val *GetLogsSearchFiltersResponse) *NullableGetLogsSearchFiltersResponse { - return &NullableGetLogsSearchFiltersResponse{value: val, isSet: true} -} - -func (v NullableGetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsSearchFiltersResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_logs_search_filters_response_cache_inner.go b/services/cdn/v1beta2api/model_get_logs_search_filters_response_cache_inner.go deleted file mode 100644 index a6cb1c0fb..000000000 --- a/services/cdn/v1beta2api/model_get_logs_search_filters_response_cache_inner.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// GetLogsSearchFiltersResponseCacheInner the model 'GetLogsSearchFiltersResponseCacheInner' -type GetLogsSearchFiltersResponseCacheInner string - -// List of GetLogsSearchFiltersResponse_cache_inner -const ( - GETLOGSSEARCHFILTERSRESPONSECACHEINNER_HIT GetLogsSearchFiltersResponseCacheInner = "HIT" - GETLOGSSEARCHFILTERSRESPONSECACHEINNER_MISS GetLogsSearchFiltersResponseCacheInner = "MISS" - GETLOGSSEARCHFILTERSRESPONSECACHEINNER_UNKNOWN_DEFAULT_OPEN_API GetLogsSearchFiltersResponseCacheInner = "unknown_default_open_api" -) - -// All allowed values of GetLogsSearchFiltersResponseCacheInner enum -var AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues = []GetLogsSearchFiltersResponseCacheInner{ - "HIT", - "MISS", - "unknown_default_open_api", -} - -func (v *GetLogsSearchFiltersResponseCacheInner) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetLogsSearchFiltersResponseCacheInner(value) - for _, existing := range AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETLOGSSEARCHFILTERSRESPONSECACHEINNER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetLogsSearchFiltersResponseCacheInnerFromValue returns a pointer to a valid GetLogsSearchFiltersResponseCacheInner -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetLogsSearchFiltersResponseCacheInnerFromValue(v string) (*GetLogsSearchFiltersResponseCacheInner, error) { - ev := GetLogsSearchFiltersResponseCacheInner(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetLogsSearchFiltersResponseCacheInner: valid values are %v", v, AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetLogsSearchFiltersResponseCacheInner) IsValid() bool { - for _, existing := range AllowedGetLogsSearchFiltersResponseCacheInnerEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetLogsSearchFiltersResponse_cache_inner value -func (v GetLogsSearchFiltersResponseCacheInner) Ptr() *GetLogsSearchFiltersResponseCacheInner { - return &v -} - -type NullableGetLogsSearchFiltersResponseCacheInner struct { - value *GetLogsSearchFiltersResponseCacheInner - isSet bool -} - -func (v NullableGetLogsSearchFiltersResponseCacheInner) Get() *GetLogsSearchFiltersResponseCacheInner { - return v.value -} - -func (v *NullableGetLogsSearchFiltersResponseCacheInner) Set(val *GetLogsSearchFiltersResponseCacheInner) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsSearchFiltersResponseCacheInner) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsSearchFiltersResponseCacheInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsSearchFiltersResponseCacheInner(val *GetLogsSearchFiltersResponseCacheInner) *NullableGetLogsSearchFiltersResponseCacheInner { - return &NullableGetLogsSearchFiltersResponseCacheInner{value: val, isSet: true} -} - -func (v NullableGetLogsSearchFiltersResponseCacheInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsSearchFiltersResponseCacheInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block.go b/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block.go deleted file mode 100644 index e05148ad6..000000000 --- a/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetLogsSearchFiltersResponseDatacenterBlock type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetLogsSearchFiltersResponseDatacenterBlock{} - -// GetLogsSearchFiltersResponseDatacenterBlock Object containing Datacenters to filter for. Each datacenter is grouped to the respective region. -type GetLogsSearchFiltersResponseDatacenterBlock struct { - AF []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"AF"` - ASIA []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"ASIA"` - EU []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"EU"` - NA []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"NA"` - SA []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"SA"` - AdditionalProperties map[string]interface{} -} - -type _GetLogsSearchFiltersResponseDatacenterBlock GetLogsSearchFiltersResponseDatacenterBlock - -// NewGetLogsSearchFiltersResponseDatacenterBlock instantiates a new GetLogsSearchFiltersResponseDatacenterBlock 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 NewGetLogsSearchFiltersResponseDatacenterBlock(aF []GetLogsSearchFiltersResponseDatacenterBlockItem, aSIA []GetLogsSearchFiltersResponseDatacenterBlockItem, eU []GetLogsSearchFiltersResponseDatacenterBlockItem, nA []GetLogsSearchFiltersResponseDatacenterBlockItem, sA []GetLogsSearchFiltersResponseDatacenterBlockItem) *GetLogsSearchFiltersResponseDatacenterBlock { - this := GetLogsSearchFiltersResponseDatacenterBlock{} - this.AF = aF - this.ASIA = aSIA - this.EU = eU - this.NA = nA - this.SA = sA - return &this -} - -// NewGetLogsSearchFiltersResponseDatacenterBlockWithDefaults instantiates a new GetLogsSearchFiltersResponseDatacenterBlock 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 NewGetLogsSearchFiltersResponseDatacenterBlockWithDefaults() *GetLogsSearchFiltersResponseDatacenterBlock { - this := GetLogsSearchFiltersResponseDatacenterBlock{} - return &this -} - -// GetAF returns the AF field value -func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetAF() []GetLogsSearchFiltersResponseDatacenterBlockItem { - if o == nil { - var ret []GetLogsSearchFiltersResponseDatacenterBlockItem - return ret - } - - return o.AF -} - -// GetAFOk returns a tuple with the AF field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetAFOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { - if o == nil { - return nil, false - } - return o.AF, true -} - -// SetAF sets field value -func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetAF(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { - o.AF = v -} - -// GetASIA returns the ASIA field value -func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetASIA() []GetLogsSearchFiltersResponseDatacenterBlockItem { - if o == nil { - var ret []GetLogsSearchFiltersResponseDatacenterBlockItem - return ret - } - - return o.ASIA -} - -// GetASIAOk returns a tuple with the ASIA field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetASIAOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { - if o == nil { - return nil, false - } - return o.ASIA, true -} - -// SetASIA sets field value -func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetASIA(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { - o.ASIA = v -} - -// GetEU returns the EU field value -func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetEU() []GetLogsSearchFiltersResponseDatacenterBlockItem { - if o == nil { - var ret []GetLogsSearchFiltersResponseDatacenterBlockItem - return ret - } - - return o.EU -} - -// GetEUOk returns a tuple with the EU field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetEUOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { - if o == nil { - return nil, false - } - return o.EU, true -} - -// SetEU sets field value -func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetEU(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { - o.EU = v -} - -// GetNA returns the NA field value -func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetNA() []GetLogsSearchFiltersResponseDatacenterBlockItem { - if o == nil { - var ret []GetLogsSearchFiltersResponseDatacenterBlockItem - return ret - } - - return o.NA -} - -// GetNAOk returns a tuple with the NA field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetNAOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { - if o == nil { - return nil, false - } - return o.NA, true -} - -// SetNA sets field value -func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetNA(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { - o.NA = v -} - -// GetSA returns the SA field value -func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetSA() []GetLogsSearchFiltersResponseDatacenterBlockItem { - if o == nil { - var ret []GetLogsSearchFiltersResponseDatacenterBlockItem - return ret - } - - return o.SA -} - -// GetSAOk returns a tuple with the SA field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetSAOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { - if o == nil { - return nil, false - } - return o.SA, true -} - -// SetSA sets field value -func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetSA(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { - o.SA = v -} - -func (o GetLogsSearchFiltersResponseDatacenterBlock) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetLogsSearchFiltersResponseDatacenterBlock) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["AF"] = o.AF - toSerialize["ASIA"] = o.ASIA - toSerialize["EU"] = o.EU - toSerialize["NA"] = o.NA - toSerialize["SA"] = o.SA - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetLogsSearchFiltersResponseDatacenterBlock) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "AF", - "ASIA", - "EU", - "NA", - "SA", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetLogsSearchFiltersResponseDatacenterBlock := _GetLogsSearchFiltersResponseDatacenterBlock{} - - err = json.Unmarshal(data, &varGetLogsSearchFiltersResponseDatacenterBlock) - - if err != nil { - return err - } - - *o = GetLogsSearchFiltersResponseDatacenterBlock(varGetLogsSearchFiltersResponseDatacenterBlock) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "AF") - delete(additionalProperties, "ASIA") - delete(additionalProperties, "EU") - delete(additionalProperties, "NA") - delete(additionalProperties, "SA") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetLogsSearchFiltersResponseDatacenterBlock struct { - value *GetLogsSearchFiltersResponseDatacenterBlock - isSet bool -} - -func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) Get() *GetLogsSearchFiltersResponseDatacenterBlock { - return v.value -} - -func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) Set(val *GetLogsSearchFiltersResponseDatacenterBlock) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsSearchFiltersResponseDatacenterBlock(val *GetLogsSearchFiltersResponseDatacenterBlock) *NullableGetLogsSearchFiltersResponseDatacenterBlock { - return &NullableGetLogsSearchFiltersResponseDatacenterBlock{value: val, isSet: true} -} - -func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block_item.go b/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block_item.go deleted file mode 100644 index 8f291607d..000000000 --- a/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block_item.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetLogsSearchFiltersResponseDatacenterBlockItem type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetLogsSearchFiltersResponseDatacenterBlockItem{} - -// GetLogsSearchFiltersResponseDatacenterBlockItem A datacenter. The `id` defines the key needed to filter against the logs endpoint, while the `displayName` defines a human-readable Name. -type GetLogsSearchFiltersResponseDatacenterBlockItem struct { - DisplayName string `json:"displayName"` - Id string `json:"id"` - AdditionalProperties map[string]interface{} -} - -type _GetLogsSearchFiltersResponseDatacenterBlockItem GetLogsSearchFiltersResponseDatacenterBlockItem - -// NewGetLogsSearchFiltersResponseDatacenterBlockItem instantiates a new GetLogsSearchFiltersResponseDatacenterBlockItem 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 NewGetLogsSearchFiltersResponseDatacenterBlockItem(displayName string, id string) *GetLogsSearchFiltersResponseDatacenterBlockItem { - this := GetLogsSearchFiltersResponseDatacenterBlockItem{} - this.DisplayName = displayName - this.Id = id - return &this -} - -// NewGetLogsSearchFiltersResponseDatacenterBlockItemWithDefaults instantiates a new GetLogsSearchFiltersResponseDatacenterBlockItem 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 NewGetLogsSearchFiltersResponseDatacenterBlockItemWithDefaults() *GetLogsSearchFiltersResponseDatacenterBlockItem { - this := GetLogsSearchFiltersResponseDatacenterBlockItem{} - return &this -} - -// GetDisplayName returns the DisplayName field value -func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetDisplayName() string { - if o == nil { - var ret string - return ret - } - - return o.DisplayName -} - -// GetDisplayNameOk returns a tuple with the DisplayName field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetDisplayNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DisplayName, true -} - -// SetDisplayName sets field value -func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) SetDisplayName(v string) { - o.DisplayName = v -} - -// GetId returns the Id field value -func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) 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 *GetLogsSearchFiltersResponseDatacenterBlockItem) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) SetId(v string) { - o.Id = v -} - -func (o GetLogsSearchFiltersResponseDatacenterBlockItem) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetLogsSearchFiltersResponseDatacenterBlockItem) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["displayName"] = o.DisplayName - toSerialize["id"] = o.Id - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "displayName", - "id", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetLogsSearchFiltersResponseDatacenterBlockItem := _GetLogsSearchFiltersResponseDatacenterBlockItem{} - - err = json.Unmarshal(data, &varGetLogsSearchFiltersResponseDatacenterBlockItem) - - if err != nil { - return err - } - - *o = GetLogsSearchFiltersResponseDatacenterBlockItem(varGetLogsSearchFiltersResponseDatacenterBlockItem) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "displayName") - delete(additionalProperties, "id") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetLogsSearchFiltersResponseDatacenterBlockItem struct { - value *GetLogsSearchFiltersResponseDatacenterBlockItem - isSet bool -} - -func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Get() *GetLogsSearchFiltersResponseDatacenterBlockItem { - return v.value -} - -func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Set(val *GetLogsSearchFiltersResponseDatacenterBlockItem) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsSearchFiltersResponseDatacenterBlockItem(val *GetLogsSearchFiltersResponseDatacenterBlockItem) *NullableGetLogsSearchFiltersResponseDatacenterBlockItem { - return &NullableGetLogsSearchFiltersResponseDatacenterBlockItem{value: val, isSet: true} -} - -func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_logs_sort_by_parameter.go b/services/cdn/v1beta2api/model_get_logs_sort_by_parameter.go deleted file mode 100644 index cb64349f0..000000000 --- a/services/cdn/v1beta2api/model_get_logs_sort_by_parameter.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// GetLogsSortByParameter the model 'GetLogsSortByParameter' -type GetLogsSortByParameter string - -// List of GetLogs_sortBy_parameter -const ( - GETLOGSSORTBYPARAMETER_TIMESTAMP GetLogsSortByParameter = "timestamp" - GETLOGSSORTBYPARAMETER_DATA_CENTER_REGION GetLogsSortByParameter = "dataCenterRegion" - GETLOGSSORTBYPARAMETER_REQUEST_COUNTRY_CODE GetLogsSortByParameter = "requestCountryCode" - GETLOGSSORTBYPARAMETER_STATUS_CODE GetLogsSortByParameter = "statusCode" - GETLOGSSORTBYPARAMETER_CACHE_HIT GetLogsSortByParameter = "cacheHit" - GETLOGSSORTBYPARAMETER_SIZE GetLogsSortByParameter = "size" - GETLOGSSORTBYPARAMETER_PATH GetLogsSortByParameter = "path" - GETLOGSSORTBYPARAMETER_HOST GetLogsSortByParameter = "host" - GETLOGSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetLogsSortByParameter = "unknown_default_open_api" -) - -// All allowed values of GetLogsSortByParameter enum -var AllowedGetLogsSortByParameterEnumValues = []GetLogsSortByParameter{ - "timestamp", - "dataCenterRegion", - "requestCountryCode", - "statusCode", - "cacheHit", - "size", - "path", - "host", - "unknown_default_open_api", -} - -func (v *GetLogsSortByParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetLogsSortByParameter(value) - for _, existing := range AllowedGetLogsSortByParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETLOGSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetLogsSortByParameterFromValue returns a pointer to a valid GetLogsSortByParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetLogsSortByParameterFromValue(v string) (*GetLogsSortByParameter, error) { - ev := GetLogsSortByParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetLogsSortByParameter: valid values are %v", v, AllowedGetLogsSortByParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetLogsSortByParameter) IsValid() bool { - for _, existing := range AllowedGetLogsSortByParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetLogs_sortBy_parameter value -func (v GetLogsSortByParameter) Ptr() *GetLogsSortByParameter { - return &v -} - -type NullableGetLogsSortByParameter struct { - value *GetLogsSortByParameter - isSet bool -} - -func (v NullableGetLogsSortByParameter) Get() *GetLogsSortByParameter { - return v.value -} - -func (v *NullableGetLogsSortByParameter) Set(val *GetLogsSortByParameter) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsSortByParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsSortByParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsSortByParameter(val *GetLogsSortByParameter) *NullableGetLogsSortByParameter { - return &NullableGetLogsSortByParameter{value: val, isSet: true} -} - -func (v NullableGetLogsSortByParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsSortByParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_logs_sort_order_parameter.go b/services/cdn/v1beta2api/model_get_logs_sort_order_parameter.go deleted file mode 100644 index 33cca3bf7..000000000 --- a/services/cdn/v1beta2api/model_get_logs_sort_order_parameter.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// GetLogsSortOrderParameter the model 'GetLogsSortOrderParameter' -type GetLogsSortOrderParameter string - -// List of GetLogs_sortOrder_parameter -const ( - GETLOGSSORTORDERPARAMETER_ASCENDING GetLogsSortOrderParameter = "ascending" - GETLOGSSORTORDERPARAMETER_DESCENDING GetLogsSortOrderParameter = "descending" - GETLOGSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetLogsSortOrderParameter = "unknown_default_open_api" -) - -// All allowed values of GetLogsSortOrderParameter enum -var AllowedGetLogsSortOrderParameterEnumValues = []GetLogsSortOrderParameter{ - "ascending", - "descending", - "unknown_default_open_api", -} - -func (v *GetLogsSortOrderParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetLogsSortOrderParameter(value) - for _, existing := range AllowedGetLogsSortOrderParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETLOGSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetLogsSortOrderParameterFromValue returns a pointer to a valid GetLogsSortOrderParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetLogsSortOrderParameterFromValue(v string) (*GetLogsSortOrderParameter, error) { - ev := GetLogsSortOrderParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetLogsSortOrderParameter: valid values are %v", v, AllowedGetLogsSortOrderParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetLogsSortOrderParameter) IsValid() bool { - for _, existing := range AllowedGetLogsSortOrderParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetLogs_sortOrder_parameter value -func (v GetLogsSortOrderParameter) Ptr() *GetLogsSortOrderParameter { - return &v -} - -type NullableGetLogsSortOrderParameter struct { - value *GetLogsSortOrderParameter - isSet bool -} - -func (v NullableGetLogsSortOrderParameter) Get() *GetLogsSortOrderParameter { - return v.value -} - -func (v *NullableGetLogsSortOrderParameter) Set(val *GetLogsSortOrderParameter) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsSortOrderParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsSortOrderParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsSortOrderParameter(val *GetLogsSortOrderParameter) *NullableGetLogsSortOrderParameter { - return &NullableGetLogsSortOrderParameter{value: val, isSet: true} -} - -func (v NullableGetLogsSortOrderParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsSortOrderParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_statistics_interval_parameter.go b/services/cdn/v1beta2api/model_get_statistics_interval_parameter.go deleted file mode 100644 index 02cfa080d..000000000 --- a/services/cdn/v1beta2api/model_get_statistics_interval_parameter.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// GetStatisticsIntervalParameter the model 'GetStatisticsIntervalParameter' -type GetStatisticsIntervalParameter string - -// List of GetStatistics_interval_parameter -const ( - GETSTATISTICSINTERVALPARAMETER_HOURLY GetStatisticsIntervalParameter = "hourly" - GETSTATISTICSINTERVALPARAMETER_DAILY GetStatisticsIntervalParameter = "daily" - GETSTATISTICSINTERVALPARAMETER_MONTHLY GetStatisticsIntervalParameter = "monthly" - GETSTATISTICSINTERVALPARAMETER_YEARLY GetStatisticsIntervalParameter = "yearly" - GETSTATISTICSINTERVALPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetStatisticsIntervalParameter = "unknown_default_open_api" -) - -// All allowed values of GetStatisticsIntervalParameter enum -var AllowedGetStatisticsIntervalParameterEnumValues = []GetStatisticsIntervalParameter{ - "hourly", - "daily", - "monthly", - "yearly", - "unknown_default_open_api", -} - -func (v *GetStatisticsIntervalParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetStatisticsIntervalParameter(value) - for _, existing := range AllowedGetStatisticsIntervalParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETSTATISTICSINTERVALPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetStatisticsIntervalParameterFromValue returns a pointer to a valid GetStatisticsIntervalParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetStatisticsIntervalParameterFromValue(v string) (*GetStatisticsIntervalParameter, error) { - ev := GetStatisticsIntervalParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetStatisticsIntervalParameter: valid values are %v", v, AllowedGetStatisticsIntervalParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetStatisticsIntervalParameter) IsValid() bool { - for _, existing := range AllowedGetStatisticsIntervalParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetStatistics_interval_parameter value -func (v GetStatisticsIntervalParameter) Ptr() *GetStatisticsIntervalParameter { - return &v -} - -type NullableGetStatisticsIntervalParameter struct { - value *GetStatisticsIntervalParameter - isSet bool -} - -func (v NullableGetStatisticsIntervalParameter) Get() *GetStatisticsIntervalParameter { - return v.value -} - -func (v *NullableGetStatisticsIntervalParameter) Set(val *GetStatisticsIntervalParameter) { - v.value = val - v.isSet = true -} - -func (v NullableGetStatisticsIntervalParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableGetStatisticsIntervalParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetStatisticsIntervalParameter(val *GetStatisticsIntervalParameter) *NullableGetStatisticsIntervalParameter { - return &NullableGetStatisticsIntervalParameter{value: val, isSet: true} -} - -func (v NullableGetStatisticsIntervalParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetStatisticsIntervalParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_get_statistics_response.go b/services/cdn/v1beta2api/model_get_statistics_response.go deleted file mode 100644 index a3b028362..000000000 --- a/services/cdn/v1beta2api/model_get_statistics_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetStatisticsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetStatisticsResponse{} - -// GetStatisticsResponse struct for GetStatisticsResponse -type GetStatisticsResponse struct { - Records []DistributionStatisticsRecord `json:"records"` - AdditionalProperties map[string]interface{} -} - -type _GetStatisticsResponse GetStatisticsResponse - -// NewGetStatisticsResponse instantiates a new GetStatisticsResponse 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 NewGetStatisticsResponse(records []DistributionStatisticsRecord) *GetStatisticsResponse { - this := GetStatisticsResponse{} - this.Records = records - return &this -} - -// NewGetStatisticsResponseWithDefaults instantiates a new GetStatisticsResponse 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 NewGetStatisticsResponseWithDefaults() *GetStatisticsResponse { - this := GetStatisticsResponse{} - return &this -} - -// GetRecords returns the Records field value -func (o *GetStatisticsResponse) GetRecords() []DistributionStatisticsRecord { - if o == nil { - var ret []DistributionStatisticsRecord - return ret - } - - return o.Records -} - -// GetRecordsOk returns a tuple with the Records field value -// and a boolean to check if the value has been set. -func (o *GetStatisticsResponse) GetRecordsOk() ([]DistributionStatisticsRecord, bool) { - if o == nil { - return nil, false - } - return o.Records, true -} - -// SetRecords sets field value -func (o *GetStatisticsResponse) SetRecords(v []DistributionStatisticsRecord) { - o.Records = v -} - -func (o GetStatisticsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetStatisticsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["records"] = o.Records - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetStatisticsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "records", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetStatisticsResponse := _GetStatisticsResponse{} - - err = json.Unmarshal(data, &varGetStatisticsResponse) - - if err != nil { - return err - } - - *o = GetStatisticsResponse(varGetStatisticsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "records") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetStatisticsResponse struct { - value *GetStatisticsResponse - isSet bool -} - -func (v NullableGetStatisticsResponse) Get() *GetStatisticsResponse { - return v.value -} - -func (v *NullableGetStatisticsResponse) Set(val *GetStatisticsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetStatisticsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetStatisticsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetStatisticsResponse(val *GetStatisticsResponse) *NullableGetStatisticsResponse { - return &NullableGetStatisticsResponse{value: val, isSet: true} -} - -func (v NullableGetStatisticsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetStatisticsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_http_backend.go b/services/cdn/v1beta2api/model_http_backend.go deleted file mode 100644 index cfc99f0cd..000000000 --- a/services/cdn/v1beta2api/model_http_backend.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the HttpBackend type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &HttpBackend{} - -// HttpBackend struct for HttpBackend -type HttpBackend struct { - // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. - Geofencing map[string][]string `json:"geofencing"` - // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. - OriginRequestHeaders map[string]string `json:"originRequestHeaders"` - // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` - OriginUrl string `json:"originUrl"` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _HttpBackend HttpBackend - -// NewHttpBackend instantiates a new HttpBackend 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 NewHttpBackend(geofencing map[string][]string, originRequestHeaders map[string]string, originUrl string, types string) *HttpBackend { - this := HttpBackend{} - this.Geofencing = geofencing - this.OriginRequestHeaders = originRequestHeaders - this.OriginUrl = originUrl - this.Type = types - return &this -} - -// NewHttpBackendWithDefaults instantiates a new HttpBackend 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 NewHttpBackendWithDefaults() *HttpBackend { - this := HttpBackend{} - return &this -} - -// GetGeofencing returns the Geofencing field value -func (o *HttpBackend) GetGeofencing() map[string][]string { - if o == nil { - var ret map[string][]string - return ret - } - - return o.Geofencing -} - -// GetGeofencingOk returns a tuple with the Geofencing field value -// and a boolean to check if the value has been set. -func (o *HttpBackend) GetGeofencingOk() (*map[string][]string, bool) { - if o == nil { - return nil, false - } - return &o.Geofencing, true -} - -// SetGeofencing sets field value -func (o *HttpBackend) SetGeofencing(v map[string][]string) { - o.Geofencing = v -} - -// GetOriginRequestHeaders returns the OriginRequestHeaders field value -func (o *HttpBackend) GetOriginRequestHeaders() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.OriginRequestHeaders -} - -// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value -// and a boolean to check if the value has been set. -func (o *HttpBackend) GetOriginRequestHeadersOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.OriginRequestHeaders, true -} - -// SetOriginRequestHeaders sets field value -func (o *HttpBackend) SetOriginRequestHeaders(v map[string]string) { - o.OriginRequestHeaders = v -} - -// GetOriginUrl returns the OriginUrl field value -func (o *HttpBackend) GetOriginUrl() string { - if o == nil { - var ret string - return ret - } - - return o.OriginUrl -} - -// GetOriginUrlOk returns a tuple with the OriginUrl field value -// and a boolean to check if the value has been set. -func (o *HttpBackend) GetOriginUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.OriginUrl, true -} - -// SetOriginUrl sets field value -func (o *HttpBackend) SetOriginUrl(v string) { - o.OriginUrl = v -} - -// GetType returns the Type field value -func (o *HttpBackend) 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 *HttpBackend) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *HttpBackend) SetType(v string) { - o.Type = v -} - -func (o HttpBackend) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o HttpBackend) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["geofencing"] = o.Geofencing - toSerialize["originRequestHeaders"] = o.OriginRequestHeaders - toSerialize["originUrl"] = o.OriginUrl - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *HttpBackend) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "geofencing", - "originRequestHeaders", - "originUrl", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varHttpBackend := _HttpBackend{} - - err = json.Unmarshal(data, &varHttpBackend) - - if err != nil { - return err - } - - *o = HttpBackend(varHttpBackend) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "geofencing") - delete(additionalProperties, "originRequestHeaders") - delete(additionalProperties, "originUrl") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableHttpBackend struct { - value *HttpBackend - isSet bool -} - -func (v NullableHttpBackend) Get() *HttpBackend { - return v.value -} - -func (v *NullableHttpBackend) Set(val *HttpBackend) { - v.value = val - v.isSet = true -} - -func (v NullableHttpBackend) IsSet() bool { - return v.isSet -} - -func (v *NullableHttpBackend) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHttpBackend(val *HttpBackend) *NullableHttpBackend { - return &NullableHttpBackend{value: val, isSet: true} -} - -func (v NullableHttpBackend) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHttpBackend) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_http_backend_create.go b/services/cdn/v1beta2api/model_http_backend_create.go deleted file mode 100644 index a8afd4a11..000000000 --- a/services/cdn/v1beta2api/model_http_backend_create.go +++ /dev/null @@ -1,272 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the HttpBackendCreate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &HttpBackendCreate{} - -// HttpBackendCreate struct for HttpBackendCreate -type HttpBackendCreate struct { - // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. - Geofencing *map[string][]string `json:"geofencing,omitempty"` - // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. - OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` - // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` - OriginUrl string `json:"originUrl"` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _HttpBackendCreate HttpBackendCreate - -// NewHttpBackendCreate instantiates a new HttpBackendCreate 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 NewHttpBackendCreate(originUrl string, types string) *HttpBackendCreate { - this := HttpBackendCreate{} - this.OriginUrl = originUrl - this.Type = types - return &this -} - -// NewHttpBackendCreateWithDefaults instantiates a new HttpBackendCreate 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 NewHttpBackendCreateWithDefaults() *HttpBackendCreate { - this := HttpBackendCreate{} - return &this -} - -// GetGeofencing returns the Geofencing field value if set, zero value otherwise. -func (o *HttpBackendCreate) GetGeofencing() map[string][]string { - if o == nil || IsNil(o.Geofencing) { - var ret map[string][]string - return ret - } - return *o.Geofencing -} - -// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HttpBackendCreate) GetGeofencingOk() (*map[string][]string, bool) { - if o == nil || IsNil(o.Geofencing) { - return nil, false - } - return o.Geofencing, true -} - -// HasGeofencing returns a boolean if a field has been set. -func (o *HttpBackendCreate) HasGeofencing() bool { - if o != nil && !IsNil(o.Geofencing) { - return true - } - - return false -} - -// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. -func (o *HttpBackendCreate) SetGeofencing(v map[string][]string) { - o.Geofencing = &v -} - -// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. -func (o *HttpBackendCreate) GetOriginRequestHeaders() map[string]string { - if o == nil || IsNil(o.OriginRequestHeaders) { - var ret map[string]string - return ret - } - return *o.OriginRequestHeaders -} - -// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HttpBackendCreate) GetOriginRequestHeadersOk() (*map[string]string, bool) { - if o == nil || IsNil(o.OriginRequestHeaders) { - return nil, false - } - return o.OriginRequestHeaders, true -} - -// HasOriginRequestHeaders returns a boolean if a field has been set. -func (o *HttpBackendCreate) HasOriginRequestHeaders() bool { - if o != nil && !IsNil(o.OriginRequestHeaders) { - return true - } - - return false -} - -// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. -func (o *HttpBackendCreate) SetOriginRequestHeaders(v map[string]string) { - o.OriginRequestHeaders = &v -} - -// GetOriginUrl returns the OriginUrl field value -func (o *HttpBackendCreate) GetOriginUrl() string { - if o == nil { - var ret string - return ret - } - - return o.OriginUrl -} - -// GetOriginUrlOk returns a tuple with the OriginUrl field value -// and a boolean to check if the value has been set. -func (o *HttpBackendCreate) GetOriginUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.OriginUrl, true -} - -// SetOriginUrl sets field value -func (o *HttpBackendCreate) SetOriginUrl(v string) { - o.OriginUrl = v -} - -// GetType returns the Type field value -func (o *HttpBackendCreate) 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 *HttpBackendCreate) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *HttpBackendCreate) SetType(v string) { - o.Type = v -} - -func (o HttpBackendCreate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o HttpBackendCreate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Geofencing) { - toSerialize["geofencing"] = o.Geofencing - } - if !IsNil(o.OriginRequestHeaders) { - toSerialize["originRequestHeaders"] = o.OriginRequestHeaders - } - toSerialize["originUrl"] = o.OriginUrl - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *HttpBackendCreate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "originUrl", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varHttpBackendCreate := _HttpBackendCreate{} - - err = json.Unmarshal(data, &varHttpBackendCreate) - - if err != nil { - return err - } - - *o = HttpBackendCreate(varHttpBackendCreate) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "geofencing") - delete(additionalProperties, "originRequestHeaders") - delete(additionalProperties, "originUrl") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableHttpBackendCreate struct { - value *HttpBackendCreate - isSet bool -} - -func (v NullableHttpBackendCreate) Get() *HttpBackendCreate { - return v.value -} - -func (v *NullableHttpBackendCreate) Set(val *HttpBackendCreate) { - v.value = val - v.isSet = true -} - -func (v NullableHttpBackendCreate) IsSet() bool { - return v.isSet -} - -func (v *NullableHttpBackendCreate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHttpBackendCreate(val *HttpBackendCreate) *NullableHttpBackendCreate { - return &NullableHttpBackendCreate{value: val, isSet: true} -} - -func (v NullableHttpBackendCreate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHttpBackendCreate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_http_backend_patch.go b/services/cdn/v1beta2api/model_http_backend_patch.go deleted file mode 100644 index f8fa977ae..000000000 --- a/services/cdn/v1beta2api/model_http_backend_patch.go +++ /dev/null @@ -1,280 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the HttpBackendPatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &HttpBackendPatch{} - -// HttpBackendPatch A partial HTTP Backend -type HttpBackendPatch struct { - // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. - Geofencing *map[string][]string `json:"geofencing,omitempty"` - // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. - OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` - OriginUrl *string `json:"originUrl,omitempty"` - // This property is required to determine the used backend type. - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _HttpBackendPatch HttpBackendPatch - -// NewHttpBackendPatch instantiates a new HttpBackendPatch 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 NewHttpBackendPatch(types string) *HttpBackendPatch { - this := HttpBackendPatch{} - this.Type = types - return &this -} - -// NewHttpBackendPatchWithDefaults instantiates a new HttpBackendPatch 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 NewHttpBackendPatchWithDefaults() *HttpBackendPatch { - this := HttpBackendPatch{} - return &this -} - -// GetGeofencing returns the Geofencing field value if set, zero value otherwise. -func (o *HttpBackendPatch) GetGeofencing() map[string][]string { - if o == nil || IsNil(o.Geofencing) { - var ret map[string][]string - return ret - } - return *o.Geofencing -} - -// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HttpBackendPatch) GetGeofencingOk() (*map[string][]string, bool) { - if o == nil || IsNil(o.Geofencing) { - return nil, false - } - return o.Geofencing, true -} - -// HasGeofencing returns a boolean if a field has been set. -func (o *HttpBackendPatch) HasGeofencing() bool { - if o != nil && !IsNil(o.Geofencing) { - return true - } - - return false -} - -// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. -func (o *HttpBackendPatch) SetGeofencing(v map[string][]string) { - o.Geofencing = &v -} - -// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. -func (o *HttpBackendPatch) GetOriginRequestHeaders() map[string]string { - if o == nil || IsNil(o.OriginRequestHeaders) { - var ret map[string]string - return ret - } - return *o.OriginRequestHeaders -} - -// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HttpBackendPatch) GetOriginRequestHeadersOk() (*map[string]string, bool) { - if o == nil || IsNil(o.OriginRequestHeaders) { - return nil, false - } - return o.OriginRequestHeaders, true -} - -// HasOriginRequestHeaders returns a boolean if a field has been set. -func (o *HttpBackendPatch) HasOriginRequestHeaders() bool { - if o != nil && !IsNil(o.OriginRequestHeaders) { - return true - } - - return false -} - -// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. -func (o *HttpBackendPatch) SetOriginRequestHeaders(v map[string]string) { - o.OriginRequestHeaders = &v -} - -// GetOriginUrl returns the OriginUrl field value if set, zero value otherwise. -func (o *HttpBackendPatch) GetOriginUrl() string { - if o == nil || IsNil(o.OriginUrl) { - var ret string - return ret - } - return *o.OriginUrl -} - -// GetOriginUrlOk returns a tuple with the OriginUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HttpBackendPatch) GetOriginUrlOk() (*string, bool) { - if o == nil || IsNil(o.OriginUrl) { - return nil, false - } - return o.OriginUrl, true -} - -// HasOriginUrl returns a boolean if a field has been set. -func (o *HttpBackendPatch) HasOriginUrl() bool { - if o != nil && !IsNil(o.OriginUrl) { - return true - } - - return false -} - -// SetOriginUrl gets a reference to the given string and assigns it to the OriginUrl field. -func (o *HttpBackendPatch) SetOriginUrl(v string) { - o.OriginUrl = &v -} - -// GetType returns the Type field value -func (o *HttpBackendPatch) 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 *HttpBackendPatch) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *HttpBackendPatch) SetType(v string) { - o.Type = v -} - -func (o HttpBackendPatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o HttpBackendPatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Geofencing) { - toSerialize["geofencing"] = o.Geofencing - } - if !IsNil(o.OriginRequestHeaders) { - toSerialize["originRequestHeaders"] = o.OriginRequestHeaders - } - if !IsNil(o.OriginUrl) { - toSerialize["originUrl"] = o.OriginUrl - } - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *HttpBackendPatch) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varHttpBackendPatch := _HttpBackendPatch{} - - err = json.Unmarshal(data, &varHttpBackendPatch) - - if err != nil { - return err - } - - *o = HttpBackendPatch(varHttpBackendPatch) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "geofencing") - delete(additionalProperties, "originRequestHeaders") - delete(additionalProperties, "originUrl") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableHttpBackendPatch struct { - value *HttpBackendPatch - isSet bool -} - -func (v NullableHttpBackendPatch) Get() *HttpBackendPatch { - return v.value -} - -func (v *NullableHttpBackendPatch) Set(val *HttpBackendPatch) { - v.value = val - v.isSet = true -} - -func (v NullableHttpBackendPatch) IsSet() bool { - return v.isSet -} - -func (v *NullableHttpBackendPatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHttpBackendPatch(val *HttpBackendPatch) *NullableHttpBackendPatch { - return &NullableHttpBackendPatch{value: val, isSet: true} -} - -func (v NullableHttpBackendPatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHttpBackendPatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_list_distributions_response.go b/services/cdn/v1beta2api/model_list_distributions_response.go deleted file mode 100644 index 3cd908eef..000000000 --- a/services/cdn/v1beta2api/model_list_distributions_response.go +++ /dev/null @@ -1,203 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the ListDistributionsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListDistributionsResponse{} - -// ListDistributionsResponse struct for ListDistributionsResponse -type ListDistributionsResponse struct { - Distributions []Distribution `json:"distributions"` - NextPageIdentifier *string `json:"nextPageIdentifier,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ListDistributionsResponse ListDistributionsResponse - -// NewListDistributionsResponse instantiates a new ListDistributionsResponse 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 NewListDistributionsResponse(distributions []Distribution) *ListDistributionsResponse { - this := ListDistributionsResponse{} - this.Distributions = distributions - return &this -} - -// NewListDistributionsResponseWithDefaults instantiates a new ListDistributionsResponse 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 NewListDistributionsResponseWithDefaults() *ListDistributionsResponse { - this := ListDistributionsResponse{} - return &this -} - -// GetDistributions returns the Distributions field value -func (o *ListDistributionsResponse) GetDistributions() []Distribution { - if o == nil { - var ret []Distribution - return ret - } - - return o.Distributions -} - -// GetDistributionsOk returns a tuple with the Distributions field value -// and a boolean to check if the value has been set. -func (o *ListDistributionsResponse) GetDistributionsOk() ([]Distribution, bool) { - if o == nil { - return nil, false - } - return o.Distributions, true -} - -// SetDistributions sets field value -func (o *ListDistributionsResponse) SetDistributions(v []Distribution) { - o.Distributions = v -} - -// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. -func (o *ListDistributionsResponse) GetNextPageIdentifier() string { - if o == nil || IsNil(o.NextPageIdentifier) { - var ret string - return ret - } - return *o.NextPageIdentifier -} - -// GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListDistributionsResponse) GetNextPageIdentifierOk() (*string, bool) { - if o == nil || IsNil(o.NextPageIdentifier) { - return nil, false - } - return o.NextPageIdentifier, true -} - -// HasNextPageIdentifier returns a boolean if a field has been set. -func (o *ListDistributionsResponse) HasNextPageIdentifier() bool { - if o != nil && !IsNil(o.NextPageIdentifier) { - return true - } - - return false -} - -// SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. -func (o *ListDistributionsResponse) SetNextPageIdentifier(v string) { - o.NextPageIdentifier = &v -} - -func (o ListDistributionsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListDistributionsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["distributions"] = o.Distributions - if !IsNil(o.NextPageIdentifier) { - toSerialize["nextPageIdentifier"] = o.NextPageIdentifier - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListDistributionsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "distributions", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListDistributionsResponse := _ListDistributionsResponse{} - - err = json.Unmarshal(data, &varListDistributionsResponse) - - if err != nil { - return err - } - - *o = ListDistributionsResponse(varListDistributionsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "distributions") - delete(additionalProperties, "nextPageIdentifier") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableListDistributionsResponse struct { - value *ListDistributionsResponse - isSet bool -} - -func (v NullableListDistributionsResponse) Get() *ListDistributionsResponse { - return v.value -} - -func (v *NullableListDistributionsResponse) Set(val *ListDistributionsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListDistributionsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListDistributionsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListDistributionsResponse(val *ListDistributionsResponse) *NullableListDistributionsResponse { - return &NullableListDistributionsResponse{value: val, isSet: true} -} - -func (v NullableListDistributionsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListDistributionsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_list_distributions_sort_by_parameter.go b/services/cdn/v1beta2api/model_list_distributions_sort_by_parameter.go deleted file mode 100644 index 9685b8166..000000000 --- a/services/cdn/v1beta2api/model_list_distributions_sort_by_parameter.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// ListDistributionsSortByParameter the model 'ListDistributionsSortByParameter' -type ListDistributionsSortByParameter string - -// List of ListDistributions_sortBy_parameter -const ( - LISTDISTRIBUTIONSSORTBYPARAMETER_ID ListDistributionsSortByParameter = "id" - LISTDISTRIBUTIONSSORTBYPARAMETER_UPDATED_AT ListDistributionsSortByParameter = "updatedAt" - LISTDISTRIBUTIONSSORTBYPARAMETER_CREATED_AT ListDistributionsSortByParameter = "createdAt" - LISTDISTRIBUTIONSSORTBYPARAMETER_ORIGIN_URL ListDistributionsSortByParameter = "originUrl" - LISTDISTRIBUTIONSSORTBYPARAMETER_STATUS ListDistributionsSortByParameter = "status" - LISTDISTRIBUTIONSSORTBYPARAMETER_ORIGIN_URL_RELATED ListDistributionsSortByParameter = "originUrlRelated" - LISTDISTRIBUTIONSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDistributionsSortByParameter = "unknown_default_open_api" -) - -// All allowed values of ListDistributionsSortByParameter enum -var AllowedListDistributionsSortByParameterEnumValues = []ListDistributionsSortByParameter{ - "id", - "updatedAt", - "createdAt", - "originUrl", - "status", - "originUrlRelated", - "unknown_default_open_api", -} - -func (v *ListDistributionsSortByParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListDistributionsSortByParameter(value) - for _, existing := range AllowedListDistributionsSortByParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTDISTRIBUTIONSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListDistributionsSortByParameterFromValue returns a pointer to a valid ListDistributionsSortByParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListDistributionsSortByParameterFromValue(v string) (*ListDistributionsSortByParameter, error) { - ev := ListDistributionsSortByParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListDistributionsSortByParameter: valid values are %v", v, AllowedListDistributionsSortByParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListDistributionsSortByParameter) IsValid() bool { - for _, existing := range AllowedListDistributionsSortByParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListDistributions_sortBy_parameter value -func (v ListDistributionsSortByParameter) Ptr() *ListDistributionsSortByParameter { - return &v -} - -type NullableListDistributionsSortByParameter struct { - value *ListDistributionsSortByParameter - isSet bool -} - -func (v NullableListDistributionsSortByParameter) Get() *ListDistributionsSortByParameter { - return v.value -} - -func (v *NullableListDistributionsSortByParameter) Set(val *ListDistributionsSortByParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListDistributionsSortByParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListDistributionsSortByParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListDistributionsSortByParameter(val *ListDistributionsSortByParameter) *NullableListDistributionsSortByParameter { - return &NullableListDistributionsSortByParameter{value: val, isSet: true} -} - -func (v NullableListDistributionsSortByParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListDistributionsSortByParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_list_distributions_sort_order_parameter.go b/services/cdn/v1beta2api/model_list_distributions_sort_order_parameter.go deleted file mode 100644 index f23b05e4f..000000000 --- a/services/cdn/v1beta2api/model_list_distributions_sort_order_parameter.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// ListDistributionsSortOrderParameter the model 'ListDistributionsSortOrderParameter' -type ListDistributionsSortOrderParameter string - -// List of ListDistributions_sortOrder_parameter -const ( - LISTDISTRIBUTIONSSORTORDERPARAMETER_ASCENDING ListDistributionsSortOrderParameter = "ascending" - LISTDISTRIBUTIONSSORTORDERPARAMETER_DESCENDING ListDistributionsSortOrderParameter = "descending" - LISTDISTRIBUTIONSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDistributionsSortOrderParameter = "unknown_default_open_api" -) - -// All allowed values of ListDistributionsSortOrderParameter enum -var AllowedListDistributionsSortOrderParameterEnumValues = []ListDistributionsSortOrderParameter{ - "ascending", - "descending", - "unknown_default_open_api", -} - -func (v *ListDistributionsSortOrderParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListDistributionsSortOrderParameter(value) - for _, existing := range AllowedListDistributionsSortOrderParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTDISTRIBUTIONSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListDistributionsSortOrderParameterFromValue returns a pointer to a valid ListDistributionsSortOrderParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListDistributionsSortOrderParameterFromValue(v string) (*ListDistributionsSortOrderParameter, error) { - ev := ListDistributionsSortOrderParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListDistributionsSortOrderParameter: valid values are %v", v, AllowedListDistributionsSortOrderParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListDistributionsSortOrderParameter) IsValid() bool { - for _, existing := range AllowedListDistributionsSortOrderParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListDistributions_sortOrder_parameter value -func (v ListDistributionsSortOrderParameter) Ptr() *ListDistributionsSortOrderParameter { - return &v -} - -type NullableListDistributionsSortOrderParameter struct { - value *ListDistributionsSortOrderParameter - isSet bool -} - -func (v NullableListDistributionsSortOrderParameter) Get() *ListDistributionsSortOrderParameter { - return v.value -} - -func (v *NullableListDistributionsSortOrderParameter) Set(val *ListDistributionsSortOrderParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListDistributionsSortOrderParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListDistributionsSortOrderParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListDistributionsSortOrderParameter(val *ListDistributionsSortOrderParameter) *NullableListDistributionsSortOrderParameter { - return &NullableListDistributionsSortOrderParameter{value: val, isSet: true} -} - -func (v NullableListDistributionsSortOrderParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListDistributionsSortOrderParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_list_waf_collections_response.go b/services/cdn/v1beta2api/model_list_waf_collections_response.go deleted file mode 100644 index d311ce1da..000000000 --- a/services/cdn/v1beta2api/model_list_waf_collections_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the ListWafCollectionsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListWafCollectionsResponse{} - -// ListWafCollectionsResponse struct for ListWafCollectionsResponse -type ListWafCollectionsResponse struct { - Collections []WafRuleCollection `json:"collections"` - AdditionalProperties map[string]interface{} -} - -type _ListWafCollectionsResponse ListWafCollectionsResponse - -// NewListWafCollectionsResponse instantiates a new ListWafCollectionsResponse 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 NewListWafCollectionsResponse(collections []WafRuleCollection) *ListWafCollectionsResponse { - this := ListWafCollectionsResponse{} - this.Collections = collections - return &this -} - -// NewListWafCollectionsResponseWithDefaults instantiates a new ListWafCollectionsResponse 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 NewListWafCollectionsResponseWithDefaults() *ListWafCollectionsResponse { - this := ListWafCollectionsResponse{} - return &this -} - -// GetCollections returns the Collections field value -func (o *ListWafCollectionsResponse) GetCollections() []WafRuleCollection { - if o == nil { - var ret []WafRuleCollection - return ret - } - - return o.Collections -} - -// GetCollectionsOk returns a tuple with the Collections field value -// and a boolean to check if the value has been set. -func (o *ListWafCollectionsResponse) GetCollectionsOk() ([]WafRuleCollection, bool) { - if o == nil { - return nil, false - } - return o.Collections, true -} - -// SetCollections sets field value -func (o *ListWafCollectionsResponse) SetCollections(v []WafRuleCollection) { - o.Collections = v -} - -func (o ListWafCollectionsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListWafCollectionsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["collections"] = o.Collections - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListWafCollectionsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "collections", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListWafCollectionsResponse := _ListWafCollectionsResponse{} - - err = json.Unmarshal(data, &varListWafCollectionsResponse) - - if err != nil { - return err - } - - *o = ListWafCollectionsResponse(varListWafCollectionsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "collections") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableListWafCollectionsResponse struct { - value *ListWafCollectionsResponse - isSet bool -} - -func (v NullableListWafCollectionsResponse) Get() *ListWafCollectionsResponse { - return v.value -} - -func (v *NullableListWafCollectionsResponse) Set(val *ListWafCollectionsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListWafCollectionsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListWafCollectionsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListWafCollectionsResponse(val *ListWafCollectionsResponse) *NullableListWafCollectionsResponse { - return &NullableListWafCollectionsResponse{value: val, isSet: true} -} - -func (v NullableListWafCollectionsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListWafCollectionsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_loki_log_sink_credentials.go b/services/cdn/v1beta2api/model_loki_log_sink_credentials.go deleted file mode 100644 index 4c3377513..000000000 --- a/services/cdn/v1beta2api/model_loki_log_sink_credentials.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the LokiLogSinkCredentials type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &LokiLogSinkCredentials{} - -// LokiLogSinkCredentials struct for LokiLogSinkCredentials -type LokiLogSinkCredentials struct { - Password string `json:"password"` - Username string `json:"username"` - AdditionalProperties map[string]interface{} -} - -type _LokiLogSinkCredentials LokiLogSinkCredentials - -// NewLokiLogSinkCredentials instantiates a new LokiLogSinkCredentials 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 NewLokiLogSinkCredentials(password string, username string) *LokiLogSinkCredentials { - this := LokiLogSinkCredentials{} - this.Password = password - this.Username = username - return &this -} - -// NewLokiLogSinkCredentialsWithDefaults instantiates a new LokiLogSinkCredentials 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 NewLokiLogSinkCredentialsWithDefaults() *LokiLogSinkCredentials { - this := LokiLogSinkCredentials{} - return &this -} - -// GetPassword returns the Password field value -func (o *LokiLogSinkCredentials) GetPassword() string { - if o == nil { - var ret string - return ret - } - - return o.Password -} - -// GetPasswordOk returns a tuple with the Password field value -// and a boolean to check if the value has been set. -func (o *LokiLogSinkCredentials) GetPasswordOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Password, true -} - -// SetPassword sets field value -func (o *LokiLogSinkCredentials) SetPassword(v string) { - o.Password = v -} - -// GetUsername returns the Username field value -func (o *LokiLogSinkCredentials) GetUsername() string { - if o == nil { - var ret string - return ret - } - - return o.Username -} - -// GetUsernameOk returns a tuple with the Username field value -// and a boolean to check if the value has been set. -func (o *LokiLogSinkCredentials) GetUsernameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Username, true -} - -// SetUsername sets field value -func (o *LokiLogSinkCredentials) SetUsername(v string) { - o.Username = v -} - -func (o LokiLogSinkCredentials) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o LokiLogSinkCredentials) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["password"] = o.Password - toSerialize["username"] = o.Username - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *LokiLogSinkCredentials) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "password", - "username", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varLokiLogSinkCredentials := _LokiLogSinkCredentials{} - - err = json.Unmarshal(data, &varLokiLogSinkCredentials) - - if err != nil { - return err - } - - *o = LokiLogSinkCredentials(varLokiLogSinkCredentials) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "password") - delete(additionalProperties, "username") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableLokiLogSinkCredentials struct { - value *LokiLogSinkCredentials - isSet bool -} - -func (v NullableLokiLogSinkCredentials) Get() *LokiLogSinkCredentials { - return v.value -} - -func (v *NullableLokiLogSinkCredentials) Set(val *LokiLogSinkCredentials) { - v.value = val - v.isSet = true -} - -func (v NullableLokiLogSinkCredentials) IsSet() bool { - return v.isSet -} - -func (v *NullableLokiLogSinkCredentials) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableLokiLogSinkCredentials(val *LokiLogSinkCredentials) *NullableLokiLogSinkCredentials { - return &NullableLokiLogSinkCredentials{value: val, isSet: true} -} - -func (v NullableLokiLogSinkCredentials) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableLokiLogSinkCredentials) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_optimizer.go b/services/cdn/v1beta2api/model_optimizer.go deleted file mode 100644 index eb1aed18d..000000000 --- a/services/cdn/v1beta2api/model_optimizer.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the Optimizer type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Optimizer{} - -// Optimizer Optimizer is paid feature, a real-time on the fly image manipulation and optimization service that automatically optimizes your images for faster image delivery. -type Optimizer struct { - // Determines if the optimizer should be enabled for this distribution and incurs a monthly fee - Enabled bool `json:"enabled"` - AdditionalProperties map[string]interface{} -} - -type _Optimizer Optimizer - -// NewOptimizer instantiates a new Optimizer 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 NewOptimizer(enabled bool) *Optimizer { - this := Optimizer{} - this.Enabled = enabled - return &this -} - -// NewOptimizerWithDefaults instantiates a new Optimizer 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 NewOptimizerWithDefaults() *Optimizer { - this := Optimizer{} - return &this -} - -// GetEnabled returns the Enabled field value -func (o *Optimizer) GetEnabled() bool { - if o == nil { - var ret bool - return ret - } - - return o.Enabled -} - -// GetEnabledOk returns a tuple with the Enabled field value -// and a boolean to check if the value has been set. -func (o *Optimizer) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Enabled, true -} - -// SetEnabled sets field value -func (o *Optimizer) SetEnabled(v bool) { - o.Enabled = v -} - -func (o Optimizer) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Optimizer) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["enabled"] = o.Enabled - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Optimizer) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "enabled", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varOptimizer := _Optimizer{} - - err = json.Unmarshal(data, &varOptimizer) - - if err != nil { - return err - } - - *o = Optimizer(varOptimizer) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "enabled") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableOptimizer struct { - value *Optimizer - isSet bool -} - -func (v NullableOptimizer) Get() *Optimizer { - return v.value -} - -func (v *NullableOptimizer) Set(val *Optimizer) { - v.value = val - v.isSet = true -} - -func (v NullableOptimizer) IsSet() bool { - return v.isSet -} - -func (v *NullableOptimizer) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOptimizer(val *Optimizer) *NullableOptimizer { - return &NullableOptimizer{value: val, isSet: true} -} - -func (v NullableOptimizer) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOptimizer) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_optimizer_patch.go b/services/cdn/v1beta2api/model_optimizer_patch.go deleted file mode 100644 index 198a75e76..000000000 --- a/services/cdn/v1beta2api/model_optimizer_patch.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" -) - -// checks if the OptimizerPatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &OptimizerPatch{} - -// OptimizerPatch struct for OptimizerPatch -type OptimizerPatch struct { - Enabled *bool `json:"enabled,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _OptimizerPatch OptimizerPatch - -// NewOptimizerPatch instantiates a new OptimizerPatch 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 NewOptimizerPatch() *OptimizerPatch { - this := OptimizerPatch{} - return &this -} - -// NewOptimizerPatchWithDefaults instantiates a new OptimizerPatch 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 NewOptimizerPatchWithDefaults() *OptimizerPatch { - this := OptimizerPatch{} - return &this -} - -// GetEnabled returns the Enabled field value if set, zero value otherwise. -func (o *OptimizerPatch) GetEnabled() bool { - if o == nil || IsNil(o.Enabled) { - 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 *OptimizerPatch) GetEnabledOk() (*bool, bool) { - if o == nil || IsNil(o.Enabled) { - return nil, false - } - return o.Enabled, true -} - -// HasEnabled returns a boolean if a field has been set. -func (o *OptimizerPatch) HasEnabled() bool { - if o != nil && !IsNil(o.Enabled) { - return true - } - - return false -} - -// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. -func (o *OptimizerPatch) SetEnabled(v bool) { - o.Enabled = &v -} - -func (o OptimizerPatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o OptimizerPatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Enabled) { - toSerialize["enabled"] = o.Enabled - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *OptimizerPatch) UnmarshalJSON(data []byte) (err error) { - varOptimizerPatch := _OptimizerPatch{} - - err = json.Unmarshal(data, &varOptimizerPatch) - - if err != nil { - return err - } - - *o = OptimizerPatch(varOptimizerPatch) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "enabled") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableOptimizerPatch struct { - value *OptimizerPatch - isSet bool -} - -func (v NullableOptimizerPatch) Get() *OptimizerPatch { - return v.value -} - -func (v *NullableOptimizerPatch) Set(val *OptimizerPatch) { - v.value = val - v.isSet = true -} - -func (v NullableOptimizerPatch) IsSet() bool { - return v.isSet -} - -func (v *NullableOptimizerPatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOptimizerPatch(val *OptimizerPatch) *NullableOptimizerPatch { - return &NullableOptimizerPatch{value: val, isSet: true} -} - -func (v NullableOptimizerPatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOptimizerPatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_patch_distribution_payload.go b/services/cdn/v1beta2api/model_patch_distribution_payload.go deleted file mode 100644 index fcbc666e6..000000000 --- a/services/cdn/v1beta2api/model_patch_distribution_payload.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" -) - -// checks if the PatchDistributionPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PatchDistributionPayload{} - -// PatchDistributionPayload Defines a partial distribution. Set values -type PatchDistributionPayload struct { - Config *ConfigPatch `json:"config,omitempty"` - // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. - IntentId *string `json:"intentId,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PatchDistributionPayload PatchDistributionPayload - -// NewPatchDistributionPayload instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayload() *PatchDistributionPayload { - this := PatchDistributionPayload{} - return &this -} - -// NewPatchDistributionPayloadWithDefaults instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayloadWithDefaults() *PatchDistributionPayload { - this := PatchDistributionPayload{} - return &this -} - -// GetConfig returns the Config field value if set, zero value otherwise. -func (o *PatchDistributionPayload) GetConfig() ConfigPatch { - if o == nil || IsNil(o.Config) { - var ret ConfigPatch - return ret - } - return *o.Config -} - -// GetConfigOk returns a tuple with the Config field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PatchDistributionPayload) GetConfigOk() (*ConfigPatch, bool) { - if o == nil || IsNil(o.Config) { - return nil, false - } - return o.Config, true -} - -// HasConfig returns a boolean if a field has been set. -func (o *PatchDistributionPayload) HasConfig() bool { - if o != nil && !IsNil(o.Config) { - return true - } - - return false -} - -// SetConfig gets a reference to the given ConfigPatch and assigns it to the Config field. -func (o *PatchDistributionPayload) SetConfig(v ConfigPatch) { - o.Config = &v -} - -// GetIntentId returns the IntentId field value if set, zero value otherwise. -func (o *PatchDistributionPayload) GetIntentId() string { - if o == nil || IsNil(o.IntentId) { - var ret string - return ret - } - return *o.IntentId -} - -// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PatchDistributionPayload) GetIntentIdOk() (*string, bool) { - if o == nil || IsNil(o.IntentId) { - return nil, false - } - return o.IntentId, true -} - -// HasIntentId returns a boolean if a field has been set. -func (o *PatchDistributionPayload) HasIntentId() bool { - if o != nil && !IsNil(o.IntentId) { - return true - } - - return false -} - -// SetIntentId gets a reference to the given string and assigns it to the IntentId field. -func (o *PatchDistributionPayload) SetIntentId(v string) { - o.IntentId = &v -} - -func (o PatchDistributionPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PatchDistributionPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Config) { - toSerialize["config"] = o.Config - } - if !IsNil(o.IntentId) { - toSerialize["intentId"] = o.IntentId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PatchDistributionPayload) UnmarshalJSON(data []byte) (err error) { - varPatchDistributionPayload := _PatchDistributionPayload{} - - err = json.Unmarshal(data, &varPatchDistributionPayload) - - if err != nil { - return err - } - - *o = PatchDistributionPayload(varPatchDistributionPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "config") - delete(additionalProperties, "intentId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePatchDistributionPayload struct { - value *PatchDistributionPayload - isSet bool -} - -func (v NullablePatchDistributionPayload) Get() *PatchDistributionPayload { - return v.value -} - -func (v *NullablePatchDistributionPayload) Set(val *PatchDistributionPayload) { - v.value = val - v.isSet = true -} - -func (v NullablePatchDistributionPayload) IsSet() bool { - return v.isSet -} - -func (v *NullablePatchDistributionPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePatchDistributionPayload(val *PatchDistributionPayload) *NullablePatchDistributionPayload { - return &NullablePatchDistributionPayload{value: val, isSet: true} -} - -func (v NullablePatchDistributionPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePatchDistributionPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_patch_distribution_response.go b/services/cdn/v1beta2api/model_patch_distribution_response.go deleted file mode 100644 index 20aca0ab3..000000000 --- a/services/cdn/v1beta2api/model_patch_distribution_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the PatchDistributionResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PatchDistributionResponse{} - -// PatchDistributionResponse struct for PatchDistributionResponse -type PatchDistributionResponse struct { - Distribution Distribution `json:"distribution"` - AdditionalProperties map[string]interface{} -} - -type _PatchDistributionResponse PatchDistributionResponse - -// NewPatchDistributionResponse instantiates a new PatchDistributionResponse 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 NewPatchDistributionResponse(distribution Distribution) *PatchDistributionResponse { - this := PatchDistributionResponse{} - this.Distribution = distribution - return &this -} - -// NewPatchDistributionResponseWithDefaults instantiates a new PatchDistributionResponse 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 NewPatchDistributionResponseWithDefaults() *PatchDistributionResponse { - this := PatchDistributionResponse{} - return &this -} - -// GetDistribution returns the Distribution field value -func (o *PatchDistributionResponse) GetDistribution() Distribution { - if o == nil { - var ret Distribution - return ret - } - - return o.Distribution -} - -// GetDistributionOk returns a tuple with the Distribution field value -// and a boolean to check if the value has been set. -func (o *PatchDistributionResponse) GetDistributionOk() (*Distribution, bool) { - if o == nil { - return nil, false - } - return &o.Distribution, true -} - -// SetDistribution sets field value -func (o *PatchDistributionResponse) SetDistribution(v Distribution) { - o.Distribution = v -} - -func (o PatchDistributionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PatchDistributionResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["distribution"] = o.Distribution - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PatchDistributionResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "distribution", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPatchDistributionResponse := _PatchDistributionResponse{} - - err = json.Unmarshal(data, &varPatchDistributionResponse) - - if err != nil { - return err - } - - *o = PatchDistributionResponse(varPatchDistributionResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "distribution") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePatchDistributionResponse struct { - value *PatchDistributionResponse - isSet bool -} - -func (v NullablePatchDistributionResponse) Get() *PatchDistributionResponse { - return v.value -} - -func (v *NullablePatchDistributionResponse) Set(val *PatchDistributionResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePatchDistributionResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePatchDistributionResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePatchDistributionResponse(val *PatchDistributionResponse) *NullablePatchDistributionResponse { - return &NullablePatchDistributionResponse{value: val, isSet: true} -} - -func (v NullablePatchDistributionResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePatchDistributionResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_purge_cache_payload.go b/services/cdn/v1beta2api/model_purge_cache_payload.go deleted file mode 100644 index 09de13b1f..000000000 --- a/services/cdn/v1beta2api/model_purge_cache_payload.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" -) - -// checks if the PurgeCachePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PurgeCachePayload{} - -// PurgeCachePayload struct for PurgeCachePayload -type PurgeCachePayload struct { - // Defines an optional path. If this is set, a granular purge is done. If missing, the entire cache is invalidated. During a granular cache purge, only the provided path is purged. Please do not that for example `/some/path` and `/some/path.txt` are considered different paths. - Path *string `json:"path,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PurgeCachePayload PurgeCachePayload - -// NewPurgeCachePayload instantiates a new PurgeCachePayload 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 NewPurgeCachePayload() *PurgeCachePayload { - this := PurgeCachePayload{} - return &this -} - -// NewPurgeCachePayloadWithDefaults instantiates a new PurgeCachePayload 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 NewPurgeCachePayloadWithDefaults() *PurgeCachePayload { - this := PurgeCachePayload{} - return &this -} - -// GetPath returns the Path field value if set, zero value otherwise. -func (o *PurgeCachePayload) GetPath() string { - if o == nil || IsNil(o.Path) { - var ret string - return ret - } - return *o.Path -} - -// GetPathOk returns a tuple with the Path field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PurgeCachePayload) GetPathOk() (*string, bool) { - if o == nil || IsNil(o.Path) { - return nil, false - } - return o.Path, true -} - -// HasPath returns a boolean if a field has been set. -func (o *PurgeCachePayload) HasPath() bool { - if o != nil && !IsNil(o.Path) { - return true - } - - return false -} - -// SetPath gets a reference to the given string and assigns it to the Path field. -func (o *PurgeCachePayload) SetPath(v string) { - o.Path = &v -} - -func (o PurgeCachePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PurgeCachePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Path) { - toSerialize["path"] = o.Path - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PurgeCachePayload) UnmarshalJSON(data []byte) (err error) { - varPurgeCachePayload := _PurgeCachePayload{} - - err = json.Unmarshal(data, &varPurgeCachePayload) - - if err != nil { - return err - } - - *o = PurgeCachePayload(varPurgeCachePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "path") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePurgeCachePayload struct { - value *PurgeCachePayload - isSet bool -} - -func (v NullablePurgeCachePayload) Get() *PurgeCachePayload { - return v.value -} - -func (v *NullablePurgeCachePayload) Set(val *PurgeCachePayload) { - v.value = val - v.isSet = true -} - -func (v NullablePurgeCachePayload) IsSet() bool { - return v.isSet -} - -func (v *NullablePurgeCachePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePurgeCachePayload(val *PurgeCachePayload) *NullablePurgeCachePayload { - return &NullablePurgeCachePayload{value: val, isSet: true} -} - -func (v NullablePurgeCachePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePurgeCachePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_custom_certificate.go b/services/cdn/v1beta2api/model_put_custom_domain_custom_certificate.go deleted file mode 100644 index 9d7a8a0f1..000000000 --- a/services/cdn/v1beta2api/model_put_custom_domain_custom_certificate.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the PutCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PutCustomDomainCustomCertificate{} - -// PutCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. -type PutCustomDomainCustomCertificate struct { - // base64-encoded PEM-encoded certificate - Certificate string `json:"certificate"` - // base64-encoded PEM encoded key - Key string `json:"key"` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _PutCustomDomainCustomCertificate PutCustomDomainCustomCertificate - -// NewPutCustomDomainCustomCertificate instantiates a new PutCustomDomainCustomCertificate 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 NewPutCustomDomainCustomCertificate(certificate string, key string, types string) *PutCustomDomainCustomCertificate { - this := PutCustomDomainCustomCertificate{} - this.Certificate = certificate - this.Key = key - this.Type = types - return &this -} - -// NewPutCustomDomainCustomCertificateWithDefaults instantiates a new PutCustomDomainCustomCertificate 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 NewPutCustomDomainCustomCertificateWithDefaults() *PutCustomDomainCustomCertificate { - this := PutCustomDomainCustomCertificate{} - return &this -} - -// GetCertificate returns the Certificate field value -func (o *PutCustomDomainCustomCertificate) GetCertificate() string { - if o == nil { - var ret string - return ret - } - - return o.Certificate -} - -// GetCertificateOk returns a tuple with the Certificate field value -// and a boolean to check if the value has been set. -func (o *PutCustomDomainCustomCertificate) GetCertificateOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Certificate, true -} - -// SetCertificate sets field value -func (o *PutCustomDomainCustomCertificate) SetCertificate(v string) { - o.Certificate = v -} - -// GetKey returns the Key field value -func (o *PutCustomDomainCustomCertificate) GetKey() string { - if o == nil { - var ret string - return ret - } - - return o.Key -} - -// GetKeyOk returns a tuple with the Key field value -// and a boolean to check if the value has been set. -func (o *PutCustomDomainCustomCertificate) GetKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Key, true -} - -// SetKey sets field value -func (o *PutCustomDomainCustomCertificate) SetKey(v string) { - o.Key = v -} - -// GetType returns the Type field value -func (o *PutCustomDomainCustomCertificate) 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 *PutCustomDomainCustomCertificate) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *PutCustomDomainCustomCertificate) SetType(v string) { - o.Type = v -} - -func (o PutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PutCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["certificate"] = o.Certificate - toSerialize["key"] = o.Key - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PutCustomDomainCustomCertificate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "certificate", - "key", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPutCustomDomainCustomCertificate := _PutCustomDomainCustomCertificate{} - - err = json.Unmarshal(data, &varPutCustomDomainCustomCertificate) - - if err != nil { - return err - } - - *o = PutCustomDomainCustomCertificate(varPutCustomDomainCustomCertificate) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "certificate") - delete(additionalProperties, "key") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePutCustomDomainCustomCertificate struct { - value *PutCustomDomainCustomCertificate - isSet bool -} - -func (v NullablePutCustomDomainCustomCertificate) Get() *PutCustomDomainCustomCertificate { - return v.value -} - -func (v *NullablePutCustomDomainCustomCertificate) Set(val *PutCustomDomainCustomCertificate) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainCustomCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainCustomCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainCustomCertificate(val *PutCustomDomainCustomCertificate) *NullablePutCustomDomainCustomCertificate { - return &NullablePutCustomDomainCustomCertificate{value: val, isSet: true} -} - -func (v NullablePutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_managed_certificate.go b/services/cdn/v1beta2api/model_put_custom_domain_managed_certificate.go deleted file mode 100644 index abd0594a9..000000000 --- a/services/cdn/v1beta2api/model_put_custom_domain_managed_certificate.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the PutCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PutCustomDomainManagedCertificate{} - -// PutCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you -type PutCustomDomainManagedCertificate struct { - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _PutCustomDomainManagedCertificate PutCustomDomainManagedCertificate - -// NewPutCustomDomainManagedCertificate instantiates a new PutCustomDomainManagedCertificate 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 NewPutCustomDomainManagedCertificate(types string) *PutCustomDomainManagedCertificate { - this := PutCustomDomainManagedCertificate{} - this.Type = types - return &this -} - -// NewPutCustomDomainManagedCertificateWithDefaults instantiates a new PutCustomDomainManagedCertificate 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 NewPutCustomDomainManagedCertificateWithDefaults() *PutCustomDomainManagedCertificate { - this := PutCustomDomainManagedCertificate{} - return &this -} - -// GetType returns the Type field value -func (o *PutCustomDomainManagedCertificate) 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 *PutCustomDomainManagedCertificate) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *PutCustomDomainManagedCertificate) SetType(v string) { - o.Type = v -} - -func (o PutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PutCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PutCustomDomainManagedCertificate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPutCustomDomainManagedCertificate := _PutCustomDomainManagedCertificate{} - - err = json.Unmarshal(data, &varPutCustomDomainManagedCertificate) - - if err != nil { - return err - } - - *o = PutCustomDomainManagedCertificate(varPutCustomDomainManagedCertificate) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePutCustomDomainManagedCertificate struct { - value *PutCustomDomainManagedCertificate - isSet bool -} - -func (v NullablePutCustomDomainManagedCertificate) Get() *PutCustomDomainManagedCertificate { - return v.value -} - -func (v *NullablePutCustomDomainManagedCertificate) Set(val *PutCustomDomainManagedCertificate) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainManagedCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainManagedCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainManagedCertificate(val *PutCustomDomainManagedCertificate) *NullablePutCustomDomainManagedCertificate { - return &NullablePutCustomDomainManagedCertificate{value: val, isSet: true} -} - -func (v NullablePutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_payload.go b/services/cdn/v1beta2api/model_put_custom_domain_payload.go deleted file mode 100644 index ffbefcfca..000000000 --- a/services/cdn/v1beta2api/model_put_custom_domain_payload.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" -) - -// checks if the PutCustomDomainPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PutCustomDomainPayload{} - -// PutCustomDomainPayload struct for PutCustomDomainPayload -type PutCustomDomainPayload struct { - Certificate *PutCustomDomainPayloadCertificate `json:"certificate,omitempty"` - // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. - IntentId *string `json:"intentId,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PutCustomDomainPayload PutCustomDomainPayload - -// NewPutCustomDomainPayload instantiates a new PutCustomDomainPayload 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 NewPutCustomDomainPayload() *PutCustomDomainPayload { - this := PutCustomDomainPayload{} - return &this -} - -// NewPutCustomDomainPayloadWithDefaults instantiates a new PutCustomDomainPayload 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 NewPutCustomDomainPayloadWithDefaults() *PutCustomDomainPayload { - this := PutCustomDomainPayload{} - return &this -} - -// GetCertificate returns the Certificate field value if set, zero value otherwise. -func (o *PutCustomDomainPayload) GetCertificate() PutCustomDomainPayloadCertificate { - if o == nil || IsNil(o.Certificate) { - var ret PutCustomDomainPayloadCertificate - return ret - } - return *o.Certificate -} - -// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PutCustomDomainPayload) GetCertificateOk() (*PutCustomDomainPayloadCertificate, bool) { - if o == nil || IsNil(o.Certificate) { - return nil, false - } - return o.Certificate, true -} - -// HasCertificate returns a boolean if a field has been set. -func (o *PutCustomDomainPayload) HasCertificate() bool { - if o != nil && !IsNil(o.Certificate) { - return true - } - - return false -} - -// SetCertificate gets a reference to the given PutCustomDomainPayloadCertificate and assigns it to the Certificate field. -func (o *PutCustomDomainPayload) SetCertificate(v PutCustomDomainPayloadCertificate) { - o.Certificate = &v -} - -// GetIntentId returns the IntentId field value if set, zero value otherwise. -func (o *PutCustomDomainPayload) GetIntentId() string { - if o == nil || IsNil(o.IntentId) { - var ret string - return ret - } - return *o.IntentId -} - -// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PutCustomDomainPayload) GetIntentIdOk() (*string, bool) { - if o == nil || IsNil(o.IntentId) { - return nil, false - } - return o.IntentId, true -} - -// HasIntentId returns a boolean if a field has been set. -func (o *PutCustomDomainPayload) HasIntentId() bool { - if o != nil && !IsNil(o.IntentId) { - return true - } - - return false -} - -// SetIntentId gets a reference to the given string and assigns it to the IntentId field. -func (o *PutCustomDomainPayload) SetIntentId(v string) { - o.IntentId = &v -} - -func (o PutCustomDomainPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PutCustomDomainPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Certificate) { - toSerialize["certificate"] = o.Certificate - } - if !IsNil(o.IntentId) { - toSerialize["intentId"] = o.IntentId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PutCustomDomainPayload) UnmarshalJSON(data []byte) (err error) { - varPutCustomDomainPayload := _PutCustomDomainPayload{} - - err = json.Unmarshal(data, &varPutCustomDomainPayload) - - if err != nil { - return err - } - - *o = PutCustomDomainPayload(varPutCustomDomainPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "certificate") - delete(additionalProperties, "intentId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePutCustomDomainPayload struct { - value *PutCustomDomainPayload - isSet bool -} - -func (v NullablePutCustomDomainPayload) Get() *PutCustomDomainPayload { - return v.value -} - -func (v *NullablePutCustomDomainPayload) Set(val *PutCustomDomainPayload) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainPayload) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainPayload(val *PutCustomDomainPayload) *NullablePutCustomDomainPayload { - return &NullablePutCustomDomainPayload{value: val, isSet: true} -} - -func (v NullablePutCustomDomainPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_payload_certificate.go b/services/cdn/v1beta2api/model_put_custom_domain_payload_certificate.go deleted file mode 100644 index 4df6cd431..000000000 --- a/services/cdn/v1beta2api/model_put_custom_domain_payload_certificate.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// PutCustomDomainPayloadCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted -type PutCustomDomainPayloadCertificate struct { - PutCustomDomainCustomCertificate *PutCustomDomainCustomCertificate - PutCustomDomainManagedCertificate *PutCustomDomainManagedCertificate -} - -// PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainCustomCertificate wrapped in PutCustomDomainPayloadCertificate -func PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainCustomCertificate) PutCustomDomainPayloadCertificate { - return PutCustomDomainPayloadCertificate{ - PutCustomDomainCustomCertificate: v, - } -} - -// PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainManagedCertificate wrapped in PutCustomDomainPayloadCertificate -func PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainManagedCertificate) PutCustomDomainPayloadCertificate { - return PutCustomDomainPayloadCertificate{ - PutCustomDomainManagedCertificate: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *PutCustomDomainPayloadCertificate) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'custom' - if jsonDict["type"] == "custom" { - // try to unmarshal JSON data into PutCustomDomainCustomCertificate - err = json.Unmarshal(data, &dst.PutCustomDomainCustomCertificate) - if err == nil { - return nil // data stored in dst.PutCustomDomainCustomCertificate, return on the first match - } else { - dst.PutCustomDomainCustomCertificate = nil - return fmt.Errorf("failed to unmarshal PutCustomDomainPayloadCertificate as PutCustomDomainCustomCertificate: %s", err.Error()) - } - } - - // check if the discriminator value is 'managed' - if jsonDict["type"] == "managed" { - // try to unmarshal JSON data into PutCustomDomainManagedCertificate - err = json.Unmarshal(data, &dst.PutCustomDomainManagedCertificate) - if err == nil { - return nil // data stored in dst.PutCustomDomainManagedCertificate, return on the first match - } else { - dst.PutCustomDomainManagedCertificate = nil - return fmt.Errorf("failed to unmarshal PutCustomDomainPayloadCertificate as PutCustomDomainManagedCertificate: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src PutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { - if src.PutCustomDomainCustomCertificate != nil { - return json.Marshal(&src.PutCustomDomainCustomCertificate) - } - - if src.PutCustomDomainManagedCertificate != nil { - return json.Marshal(&src.PutCustomDomainManagedCertificate) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *PutCustomDomainPayloadCertificate) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.PutCustomDomainCustomCertificate != nil { - return obj.PutCustomDomainCustomCertificate - } - - if obj.PutCustomDomainManagedCertificate != nil { - return obj.PutCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj PutCustomDomainPayloadCertificate) GetActualInstanceValue() interface{} { - if obj.PutCustomDomainCustomCertificate != nil { - return *obj.PutCustomDomainCustomCertificate - } - - if obj.PutCustomDomainManagedCertificate != nil { - return *obj.PutCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -type NullablePutCustomDomainPayloadCertificate struct { - value *PutCustomDomainPayloadCertificate - isSet bool -} - -func (v NullablePutCustomDomainPayloadCertificate) Get() *PutCustomDomainPayloadCertificate { - return v.value -} - -func (v *NullablePutCustomDomainPayloadCertificate) Set(val *PutCustomDomainPayloadCertificate) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainPayloadCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainPayloadCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainPayloadCertificate(val *PutCustomDomainPayloadCertificate) *NullablePutCustomDomainPayloadCertificate { - return &NullablePutCustomDomainPayloadCertificate{value: val, isSet: true} -} - -func (v NullablePutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainPayloadCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_response.go b/services/cdn/v1beta2api/model_put_custom_domain_response.go deleted file mode 100644 index 157f6ef9a..000000000 --- a/services/cdn/v1beta2api/model_put_custom_domain_response.go +++ /dev/null @@ -1,203 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the PutCustomDomainResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PutCustomDomainResponse{} - -// PutCustomDomainResponse struct for PutCustomDomainResponse -type PutCustomDomainResponse struct { - Certificate *PutCustomDomainResponseCertificate `json:"certificate,omitempty"` - CustomDomain CustomDomain `json:"customDomain"` - AdditionalProperties map[string]interface{} -} - -type _PutCustomDomainResponse PutCustomDomainResponse - -// NewPutCustomDomainResponse instantiates a new PutCustomDomainResponse 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 NewPutCustomDomainResponse(customDomain CustomDomain) *PutCustomDomainResponse { - this := PutCustomDomainResponse{} - this.CustomDomain = customDomain - return &this -} - -// NewPutCustomDomainResponseWithDefaults instantiates a new PutCustomDomainResponse 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 NewPutCustomDomainResponseWithDefaults() *PutCustomDomainResponse { - this := PutCustomDomainResponse{} - return &this -} - -// GetCertificate returns the Certificate field value if set, zero value otherwise. -func (o *PutCustomDomainResponse) GetCertificate() PutCustomDomainResponseCertificate { - if o == nil || IsNil(o.Certificate) { - var ret PutCustomDomainResponseCertificate - return ret - } - return *o.Certificate -} - -// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PutCustomDomainResponse) GetCertificateOk() (*PutCustomDomainResponseCertificate, bool) { - if o == nil || IsNil(o.Certificate) { - return nil, false - } - return o.Certificate, true -} - -// HasCertificate returns a boolean if a field has been set. -func (o *PutCustomDomainResponse) HasCertificate() bool { - if o != nil && !IsNil(o.Certificate) { - return true - } - - return false -} - -// SetCertificate gets a reference to the given PutCustomDomainResponseCertificate and assigns it to the Certificate field. -func (o *PutCustomDomainResponse) SetCertificate(v PutCustomDomainResponseCertificate) { - o.Certificate = &v -} - -// GetCustomDomain returns the CustomDomain field value -func (o *PutCustomDomainResponse) GetCustomDomain() CustomDomain { - if o == nil { - var ret CustomDomain - return ret - } - - return o.CustomDomain -} - -// GetCustomDomainOk returns a tuple with the CustomDomain field value -// and a boolean to check if the value has been set. -func (o *PutCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { - if o == nil { - return nil, false - } - return &o.CustomDomain, true -} - -// SetCustomDomain sets field value -func (o *PutCustomDomainResponse) SetCustomDomain(v CustomDomain) { - o.CustomDomain = v -} - -func (o PutCustomDomainResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PutCustomDomainResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Certificate) { - toSerialize["certificate"] = o.Certificate - } - toSerialize["customDomain"] = o.CustomDomain - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PutCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "customDomain", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPutCustomDomainResponse := _PutCustomDomainResponse{} - - err = json.Unmarshal(data, &varPutCustomDomainResponse) - - if err != nil { - return err - } - - *o = PutCustomDomainResponse(varPutCustomDomainResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "certificate") - delete(additionalProperties, "customDomain") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePutCustomDomainResponse struct { - value *PutCustomDomainResponse - isSet bool -} - -func (v NullablePutCustomDomainResponse) Get() *PutCustomDomainResponse { - return v.value -} - -func (v *NullablePutCustomDomainResponse) Set(val *PutCustomDomainResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainResponse(val *PutCustomDomainResponse) *NullablePutCustomDomainResponse { - return &NullablePutCustomDomainResponse{value: val, isSet: true} -} - -func (v NullablePutCustomDomainResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_response_certificate.go b/services/cdn/v1beta2api/model_put_custom_domain_response_certificate.go deleted file mode 100644 index c111689ca..000000000 --- a/services/cdn/v1beta2api/model_put_custom_domain_response_certificate.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// PutCustomDomainResponseCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted -type PutCustomDomainResponseCertificate struct { - GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate - GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate -} - -// GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in PutCustomDomainResponseCertificate -func GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) PutCustomDomainResponseCertificate { - return PutCustomDomainResponseCertificate{ - GetCustomDomainCustomCertificate: v, - } -} - -// GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in PutCustomDomainResponseCertificate -func GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) PutCustomDomainResponseCertificate { - return PutCustomDomainResponseCertificate{ - GetCustomDomainManagedCertificate: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *PutCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'custom' - if jsonDict["type"] == "custom" { - // try to unmarshal JSON data into GetCustomDomainCustomCertificate - err = json.Unmarshal(data, &dst.GetCustomDomainCustomCertificate) - if err == nil { - return nil // data stored in dst.GetCustomDomainCustomCertificate, return on the first match - } else { - dst.GetCustomDomainCustomCertificate = nil - return fmt.Errorf("failed to unmarshal PutCustomDomainResponseCertificate as GetCustomDomainCustomCertificate: %s", err.Error()) - } - } - - // check if the discriminator value is 'managed' - if jsonDict["type"] == "managed" { - // try to unmarshal JSON data into GetCustomDomainManagedCertificate - err = json.Unmarshal(data, &dst.GetCustomDomainManagedCertificate) - if err == nil { - return nil // data stored in dst.GetCustomDomainManagedCertificate, return on the first match - } else { - dst.GetCustomDomainManagedCertificate = nil - return fmt.Errorf("failed to unmarshal PutCustomDomainResponseCertificate as GetCustomDomainManagedCertificate: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src PutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { - if src.GetCustomDomainCustomCertificate != nil { - return json.Marshal(&src.GetCustomDomainCustomCertificate) - } - - if src.GetCustomDomainManagedCertificate != nil { - return json.Marshal(&src.GetCustomDomainManagedCertificate) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *PutCustomDomainResponseCertificate) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.GetCustomDomainCustomCertificate != nil { - return obj.GetCustomDomainCustomCertificate - } - - if obj.GetCustomDomainManagedCertificate != nil { - return obj.GetCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj PutCustomDomainResponseCertificate) GetActualInstanceValue() interface{} { - if obj.GetCustomDomainCustomCertificate != nil { - return *obj.GetCustomDomainCustomCertificate - } - - if obj.GetCustomDomainManagedCertificate != nil { - return *obj.GetCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -type NullablePutCustomDomainResponseCertificate struct { - value *PutCustomDomainResponseCertificate - isSet bool -} - -func (v NullablePutCustomDomainResponseCertificate) Get() *PutCustomDomainResponseCertificate { - return v.value -} - -func (v *NullablePutCustomDomainResponseCertificate) Set(val *PutCustomDomainResponseCertificate) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainResponseCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainResponseCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainResponseCertificate(val *PutCustomDomainResponseCertificate) *NullablePutCustomDomainResponseCertificate { - return &NullablePutCustomDomainResponseCertificate{value: val, isSet: true} -} - -func (v NullablePutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_region.go b/services/cdn/v1beta2api/model_region.go deleted file mode 100644 index 619b1f481..000000000 --- a/services/cdn/v1beta2api/model_region.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// Region The following regions exist: - `EU` - Europe - `US` - United States / North America - `AF` - Africa - `SA` - South America - `ASIA` - Asia and Oceania -type Region string - -// List of Region -const ( - REGION_EU Region = "EU" - REGION_US Region = "US" - REGION_AF Region = "AF" - REGION_SA Region = "SA" - REGION_ASIA Region = "ASIA" - REGION_UNKNOWN_DEFAULT_OPEN_API Region = "unknown_default_open_api" -) - -// All allowed values of Region enum -var AllowedRegionEnumValues = []Region{ - "EU", - "US", - "AF", - "SA", - "ASIA", - "unknown_default_open_api", -} - -func (v *Region) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := Region(value) - for _, existing := range AllowedRegionEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = REGION_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewRegionFromValue returns a pointer to a valid Region -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewRegionFromValue(v string) (*Region, error) { - ev := Region(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for Region: valid values are %v", v, AllowedRegionEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v Region) IsValid() bool { - for _, existing := range AllowedRegionEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to Region value -func (v Region) Ptr() *Region { - return &v -} - -type NullableRegion struct { - value *Region - isSet bool -} - -func (v NullableRegion) Get() *Region { - return v.value -} - -func (v *NullableRegion) Set(val *Region) { - v.value = val - v.isSet = true -} - -func (v NullableRegion) IsSet() bool { - return v.isSet -} - -func (v *NullableRegion) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRegion(val *Region) *NullableRegion { - return &NullableRegion{value: val, isSet: true} -} - -func (v NullableRegion) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRegion) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_status_error.go b/services/cdn/v1beta2api/model_status_error.go deleted file mode 100644 index 65a7c64f5..000000000 --- a/services/cdn/v1beta2api/model_status_error.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the StatusError type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &StatusError{} - -// StatusError struct for StatusError -type StatusError struct { - // A german translation string corresponding to the error key. Note that we do not guarantee german translations are present. - De *string `json:"de,omitempty"` - // An english translation string corresponding to the error key. An english translation key is always present. - En string `json:"en"` - Key StatusErrorKey `json:"key"` - AdditionalProperties map[string]interface{} -} - -type _StatusError StatusError - -// NewStatusError instantiates a new StatusError 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 NewStatusError(en string, key StatusErrorKey) *StatusError { - this := StatusError{} - this.En = en - this.Key = key - return &this -} - -// NewStatusErrorWithDefaults instantiates a new StatusError 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 NewStatusErrorWithDefaults() *StatusError { - this := StatusError{} - return &this -} - -// GetDe returns the De field value if set, zero value otherwise. -func (o *StatusError) GetDe() string { - if o == nil || IsNil(o.De) { - var ret string - return ret - } - return *o.De -} - -// GetDeOk returns a tuple with the De field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StatusError) GetDeOk() (*string, bool) { - if o == nil || IsNil(o.De) { - return nil, false - } - return o.De, true -} - -// HasDe returns a boolean if a field has been set. -func (o *StatusError) HasDe() bool { - if o != nil && !IsNil(o.De) { - return true - } - - return false -} - -// SetDe gets a reference to the given string and assigns it to the De field. -func (o *StatusError) SetDe(v string) { - o.De = &v -} - -// GetEn returns the En field value -func (o *StatusError) GetEn() string { - if o == nil { - var ret string - return ret - } - - return o.En -} - -// GetEnOk returns a tuple with the En field value -// and a boolean to check if the value has been set. -func (o *StatusError) GetEnOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.En, true -} - -// SetEn sets field value -func (o *StatusError) SetEn(v string) { - o.En = v -} - -// GetKey returns the Key field value -func (o *StatusError) GetKey() StatusErrorKey { - if o == nil { - var ret StatusErrorKey - return ret - } - - return o.Key -} - -// GetKeyOk returns a tuple with the Key field value -// and a boolean to check if the value has been set. -func (o *StatusError) GetKeyOk() (*StatusErrorKey, bool) { - if o == nil { - return nil, false - } - return &o.Key, true -} - -// SetKey sets field value -func (o *StatusError) SetKey(v StatusErrorKey) { - o.Key = v -} - -func (o StatusError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o StatusError) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.De) { - toSerialize["de"] = o.De - } - toSerialize["en"] = o.En - toSerialize["key"] = o.Key - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *StatusError) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "en", - "key", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varStatusError := _StatusError{} - - err = json.Unmarshal(data, &varStatusError) - - if err != nil { - return err - } - - *o = StatusError(varStatusError) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "de") - delete(additionalProperties, "en") - delete(additionalProperties, "key") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableStatusError struct { - value *StatusError - isSet bool -} - -func (v NullableStatusError) Get() *StatusError { - return v.value -} - -func (v *NullableStatusError) Set(val *StatusError) { - v.value = val - v.isSet = true -} - -func (v NullableStatusError) IsSet() bool { - return v.isSet -} - -func (v *NullableStatusError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableStatusError(val *StatusError) *NullableStatusError { - return &NullableStatusError{value: val, isSet: true} -} - -func (v NullableStatusError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableStatusError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_status_error_key.go b/services/cdn/v1beta2api/model_status_error_key.go deleted file mode 100644 index 5dfaa9791..000000000 --- a/services/cdn/v1beta2api/model_status_error_key.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// StatusErrorKey An enum value that describes a Status Error. -type StatusErrorKey string - -// List of StatusError_key -const ( - STATUSERRORKEY_UNKNOWN StatusErrorKey = "UNKNOWN" - STATUSERRORKEY_CUSTOM_DOMAIN_CNAME_MISSING StatusErrorKey = "CUSTOM_DOMAIN_CNAME_MISSING" - STATUSERRORKEY_CUSTOM_DOMAIN_ALREADY_IN_USE StatusErrorKey = "CUSTOM_DOMAIN_ALREADY_IN_USE" - STATUSERRORKEY_PUBLIC_BETA_QUOTA_REACHED StatusErrorKey = "PUBLIC_BETA_QUOTA_REACHED" - STATUSERRORKEY_LOG_SINK_INSTANCE_UNAVAILABLE StatusErrorKey = "LOG_SINK_INSTANCE_UNAVAILABLE" - STATUSERRORKEY_EXTERNAL_QUOTA_REACHED StatusErrorKey = "EXTERNAL_QUOTA_REACHED" - STATUSERRORKEY_UNKNOWN_DEFAULT_OPEN_API StatusErrorKey = "unknown_default_open_api" -) - -// All allowed values of StatusErrorKey enum -var AllowedStatusErrorKeyEnumValues = []StatusErrorKey{ - "UNKNOWN", - "CUSTOM_DOMAIN_CNAME_MISSING", - "CUSTOM_DOMAIN_ALREADY_IN_USE", - "PUBLIC_BETA_QUOTA_REACHED", - "LOG_SINK_INSTANCE_UNAVAILABLE", - "EXTERNAL_QUOTA_REACHED", - "unknown_default_open_api", -} - -func (v *StatusErrorKey) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := StatusErrorKey(value) - for _, existing := range AllowedStatusErrorKeyEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = STATUSERRORKEY_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewStatusErrorKeyFromValue returns a pointer to a valid StatusErrorKey -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewStatusErrorKeyFromValue(v string) (*StatusErrorKey, error) { - ev := StatusErrorKey(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for StatusErrorKey: valid values are %v", v, AllowedStatusErrorKeyEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v StatusErrorKey) IsValid() bool { - for _, existing := range AllowedStatusErrorKeyEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to StatusError_key value -func (v StatusErrorKey) Ptr() *StatusErrorKey { - return &v -} - -type NullableStatusErrorKey struct { - value *StatusErrorKey - isSet bool -} - -func (v NullableStatusErrorKey) Get() *StatusErrorKey { - return v.value -} - -func (v *NullableStatusErrorKey) Set(val *StatusErrorKey) { - v.value = val - v.isSet = true -} - -func (v NullableStatusErrorKey) IsSet() bool { - return v.isSet -} - -func (v *NullableStatusErrorKey) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableStatusErrorKey(val *StatusErrorKey) *NullableStatusErrorKey { - return &NullableStatusErrorKey{value: val, isSet: true} -} - -func (v NullableStatusErrorKey) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableStatusErrorKey) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_config.go b/services/cdn/v1beta2api/model_waf_config.go deleted file mode 100644 index db2d5fa9b..000000000 --- a/services/cdn/v1beta2api/model_waf_config.go +++ /dev/null @@ -1,679 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafConfig type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafConfig{} - -// WafConfig Configuration of the WAF of a distribution A WAF Config always contains a WAF Mode and Type. If a WAF was never enabled, most of the properties are not present. To **enable** the WAF for your Distribution, you must set the `mode` to `ENABLED` or `LOG_ONLY`. This causes the other properties to be populated. ## Rules There are 9 properties used to control which Rules are enabled, disabled or set to Log-Only. These properties can be grouped in 3 groups of 3. Each of these groups varies in specificity: Rules are more specific than Rule Groups, which in turn are more specific than Collections. More specific definitions override more generic definitions. ### Collections - `enabledRuleCollectionIds` - `disabledRuleCollectionIds` - `logOnlyRuleCollectionIds` These are the least specific selectors. As of 2025, only two collections exist: - `@builtin/crs/response`, containing all Rules regarding Responses - `@builtin/crs/request`, containing all Rules regarding Requests More collections may be added in the future ### Rule Groups - `enabledRuleGroupIds` - `disabledRuleGroupIds` - `logOnlyRuleGroupIds` These are more specific than Collections and will override their selector. You can find all available Rule Groups by calling the `ListWafCollections` Operation. ### Rules - `enabledRuleIds` - `disabledRuleIds` - `logOnlyRuleGds` Being the most specific selectors, these will override both Collection and Rule Group selectors. You can find all available Rule Groups by calling the `ListWafCollections` Operation. ### TIP: Review resolved config If you call `GetDistribution` with `?withWafStatus=true`, you get back a resolved WAF Rules Config which contains a `waf` property which you can inspect to see why a Rule is either enabled, disabled or logOnly. -type WafConfig struct { - // This whitelist restricts which HTTP methods the distribution accepts. Requests using non-whitelisted methods are blocked by the WAF before reaching the origin. Common methods: `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS`, `CONNECT`, `TRACE` Validation ensures: 1. At least one method is allowed 2. No duplicate methods (e.g., `GET` appearing twice) 3. Each method is valid per HTTP standards - AllowedHttpMethods []string `json:"allowedHttpMethods,omitempty"` - AllowedHttpVersions []string `json:"allowedHttpVersions,omitempty"` - // This allow list restricts which Content-Type headers are accepted in request bodies. Format: Must be `type/subtype` with no spaces. Common content types: - `application/json` - `application/x-www-form-urlencoded` - `multipart/form-data` - `text/html` - `text/plain` - `application/xml` - AllowedRequestContentTypes []string `json:"allowedRequestContentTypes,omitempty"` - // Ids of WAF Collections to mark as disabled - DisabledRuleCollectionIds []string `json:"disabledRuleCollectionIds,omitempty"` - // Ids of WAF Rule Groups to mark as disabled - DisabledRuleGroupIds []string `json:"disabledRuleGroupIds,omitempty"` - // Ids of WAF Rules that are **explicitly** disabled for this distribution. - DisabledRuleIds []string `json:"disabledRuleIds,omitempty"` - // Ids of WAF Collections to mark as enabled - EnabledRuleCollectionIds []string `json:"enabledRuleCollectionIds,omitempty"` - // Ids of WAF Rule Groups to mark as enabled - EnabledRuleGroupIds []string `json:"enabledRuleGroupIds,omitempty"` - // Ids of the WAF rules that are **explicitly** enabled for this distribution. If this rule is in a disabled / log Only RuleGroup or Collection, it will be enabled regardless as `enabledRuleIds` overrides those in specificity. Do note that rules can also be enabled because a Rulegroup or Collection is enabled. **DO NOT** use this property to find all active rules. Instead, pass `?withWafStatus=true` as a query parameter to `GetDistribution` or `ListDistributions`. This will expose the `waf` Property on distribution Level. From there you can `$.waf.enabledRules.map(e => e.id)` to get a list of all enabled rules. - EnabledRuleIds []string `json:"enabledRuleIds"` - // Ids of WAF Collections to mark as log Only. - LogOnlyRuleCollectionIds []string `json:"logOnlyRuleCollectionIds,omitempty"` - // Ids of WAF Rule Groups to mark as log Only. - LogOnlyRuleGroupIds []string `json:"logOnlyRuleGroupIds,omitempty"` - // Ids of WAF Rules that are **explicitly** marked as Log Only for this distribution. - LogOnlyRuleIds []string `json:"logOnlyRuleIds,omitempty"` - Mode WafMode `json:"mode"` - ParanoiaLevel *WafParanoiaLevel `json:"paranoiaLevel,omitempty"` - Type WafType `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _WafConfig WafConfig - -// NewWafConfig instantiates a new WafConfig 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 NewWafConfig(enabledRuleIds []string, mode WafMode, types WafType) *WafConfig { - this := WafConfig{} - this.EnabledRuleIds = enabledRuleIds - this.Mode = mode - this.Type = types - return &this -} - -// NewWafConfigWithDefaults instantiates a new WafConfig 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 NewWafConfigWithDefaults() *WafConfig { - this := WafConfig{} - return &this -} - -// GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. -func (o *WafConfig) GetAllowedHttpMethods() []string { - if o == nil || IsNil(o.AllowedHttpMethods) { - var ret []string - return ret - } - return o.AllowedHttpMethods -} - -// GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetAllowedHttpMethodsOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedHttpMethods) { - return nil, false - } - return o.AllowedHttpMethods, true -} - -// HasAllowedHttpMethods returns a boolean if a field has been set. -func (o *WafConfig) HasAllowedHttpMethods() bool { - if o != nil && !IsNil(o.AllowedHttpMethods) { - return true - } - - return false -} - -// SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. -func (o *WafConfig) SetAllowedHttpMethods(v []string) { - o.AllowedHttpMethods = v -} - -// GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. -func (o *WafConfig) GetAllowedHttpVersions() []string { - if o == nil || IsNil(o.AllowedHttpVersions) { - var ret []string - return ret - } - return o.AllowedHttpVersions -} - -// GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetAllowedHttpVersionsOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedHttpVersions) { - return nil, false - } - return o.AllowedHttpVersions, true -} - -// HasAllowedHttpVersions returns a boolean if a field has been set. -func (o *WafConfig) HasAllowedHttpVersions() bool { - if o != nil && !IsNil(o.AllowedHttpVersions) { - return true - } - - return false -} - -// SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. -func (o *WafConfig) SetAllowedHttpVersions(v []string) { - o.AllowedHttpVersions = v -} - -// GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. -func (o *WafConfig) GetAllowedRequestContentTypes() []string { - if o == nil || IsNil(o.AllowedRequestContentTypes) { - var ret []string - return ret - } - return o.AllowedRequestContentTypes -} - -// GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetAllowedRequestContentTypesOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedRequestContentTypes) { - return nil, false - } - return o.AllowedRequestContentTypes, true -} - -// HasAllowedRequestContentTypes returns a boolean if a field has been set. -func (o *WafConfig) HasAllowedRequestContentTypes() bool { - if o != nil && !IsNil(o.AllowedRequestContentTypes) { - return true - } - - return false -} - -// SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. -func (o *WafConfig) SetAllowedRequestContentTypes(v []string) { - o.AllowedRequestContentTypes = v -} - -// GetDisabledRuleCollectionIds returns the DisabledRuleCollectionIds field value if set, zero value otherwise. -func (o *WafConfig) GetDisabledRuleCollectionIds() []string { - if o == nil || IsNil(o.DisabledRuleCollectionIds) { - var ret []string - return ret - } - return o.DisabledRuleCollectionIds -} - -// GetDisabledRuleCollectionIdsOk returns a tuple with the DisabledRuleCollectionIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetDisabledRuleCollectionIdsOk() ([]string, bool) { - if o == nil || IsNil(o.DisabledRuleCollectionIds) { - return nil, false - } - return o.DisabledRuleCollectionIds, true -} - -// HasDisabledRuleCollectionIds returns a boolean if a field has been set. -func (o *WafConfig) HasDisabledRuleCollectionIds() bool { - if o != nil && !IsNil(o.DisabledRuleCollectionIds) { - return true - } - - return false -} - -// SetDisabledRuleCollectionIds gets a reference to the given []string and assigns it to the DisabledRuleCollectionIds field. -func (o *WafConfig) SetDisabledRuleCollectionIds(v []string) { - o.DisabledRuleCollectionIds = v -} - -// GetDisabledRuleGroupIds returns the DisabledRuleGroupIds field value if set, zero value otherwise. -func (o *WafConfig) GetDisabledRuleGroupIds() []string { - if o == nil || IsNil(o.DisabledRuleGroupIds) { - var ret []string - return ret - } - return o.DisabledRuleGroupIds -} - -// GetDisabledRuleGroupIdsOk returns a tuple with the DisabledRuleGroupIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetDisabledRuleGroupIdsOk() ([]string, bool) { - if o == nil || IsNil(o.DisabledRuleGroupIds) { - return nil, false - } - return o.DisabledRuleGroupIds, true -} - -// HasDisabledRuleGroupIds returns a boolean if a field has been set. -func (o *WafConfig) HasDisabledRuleGroupIds() bool { - if o != nil && !IsNil(o.DisabledRuleGroupIds) { - return true - } - - return false -} - -// SetDisabledRuleGroupIds gets a reference to the given []string and assigns it to the DisabledRuleGroupIds field. -func (o *WafConfig) SetDisabledRuleGroupIds(v []string) { - o.DisabledRuleGroupIds = v -} - -// GetDisabledRuleIds returns the DisabledRuleIds field value if set, zero value otherwise. -func (o *WafConfig) GetDisabledRuleIds() []string { - if o == nil || IsNil(o.DisabledRuleIds) { - var ret []string - return ret - } - return o.DisabledRuleIds -} - -// GetDisabledRuleIdsOk returns a tuple with the DisabledRuleIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetDisabledRuleIdsOk() ([]string, bool) { - if o == nil || IsNil(o.DisabledRuleIds) { - return nil, false - } - return o.DisabledRuleIds, true -} - -// HasDisabledRuleIds returns a boolean if a field has been set. -func (o *WafConfig) HasDisabledRuleIds() bool { - if o != nil && !IsNil(o.DisabledRuleIds) { - return true - } - - return false -} - -// SetDisabledRuleIds gets a reference to the given []string and assigns it to the DisabledRuleIds field. -func (o *WafConfig) SetDisabledRuleIds(v []string) { - o.DisabledRuleIds = v -} - -// GetEnabledRuleCollectionIds returns the EnabledRuleCollectionIds field value if set, zero value otherwise. -func (o *WafConfig) GetEnabledRuleCollectionIds() []string { - if o == nil || IsNil(o.EnabledRuleCollectionIds) { - var ret []string - return ret - } - return o.EnabledRuleCollectionIds -} - -// GetEnabledRuleCollectionIdsOk returns a tuple with the EnabledRuleCollectionIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetEnabledRuleCollectionIdsOk() ([]string, bool) { - if o == nil || IsNil(o.EnabledRuleCollectionIds) { - return nil, false - } - return o.EnabledRuleCollectionIds, true -} - -// HasEnabledRuleCollectionIds returns a boolean if a field has been set. -func (o *WafConfig) HasEnabledRuleCollectionIds() bool { - if o != nil && !IsNil(o.EnabledRuleCollectionIds) { - return true - } - - return false -} - -// SetEnabledRuleCollectionIds gets a reference to the given []string and assigns it to the EnabledRuleCollectionIds field. -func (o *WafConfig) SetEnabledRuleCollectionIds(v []string) { - o.EnabledRuleCollectionIds = v -} - -// GetEnabledRuleGroupIds returns the EnabledRuleGroupIds field value if set, zero value otherwise. -func (o *WafConfig) GetEnabledRuleGroupIds() []string { - if o == nil || IsNil(o.EnabledRuleGroupIds) { - var ret []string - return ret - } - return o.EnabledRuleGroupIds -} - -// GetEnabledRuleGroupIdsOk returns a tuple with the EnabledRuleGroupIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetEnabledRuleGroupIdsOk() ([]string, bool) { - if o == nil || IsNil(o.EnabledRuleGroupIds) { - return nil, false - } - return o.EnabledRuleGroupIds, true -} - -// HasEnabledRuleGroupIds returns a boolean if a field has been set. -func (o *WafConfig) HasEnabledRuleGroupIds() bool { - if o != nil && !IsNil(o.EnabledRuleGroupIds) { - return true - } - - return false -} - -// SetEnabledRuleGroupIds gets a reference to the given []string and assigns it to the EnabledRuleGroupIds field. -func (o *WafConfig) SetEnabledRuleGroupIds(v []string) { - o.EnabledRuleGroupIds = v -} - -// GetEnabledRuleIds returns the EnabledRuleIds field value -func (o *WafConfig) GetEnabledRuleIds() []string { - if o == nil { - var ret []string - return ret - } - - return o.EnabledRuleIds -} - -// GetEnabledRuleIdsOk returns a tuple with the EnabledRuleIds field value -// and a boolean to check if the value has been set. -func (o *WafConfig) GetEnabledRuleIdsOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.EnabledRuleIds, true -} - -// SetEnabledRuleIds sets field value -func (o *WafConfig) SetEnabledRuleIds(v []string) { - o.EnabledRuleIds = v -} - -// GetLogOnlyRuleCollectionIds returns the LogOnlyRuleCollectionIds field value if set, zero value otherwise. -func (o *WafConfig) GetLogOnlyRuleCollectionIds() []string { - if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { - var ret []string - return ret - } - return o.LogOnlyRuleCollectionIds -} - -// GetLogOnlyRuleCollectionIdsOk returns a tuple with the LogOnlyRuleCollectionIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetLogOnlyRuleCollectionIdsOk() ([]string, bool) { - if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { - return nil, false - } - return o.LogOnlyRuleCollectionIds, true -} - -// HasLogOnlyRuleCollectionIds returns a boolean if a field has been set. -func (o *WafConfig) HasLogOnlyRuleCollectionIds() bool { - if o != nil && !IsNil(o.LogOnlyRuleCollectionIds) { - return true - } - - return false -} - -// SetLogOnlyRuleCollectionIds gets a reference to the given []string and assigns it to the LogOnlyRuleCollectionIds field. -func (o *WafConfig) SetLogOnlyRuleCollectionIds(v []string) { - o.LogOnlyRuleCollectionIds = v -} - -// GetLogOnlyRuleGroupIds returns the LogOnlyRuleGroupIds field value if set, zero value otherwise. -func (o *WafConfig) GetLogOnlyRuleGroupIds() []string { - if o == nil || IsNil(o.LogOnlyRuleGroupIds) { - var ret []string - return ret - } - return o.LogOnlyRuleGroupIds -} - -// GetLogOnlyRuleGroupIdsOk returns a tuple with the LogOnlyRuleGroupIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetLogOnlyRuleGroupIdsOk() ([]string, bool) { - if o == nil || IsNil(o.LogOnlyRuleGroupIds) { - return nil, false - } - return o.LogOnlyRuleGroupIds, true -} - -// HasLogOnlyRuleGroupIds returns a boolean if a field has been set. -func (o *WafConfig) HasLogOnlyRuleGroupIds() bool { - if o != nil && !IsNil(o.LogOnlyRuleGroupIds) { - return true - } - - return false -} - -// SetLogOnlyRuleGroupIds gets a reference to the given []string and assigns it to the LogOnlyRuleGroupIds field. -func (o *WafConfig) SetLogOnlyRuleGroupIds(v []string) { - o.LogOnlyRuleGroupIds = v -} - -// GetLogOnlyRuleIds returns the LogOnlyRuleIds field value if set, zero value otherwise. -func (o *WafConfig) GetLogOnlyRuleIds() []string { - if o == nil || IsNil(o.LogOnlyRuleIds) { - var ret []string - return ret - } - return o.LogOnlyRuleIds -} - -// GetLogOnlyRuleIdsOk returns a tuple with the LogOnlyRuleIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetLogOnlyRuleIdsOk() ([]string, bool) { - if o == nil || IsNil(o.LogOnlyRuleIds) { - return nil, false - } - return o.LogOnlyRuleIds, true -} - -// HasLogOnlyRuleIds returns a boolean if a field has been set. -func (o *WafConfig) HasLogOnlyRuleIds() bool { - if o != nil && !IsNil(o.LogOnlyRuleIds) { - return true - } - - return false -} - -// SetLogOnlyRuleIds gets a reference to the given []string and assigns it to the LogOnlyRuleIds field. -func (o *WafConfig) SetLogOnlyRuleIds(v []string) { - o.LogOnlyRuleIds = v -} - -// GetMode returns the Mode field value -func (o *WafConfig) GetMode() WafMode { - if o == nil { - var ret WafMode - return ret - } - - return o.Mode -} - -// GetModeOk returns a tuple with the Mode field value -// and a boolean to check if the value has been set. -func (o *WafConfig) GetModeOk() (*WafMode, bool) { - if o == nil { - return nil, false - } - return &o.Mode, true -} - -// SetMode sets field value -func (o *WafConfig) SetMode(v WafMode) { - o.Mode = v -} - -// GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. -func (o *WafConfig) GetParanoiaLevel() WafParanoiaLevel { - if o == nil || IsNil(o.ParanoiaLevel) { - var ret WafParanoiaLevel - return ret - } - return *o.ParanoiaLevel -} - -// GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetParanoiaLevelOk() (*WafParanoiaLevel, bool) { - if o == nil || IsNil(o.ParanoiaLevel) { - return nil, false - } - return o.ParanoiaLevel, true -} - -// HasParanoiaLevel returns a boolean if a field has been set. -func (o *WafConfig) HasParanoiaLevel() bool { - if o != nil && !IsNil(o.ParanoiaLevel) { - return true - } - - return false -} - -// SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. -func (o *WafConfig) SetParanoiaLevel(v WafParanoiaLevel) { - o.ParanoiaLevel = &v -} - -// GetType returns the Type field value -func (o *WafConfig) GetType() WafType { - if o == nil { - var ret WafType - 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 *WafConfig) GetTypeOk() (*WafType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *WafConfig) SetType(v WafType) { - o.Type = v -} - -func (o WafConfig) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafConfig) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.AllowedHttpMethods) { - toSerialize["allowedHttpMethods"] = o.AllowedHttpMethods - } - if !IsNil(o.AllowedHttpVersions) { - toSerialize["allowedHttpVersions"] = o.AllowedHttpVersions - } - if !IsNil(o.AllowedRequestContentTypes) { - toSerialize["allowedRequestContentTypes"] = o.AllowedRequestContentTypes - } - if !IsNil(o.DisabledRuleCollectionIds) { - toSerialize["disabledRuleCollectionIds"] = o.DisabledRuleCollectionIds - } - if !IsNil(o.DisabledRuleGroupIds) { - toSerialize["disabledRuleGroupIds"] = o.DisabledRuleGroupIds - } - if !IsNil(o.DisabledRuleIds) { - toSerialize["disabledRuleIds"] = o.DisabledRuleIds - } - if !IsNil(o.EnabledRuleCollectionIds) { - toSerialize["enabledRuleCollectionIds"] = o.EnabledRuleCollectionIds - } - if !IsNil(o.EnabledRuleGroupIds) { - toSerialize["enabledRuleGroupIds"] = o.EnabledRuleGroupIds - } - toSerialize["enabledRuleIds"] = o.EnabledRuleIds - if !IsNil(o.LogOnlyRuleCollectionIds) { - toSerialize["logOnlyRuleCollectionIds"] = o.LogOnlyRuleCollectionIds - } - if !IsNil(o.LogOnlyRuleGroupIds) { - toSerialize["logOnlyRuleGroupIds"] = o.LogOnlyRuleGroupIds - } - if !IsNil(o.LogOnlyRuleIds) { - toSerialize["logOnlyRuleIds"] = o.LogOnlyRuleIds - } - toSerialize["mode"] = o.Mode - if !IsNil(o.ParanoiaLevel) { - toSerialize["paranoiaLevel"] = o.ParanoiaLevel - } - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafConfig) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "enabledRuleIds", - "mode", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafConfig := _WafConfig{} - - err = json.Unmarshal(data, &varWafConfig) - - if err != nil { - return err - } - - *o = WafConfig(varWafConfig) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "allowedHttpMethods") - delete(additionalProperties, "allowedHttpVersions") - delete(additionalProperties, "allowedRequestContentTypes") - delete(additionalProperties, "disabledRuleCollectionIds") - delete(additionalProperties, "disabledRuleGroupIds") - delete(additionalProperties, "disabledRuleIds") - delete(additionalProperties, "enabledRuleCollectionIds") - delete(additionalProperties, "enabledRuleGroupIds") - delete(additionalProperties, "enabledRuleIds") - delete(additionalProperties, "logOnlyRuleCollectionIds") - delete(additionalProperties, "logOnlyRuleGroupIds") - delete(additionalProperties, "logOnlyRuleIds") - delete(additionalProperties, "mode") - delete(additionalProperties, "paranoiaLevel") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafConfig struct { - value *WafConfig - isSet bool -} - -func (v NullableWafConfig) Get() *WafConfig { - return v.value -} - -func (v *NullableWafConfig) Set(val *WafConfig) { - v.value = val - v.isSet = true -} - -func (v NullableWafConfig) IsSet() bool { - return v.isSet -} - -func (v *NullableWafConfig) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafConfig(val *WafConfig) *NullableWafConfig { - return &NullableWafConfig{value: val, isSet: true} -} - -func (v NullableWafConfig) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafConfig) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_config_patch.go b/services/cdn/v1beta2api/model_waf_config_patch.go deleted file mode 100644 index c3ff89e15..000000000 --- a/services/cdn/v1beta2api/model_waf_config_patch.go +++ /dev/null @@ -1,680 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" -) - -// checks if the WafConfigPatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafConfigPatch{} - -// WafConfigPatch Modify the WAF Configuration ## WAF Rules You can modify the set of enabled, disabled and log-only Rules by modifying these 9 properties: - enabledRuleIds - disabledRuleIds - logOnlyRuleIds - enabledRuleGroupIds - disabledRuleGroupIds - logOnlyRuleGroupIds - enabledRuleCollectionIds - disabledRuleCollectionIds - logOnlyRuleCollectionIds Please inquire the `WafConfig` Description on how the effective configuration is determined. For patching, if an ID is already used in one of the properties, it will be removed (and effectively moved) to the new property. If patching multiple properties with the same ID (e.g. writing `@builtin/crs/response` to `logOnlyRuleCollectionIds` and `enabledRuleCollectionIds`), the request will be rejected with a 400. -type WafConfigPatch struct { - AllowedHttpMethods []string `json:"allowedHttpMethods,omitempty"` - AllowedHttpVersions []string `json:"allowedHttpVersions,omitempty"` - AllowedRequestContentTypes []string `json:"allowedRequestContentTypes,omitempty"` - // Ids of WAF Collections to mark as disabled - DisabledRuleCollectionIds []string `json:"disabledRuleCollectionIds,omitempty"` - // Ids of WAF Rule Groups to mark as disabled - DisabledRuleGroupIds []string `json:"disabledRuleGroupIds,omitempty"` - // Ids of WAF Rules that are **explicitly** disabled for this distribution. - DisabledRuleIds []string `json:"disabledRuleIds,omitempty"` - // Ids of WAF Collections to mark as enabled - EnabledRuleCollectionIds []string `json:"enabledRuleCollectionIds,omitempty"` - // Ids of WAF Rule Groups to mark as enabled - EnabledRuleGroupIds []string `json:"enabledRuleGroupIds,omitempty"` - // Ids of WAF Rules that are **explicitly** enabled for this distribution. - EnabledRuleIds []string `json:"enabledRuleIds,omitempty"` - // Ids of WAF Collections to mark as log Only. - LogOnlyRuleCollectionIds []string `json:"logOnlyRuleCollectionIds,omitempty"` - // Ids of WAF Rule Groups to mark as log Only. - LogOnlyRuleGroupIds []string `json:"logOnlyRuleGroupIds,omitempty"` - // Ids of WAF Rules that are **explicitly** marked as Log Only for this distribution. - LogOnlyRuleIds []string `json:"logOnlyRuleIds,omitempty"` - Mode *WafMode `json:"mode,omitempty"` - ParanoiaLevel *WafParanoiaLevel `json:"paranoiaLevel,omitempty"` - Type *WafType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _WafConfigPatch WafConfigPatch - -// NewWafConfigPatch instantiates a new WafConfigPatch 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 NewWafConfigPatch() *WafConfigPatch { - this := WafConfigPatch{} - return &this -} - -// NewWafConfigPatchWithDefaults instantiates a new WafConfigPatch 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 NewWafConfigPatchWithDefaults() *WafConfigPatch { - this := WafConfigPatch{} - return &this -} - -// GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. -func (o *WafConfigPatch) GetAllowedHttpMethods() []string { - if o == nil || IsNil(o.AllowedHttpMethods) { - var ret []string - return ret - } - return o.AllowedHttpMethods -} - -// GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetAllowedHttpMethodsOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedHttpMethods) { - return nil, false - } - return o.AllowedHttpMethods, true -} - -// HasAllowedHttpMethods returns a boolean if a field has been set. -func (o *WafConfigPatch) HasAllowedHttpMethods() bool { - if o != nil && !IsNil(o.AllowedHttpMethods) { - return true - } - - return false -} - -// SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. -func (o *WafConfigPatch) SetAllowedHttpMethods(v []string) { - o.AllowedHttpMethods = v -} - -// GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. -func (o *WafConfigPatch) GetAllowedHttpVersions() []string { - if o == nil || IsNil(o.AllowedHttpVersions) { - var ret []string - return ret - } - return o.AllowedHttpVersions -} - -// GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetAllowedHttpVersionsOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedHttpVersions) { - return nil, false - } - return o.AllowedHttpVersions, true -} - -// HasAllowedHttpVersions returns a boolean if a field has been set. -func (o *WafConfigPatch) HasAllowedHttpVersions() bool { - if o != nil && !IsNil(o.AllowedHttpVersions) { - return true - } - - return false -} - -// SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. -func (o *WafConfigPatch) SetAllowedHttpVersions(v []string) { - o.AllowedHttpVersions = v -} - -// GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. -func (o *WafConfigPatch) GetAllowedRequestContentTypes() []string { - if o == nil || IsNil(o.AllowedRequestContentTypes) { - var ret []string - return ret - } - return o.AllowedRequestContentTypes -} - -// GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetAllowedRequestContentTypesOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedRequestContentTypes) { - return nil, false - } - return o.AllowedRequestContentTypes, true -} - -// HasAllowedRequestContentTypes returns a boolean if a field has been set. -func (o *WafConfigPatch) HasAllowedRequestContentTypes() bool { - if o != nil && !IsNil(o.AllowedRequestContentTypes) { - return true - } - - return false -} - -// SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. -func (o *WafConfigPatch) SetAllowedRequestContentTypes(v []string) { - o.AllowedRequestContentTypes = v -} - -// GetDisabledRuleCollectionIds returns the DisabledRuleCollectionIds field value if set, zero value otherwise. -func (o *WafConfigPatch) GetDisabledRuleCollectionIds() []string { - if o == nil || IsNil(o.DisabledRuleCollectionIds) { - var ret []string - return ret - } - return o.DisabledRuleCollectionIds -} - -// GetDisabledRuleCollectionIdsOk returns a tuple with the DisabledRuleCollectionIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetDisabledRuleCollectionIdsOk() ([]string, bool) { - if o == nil || IsNil(o.DisabledRuleCollectionIds) { - return nil, false - } - return o.DisabledRuleCollectionIds, true -} - -// HasDisabledRuleCollectionIds returns a boolean if a field has been set. -func (o *WafConfigPatch) HasDisabledRuleCollectionIds() bool { - if o != nil && !IsNil(o.DisabledRuleCollectionIds) { - return true - } - - return false -} - -// SetDisabledRuleCollectionIds gets a reference to the given []string and assigns it to the DisabledRuleCollectionIds field. -func (o *WafConfigPatch) SetDisabledRuleCollectionIds(v []string) { - o.DisabledRuleCollectionIds = v -} - -// GetDisabledRuleGroupIds returns the DisabledRuleGroupIds field value if set, zero value otherwise. -func (o *WafConfigPatch) GetDisabledRuleGroupIds() []string { - if o == nil || IsNil(o.DisabledRuleGroupIds) { - var ret []string - return ret - } - return o.DisabledRuleGroupIds -} - -// GetDisabledRuleGroupIdsOk returns a tuple with the DisabledRuleGroupIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetDisabledRuleGroupIdsOk() ([]string, bool) { - if o == nil || IsNil(o.DisabledRuleGroupIds) { - return nil, false - } - return o.DisabledRuleGroupIds, true -} - -// HasDisabledRuleGroupIds returns a boolean if a field has been set. -func (o *WafConfigPatch) HasDisabledRuleGroupIds() bool { - if o != nil && !IsNil(o.DisabledRuleGroupIds) { - return true - } - - return false -} - -// SetDisabledRuleGroupIds gets a reference to the given []string and assigns it to the DisabledRuleGroupIds field. -func (o *WafConfigPatch) SetDisabledRuleGroupIds(v []string) { - o.DisabledRuleGroupIds = v -} - -// GetDisabledRuleIds returns the DisabledRuleIds field value if set, zero value otherwise. -func (o *WafConfigPatch) GetDisabledRuleIds() []string { - if o == nil || IsNil(o.DisabledRuleIds) { - var ret []string - return ret - } - return o.DisabledRuleIds -} - -// GetDisabledRuleIdsOk returns a tuple with the DisabledRuleIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetDisabledRuleIdsOk() ([]string, bool) { - if o == nil || IsNil(o.DisabledRuleIds) { - return nil, false - } - return o.DisabledRuleIds, true -} - -// HasDisabledRuleIds returns a boolean if a field has been set. -func (o *WafConfigPatch) HasDisabledRuleIds() bool { - if o != nil && !IsNil(o.DisabledRuleIds) { - return true - } - - return false -} - -// SetDisabledRuleIds gets a reference to the given []string and assigns it to the DisabledRuleIds field. -func (o *WafConfigPatch) SetDisabledRuleIds(v []string) { - o.DisabledRuleIds = v -} - -// GetEnabledRuleCollectionIds returns the EnabledRuleCollectionIds field value if set, zero value otherwise. -func (o *WafConfigPatch) GetEnabledRuleCollectionIds() []string { - if o == nil || IsNil(o.EnabledRuleCollectionIds) { - var ret []string - return ret - } - return o.EnabledRuleCollectionIds -} - -// GetEnabledRuleCollectionIdsOk returns a tuple with the EnabledRuleCollectionIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetEnabledRuleCollectionIdsOk() ([]string, bool) { - if o == nil || IsNil(o.EnabledRuleCollectionIds) { - return nil, false - } - return o.EnabledRuleCollectionIds, true -} - -// HasEnabledRuleCollectionIds returns a boolean if a field has been set. -func (o *WafConfigPatch) HasEnabledRuleCollectionIds() bool { - if o != nil && !IsNil(o.EnabledRuleCollectionIds) { - return true - } - - return false -} - -// SetEnabledRuleCollectionIds gets a reference to the given []string and assigns it to the EnabledRuleCollectionIds field. -func (o *WafConfigPatch) SetEnabledRuleCollectionIds(v []string) { - o.EnabledRuleCollectionIds = v -} - -// GetEnabledRuleGroupIds returns the EnabledRuleGroupIds field value if set, zero value otherwise. -func (o *WafConfigPatch) GetEnabledRuleGroupIds() []string { - if o == nil || IsNil(o.EnabledRuleGroupIds) { - var ret []string - return ret - } - return o.EnabledRuleGroupIds -} - -// GetEnabledRuleGroupIdsOk returns a tuple with the EnabledRuleGroupIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetEnabledRuleGroupIdsOk() ([]string, bool) { - if o == nil || IsNil(o.EnabledRuleGroupIds) { - return nil, false - } - return o.EnabledRuleGroupIds, true -} - -// HasEnabledRuleGroupIds returns a boolean if a field has been set. -func (o *WafConfigPatch) HasEnabledRuleGroupIds() bool { - if o != nil && !IsNil(o.EnabledRuleGroupIds) { - return true - } - - return false -} - -// SetEnabledRuleGroupIds gets a reference to the given []string and assigns it to the EnabledRuleGroupIds field. -func (o *WafConfigPatch) SetEnabledRuleGroupIds(v []string) { - o.EnabledRuleGroupIds = v -} - -// GetEnabledRuleIds returns the EnabledRuleIds field value if set, zero value otherwise. -func (o *WafConfigPatch) GetEnabledRuleIds() []string { - if o == nil || IsNil(o.EnabledRuleIds) { - var ret []string - return ret - } - return o.EnabledRuleIds -} - -// GetEnabledRuleIdsOk returns a tuple with the EnabledRuleIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetEnabledRuleIdsOk() ([]string, bool) { - if o == nil || IsNil(o.EnabledRuleIds) { - return nil, false - } - return o.EnabledRuleIds, true -} - -// HasEnabledRuleIds returns a boolean if a field has been set. -func (o *WafConfigPatch) HasEnabledRuleIds() bool { - if o != nil && !IsNil(o.EnabledRuleIds) { - return true - } - - return false -} - -// SetEnabledRuleIds gets a reference to the given []string and assigns it to the EnabledRuleIds field. -func (o *WafConfigPatch) SetEnabledRuleIds(v []string) { - o.EnabledRuleIds = v -} - -// GetLogOnlyRuleCollectionIds returns the LogOnlyRuleCollectionIds field value if set, zero value otherwise. -func (o *WafConfigPatch) GetLogOnlyRuleCollectionIds() []string { - if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { - var ret []string - return ret - } - return o.LogOnlyRuleCollectionIds -} - -// GetLogOnlyRuleCollectionIdsOk returns a tuple with the LogOnlyRuleCollectionIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetLogOnlyRuleCollectionIdsOk() ([]string, bool) { - if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { - return nil, false - } - return o.LogOnlyRuleCollectionIds, true -} - -// HasLogOnlyRuleCollectionIds returns a boolean if a field has been set. -func (o *WafConfigPatch) HasLogOnlyRuleCollectionIds() bool { - if o != nil && !IsNil(o.LogOnlyRuleCollectionIds) { - return true - } - - return false -} - -// SetLogOnlyRuleCollectionIds gets a reference to the given []string and assigns it to the LogOnlyRuleCollectionIds field. -func (o *WafConfigPatch) SetLogOnlyRuleCollectionIds(v []string) { - o.LogOnlyRuleCollectionIds = v -} - -// GetLogOnlyRuleGroupIds returns the LogOnlyRuleGroupIds field value if set, zero value otherwise. -func (o *WafConfigPatch) GetLogOnlyRuleGroupIds() []string { - if o == nil || IsNil(o.LogOnlyRuleGroupIds) { - var ret []string - return ret - } - return o.LogOnlyRuleGroupIds -} - -// GetLogOnlyRuleGroupIdsOk returns a tuple with the LogOnlyRuleGroupIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetLogOnlyRuleGroupIdsOk() ([]string, bool) { - if o == nil || IsNil(o.LogOnlyRuleGroupIds) { - return nil, false - } - return o.LogOnlyRuleGroupIds, true -} - -// HasLogOnlyRuleGroupIds returns a boolean if a field has been set. -func (o *WafConfigPatch) HasLogOnlyRuleGroupIds() bool { - if o != nil && !IsNil(o.LogOnlyRuleGroupIds) { - return true - } - - return false -} - -// SetLogOnlyRuleGroupIds gets a reference to the given []string and assigns it to the LogOnlyRuleGroupIds field. -func (o *WafConfigPatch) SetLogOnlyRuleGroupIds(v []string) { - o.LogOnlyRuleGroupIds = v -} - -// GetLogOnlyRuleIds returns the LogOnlyRuleIds field value if set, zero value otherwise. -func (o *WafConfigPatch) GetLogOnlyRuleIds() []string { - if o == nil || IsNil(o.LogOnlyRuleIds) { - var ret []string - return ret - } - return o.LogOnlyRuleIds -} - -// GetLogOnlyRuleIdsOk returns a tuple with the LogOnlyRuleIds field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetLogOnlyRuleIdsOk() ([]string, bool) { - if o == nil || IsNil(o.LogOnlyRuleIds) { - return nil, false - } - return o.LogOnlyRuleIds, true -} - -// HasLogOnlyRuleIds returns a boolean if a field has been set. -func (o *WafConfigPatch) HasLogOnlyRuleIds() bool { - if o != nil && !IsNil(o.LogOnlyRuleIds) { - return true - } - - return false -} - -// SetLogOnlyRuleIds gets a reference to the given []string and assigns it to the LogOnlyRuleIds field. -func (o *WafConfigPatch) SetLogOnlyRuleIds(v []string) { - o.LogOnlyRuleIds = v -} - -// GetMode returns the Mode field value if set, zero value otherwise. -func (o *WafConfigPatch) GetMode() WafMode { - if o == nil || IsNil(o.Mode) { - var ret WafMode - return ret - } - return *o.Mode -} - -// GetModeOk returns a tuple with the Mode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetModeOk() (*WafMode, bool) { - if o == nil || IsNil(o.Mode) { - return nil, false - } - return o.Mode, true -} - -// HasMode returns a boolean if a field has been set. -func (o *WafConfigPatch) HasMode() bool { - if o != nil && !IsNil(o.Mode) { - return true - } - - return false -} - -// SetMode gets a reference to the given WafMode and assigns it to the Mode field. -func (o *WafConfigPatch) SetMode(v WafMode) { - o.Mode = &v -} - -// GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. -func (o *WafConfigPatch) GetParanoiaLevel() WafParanoiaLevel { - if o == nil || IsNil(o.ParanoiaLevel) { - var ret WafParanoiaLevel - return ret - } - return *o.ParanoiaLevel -} - -// GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetParanoiaLevelOk() (*WafParanoiaLevel, bool) { - if o == nil || IsNil(o.ParanoiaLevel) { - return nil, false - } - return o.ParanoiaLevel, true -} - -// HasParanoiaLevel returns a boolean if a field has been set. -func (o *WafConfigPatch) HasParanoiaLevel() bool { - if o != nil && !IsNil(o.ParanoiaLevel) { - return true - } - - return false -} - -// SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. -func (o *WafConfigPatch) SetParanoiaLevel(v WafParanoiaLevel) { - o.ParanoiaLevel = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *WafConfigPatch) GetType() WafType { - if o == nil || IsNil(o.Type) { - var ret WafType - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetTypeOk() (*WafType, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *WafConfigPatch) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false -} - -// SetType gets a reference to the given WafType and assigns it to the Type field. -func (o *WafConfigPatch) SetType(v WafType) { - o.Type = &v -} - -func (o WafConfigPatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafConfigPatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.AllowedHttpMethods) { - toSerialize["allowedHttpMethods"] = o.AllowedHttpMethods - } - if !IsNil(o.AllowedHttpVersions) { - toSerialize["allowedHttpVersions"] = o.AllowedHttpVersions - } - if !IsNil(o.AllowedRequestContentTypes) { - toSerialize["allowedRequestContentTypes"] = o.AllowedRequestContentTypes - } - if !IsNil(o.DisabledRuleCollectionIds) { - toSerialize["disabledRuleCollectionIds"] = o.DisabledRuleCollectionIds - } - if !IsNil(o.DisabledRuleGroupIds) { - toSerialize["disabledRuleGroupIds"] = o.DisabledRuleGroupIds - } - if !IsNil(o.DisabledRuleIds) { - toSerialize["disabledRuleIds"] = o.DisabledRuleIds - } - if !IsNil(o.EnabledRuleCollectionIds) { - toSerialize["enabledRuleCollectionIds"] = o.EnabledRuleCollectionIds - } - if !IsNil(o.EnabledRuleGroupIds) { - toSerialize["enabledRuleGroupIds"] = o.EnabledRuleGroupIds - } - if !IsNil(o.EnabledRuleIds) { - toSerialize["enabledRuleIds"] = o.EnabledRuleIds - } - if !IsNil(o.LogOnlyRuleCollectionIds) { - toSerialize["logOnlyRuleCollectionIds"] = o.LogOnlyRuleCollectionIds - } - if !IsNil(o.LogOnlyRuleGroupIds) { - toSerialize["logOnlyRuleGroupIds"] = o.LogOnlyRuleGroupIds - } - if !IsNil(o.LogOnlyRuleIds) { - toSerialize["logOnlyRuleIds"] = o.LogOnlyRuleIds - } - if !IsNil(o.Mode) { - toSerialize["mode"] = o.Mode - } - if !IsNil(o.ParanoiaLevel) { - toSerialize["paranoiaLevel"] = o.ParanoiaLevel - } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafConfigPatch) UnmarshalJSON(data []byte) (err error) { - varWafConfigPatch := _WafConfigPatch{} - - err = json.Unmarshal(data, &varWafConfigPatch) - - if err != nil { - return err - } - - *o = WafConfigPatch(varWafConfigPatch) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "allowedHttpMethods") - delete(additionalProperties, "allowedHttpVersions") - delete(additionalProperties, "allowedRequestContentTypes") - delete(additionalProperties, "disabledRuleCollectionIds") - delete(additionalProperties, "disabledRuleGroupIds") - delete(additionalProperties, "disabledRuleIds") - delete(additionalProperties, "enabledRuleCollectionIds") - delete(additionalProperties, "enabledRuleGroupIds") - delete(additionalProperties, "enabledRuleIds") - delete(additionalProperties, "logOnlyRuleCollectionIds") - delete(additionalProperties, "logOnlyRuleGroupIds") - delete(additionalProperties, "logOnlyRuleIds") - delete(additionalProperties, "mode") - delete(additionalProperties, "paranoiaLevel") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafConfigPatch struct { - value *WafConfigPatch - isSet bool -} - -func (v NullableWafConfigPatch) Get() *WafConfigPatch { - return v.value -} - -func (v *NullableWafConfigPatch) Set(val *WafConfigPatch) { - v.value = val - v.isSet = true -} - -func (v NullableWafConfigPatch) IsSet() bool { - return v.isSet -} - -func (v *NullableWafConfigPatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafConfigPatch(val *WafConfigPatch) *NullableWafConfigPatch { - return &NullableWafConfigPatch{value: val, isSet: true} -} - -func (v NullableWafConfigPatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafConfigPatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_mode.go b/services/cdn/v1beta2api/model_waf_mode.go deleted file mode 100644 index 4d0bb1a43..000000000 --- a/services/cdn/v1beta2api/model_waf_mode.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// WafMode - `ENABLED`: The WAF actively inspects and blocks malicious requests. - `DISABLED`: The WAF is completely off. No inspection occurs. - `LOG_ONLY`: The WAF inspects requests and logs matches but never blocks. -type WafMode string - -// List of WafMode -const ( - WAFMODE_DISABLED WafMode = "DISABLED" - WAFMODE_ENABLED WafMode = "ENABLED" - WAFMODE_LOG_ONLY WafMode = "LOG_ONLY" - WAFMODE_UNKNOWN_DEFAULT_OPEN_API WafMode = "unknown_default_open_api" -) - -// All allowed values of WafMode enum -var AllowedWafModeEnumValues = []WafMode{ - "DISABLED", - "ENABLED", - "LOG_ONLY", - "unknown_default_open_api", -} - -func (v *WafMode) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := WafMode(value) - for _, existing := range AllowedWafModeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = WAFMODE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewWafModeFromValue returns a pointer to a valid WafMode -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewWafModeFromValue(v string) (*WafMode, error) { - ev := WafMode(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for WafMode: valid values are %v", v, AllowedWafModeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v WafMode) IsValid() bool { - for _, existing := range AllowedWafModeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to WafMode value -func (v WafMode) Ptr() *WafMode { - return &v -} - -type NullableWafMode struct { - value *WafMode - isSet bool -} - -func (v NullableWafMode) Get() *WafMode { - return v.value -} - -func (v *NullableWafMode) Set(val *WafMode) { - v.value = val - v.isSet = true -} - -func (v NullableWafMode) IsSet() bool { - return v.isSet -} - -func (v *NullableWafMode) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafMode(val *WafMode) *NullableWafMode { - return &NullableWafMode{value: val, isSet: true} -} - -func (v NullableWafMode) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafMode) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_paranoia_level.go b/services/cdn/v1beta2api/model_waf_paranoia_level.go deleted file mode 100644 index 0702b5f30..000000000 --- a/services/cdn/v1beta2api/model_waf_paranoia_level.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// WafParanoiaLevel The paranoia level defines how aggressively the WAF should action on requests. It ranges from `L1` (least strict, lowest chance of false positives) to `L4` (most strict, highest chance of false positives). A higher paranoia level is more effective at catching attacks but can also block legitimate traffic. -type WafParanoiaLevel string - -// List of WafParanoiaLevel -const ( - WAFPARANOIALEVEL_L1 WafParanoiaLevel = "L1" - WAFPARANOIALEVEL_L2 WafParanoiaLevel = "L2" - WAFPARANOIALEVEL_L3 WafParanoiaLevel = "L3" - WAFPARANOIALEVEL_L4 WafParanoiaLevel = "L4" - WAFPARANOIALEVEL_UNKNOWN_DEFAULT_OPEN_API WafParanoiaLevel = "unknown_default_open_api" -) - -// All allowed values of WafParanoiaLevel enum -var AllowedWafParanoiaLevelEnumValues = []WafParanoiaLevel{ - "L1", - "L2", - "L3", - "L4", - "unknown_default_open_api", -} - -func (v *WafParanoiaLevel) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := WafParanoiaLevel(value) - for _, existing := range AllowedWafParanoiaLevelEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = WAFPARANOIALEVEL_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewWafParanoiaLevelFromValue returns a pointer to a valid WafParanoiaLevel -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewWafParanoiaLevelFromValue(v string) (*WafParanoiaLevel, error) { - ev := WafParanoiaLevel(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for WafParanoiaLevel: valid values are %v", v, AllowedWafParanoiaLevelEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v WafParanoiaLevel) IsValid() bool { - for _, existing := range AllowedWafParanoiaLevelEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to WafParanoiaLevel value -func (v WafParanoiaLevel) Ptr() *WafParanoiaLevel { - return &v -} - -type NullableWafParanoiaLevel struct { - value *WafParanoiaLevel - isSet bool -} - -func (v NullableWafParanoiaLevel) Get() *WafParanoiaLevel { - return v.value -} - -func (v *NullableWafParanoiaLevel) Set(val *WafParanoiaLevel) { - v.value = val - v.isSet = true -} - -func (v NullableWafParanoiaLevel) IsSet() bool { - return v.isSet -} - -func (v *NullableWafParanoiaLevel) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafParanoiaLevel(val *WafParanoiaLevel) *NullableWafParanoiaLevel { - return &NullableWafParanoiaLevel{value: val, isSet: true} -} - -func (v NullableWafParanoiaLevel) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafParanoiaLevel) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_rule.go b/services/cdn/v1beta2api/model_waf_rule.go deleted file mode 100644 index 43785717f..000000000 --- a/services/cdn/v1beta2api/model_waf_rule.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafRule type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafRule{} - -// WafRule struct for WafRule -type WafRule struct { - // Optional CoreRuleSet rule Id in case this is a CRS rule - Code *string `json:"code,omitempty"` - // LocalizedString is a map from language to string value - Description map[string]string `json:"description"` - Id string `json:"id"` - AdditionalProperties map[string]interface{} -} - -type _WafRule WafRule - -// NewWafRule instantiates a new WafRule 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 NewWafRule(description map[string]string, id string) *WafRule { - this := WafRule{} - this.Description = description - this.Id = id - return &this -} - -// NewWafRuleWithDefaults instantiates a new WafRule 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 NewWafRuleWithDefaults() *WafRule { - this := WafRule{} - return &this -} - -// GetCode returns the Code field value if set, zero value otherwise. -func (o *WafRule) GetCode() string { - if o == nil || IsNil(o.Code) { - var ret string - return ret - } - return *o.Code -} - -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafRule) GetCodeOk() (*string, bool) { - if o == nil || IsNil(o.Code) { - return nil, false - } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *WafRule) HasCode() bool { - if o != nil && !IsNil(o.Code) { - return true - } - - return false -} - -// SetCode gets a reference to the given string and assigns it to the Code field. -func (o *WafRule) SetCode(v string) { - o.Code = &v -} - -// GetDescription returns the Description field value -func (o *WafRule) GetDescription() map[string]string { - if o == nil { - var ret map[string]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 *WafRule) GetDescriptionOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.Description, true -} - -// SetDescription sets field value -func (o *WafRule) SetDescription(v map[string]string) { - o.Description = v -} - -// GetId returns the Id field value -func (o *WafRule) 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 *WafRule) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *WafRule) SetId(v string) { - o.Id = v -} - -func (o WafRule) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafRule) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Code) { - toSerialize["code"] = o.Code - } - toSerialize["description"] = o.Description - toSerialize["id"] = o.Id - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafRule) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "description", - "id", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafRule := _WafRule{} - - err = json.Unmarshal(data, &varWafRule) - - if err != nil { - return err - } - - *o = WafRule(varWafRule) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "code") - delete(additionalProperties, "description") - delete(additionalProperties, "id") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafRule struct { - value *WafRule - isSet bool -} - -func (v NullableWafRule) Get() *WafRule { - return v.value -} - -func (v *NullableWafRule) Set(val *WafRule) { - v.value = val - v.isSet = true -} - -func (v NullableWafRule) IsSet() bool { - return v.isSet -} - -func (v *NullableWafRule) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafRule(val *WafRule) *NullableWafRule { - return &NullableWafRule{value: val, isSet: true} -} - -func (v NullableWafRule) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafRule) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_rule_action.go b/services/cdn/v1beta2api/model_waf_rule_action.go deleted file mode 100644 index d38d4cd3a..000000000 --- a/services/cdn/v1beta2api/model_waf_rule_action.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// WAFRuleAction The action a WAF rule can take based on a request -type WAFRuleAction string - -// List of WAFRuleAction -const ( - WAFRULEACTION_BLOCKED WAFRuleAction = "BLOCKED" - WAFRULEACTION_LOGGED WAFRuleAction = "LOGGED" - WAFRULEACTION_ALLOWED WAFRuleAction = "ALLOWED" - WAFRULEACTION_UNKNOWN_DEFAULT_OPEN_API WAFRuleAction = "unknown_default_open_api" -) - -// All allowed values of WAFRuleAction enum -var AllowedWAFRuleActionEnumValues = []WAFRuleAction{ - "BLOCKED", - "LOGGED", - "ALLOWED", - "unknown_default_open_api", -} - -func (v *WAFRuleAction) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := WAFRuleAction(value) - for _, existing := range AllowedWAFRuleActionEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = WAFRULEACTION_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewWAFRuleActionFromValue returns a pointer to a valid WAFRuleAction -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewWAFRuleActionFromValue(v string) (*WAFRuleAction, error) { - ev := WAFRuleAction(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for WAFRuleAction: valid values are %v", v, AllowedWAFRuleActionEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v WAFRuleAction) IsValid() bool { - for _, existing := range AllowedWAFRuleActionEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to WAFRuleAction value -func (v WAFRuleAction) Ptr() *WAFRuleAction { - return &v -} - -type NullableWAFRuleAction struct { - value *WAFRuleAction - isSet bool -} - -func (v NullableWAFRuleAction) Get() *WAFRuleAction { - return v.value -} - -func (v *NullableWAFRuleAction) Set(val *WAFRuleAction) { - v.value = val - v.isSet = true -} - -func (v NullableWAFRuleAction) IsSet() bool { - return v.isSet -} - -func (v *NullableWAFRuleAction) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWAFRuleAction(val *WAFRuleAction) *NullableWAFRuleAction { - return &NullableWAFRuleAction{value: val, isSet: true} -} - -func (v NullableWAFRuleAction) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWAFRuleAction) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_rule_collection.go b/services/cdn/v1beta2api/model_waf_rule_collection.go deleted file mode 100644 index b77314ddb..000000000 --- a/services/cdn/v1beta2api/model_waf_rule_collection.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafRuleCollection type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafRuleCollection{} - -// WafRuleCollection struct for WafRuleCollection -type WafRuleCollection struct { - Groups []WafRuleGroup `json:"groups"` - Id string `json:"id"` - // LocalizedString is a map from language to string value - Name map[string]string `json:"name"` - AdditionalProperties map[string]interface{} -} - -type _WafRuleCollection WafRuleCollection - -// NewWafRuleCollection instantiates a new WafRuleCollection 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 NewWafRuleCollection(groups []WafRuleGroup, id string, name map[string]string) *WafRuleCollection { - this := WafRuleCollection{} - this.Groups = groups - this.Id = id - this.Name = name - return &this -} - -// NewWafRuleCollectionWithDefaults instantiates a new WafRuleCollection 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 NewWafRuleCollectionWithDefaults() *WafRuleCollection { - this := WafRuleCollection{} - return &this -} - -// GetGroups returns the Groups field value -func (o *WafRuleCollection) GetGroups() []WafRuleGroup { - if o == nil { - var ret []WafRuleGroup - return ret - } - - return o.Groups -} - -// GetGroupsOk returns a tuple with the Groups field value -// and a boolean to check if the value has been set. -func (o *WafRuleCollection) GetGroupsOk() ([]WafRuleGroup, bool) { - if o == nil { - return nil, false - } - return o.Groups, true -} - -// SetGroups sets field value -func (o *WafRuleCollection) SetGroups(v []WafRuleGroup) { - o.Groups = v -} - -// GetId returns the Id field value -func (o *WafRuleCollection) 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 *WafRuleCollection) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *WafRuleCollection) SetId(v string) { - o.Id = v -} - -// GetName returns the Name field value -func (o *WafRuleCollection) GetName() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *WafRuleCollection) GetNameOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *WafRuleCollection) SetName(v map[string]string) { - o.Name = v -} - -func (o WafRuleCollection) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafRuleCollection) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["groups"] = o.Groups - toSerialize["id"] = o.Id - toSerialize["name"] = o.Name - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafRuleCollection) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "groups", - "id", - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafRuleCollection := _WafRuleCollection{} - - err = json.Unmarshal(data, &varWafRuleCollection) - - if err != nil { - return err - } - - *o = WafRuleCollection(varWafRuleCollection) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "groups") - delete(additionalProperties, "id") - delete(additionalProperties, "name") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafRuleCollection struct { - value *WafRuleCollection - isSet bool -} - -func (v NullableWafRuleCollection) Get() *WafRuleCollection { - return v.value -} - -func (v *NullableWafRuleCollection) Set(val *WafRuleCollection) { - v.value = val - v.isSet = true -} - -func (v NullableWafRuleCollection) IsSet() bool { - return v.isSet -} - -func (v *NullableWafRuleCollection) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafRuleCollection(val *WafRuleCollection) *NullableWafRuleCollection { - return &NullableWafRuleCollection{value: val, isSet: true} -} - -func (v NullableWafRuleCollection) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafRuleCollection) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_rule_group.go b/services/cdn/v1beta2api/model_waf_rule_group.go deleted file mode 100644 index 7d571f496..000000000 --- a/services/cdn/v1beta2api/model_waf_rule_group.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafRuleGroup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafRuleGroup{} - -// WafRuleGroup struct for WafRuleGroup -type WafRuleGroup struct { - // LocalizedString is a map from language to string value - Description map[string]string `json:"description"` - // LocalizedString is a map from language to string value - Name map[string]string `json:"name"` - Rules []WafRule `json:"rules"` - AdditionalProperties map[string]interface{} -} - -type _WafRuleGroup WafRuleGroup - -// NewWafRuleGroup instantiates a new WafRuleGroup 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 NewWafRuleGroup(description map[string]string, name map[string]string, rules []WafRule) *WafRuleGroup { - this := WafRuleGroup{} - this.Description = description - this.Name = name - this.Rules = rules - return &this -} - -// NewWafRuleGroupWithDefaults instantiates a new WafRuleGroup 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 NewWafRuleGroupWithDefaults() *WafRuleGroup { - this := WafRuleGroup{} - return &this -} - -// GetDescription returns the Description field value -func (o *WafRuleGroup) GetDescription() map[string]string { - if o == nil { - var ret map[string]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 *WafRuleGroup) GetDescriptionOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.Description, true -} - -// SetDescription sets field value -func (o *WafRuleGroup) SetDescription(v map[string]string) { - o.Description = v -} - -// GetName returns the Name field value -func (o *WafRuleGroup) GetName() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *WafRuleGroup) GetNameOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *WafRuleGroup) SetName(v map[string]string) { - o.Name = v -} - -// GetRules returns the Rules field value -func (o *WafRuleGroup) GetRules() []WafRule { - if o == nil { - var ret []WafRule - return ret - } - - return o.Rules -} - -// GetRulesOk returns a tuple with the Rules field value -// and a boolean to check if the value has been set. -func (o *WafRuleGroup) GetRulesOk() ([]WafRule, bool) { - if o == nil { - return nil, false - } - return o.Rules, true -} - -// SetRules sets field value -func (o *WafRuleGroup) SetRules(v []WafRule) { - o.Rules = v -} - -func (o WafRuleGroup) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafRuleGroup) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["description"] = o.Description - toSerialize["name"] = o.Name - toSerialize["rules"] = o.Rules - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafRuleGroup) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "description", - "name", - "rules", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafRuleGroup := _WafRuleGroup{} - - err = json.Unmarshal(data, &varWafRuleGroup) - - if err != nil { - return err - } - - *o = WafRuleGroup(varWafRuleGroup) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "description") - delete(additionalProperties, "name") - delete(additionalProperties, "rules") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafRuleGroup struct { - value *WafRuleGroup - isSet bool -} - -func (v NullableWafRuleGroup) Get() *WafRuleGroup { - return v.value -} - -func (v *NullableWafRuleGroup) Set(val *WafRuleGroup) { - v.value = val - v.isSet = true -} - -func (v NullableWafRuleGroup) IsSet() bool { - return v.isSet -} - -func (v *NullableWafRuleGroup) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafRuleGroup(val *WafRuleGroup) *NullableWafRuleGroup { - return &NullableWafRuleGroup{value: val, isSet: true} -} - -func (v NullableWafRuleGroup) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafRuleGroup) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block.go b/services/cdn/v1beta2api/model_waf_status_rule_block.go deleted file mode 100644 index 992f0ce48..000000000 --- a/services/cdn/v1beta2api/model_waf_status_rule_block.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafStatusRuleBlock type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafStatusRuleBlock{} - -// WafStatusRuleBlock struct for WafStatusRuleBlock -type WafStatusRuleBlock struct { - // Specifies the Id of the Rule. - Id string `json:"id"` - Reason WafStatusRuleBlockReason `json:"reason"` - AdditionalProperties map[string]interface{} -} - -type _WafStatusRuleBlock WafStatusRuleBlock - -// NewWafStatusRuleBlock instantiates a new WafStatusRuleBlock 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 NewWafStatusRuleBlock(id string, reason WafStatusRuleBlockReason) *WafStatusRuleBlock { - this := WafStatusRuleBlock{} - this.Id = id - this.Reason = reason - return &this -} - -// NewWafStatusRuleBlockWithDefaults instantiates a new WafStatusRuleBlock 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 NewWafStatusRuleBlockWithDefaults() *WafStatusRuleBlock { - this := WafStatusRuleBlock{} - return &this -} - -// GetId returns the Id field value -func (o *WafStatusRuleBlock) 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 *WafStatusRuleBlock) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *WafStatusRuleBlock) SetId(v string) { - o.Id = v -} - -// GetReason returns the Reason field value -func (o *WafStatusRuleBlock) GetReason() WafStatusRuleBlockReason { - if o == nil { - var ret WafStatusRuleBlockReason - return ret - } - - return o.Reason -} - -// GetReasonOk returns a tuple with the Reason field value -// and a boolean to check if the value has been set. -func (o *WafStatusRuleBlock) GetReasonOk() (*WafStatusRuleBlockReason, bool) { - if o == nil { - return nil, false - } - return &o.Reason, true -} - -// SetReason sets field value -func (o *WafStatusRuleBlock) SetReason(v WafStatusRuleBlockReason) { - o.Reason = v -} - -func (o WafStatusRuleBlock) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafStatusRuleBlock) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["reason"] = o.Reason - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafStatusRuleBlock) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - "reason", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafStatusRuleBlock := _WafStatusRuleBlock{} - - err = json.Unmarshal(data, &varWafStatusRuleBlock) - - if err != nil { - return err - } - - *o = WafStatusRuleBlock(varWafStatusRuleBlock) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "id") - delete(additionalProperties, "reason") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafStatusRuleBlock struct { - value *WafStatusRuleBlock - isSet bool -} - -func (v NullableWafStatusRuleBlock) Get() *WafStatusRuleBlock { - return v.value -} - -func (v *NullableWafStatusRuleBlock) Set(val *WafStatusRuleBlock) { - v.value = val - v.isSet = true -} - -func (v NullableWafStatusRuleBlock) IsSet() bool { - return v.isSet -} - -func (v *NullableWafStatusRuleBlock) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafStatusRuleBlock(val *WafStatusRuleBlock) *NullableWafStatusRuleBlock { - return &NullableWafStatusRuleBlock{value: val, isSet: true} -} - -func (v NullableWafStatusRuleBlock) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafStatusRuleBlock) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason.go deleted file mode 100644 index 905882db3..000000000 --- a/services/cdn/v1beta2api/model_waf_status_rule_block_reason.go +++ /dev/null @@ -1,249 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// WafStatusRuleBlockReason - Defines the Reason why a Rule is in the specified state (set to be enabled, disabled or logOnly). -type WafStatusRuleBlockReason struct { - WafStatusRuleBlockReasonDirectlyDefined *WafStatusRuleBlockReasonDirectlyDefined - WafStatusRuleBlockReasonInheritedFromCollection *WafStatusRuleBlockReasonInheritedFromCollection - WafStatusRuleBlockReasonInheritedFromGroup *WafStatusRuleBlockReasonInheritedFromGroup - WafStatusRuleBlockReasonInvalidWafType *WafStatusRuleBlockReasonInvalidWafType - WafStatusRuleBlockReasonNeverDefined *WafStatusRuleBlockReasonNeverDefined -} - -// WafStatusRuleBlockReasonDirectlyDefinedAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonDirectlyDefined wrapped in WafStatusRuleBlockReason -func WafStatusRuleBlockReasonDirectlyDefinedAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonDirectlyDefined) WafStatusRuleBlockReason { - return WafStatusRuleBlockReason{ - WafStatusRuleBlockReasonDirectlyDefined: v, - } -} - -// WafStatusRuleBlockReasonInheritedFromCollectionAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInheritedFromCollection wrapped in WafStatusRuleBlockReason -func WafStatusRuleBlockReasonInheritedFromCollectionAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInheritedFromCollection) WafStatusRuleBlockReason { - return WafStatusRuleBlockReason{ - WafStatusRuleBlockReasonInheritedFromCollection: v, - } -} - -// WafStatusRuleBlockReasonInheritedFromGroupAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInheritedFromGroup wrapped in WafStatusRuleBlockReason -func WafStatusRuleBlockReasonInheritedFromGroupAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInheritedFromGroup) WafStatusRuleBlockReason { - return WafStatusRuleBlockReason{ - WafStatusRuleBlockReasonInheritedFromGroup: v, - } -} - -// WafStatusRuleBlockReasonInvalidWafTypeAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInvalidWafType wrapped in WafStatusRuleBlockReason -func WafStatusRuleBlockReasonInvalidWafTypeAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInvalidWafType) WafStatusRuleBlockReason { - return WafStatusRuleBlockReason{ - WafStatusRuleBlockReasonInvalidWafType: v, - } -} - -// WafStatusRuleBlockReasonNeverDefinedAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonNeverDefined wrapped in WafStatusRuleBlockReason -func WafStatusRuleBlockReasonNeverDefinedAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonNeverDefined) WafStatusRuleBlockReason { - return WafStatusRuleBlockReason{ - WafStatusRuleBlockReasonNeverDefined: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *WafStatusRuleBlockReason) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'directlyDefined' - if jsonDict["type"] == "directlyDefined" { - // try to unmarshal JSON data into WafStatusRuleBlockReasonDirectlyDefined - err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonDirectlyDefined) - if err == nil { - return nil // data stored in dst.WafStatusRuleBlockReasonDirectlyDefined, return on the first match - } else { - dst.WafStatusRuleBlockReasonDirectlyDefined = nil - return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonDirectlyDefined: %s", err.Error()) - } - } - - // check if the discriminator value is 'inheritedFromCollection' - if jsonDict["type"] == "inheritedFromCollection" { - // try to unmarshal JSON data into WafStatusRuleBlockReasonInheritedFromCollection - err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonInheritedFromCollection) - if err == nil { - return nil // data stored in dst.WafStatusRuleBlockReasonInheritedFromCollection, return on the first match - } else { - dst.WafStatusRuleBlockReasonInheritedFromCollection = nil - return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonInheritedFromCollection: %s", err.Error()) - } - } - - // check if the discriminator value is 'inheritedFromGroup' - if jsonDict["type"] == "inheritedFromGroup" { - // try to unmarshal JSON data into WafStatusRuleBlockReasonInheritedFromGroup - err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonInheritedFromGroup) - if err == nil { - return nil // data stored in dst.WafStatusRuleBlockReasonInheritedFromGroup, return on the first match - } else { - dst.WafStatusRuleBlockReasonInheritedFromGroup = nil - return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonInheritedFromGroup: %s", err.Error()) - } - } - - // check if the discriminator value is 'invalidWafType' - if jsonDict["type"] == "invalidWafType" { - // try to unmarshal JSON data into WafStatusRuleBlockReasonInvalidWafType - err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonInvalidWafType) - if err == nil { - return nil // data stored in dst.WafStatusRuleBlockReasonInvalidWafType, return on the first match - } else { - dst.WafStatusRuleBlockReasonInvalidWafType = nil - return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonInvalidWafType: %s", err.Error()) - } - } - - // check if the discriminator value is 'neverDefined' - if jsonDict["type"] == "neverDefined" { - // try to unmarshal JSON data into WafStatusRuleBlockReasonNeverDefined - err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonNeverDefined) - if err == nil { - return nil // data stored in dst.WafStatusRuleBlockReasonNeverDefined, return on the first match - } else { - dst.WafStatusRuleBlockReasonNeverDefined = nil - return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonNeverDefined: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src WafStatusRuleBlockReason) MarshalJSON() ([]byte, error) { - if src.WafStatusRuleBlockReasonDirectlyDefined != nil { - return json.Marshal(&src.WafStatusRuleBlockReasonDirectlyDefined) - } - - if src.WafStatusRuleBlockReasonInheritedFromCollection != nil { - return json.Marshal(&src.WafStatusRuleBlockReasonInheritedFromCollection) - } - - if src.WafStatusRuleBlockReasonInheritedFromGroup != nil { - return json.Marshal(&src.WafStatusRuleBlockReasonInheritedFromGroup) - } - - if src.WafStatusRuleBlockReasonInvalidWafType != nil { - return json.Marshal(&src.WafStatusRuleBlockReasonInvalidWafType) - } - - if src.WafStatusRuleBlockReasonNeverDefined != nil { - return json.Marshal(&src.WafStatusRuleBlockReasonNeverDefined) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *WafStatusRuleBlockReason) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.WafStatusRuleBlockReasonDirectlyDefined != nil { - return obj.WafStatusRuleBlockReasonDirectlyDefined - } - - if obj.WafStatusRuleBlockReasonInheritedFromCollection != nil { - return obj.WafStatusRuleBlockReasonInheritedFromCollection - } - - if obj.WafStatusRuleBlockReasonInheritedFromGroup != nil { - return obj.WafStatusRuleBlockReasonInheritedFromGroup - } - - if obj.WafStatusRuleBlockReasonInvalidWafType != nil { - return obj.WafStatusRuleBlockReasonInvalidWafType - } - - if obj.WafStatusRuleBlockReasonNeverDefined != nil { - return obj.WafStatusRuleBlockReasonNeverDefined - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj WafStatusRuleBlockReason) GetActualInstanceValue() interface{} { - if obj.WafStatusRuleBlockReasonDirectlyDefined != nil { - return *obj.WafStatusRuleBlockReasonDirectlyDefined - } - - if obj.WafStatusRuleBlockReasonInheritedFromCollection != nil { - return *obj.WafStatusRuleBlockReasonInheritedFromCollection - } - - if obj.WafStatusRuleBlockReasonInheritedFromGroup != nil { - return *obj.WafStatusRuleBlockReasonInheritedFromGroup - } - - if obj.WafStatusRuleBlockReasonInvalidWafType != nil { - return *obj.WafStatusRuleBlockReasonInvalidWafType - } - - if obj.WafStatusRuleBlockReasonNeverDefined != nil { - return *obj.WafStatusRuleBlockReasonNeverDefined - } - - // all schemas are nil - return nil -} - -type NullableWafStatusRuleBlockReason struct { - value *WafStatusRuleBlockReason - isSet bool -} - -func (v NullableWafStatusRuleBlockReason) Get() *WafStatusRuleBlockReason { - return v.value -} - -func (v *NullableWafStatusRuleBlockReason) Set(val *WafStatusRuleBlockReason) { - v.value = val - v.isSet = true -} - -func (v NullableWafStatusRuleBlockReason) IsSet() bool { - return v.isSet -} - -func (v *NullableWafStatusRuleBlockReason) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafStatusRuleBlockReason(val *WafStatusRuleBlockReason) *NullableWafStatusRuleBlockReason { - return &NullableWafStatusRuleBlockReason{value: val, isSet: true} -} - -func (v NullableWafStatusRuleBlockReason) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafStatusRuleBlockReason) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_directly_defined.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_directly_defined.go deleted file mode 100644 index e7ecbb5ce..000000000 --- a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_directly_defined.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafStatusRuleBlockReasonDirectlyDefined type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafStatusRuleBlockReasonDirectlyDefined{} - -// WafStatusRuleBlockReasonDirectlyDefined struct for WafStatusRuleBlockReasonDirectlyDefined -type WafStatusRuleBlockReasonDirectlyDefined struct { - // This is always `directlyDefined` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _WafStatusRuleBlockReasonDirectlyDefined WafStatusRuleBlockReasonDirectlyDefined - -// NewWafStatusRuleBlockReasonDirectlyDefined instantiates a new WafStatusRuleBlockReasonDirectlyDefined 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 NewWafStatusRuleBlockReasonDirectlyDefined(types string) *WafStatusRuleBlockReasonDirectlyDefined { - this := WafStatusRuleBlockReasonDirectlyDefined{} - this.Type = types - return &this -} - -// NewWafStatusRuleBlockReasonDirectlyDefinedWithDefaults instantiates a new WafStatusRuleBlockReasonDirectlyDefined 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 NewWafStatusRuleBlockReasonDirectlyDefinedWithDefaults() *WafStatusRuleBlockReasonDirectlyDefined { - this := WafStatusRuleBlockReasonDirectlyDefined{} - return &this -} - -// GetType returns the Type field value -func (o *WafStatusRuleBlockReasonDirectlyDefined) 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 *WafStatusRuleBlockReasonDirectlyDefined) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *WafStatusRuleBlockReasonDirectlyDefined) SetType(v string) { - o.Type = v -} - -func (o WafStatusRuleBlockReasonDirectlyDefined) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafStatusRuleBlockReasonDirectlyDefined) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafStatusRuleBlockReasonDirectlyDefined) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafStatusRuleBlockReasonDirectlyDefined := _WafStatusRuleBlockReasonDirectlyDefined{} - - err = json.Unmarshal(data, &varWafStatusRuleBlockReasonDirectlyDefined) - - if err != nil { - return err - } - - *o = WafStatusRuleBlockReasonDirectlyDefined(varWafStatusRuleBlockReasonDirectlyDefined) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafStatusRuleBlockReasonDirectlyDefined struct { - value *WafStatusRuleBlockReasonDirectlyDefined - isSet bool -} - -func (v NullableWafStatusRuleBlockReasonDirectlyDefined) Get() *WafStatusRuleBlockReasonDirectlyDefined { - return v.value -} - -func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) Set(val *WafStatusRuleBlockReasonDirectlyDefined) { - v.value = val - v.isSet = true -} - -func (v NullableWafStatusRuleBlockReasonDirectlyDefined) IsSet() bool { - return v.isSet -} - -func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafStatusRuleBlockReasonDirectlyDefined(val *WafStatusRuleBlockReasonDirectlyDefined) *NullableWafStatusRuleBlockReasonDirectlyDefined { - return &NullableWafStatusRuleBlockReasonDirectlyDefined{value: val, isSet: true} -} - -func (v NullableWafStatusRuleBlockReasonDirectlyDefined) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_collection.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_collection.go deleted file mode 100644 index 108f3142a..000000000 --- a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_collection.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafStatusRuleBlockReasonInheritedFromCollection type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafStatusRuleBlockReasonInheritedFromCollection{} - -// WafStatusRuleBlockReasonInheritedFromCollection struct for WafStatusRuleBlockReasonInheritedFromCollection -type WafStatusRuleBlockReasonInheritedFromCollection struct { - // The Collection that caused this rule to be in its current state. - CollectionId string `json:"collectionId"` - // This is always `inheritedFromCollection` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _WafStatusRuleBlockReasonInheritedFromCollection WafStatusRuleBlockReasonInheritedFromCollection - -// NewWafStatusRuleBlockReasonInheritedFromCollection instantiates a new WafStatusRuleBlockReasonInheritedFromCollection 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 NewWafStatusRuleBlockReasonInheritedFromCollection(collectionId string, types string) *WafStatusRuleBlockReasonInheritedFromCollection { - this := WafStatusRuleBlockReasonInheritedFromCollection{} - this.CollectionId = collectionId - this.Type = types - return &this -} - -// NewWafStatusRuleBlockReasonInheritedFromCollectionWithDefaults instantiates a new WafStatusRuleBlockReasonInheritedFromCollection 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 NewWafStatusRuleBlockReasonInheritedFromCollectionWithDefaults() *WafStatusRuleBlockReasonInheritedFromCollection { - this := WafStatusRuleBlockReasonInheritedFromCollection{} - return &this -} - -// GetCollectionId returns the CollectionId field value -func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetCollectionId() string { - if o == nil { - var ret string - return ret - } - - return o.CollectionId -} - -// GetCollectionIdOk returns a tuple with the CollectionId field value -// and a boolean to check if the value has been set. -func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetCollectionIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.CollectionId, true -} - -// SetCollectionId sets field value -func (o *WafStatusRuleBlockReasonInheritedFromCollection) SetCollectionId(v string) { - o.CollectionId = v -} - -// GetType returns the Type field value -func (o *WafStatusRuleBlockReasonInheritedFromCollection) 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 *WafStatusRuleBlockReasonInheritedFromCollection) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *WafStatusRuleBlockReasonInheritedFromCollection) SetType(v string) { - o.Type = v -} - -func (o WafStatusRuleBlockReasonInheritedFromCollection) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafStatusRuleBlockReasonInheritedFromCollection) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["collectionId"] = o.CollectionId - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafStatusRuleBlockReasonInheritedFromCollection) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "collectionId", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafStatusRuleBlockReasonInheritedFromCollection := _WafStatusRuleBlockReasonInheritedFromCollection{} - - err = json.Unmarshal(data, &varWafStatusRuleBlockReasonInheritedFromCollection) - - if err != nil { - return err - } - - *o = WafStatusRuleBlockReasonInheritedFromCollection(varWafStatusRuleBlockReasonInheritedFromCollection) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "collectionId") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafStatusRuleBlockReasonInheritedFromCollection struct { - value *WafStatusRuleBlockReasonInheritedFromCollection - isSet bool -} - -func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) Get() *WafStatusRuleBlockReasonInheritedFromCollection { - return v.value -} - -func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) Set(val *WafStatusRuleBlockReasonInheritedFromCollection) { - v.value = val - v.isSet = true -} - -func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) IsSet() bool { - return v.isSet -} - -func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafStatusRuleBlockReasonInheritedFromCollection(val *WafStatusRuleBlockReasonInheritedFromCollection) *NullableWafStatusRuleBlockReasonInheritedFromCollection { - return &NullableWafStatusRuleBlockReasonInheritedFromCollection{value: val, isSet: true} -} - -func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_group.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_group.go deleted file mode 100644 index 7e5fb9286..000000000 --- a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_group.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafStatusRuleBlockReasonInheritedFromGroup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafStatusRuleBlockReasonInheritedFromGroup{} - -// WafStatusRuleBlockReasonInheritedFromGroup struct for WafStatusRuleBlockReasonInheritedFromGroup -type WafStatusRuleBlockReasonInheritedFromGroup struct { - // The Group that caused this rule to be in its current state. - GroupId string `json:"groupId"` - // This is always `inheritedFromGroup` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _WafStatusRuleBlockReasonInheritedFromGroup WafStatusRuleBlockReasonInheritedFromGroup - -// NewWafStatusRuleBlockReasonInheritedFromGroup instantiates a new WafStatusRuleBlockReasonInheritedFromGroup 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 NewWafStatusRuleBlockReasonInheritedFromGroup(groupId string, types string) *WafStatusRuleBlockReasonInheritedFromGroup { - this := WafStatusRuleBlockReasonInheritedFromGroup{} - this.GroupId = groupId - this.Type = types - return &this -} - -// NewWafStatusRuleBlockReasonInheritedFromGroupWithDefaults instantiates a new WafStatusRuleBlockReasonInheritedFromGroup 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 NewWafStatusRuleBlockReasonInheritedFromGroupWithDefaults() *WafStatusRuleBlockReasonInheritedFromGroup { - this := WafStatusRuleBlockReasonInheritedFromGroup{} - return &this -} - -// GetGroupId returns the GroupId field value -func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetGroupId() string { - if o == nil { - var ret string - return ret - } - - return o.GroupId -} - -// GetGroupIdOk returns a tuple with the GroupId field value -// and a boolean to check if the value has been set. -func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetGroupIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.GroupId, true -} - -// SetGroupId sets field value -func (o *WafStatusRuleBlockReasonInheritedFromGroup) SetGroupId(v string) { - o.GroupId = v -} - -// GetType returns the Type field value -func (o *WafStatusRuleBlockReasonInheritedFromGroup) 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 *WafStatusRuleBlockReasonInheritedFromGroup) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *WafStatusRuleBlockReasonInheritedFromGroup) SetType(v string) { - o.Type = v -} - -func (o WafStatusRuleBlockReasonInheritedFromGroup) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafStatusRuleBlockReasonInheritedFromGroup) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["groupId"] = o.GroupId - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafStatusRuleBlockReasonInheritedFromGroup) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "groupId", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafStatusRuleBlockReasonInheritedFromGroup := _WafStatusRuleBlockReasonInheritedFromGroup{} - - err = json.Unmarshal(data, &varWafStatusRuleBlockReasonInheritedFromGroup) - - if err != nil { - return err - } - - *o = WafStatusRuleBlockReasonInheritedFromGroup(varWafStatusRuleBlockReasonInheritedFromGroup) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "groupId") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafStatusRuleBlockReasonInheritedFromGroup struct { - value *WafStatusRuleBlockReasonInheritedFromGroup - isSet bool -} - -func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) Get() *WafStatusRuleBlockReasonInheritedFromGroup { - return v.value -} - -func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) Set(val *WafStatusRuleBlockReasonInheritedFromGroup) { - v.value = val - v.isSet = true -} - -func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) IsSet() bool { - return v.isSet -} - -func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafStatusRuleBlockReasonInheritedFromGroup(val *WafStatusRuleBlockReasonInheritedFromGroup) *NullableWafStatusRuleBlockReasonInheritedFromGroup { - return &NullableWafStatusRuleBlockReasonInheritedFromGroup{value: val, isSet: true} -} - -func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_invalid_waf_type.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_invalid_waf_type.go deleted file mode 100644 index e48d34fa7..000000000 --- a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_invalid_waf_type.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafStatusRuleBlockReasonInvalidWafType type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafStatusRuleBlockReasonInvalidWafType{} - -// WafStatusRuleBlockReasonInvalidWafType struct for WafStatusRuleBlockReasonInvalidWafType -type WafStatusRuleBlockReasonInvalidWafType struct { - // A list containing all WAF Types which can use this Rule. You must patch you WAF to one of these WAF Types to make use of this rule. Rules show up with this state if they would have been enabled or logOnly otherwise. - AllowedWafTypes []WafType `json:"allowedWafTypes"` - // This is always `invalidWafType` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _WafStatusRuleBlockReasonInvalidWafType WafStatusRuleBlockReasonInvalidWafType - -// NewWafStatusRuleBlockReasonInvalidWafType instantiates a new WafStatusRuleBlockReasonInvalidWafType 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 NewWafStatusRuleBlockReasonInvalidWafType(allowedWafTypes []WafType, types string) *WafStatusRuleBlockReasonInvalidWafType { - this := WafStatusRuleBlockReasonInvalidWafType{} - this.AllowedWafTypes = allowedWafTypes - this.Type = types - return &this -} - -// NewWafStatusRuleBlockReasonInvalidWafTypeWithDefaults instantiates a new WafStatusRuleBlockReasonInvalidWafType 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 NewWafStatusRuleBlockReasonInvalidWafTypeWithDefaults() *WafStatusRuleBlockReasonInvalidWafType { - this := WafStatusRuleBlockReasonInvalidWafType{} - return &this -} - -// GetAllowedWafTypes returns the AllowedWafTypes field value -func (o *WafStatusRuleBlockReasonInvalidWafType) GetAllowedWafTypes() []WafType { - if o == nil { - var ret []WafType - return ret - } - - return o.AllowedWafTypes -} - -// GetAllowedWafTypesOk returns a tuple with the AllowedWafTypes field value -// and a boolean to check if the value has been set. -func (o *WafStatusRuleBlockReasonInvalidWafType) GetAllowedWafTypesOk() ([]WafType, bool) { - if o == nil { - return nil, false - } - return o.AllowedWafTypes, true -} - -// SetAllowedWafTypes sets field value -func (o *WafStatusRuleBlockReasonInvalidWafType) SetAllowedWafTypes(v []WafType) { - o.AllowedWafTypes = v -} - -// GetType returns the Type field value -func (o *WafStatusRuleBlockReasonInvalidWafType) 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 *WafStatusRuleBlockReasonInvalidWafType) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *WafStatusRuleBlockReasonInvalidWafType) SetType(v string) { - o.Type = v -} - -func (o WafStatusRuleBlockReasonInvalidWafType) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafStatusRuleBlockReasonInvalidWafType) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["allowedWafTypes"] = o.AllowedWafTypes - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafStatusRuleBlockReasonInvalidWafType) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "allowedWafTypes", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafStatusRuleBlockReasonInvalidWafType := _WafStatusRuleBlockReasonInvalidWafType{} - - err = json.Unmarshal(data, &varWafStatusRuleBlockReasonInvalidWafType) - - if err != nil { - return err - } - - *o = WafStatusRuleBlockReasonInvalidWafType(varWafStatusRuleBlockReasonInvalidWafType) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "allowedWafTypes") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafStatusRuleBlockReasonInvalidWafType struct { - value *WafStatusRuleBlockReasonInvalidWafType - isSet bool -} - -func (v NullableWafStatusRuleBlockReasonInvalidWafType) Get() *WafStatusRuleBlockReasonInvalidWafType { - return v.value -} - -func (v *NullableWafStatusRuleBlockReasonInvalidWafType) Set(val *WafStatusRuleBlockReasonInvalidWafType) { - v.value = val - v.isSet = true -} - -func (v NullableWafStatusRuleBlockReasonInvalidWafType) IsSet() bool { - return v.isSet -} - -func (v *NullableWafStatusRuleBlockReasonInvalidWafType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafStatusRuleBlockReasonInvalidWafType(val *WafStatusRuleBlockReasonInvalidWafType) *NullableWafStatusRuleBlockReasonInvalidWafType { - return &NullableWafStatusRuleBlockReasonInvalidWafType{value: val, isSet: true} -} - -func (v NullableWafStatusRuleBlockReasonInvalidWafType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafStatusRuleBlockReasonInvalidWafType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_never_defined.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_never_defined.go deleted file mode 100644 index 4ba0409e4..000000000 --- a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_never_defined.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafStatusRuleBlockReasonNeverDefined type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafStatusRuleBlockReasonNeverDefined{} - -// WafStatusRuleBlockReasonNeverDefined This object only ever shows up in the disabled rules section. If rules are never defined (e.g. no collection, rule group, or the rule itself is ever mentioned), they are implicitly disabled -type WafStatusRuleBlockReasonNeverDefined struct { - // This is always `neverDefined` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _WafStatusRuleBlockReasonNeverDefined WafStatusRuleBlockReasonNeverDefined - -// NewWafStatusRuleBlockReasonNeverDefined instantiates a new WafStatusRuleBlockReasonNeverDefined 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 NewWafStatusRuleBlockReasonNeverDefined(types string) *WafStatusRuleBlockReasonNeverDefined { - this := WafStatusRuleBlockReasonNeverDefined{} - this.Type = types - return &this -} - -// NewWafStatusRuleBlockReasonNeverDefinedWithDefaults instantiates a new WafStatusRuleBlockReasonNeverDefined 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 NewWafStatusRuleBlockReasonNeverDefinedWithDefaults() *WafStatusRuleBlockReasonNeverDefined { - this := WafStatusRuleBlockReasonNeverDefined{} - return &this -} - -// GetType returns the Type field value -func (o *WafStatusRuleBlockReasonNeverDefined) 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 *WafStatusRuleBlockReasonNeverDefined) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *WafStatusRuleBlockReasonNeverDefined) SetType(v string) { - o.Type = v -} - -func (o WafStatusRuleBlockReasonNeverDefined) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafStatusRuleBlockReasonNeverDefined) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafStatusRuleBlockReasonNeverDefined) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafStatusRuleBlockReasonNeverDefined := _WafStatusRuleBlockReasonNeverDefined{} - - err = json.Unmarshal(data, &varWafStatusRuleBlockReasonNeverDefined) - - if err != nil { - return err - } - - *o = WafStatusRuleBlockReasonNeverDefined(varWafStatusRuleBlockReasonNeverDefined) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafStatusRuleBlockReasonNeverDefined struct { - value *WafStatusRuleBlockReasonNeverDefined - isSet bool -} - -func (v NullableWafStatusRuleBlockReasonNeverDefined) Get() *WafStatusRuleBlockReasonNeverDefined { - return v.value -} - -func (v *NullableWafStatusRuleBlockReasonNeverDefined) Set(val *WafStatusRuleBlockReasonNeverDefined) { - v.value = val - v.isSet = true -} - -func (v NullableWafStatusRuleBlockReasonNeverDefined) IsSet() bool { - return v.isSet -} - -func (v *NullableWafStatusRuleBlockReasonNeverDefined) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafStatusRuleBlockReasonNeverDefined(val *WafStatusRuleBlockReasonNeverDefined) *NullableWafStatusRuleBlockReasonNeverDefined { - return &NullableWafStatusRuleBlockReasonNeverDefined{value: val, isSet: true} -} - -func (v NullableWafStatusRuleBlockReasonNeverDefined) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafStatusRuleBlockReasonNeverDefined) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_type.go b/services/cdn/v1beta2api/model_waf_type.go deleted file mode 100644 index 2bb866767..000000000 --- a/services/cdn/v1beta2api/model_waf_type.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// WafType Enable or disable the Premium WAF. Do note that enabling the Premium WAF will cause additional fees. Some features are gated behind the Premium WAF, like additional, **premium-only rules** and the ability to create **custom rules** (not yet implemented) -type WafType string - -// List of WafType -const ( - WAFTYPE_FREE WafType = "FREE" - WAFTYPE_PREMIUM WafType = "PREMIUM" - WAFTYPE_UNKNOWN_DEFAULT_OPEN_API WafType = "unknown_default_open_api" -) - -// All allowed values of WafType enum -var AllowedWafTypeEnumValues = []WafType{ - "FREE", - "PREMIUM", - "unknown_default_open_api", -} - -func (v *WafType) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := WafType(value) - for _, existing := range AllowedWafTypeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = WAFTYPE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewWafTypeFromValue returns a pointer to a valid WafType -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewWafTypeFromValue(v string) (*WafType, error) { - ev := WafType(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for WafType: valid values are %v", v, AllowedWafTypeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v WafType) IsValid() bool { - for _, existing := range AllowedWafTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to WafType value -func (v WafType) Ptr() *WafType { - return &v -} - -type NullableWafType struct { - value *WafType - isSet bool -} - -func (v NullableWafType) Get() *WafType { - return v.value -} - -func (v *NullableWafType) Set(val *WafType) { - v.value = val - v.isSet = true -} - -func (v NullableWafType) IsSet() bool { - return v.isSet -} - -func (v *NullableWafType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafType(val *WafType) *NullableWafType { - return &NullableWafType{value: val, isSet: true} -} - -func (v NullableWafType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/model_waf_violation.go b/services/cdn/v1beta2api/model_waf_violation.go deleted file mode 100644 index ed2659b59..000000000 --- a/services/cdn/v1beta2api/model_waf_violation.go +++ /dev/null @@ -1,315 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the WAFViolation type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WAFViolation{} - -// WAFViolation Information about a violated WAF rule in case the WAF is enabled and a rule was triggered (either in BLOCK or LOG_ONLY mode) -type WAFViolation struct { - Action WAFRuleAction `json:"action"` - // ASN for the request - Asn string `json:"asn"` - // Rule specific message explaining the violation - Message string `json:"message"` - // HTTP Method of the request that triggered the violation - Method string `json:"method"` - RequestHeaders map[string]string `json:"requestHeaders"` - // ID of the WAF rule that was triggered - RuleId string `json:"ruleId"` - AdditionalProperties map[string]interface{} -} - -type _WAFViolation WAFViolation - -// NewWAFViolation instantiates a new WAFViolation 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 NewWAFViolation(action WAFRuleAction, asn string, message string, method string, requestHeaders map[string]string, ruleId string) *WAFViolation { - this := WAFViolation{} - this.Action = action - this.Asn = asn - this.Message = message - this.Method = method - this.RequestHeaders = requestHeaders - this.RuleId = ruleId - return &this -} - -// NewWAFViolationWithDefaults instantiates a new WAFViolation 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 NewWAFViolationWithDefaults() *WAFViolation { - this := WAFViolation{} - return &this -} - -// GetAction returns the Action field value -func (o *WAFViolation) GetAction() WAFRuleAction { - if o == nil { - var ret WAFRuleAction - return ret - } - - return o.Action -} - -// GetActionOk returns a tuple with the Action field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetActionOk() (*WAFRuleAction, bool) { - if o == nil { - return nil, false - } - return &o.Action, true -} - -// SetAction sets field value -func (o *WAFViolation) SetAction(v WAFRuleAction) { - o.Action = v -} - -// GetAsn returns the Asn field value -func (o *WAFViolation) GetAsn() string { - if o == nil { - var ret string - return ret - } - - return o.Asn -} - -// GetAsnOk returns a tuple with the Asn field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetAsnOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Asn, true -} - -// SetAsn sets field value -func (o *WAFViolation) SetAsn(v string) { - o.Asn = v -} - -// GetMessage returns the Message field value -func (o *WAFViolation) GetMessage() string { - if o == nil { - var ret string - return ret - } - - return o.Message -} - -// GetMessageOk returns a tuple with the Message field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Message, true -} - -// SetMessage sets field value -func (o *WAFViolation) SetMessage(v string) { - o.Message = v -} - -// GetMethod returns the Method field value -func (o *WAFViolation) GetMethod() string { - if o == nil { - var ret string - return ret - } - - return o.Method -} - -// GetMethodOk returns a tuple with the Method field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetMethodOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Method, true -} - -// SetMethod sets field value -func (o *WAFViolation) SetMethod(v string) { - o.Method = v -} - -// GetRequestHeaders returns the RequestHeaders field value -func (o *WAFViolation) GetRequestHeaders() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.RequestHeaders -} - -// GetRequestHeadersOk returns a tuple with the RequestHeaders field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetRequestHeadersOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.RequestHeaders, true -} - -// SetRequestHeaders sets field value -func (o *WAFViolation) SetRequestHeaders(v map[string]string) { - o.RequestHeaders = v -} - -// GetRuleId returns the RuleId field value -func (o *WAFViolation) GetRuleId() string { - if o == nil { - var ret string - return ret - } - - return o.RuleId -} - -// GetRuleIdOk returns a tuple with the RuleId field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetRuleIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RuleId, true -} - -// SetRuleId sets field value -func (o *WAFViolation) SetRuleId(v string) { - o.RuleId = v -} - -func (o WAFViolation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WAFViolation) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["action"] = o.Action - toSerialize["asn"] = o.Asn - toSerialize["message"] = o.Message - toSerialize["method"] = o.Method - toSerialize["requestHeaders"] = o.RequestHeaders - toSerialize["ruleId"] = o.RuleId - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WAFViolation) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "action", - "asn", - "message", - "method", - "requestHeaders", - "ruleId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWAFViolation := _WAFViolation{} - - err = json.Unmarshal(data, &varWAFViolation) - - if err != nil { - return err - } - - *o = WAFViolation(varWAFViolation) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "action") - delete(additionalProperties, "asn") - delete(additionalProperties, "message") - delete(additionalProperties, "method") - delete(additionalProperties, "requestHeaders") - delete(additionalProperties, "ruleId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWAFViolation struct { - value *WAFViolation - isSet bool -} - -func (v NullableWAFViolation) Get() *WAFViolation { - return v.value -} - -func (v *NullableWAFViolation) Set(val *WAFViolation) { - v.value = val - v.isSet = true -} - -func (v NullableWAFViolation) IsSet() bool { - return v.isSet -} - -func (v *NullableWAFViolation) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWAFViolation(val *WAFViolation) *NullableWAFViolation { - return &NullableWAFViolation{value: val, isSet: true} -} - -func (v NullableWAFViolation) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWAFViolation) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1beta2api/response.go b/services/cdn/v1beta2api/response.go deleted file mode 100644 index bf593789c..000000000 --- a/services/cdn/v1beta2api/response.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResponse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/services/cdn/v1beta2api/utils.go b/services/cdn/v1beta2api/utils.go deleted file mode 100644 index 3b5f84ed4..000000000 --- a/services/cdn/v1beta2api/utils.go +++ /dev/null @@ -1,361 +0,0 @@ -/* -STACKIT CDN API - -**DEPRECATED:** This API version (1beta2.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1beta2api - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "time" -) - -// PtrBool is a helper routine that returns a pointer to given boolean value. -func PtrBool(v bool) *bool { return &v } - -// PtrInt is a helper routine that returns a pointer to given integer value. -func PtrInt(v int) *int { return &v } - -// PtrInt32 is a helper routine that returns a pointer to given integer value. -func PtrInt32(v int32) *int32 { return &v } - -// PtrInt64 is a helper routine that returns a pointer to given integer value. -func PtrInt64(v int64) *int64 { return &v } - -// PtrFloat32 is a helper routine that returns a pointer to given float value. -func PtrFloat32(v float32) *float32 { return &v } - -// PtrFloat64 is a helper routine that returns a pointer to given float value. -func PtrFloat64(v float64) *float64 { return &v } - -// PtrString is a helper routine that returns a pointer to given string value. -func PtrString(v string) *string { return &v } - -// PtrTime is helper routine that returns a pointer to given Time value. -func PtrTime(v time.Time) *time.Time { return &v } - -type NullableBool struct { - value *bool - isSet bool -} - -func (v NullableBool) Get() *bool { - return v.value -} - -func (v *NullableBool) Set(val *bool) { - v.value = val - v.isSet = true -} - -func (v NullableBool) IsSet() bool { - return v.isSet -} - -func (v *NullableBool) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBool(val *bool) *NullableBool { - return &NullableBool{value: val, isSet: true} -} - -func (v NullableBool) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBool) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt struct { - value *int - isSet bool -} - -func (v NullableInt) Get() *int { - return v.value -} - -func (v *NullableInt) Set(val *int) { - v.value = val - v.isSet = true -} - -func (v NullableInt) IsSet() bool { - return v.isSet -} - -func (v *NullableInt) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt(val *int) *NullableInt { - return &NullableInt{value: val, isSet: true} -} - -func (v NullableInt) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt32 struct { - value *int32 - isSet bool -} - -func (v NullableInt32) Get() *int32 { - return v.value -} - -func (v *NullableInt32) Set(val *int32) { - v.value = val - v.isSet = true -} - -func (v NullableInt32) IsSet() bool { - return v.isSet -} - -func (v *NullableInt32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt32(val *int32) *NullableInt32 { - return &NullableInt32{value: val, isSet: true} -} - -func (v NullableInt32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt64 struct { - value *int64 - isSet bool -} - -func (v NullableInt64) Get() *int64 { - return v.value -} - -func (v *NullableInt64) Set(val *int64) { - v.value = val - v.isSet = true -} - -func (v NullableInt64) IsSet() bool { - return v.isSet -} - -func (v *NullableInt64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt64(val *int64) *NullableInt64 { - return &NullableInt64{value: val, isSet: true} -} - -func (v NullableInt64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat32 struct { - value *float32 - isSet bool -} - -func (v NullableFloat32) Get() *float32 { - return v.value -} - -func (v *NullableFloat32) Set(val *float32) { - v.value = val - v.isSet = true -} - -func (v NullableFloat32) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat32(val *float32) *NullableFloat32 { - return &NullableFloat32{value: val, isSet: true} -} - -func (v NullableFloat32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat64 struct { - value *float64 - isSet bool -} - -func (v NullableFloat64) Get() *float64 { - return v.value -} - -func (v *NullableFloat64) Set(val *float64) { - v.value = val - v.isSet = true -} - -func (v NullableFloat64) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat64(val *float64) *NullableFloat64 { - return &NullableFloat64{value: val, isSet: true} -} - -func (v NullableFloat64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableString struct { - value *string - isSet bool -} - -func (v NullableString) Get() *string { - return v.value -} - -func (v *NullableString) Set(val *string) { - v.value = val - v.isSet = true -} - -func (v NullableString) IsSet() bool { - return v.isSet -} - -func (v *NullableString) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableString(val *string) *NullableString { - return &NullableString{value: val, isSet: true} -} - -func (v NullableString) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableString) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableTime struct { - value *time.Time - isSet bool -} - -func (v NullableTime) Get() *time.Time { - return v.value -} - -func (v *NullableTime) Set(val *time.Time) { - v.value = val - v.isSet = true -} - -func (v NullableTime) IsSet() bool { - return v.isSet -} - -func (v *NullableTime) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTime(val *time.Time) *NullableTime { - return &NullableTime{value: val, isSet: true} -} - -func (v NullableTime) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTime) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// IsNil checks if an input is nil -func IsNil(i interface{}) bool { - if i == nil { - return true - } - switch reflect.TypeOf(i).Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: - return reflect.ValueOf(i).IsNil() - case reflect.Array: - return reflect.ValueOf(i).IsZero() - } - return false -} - -type MappedNullable interface { - ToMap() (map[string]interface{}, error) -} - -// A wrapper for strict JSON decoding -func newStrictDecoder(data []byte) *json.Decoder { - dec := json.NewDecoder(bytes.NewBuffer(data)) - dec.DisallowUnknownFields() - return dec -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} diff --git a/services/cdn/v1betaapi/api_default.go b/services/cdn/v1betaapi/api_default.go deleted file mode 100644 index 3a1396085..000000000 --- a/services/cdn/v1betaapi/api_default.go +++ /dev/null @@ -1,3192 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1betaapi - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" - "time" - - "github.com/stackitcloud/stackit-sdk-go/core/config" - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" -) - -type DefaultAPI interface { - - /* - CreateDistribution Create new distribution - - CreateDistribution will create a new CDN distribution - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @return ApiCreateDistributionRequest - - Deprecated - */ - CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest - - // CreateDistributionExecute executes the request - // @return CreateDistributionResponse - // Deprecated - CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) - - /* - DeleteCustomDomain Delete a custom domain - - Removes a custom domain - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @param domain - @return ApiDeleteCustomDomainRequest - - Deprecated - */ - DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest - - // DeleteCustomDomainExecute executes the request - // @return DeleteCustomDomainResponse - // Deprecated - DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) - - /* - DeleteDistribution Delete distribution - - DeleteDistribution accepts a project- and distribution-ID and will delete a distribution. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiDeleteDistributionRequest - - Deprecated - */ - DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest - - // DeleteDistributionExecute executes the request - // @return DeleteDistributionResponse - // Deprecated - DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) - - /* - FindCachePaths Return Paths that were purged - - This returns paths that are present in the cache purging history. - Only substrings of the provided input are returned. - The response is sorted in descending order by the most recent purge. - - So, assuming you have have the following purged for a distribution - - `/test/1` at `2025-01-01` - - `/test/2` at `2025-01-02` - - `/someOtherPath/1` at `2025-01-03` - - `/test/1` at `2025-01-04` - - `/test/3` at `2025-01-05`, - this would return the following paths, in the following order, assuming `/te` was the search parameter: - - `/test/3` - - `/test/1` - - `/test/2` - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiFindCachePathsRequest - - Deprecated - */ - FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest - - // FindCachePathsExecute executes the request - // @return FindCachePathsResponse - // Deprecated - FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) - - /* - GetCacheInfo Get Infos about the Caching State - - Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. - - If (and only if) you provide the path query parameter, the history will also contain granular cache purges. - The request will not fail if no data about a path is found. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiGetCacheInfoRequest - - Deprecated - */ - GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest - - // GetCacheInfoExecute executes the request - // @return GetCacheInfoResponse - // Deprecated - GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) - - /* - GetCustomDomain Retrieve a specific custom domain - - Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @param domain - @return ApiGetCustomDomainRequest - - Deprecated - */ - GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest - - // GetCustomDomainExecute executes the request - // @return GetCustomDomainResponse - // Deprecated - GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) - - /* - GetDistribution Get distribution by ID - - This returns a specific distribution by its ID. If no distribution with the given ID exists the endpoint returns 404. Trying to get a deleted distributions also return 404. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiGetDistributionRequest - - Deprecated - */ - GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest - - // GetDistributionExecute executes the request - // @return GetDistributionResponse - // Deprecated - GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) - - /* - GetLogs Retrieve distribution logs - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId Your CDN distribution ID - @return ApiGetLogsRequest - - Deprecated - */ - GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest - - // GetLogsExecute executes the request - // @return GetLogsResponse - // Deprecated - GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) - - /* - GetLogsSearchFilters Get relevant search filters for this distribution based on user input - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId Your CDN distribution ID - @return ApiGetLogsSearchFiltersRequest - - Deprecated - */ - GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest - - // GetLogsSearchFiltersExecute executes the request - // @return GetLogsSearchFiltersResponse - // Deprecated - GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) - - /* - GetStatistics Retrieve the statistics of a distribution - - Returns the statistics of the distribution in the given - time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. - In case no statistics for a time interval exist, no record is returned. - The time range for which statistics should be returned can be configured using query parameters. - - Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. - - **Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. - - The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. - Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiGetStatisticsRequest - - Deprecated - */ - GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest - - // GetStatisticsExecute executes the request - // @return GetStatisticsResponse - // Deprecated - GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) - - /* - ListDistributions List all distributions belonging to a specific project - - ListDistributions returns a list of all CDN distributions associated with - a given project, ordered by their distribution ID. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @return ApiListDistributionsRequest - - Deprecated - */ - ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest - - // ListDistributionsExecute executes the request - // @return ListDistributionsResponse - // Deprecated - ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) - - /* - ListWAFCollections List all WAF rule collections of the project - - Returns all WAF rule collections available to the project - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @return ApiListWAFCollectionsRequest - - Deprecated - */ - ListWAFCollections(ctx context.Context, projectId string) ApiListWAFCollectionsRequest - - // ListWAFCollectionsExecute executes the request - // @return ListWAFCollectionsResponse - // Deprecated - ListWAFCollectionsExecute(r ApiListWAFCollectionsRequest) (*ListWAFCollectionsResponse, error) - - /* - PatchDistribution Update existing distribution - - Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiPatchDistributionRequest - - Deprecated - */ - PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest - - // PatchDistributionExecute executes the request - // @return PatchDistributionResponse - // Deprecated - PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) - - /* - PurgeCache Clear distribution cache - - Clear the cache for this distribution. - All content, regardless of its staleness, will get refetched from the host. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiPurgeCacheRequest - - Deprecated - */ - PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest - - // PurgeCacheExecute executes the request - // @return map[string]interface{} - // Deprecated - PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) - - /* - PutCustomDomain Create or update a custom domain - - Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @param domain - @return ApiPutCustomDomainRequest - - Deprecated - */ - PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest - - // PutCustomDomainExecute executes the request - // @return PutCustomDomainResponse - // Deprecated - PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) -} - -// DefaultAPIService DefaultAPI service -type DefaultAPIService service - -type ApiCreateDistributionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - createDistributionPayload *CreateDistributionPayload -} - -func (r ApiCreateDistributionRequest) CreateDistributionPayload(createDistributionPayload CreateDistributionPayload) ApiCreateDistributionRequest { - r.createDistributionPayload = &createDistributionPayload - return r -} - -func (r ApiCreateDistributionRequest) Execute() (*CreateDistributionResponse, error) { - return r.ApiService.CreateDistributionExecute(r) -} - -/* -CreateDistribution Create new distribution - -CreateDistribution will create a new CDN distribution - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @return ApiCreateDistributionRequest - -Deprecated -*/ -func (a *DefaultAPIService) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { - return ApiCreateDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Execute executes the request -// -// @return CreateDistributionResponse -// -// Deprecated -func (a *DefaultAPIService) CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *CreateDistributionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDistribution") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.createDistributionPayload == nil { - return localVarReturnValue, reportError("createDistributionPayload is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createDistributionPayload - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiDeleteCustomDomainRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - domain string - intentId *string -} - -func (r ApiDeleteCustomDomainRequest) IntentId(intentId string) ApiDeleteCustomDomainRequest { - r.intentId = &intentId - return r -} - -func (r ApiDeleteCustomDomainRequest) Execute() (*DeleteCustomDomainResponse, error) { - return r.ApiService.DeleteCustomDomainExecute(r) -} - -/* -DeleteCustomDomain Delete a custom domain - -# Removes a custom domain - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @param domain - @return ApiDeleteCustomDomainRequest - -Deprecated -*/ -func (a *DefaultAPIService) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest { - return ApiDeleteCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Execute executes the request -// -// @return DeleteCustomDomainResponse -// -// Deprecated -func (a *DefaultAPIService) DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DeleteCustomDomainResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCustomDomain") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.domain) > 72 { - return localVarReturnValue, reportError("domain must have less than 72 elements") - } - - if r.intentId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiDeleteDistributionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - intentId *string -} - -// While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped. -func (r ApiDeleteDistributionRequest) IntentId(intentId string) ApiDeleteDistributionRequest { - r.intentId = &intentId - return r -} - -func (r ApiDeleteDistributionRequest) Execute() (*DeleteDistributionResponse, error) { - return r.ApiService.DeleteDistributionExecute(r) -} - -/* -DeleteDistribution Delete distribution - -DeleteDistribution accepts a project- and distribution-ID and will delete a distribution. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiDeleteDistributionRequest - -Deprecated -*/ -func (a *DefaultAPIService) DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest { - return ApiDeleteDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return DeleteDistributionResponse -// -// Deprecated -func (a *DefaultAPIService) DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DeleteDistributionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDistribution") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.intentId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiFindCachePathsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - path *string -} - -// A substring of the search query. -func (r ApiFindCachePathsRequest) Path(path string) ApiFindCachePathsRequest { - r.path = &path - return r -} - -func (r ApiFindCachePathsRequest) Execute() (*FindCachePathsResponse, error) { - return r.ApiService.FindCachePathsExecute(r) -} - -/* -FindCachePaths Return Paths that were purged - -This returns paths that are present in the cache purging history. -Only substrings of the provided input are returned. -The response is sorted in descending order by the most recent purge. - -So, assuming you have have the following purged for a distribution -- `/test/1` at `2025-01-01` -- `/test/2` at `2025-01-02` -- `/someOtherPath/1` at `2025-01-03` -- `/test/1` at `2025-01-04` -- `/test/3` at `2025-01-05`, -this would return the following paths, in the following order, assuming `/te` was the search parameter: -- `/test/3` -- `/test/1` -- `/test/2` - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiFindCachePathsRequest - -Deprecated -*/ -func (a *DefaultAPIService) FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest { - return ApiFindCachePathsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return FindCachePathsResponse -// -// Deprecated -func (a *DefaultAPIService) FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *FindCachePathsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.FindCachePaths") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/cache/paths" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.path == nil { - return localVarReturnValue, reportError("path is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "path", r.path, "form", "") - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetCacheInfoRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - purgePath *string -} - -func (r ApiGetCacheInfoRequest) PurgePath(purgePath string) ApiGetCacheInfoRequest { - r.purgePath = &purgePath - return r -} - -func (r ApiGetCacheInfoRequest) Execute() (*GetCacheInfoResponse, error) { - return r.ApiService.GetCacheInfoExecute(r) -} - -/* -GetCacheInfo Get Infos about the Caching State - -Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. - -If (and only if) you provide the path query parameter, the history will also contain granular cache purges. -The request will not fail if no data about a path is found. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiGetCacheInfoRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest { - return ApiGetCacheInfoRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return GetCacheInfoResponse -// -// Deprecated -func (a *DefaultAPIService) GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetCacheInfoResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCacheInfo") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/cache" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.purgePath != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "purgePath", r.purgePath, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetCustomDomainRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - domain string -} - -func (r ApiGetCustomDomainRequest) Execute() (*GetCustomDomainResponse, error) { - return r.ApiService.GetCustomDomainExecute(r) -} - -/* -GetCustomDomain Retrieve a specific custom domain - -# Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @param domain - @return ApiGetCustomDomainRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest { - return ApiGetCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Execute executes the request -// -// @return GetCustomDomainResponse -// -// Deprecated -func (a *DefaultAPIService) GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetCustomDomainResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCustomDomain") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.domain) > 72 { - return localVarReturnValue, reportError("domain must have less than 72 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetDistributionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - withWafStatus *bool -} - -// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. -func (r ApiGetDistributionRequest) WithWafStatus(withWafStatus bool) ApiGetDistributionRequest { - r.withWafStatus = &withWafStatus - return r -} - -func (r ApiGetDistributionRequest) Execute() (*GetDistributionResponse, error) { - return r.ApiService.GetDistributionExecute(r) -} - -/* -GetDistribution Get distribution by ID - -This returns a specific distribution by its ID. If no distribution with the given ID exists the endpoint returns 404. Trying to get a deleted distributions also return 404. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiGetDistributionRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest { - return ApiGetDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return GetDistributionResponse -// -// Deprecated -func (a *DefaultAPIService) GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetDistributionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDistribution") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.withWafStatus != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", r.withWafStatus, "form", "") - } else { - var defaultValue bool = false - parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", defaultValue, "form", "") - r.withWafStatus = &defaultValue - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetLogsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - from *time.Time - to *time.Time - wafAction *WAFRuleAction - pageSize *int32 - pageIdentifier *string - sortBy *GetLogsSortByParameter - sortOrder *GetLogsSortOrderParameter - dataCenterRegion *string - requestCountryCode *string - statusCode *int32 - cacheHit *bool -} - -// the start of the time range for which logs should be returned -func (r ApiGetLogsRequest) From(from time.Time) ApiGetLogsRequest { - r.from = &from - return r -} - -// the end of the time range for which logs should be returned. If not specified, \"now\" is used. -func (r ApiGetLogsRequest) To(to time.Time) ApiGetLogsRequest { - r.to = &to - return r -} - -// If this is set then only log entries with the chosen WAF rule action/outcome are returned. Specifically, if `ALLOWED` then all requests with no violation are returned. If `BLOCKED` then those where a WAF rule blocked a request and if `LOGGED` then only those requests where the WAF violation was only logged but the request not blocked -func (r ApiGetLogsRequest) WafAction(wafAction WAFRuleAction) ApiGetLogsRequest { - r.wafAction = &wafAction - return r -} - -// Quantifies how many log entries should be returned on this page. Must be a natural number between 1 and 1000 (inclusive) -func (r ApiGetLogsRequest) PageSize(pageSize int32) ApiGetLogsRequest { - r.pageSize = &pageSize - return r -} - -// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. -func (r ApiGetLogsRequest) PageIdentifier(pageIdentifier string) ApiGetLogsRequest { - r.pageIdentifier = &pageIdentifier - return r -} - -// Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host` -func (r ApiGetLogsRequest) SortBy(sortBy GetLogsSortByParameter) ApiGetLogsRequest { - r.sortBy = &sortBy - return r -} - -func (r ApiGetLogsRequest) SortOrder(sortOrder GetLogsSortOrderParameter) ApiGetLogsRequest { - r.sortOrder = &sortOrder - return r -} - -// Filters by the CDN data center region that served the request. Can be combined with other filters -func (r ApiGetLogsRequest) DataCenterRegion(dataCenterRegion string) ApiGetLogsRequest { - r.dataCenterRegion = &dataCenterRegion - return r -} - -// Filters by the originating country of the user request. Can be combined with other filters -func (r ApiGetLogsRequest) RequestCountryCode(requestCountryCode string) ApiGetLogsRequest { - r.requestCountryCode = &requestCountryCode - return r -} - -// Filters by the HTTP status code returned to the client. Can be combined with other filters -func (r ApiGetLogsRequest) StatusCode(statusCode int32) ApiGetLogsRequest { - r.statusCode = &statusCode - return r -} - -// Filters based on whether the request was served from the CDN cache. Can be combined with other filters -func (r ApiGetLogsRequest) CacheHit(cacheHit bool) ApiGetLogsRequest { - r.cacheHit = &cacheHit - return r -} - -func (r ApiGetLogsRequest) Execute() (*GetLogsResponse, error) { - return r.ApiService.GetLogsExecute(r) -} - -/* -GetLogs Retrieve distribution logs - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId Your CDN distribution ID - @return ApiGetLogsRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { - return ApiGetLogsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return GetLogsResponse -// -// Deprecated -func (a *DefaultAPIService) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetLogsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetLogs") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/logs" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.from != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") - } - if r.to != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") - } - if r.wafAction != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "wafAction", r.wafAction, "form", "") - } - if r.pageSize != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") - } else { - var defaultValue int32 = 20 - parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", defaultValue, "form", "") - r.pageSize = &defaultValue - } - if r.pageIdentifier != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "form", "") - } - if r.sortBy != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") - } else { - var defaultValue GetLogsSortByParameter = "timestamp" - parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") - r.sortBy = &defaultValue - } - if r.sortOrder != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") - } - if r.dataCenterRegion != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "dataCenterRegion", r.dataCenterRegion, "form", "") - } - if r.requestCountryCode != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "requestCountryCode", r.requestCountryCode, "form", "") - } - if r.statusCode != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "statusCode", r.statusCode, "form", "") - } - if r.cacheHit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "cacheHit", r.cacheHit, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetLogsSearchFiltersRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - filter *string -} - -// Required filter for search suggestions (e.g., status=4, requestCountry, cacheHit=tru, dataCenterRegion). The filter query cannot be empty. -func (r ApiGetLogsSearchFiltersRequest) Filter(filter string) ApiGetLogsSearchFiltersRequest { - r.filter = &filter - return r -} - -func (r ApiGetLogsSearchFiltersRequest) Execute() (*GetLogsSearchFiltersResponse, error) { - return r.ApiService.GetLogsSearchFiltersExecute(r) -} - -/* -GetLogsSearchFilters Get relevant search filters for this distribution based on user input - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId Your CDN distribution ID - @return ApiGetLogsSearchFiltersRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest { - return ApiGetLogsSearchFiltersRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return GetLogsSearchFiltersResponse -// -// Deprecated -func (a *DefaultAPIService) GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetLogsSearchFiltersResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetLogsSearchFilters") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/logs/searchFilters" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.filter == nil { - return localVarReturnValue, reportError("filter is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiGetStatisticsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - from *time.Time - to *time.Time - interval *GetStatisticsIntervalParameter -} - -// the start of the time range for which statistics should be returned -func (r ApiGetStatisticsRequest) From(from time.Time) ApiGetStatisticsRequest { - r.from = &from - return r -} - -// the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on. -func (r ApiGetStatisticsRequest) To(to time.Time) ApiGetStatisticsRequest { - r.to = &to - return r -} - -// Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z` -func (r ApiGetStatisticsRequest) Interval(interval GetStatisticsIntervalParameter) ApiGetStatisticsRequest { - r.interval = &interval - return r -} - -func (r ApiGetStatisticsRequest) Execute() (*GetStatisticsResponse, error) { - return r.ApiService.GetStatisticsExecute(r) -} - -/* -GetStatistics Retrieve the statistics of a distribution - -Returns the statistics of the distribution in the given -time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. -In case no statistics for a time interval exist, no record is returned. -The time range for which statistics should be returned can be configured using query parameters. - -Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. - -**Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. - -The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. -Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiGetStatisticsRequest - -Deprecated -*/ -func (a *DefaultAPIService) GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest { - return ApiGetStatisticsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return GetStatisticsResponse -// -// Deprecated -func (a *DefaultAPIService) GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetStatisticsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetStatistics") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/statistics" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.from == nil { - return localVarReturnValue, reportError("from is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") - if r.to != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") - } - if r.interval != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "interval", r.interval, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiListDistributionsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - pageSize *int32 - withWafStatus *bool - pageIdentifier *string - sortBy *ListDistributionsSortByParameter - sortOrder *ListDistributionsSortOrderParameter -} - -// Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) -func (r ApiListDistributionsRequest) PageSize(pageSize int32) ApiListDistributionsRequest { - r.pageSize = &pageSize - return r -} - -// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. -func (r ApiListDistributionsRequest) WithWafStatus(withWafStatus bool) ApiListDistributionsRequest { - r.withWafStatus = &withWafStatus - return r -} - -// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. -func (r ApiListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiListDistributionsRequest { - r.pageIdentifier = &pageIdentifier - return r -} - -// The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. -func (r ApiListDistributionsRequest) SortBy(sortBy ListDistributionsSortByParameter) ApiListDistributionsRequest { - r.sortBy = &sortBy - return r -} - -func (r ApiListDistributionsRequest) SortOrder(sortOrder ListDistributionsSortOrderParameter) ApiListDistributionsRequest { - r.sortOrder = &sortOrder - return r -} - -func (r ApiListDistributionsRequest) Execute() (*ListDistributionsResponse, error) { - return r.ApiService.ListDistributionsExecute(r) -} - -/* -ListDistributions List all distributions belonging to a specific project - -ListDistributions returns a list of all CDN distributions associated with -a given project, ordered by their distribution ID. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @return ApiListDistributionsRequest - -Deprecated -*/ -func (a *DefaultAPIService) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { - return ApiListDistributionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Execute executes the request -// -// @return ListDistributionsResponse -// -// Deprecated -func (a *DefaultAPIService) ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListDistributionsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDistributions") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.pageSize != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") - } else { - var defaultValue int32 = 20 - parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", defaultValue, "form", "") - r.pageSize = &defaultValue - } - if r.withWafStatus != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", r.withWafStatus, "form", "") - } else { - var defaultValue bool = false - parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", defaultValue, "form", "") - r.withWafStatus = &defaultValue - } - if r.pageIdentifier != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "form", "") - } - if r.sortBy != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") - } else { - var defaultValue ListDistributionsSortByParameter = "createdAt" - parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") - r.sortBy = &defaultValue - } - if r.sortOrder != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiListWAFCollectionsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string -} - -func (r ApiListWAFCollectionsRequest) Execute() (*ListWAFCollectionsResponse, error) { - return r.ApiService.ListWAFCollectionsExecute(r) -} - -/* -ListWAFCollections List all WAF rule collections of the project - -Returns all WAF rule collections available to the project - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @return ApiListWAFCollectionsRequest - -Deprecated -*/ -func (a *DefaultAPIService) ListWAFCollections(ctx context.Context, projectId string) ApiListWAFCollectionsRequest { - return ApiListWAFCollectionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Execute executes the request -// -// @return ListWAFCollectionsResponse -// -// Deprecated -func (a *DefaultAPIService) ListWAFCollectionsExecute(r ApiListWAFCollectionsRequest) (*ListWAFCollectionsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListWAFCollectionsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListWAFCollections") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/waf/collections" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiPatchDistributionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - patchDistributionPayload *PatchDistributionPayload -} - -func (r ApiPatchDistributionRequest) PatchDistributionPayload(patchDistributionPayload PatchDistributionPayload) ApiPatchDistributionRequest { - r.patchDistributionPayload = &patchDistributionPayload - return r -} - -func (r ApiPatchDistributionRequest) Execute() (*PatchDistributionResponse, error) { - return r.ApiService.PatchDistributionExecute(r) -} - -/* -PatchDistribution Update existing distribution - -Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiPatchDistributionRequest - -Deprecated -*/ -func (a *DefaultAPIService) PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest { - return ApiPatchDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return PatchDistributionResponse -// -// Deprecated -func (a *DefaultAPIService) PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PatchDistributionResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PatchDistribution") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.patchDistributionPayload - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiPurgeCacheRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - purgeCachePayload *PurgeCachePayload -} - -func (r ApiPurgeCacheRequest) PurgeCachePayload(purgeCachePayload PurgeCachePayload) ApiPurgeCacheRequest { - r.purgeCachePayload = &purgeCachePayload - return r -} - -func (r ApiPurgeCacheRequest) Execute() (map[string]interface{}, error) { - return r.ApiService.PurgeCacheExecute(r) -} - -/* -PurgeCache Clear distribution cache - -Clear the cache for this distribution. -All content, regardless of its staleness, will get refetched from the host. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @return ApiPurgeCacheRequest - -Deprecated -*/ -func (a *DefaultAPIService) PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest { - return ApiPurgeCacheRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Execute executes the request -// -// @return map[string]interface{} -// -// Deprecated -func (a *DefaultAPIService) PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue map[string]interface{} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PurgeCache") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/cache/purge" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.purgeCachePayload - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -type ApiPutCustomDomainRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - distributionId string - domain string - putCustomDomainPayload *PutCustomDomainPayload -} - -func (r ApiPutCustomDomainRequest) PutCustomDomainPayload(putCustomDomainPayload PutCustomDomainPayload) ApiPutCustomDomainRequest { - r.putCustomDomainPayload = &putCustomDomainPayload - return r -} - -func (r ApiPutCustomDomainRequest) Execute() (*PutCustomDomainResponse, error) { - return r.ApiService.PutCustomDomainExecute(r) -} - -/* -PutCustomDomain Create or update a custom domain - -Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Your STACKIT Project ID - @param distributionId - @param domain - @return ApiPutCustomDomainRequest - -Deprecated -*/ -func (a *DefaultAPIService) PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest { - return ApiPutCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Execute executes the request -// -// @return PutCustomDomainResponse -// -// Deprecated -func (a *DefaultAPIService) PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PutCustomDomainResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PutCustomDomain") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.domain) > 72 { - return localVarReturnValue, reportError("domain must have less than 72 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.putCustomDomainPayload - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - StatusCode: localVarHTTPResponse.StatusCode, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 422 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - var v GenericJSONResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} diff --git a/services/cdn/v1betaapi/api_default_mock.go b/services/cdn/v1betaapi/api_default_mock.go deleted file mode 100644 index 07f5c4482..000000000 --- a/services/cdn/v1betaapi/api_default_mock.go +++ /dev/null @@ -1,353 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "context" -) - -// assert the implementation matches the interface -var _ DefaultAPI = &DefaultAPIServiceMock{} - -// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. -// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. -type DefaultAPIServiceMock struct { - // Deprecated: CreateDistributionExecuteMock can be populated to implement the behavior of the CreateDistributionExecute function of this mock - CreateDistributionExecuteMock *func(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) - // Deprecated: DeleteCustomDomainExecuteMock can be populated to implement the behavior of the DeleteCustomDomainExecute function of this mock - DeleteCustomDomainExecuteMock *func(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) - // Deprecated: DeleteDistributionExecuteMock can be populated to implement the behavior of the DeleteDistributionExecute function of this mock - DeleteDistributionExecuteMock *func(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) - // Deprecated: FindCachePathsExecuteMock can be populated to implement the behavior of the FindCachePathsExecute function of this mock - FindCachePathsExecuteMock *func(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) - // Deprecated: GetCacheInfoExecuteMock can be populated to implement the behavior of the GetCacheInfoExecute function of this mock - GetCacheInfoExecuteMock *func(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) - // Deprecated: GetCustomDomainExecuteMock can be populated to implement the behavior of the GetCustomDomainExecute function of this mock - GetCustomDomainExecuteMock *func(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) - // Deprecated: GetDistributionExecuteMock can be populated to implement the behavior of the GetDistributionExecute function of this mock - GetDistributionExecuteMock *func(r ApiGetDistributionRequest) (*GetDistributionResponse, error) - // Deprecated: GetLogsExecuteMock can be populated to implement the behavior of the GetLogsExecute function of this mock - GetLogsExecuteMock *func(r ApiGetLogsRequest) (*GetLogsResponse, error) - // Deprecated: GetLogsSearchFiltersExecuteMock can be populated to implement the behavior of the GetLogsSearchFiltersExecute function of this mock - GetLogsSearchFiltersExecuteMock *func(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) - // Deprecated: GetStatisticsExecuteMock can be populated to implement the behavior of the GetStatisticsExecute function of this mock - GetStatisticsExecuteMock *func(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) - // Deprecated: ListDistributionsExecuteMock can be populated to implement the behavior of the ListDistributionsExecute function of this mock - ListDistributionsExecuteMock *func(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) - // Deprecated: ListWAFCollectionsExecuteMock can be populated to implement the behavior of the ListWAFCollectionsExecute function of this mock - ListWAFCollectionsExecuteMock *func(r ApiListWAFCollectionsRequest) (*ListWAFCollectionsResponse, error) - // Deprecated: PatchDistributionExecuteMock can be populated to implement the behavior of the PatchDistributionExecute function of this mock - PatchDistributionExecuteMock *func(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) - // Deprecated: PurgeCacheExecuteMock can be populated to implement the behavior of the PurgeCacheExecute function of this mock - PurgeCacheExecuteMock *func(r ApiPurgeCacheRequest) (map[string]interface{}, error) - // Deprecated: PutCustomDomainExecuteMock can be populated to implement the behavior of the PutCustomDomainExecute function of this mock - PutCustomDomainExecuteMock *func(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) -} - -// Deprecated -func (a DefaultAPIServiceMock) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { - return ApiCreateDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Deprecated: CreateDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateDistributionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) { - if a.CreateDistributionExecuteMock == nil { - var localVarReturnValue *CreateDistributionResponse - return localVarReturnValue, nil - } - - return (*a.CreateDistributionExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest { - return ApiDeleteCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Deprecated: DeleteCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) { - if a.DeleteCustomDomainExecuteMock == nil { - var localVarReturnValue *DeleteCustomDomainResponse - return localVarReturnValue, nil - } - - return (*a.DeleteCustomDomainExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest { - return ApiDeleteDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: DeleteDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteDistributionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) { - if a.DeleteDistributionExecuteMock == nil { - var localVarReturnValue *DeleteDistributionResponse - return localVarReturnValue, nil - } - - return (*a.DeleteDistributionExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest { - return ApiFindCachePathsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: FindCachePathsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the FindCachePathsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) { - if a.FindCachePathsExecuteMock == nil { - var localVarReturnValue *FindCachePathsResponse - return localVarReturnValue, nil - } - - return (*a.FindCachePathsExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest { - return ApiGetCacheInfoRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: GetCacheInfoExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCacheInfoExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) { - if a.GetCacheInfoExecuteMock == nil { - var localVarReturnValue *GetCacheInfoResponse - return localVarReturnValue, nil - } - - return (*a.GetCacheInfoExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest { - return ApiGetCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Deprecated: GetCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) { - if a.GetCustomDomainExecuteMock == nil { - var localVarReturnValue *GetCustomDomainResponse - return localVarReturnValue, nil - } - - return (*a.GetCustomDomainExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest { - return ApiGetDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: GetDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetDistributionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) { - if a.GetDistributionExecuteMock == nil { - var localVarReturnValue *GetDistributionResponse - return localVarReturnValue, nil - } - - return (*a.GetDistributionExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { - return ApiGetLogsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: GetLogsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetLogsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) { - if a.GetLogsExecuteMock == nil { - var localVarReturnValue *GetLogsResponse - return localVarReturnValue, nil - } - - return (*a.GetLogsExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest { - return ApiGetLogsSearchFiltersRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: GetLogsSearchFiltersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetLogsSearchFiltersExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) { - if a.GetLogsSearchFiltersExecuteMock == nil { - var localVarReturnValue *GetLogsSearchFiltersResponse - return localVarReturnValue, nil - } - - return (*a.GetLogsSearchFiltersExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest { - return ApiGetStatisticsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: GetStatisticsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetStatisticsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) { - if a.GetStatisticsExecuteMock == nil { - var localVarReturnValue *GetStatisticsResponse - return localVarReturnValue, nil - } - - return (*a.GetStatisticsExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { - return ApiListDistributionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Deprecated: ListDistributionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDistributionsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) { - if a.ListDistributionsExecuteMock == nil { - var localVarReturnValue *ListDistributionsResponse - return localVarReturnValue, nil - } - - return (*a.ListDistributionsExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) ListWAFCollections(ctx context.Context, projectId string) ApiListWAFCollectionsRequest { - return ApiListWAFCollectionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Deprecated: ListWAFCollectionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListWAFCollectionsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListWAFCollectionsExecute(r ApiListWAFCollectionsRequest) (*ListWAFCollectionsResponse, error) { - if a.ListWAFCollectionsExecuteMock == nil { - var localVarReturnValue *ListWAFCollectionsResponse - return localVarReturnValue, nil - } - - return (*a.ListWAFCollectionsExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest { - return ApiPatchDistributionRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: PatchDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PatchDistributionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) { - if a.PatchDistributionExecuteMock == nil { - var localVarReturnValue *PatchDistributionResponse - return localVarReturnValue, nil - } - - return (*a.PatchDistributionExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest { - return ApiPurgeCacheRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - } -} - -// Deprecated: PurgeCacheExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PurgeCacheExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) { - if a.PurgeCacheExecuteMock == nil { - var localVarReturnValue map[string]interface{} - return localVarReturnValue, nil - } - - return (*a.PurgeCacheExecuteMock)(r) -} - -// Deprecated -func (a DefaultAPIServiceMock) PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest { - return ApiPutCustomDomainRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - distributionId: distributionId, - domain: domain, - } -} - -// Deprecated: PutCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PutCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) { - if a.PutCustomDomainExecuteMock == nil { - var localVarReturnValue *PutCustomDomainResponse - return localVarReturnValue, nil - } - - return (*a.PutCustomDomainExecuteMock)(r) -} diff --git a/services/cdn/v1betaapi/client.go b/services/cdn/v1betaapi/client.go deleted file mode 100644 index f085cf47b..000000000 --- a/services/cdn/v1betaapi/client.go +++ /dev/null @@ -1,667 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1betaapi - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "github.com/stackitcloud/stackit-sdk-go/core/auth" - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -var ( - JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) - XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) - queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) - queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") -) - -// APIClient manages communication with the STACKIT CDN API (DEPRECATED) API v1beta.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *config.Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - DefaultAPI DefaultAPI -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { - cfg := NewConfiguration() - - for _, option := range opts { - err := option(cfg) - if err != nil { - return nil, fmt.Errorf("configuring the client: %w", err) - } - } - - err := config.ConfigureRegion(cfg) - if err != nil { - return nil, fmt.Errorf("configuring region: %w", err) - } - - if cfg.HTTPClient == nil { - cfg.HTTPClient = &http.Client{} - } - - authRoundTripper, err := auth.SetupAuth(cfg) - if err != nil { - return nil, fmt.Errorf("setting up authentication: %w", err) - } - - roundTripper := authRoundTripper - if cfg.Middleware != nil { - roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) - } - - cfg.HTTPClient.Transport = roundTripper - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.DefaultAPI = (*DefaultAPIService)(&c.common) - - return c, nil -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insensitive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.EqualFold(a, needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -func parameterValueToString(obj interface{}, key string) string { - if reflect.TypeOf(obj).Kind() != reflect.Ptr { - if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { - return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) - } - - return fmt.Sprintf("%v", obj) - } - var param, ok = obj.(MappedNullable) - if !ok { - return "" - } - dataMap, err := param.ToMap() - if err != nil { - return "" - } - return fmt.Sprintf("%v", dataMap[key]) -} - -// parameterAddToHeaderOrQuery adds the provided object to the request header or url query -// supporting deep object syntax -func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { - var v = reflect.ValueOf(obj) - var value = "" - if v == reflect.ValueOf(nil) { - value = "null" - } else { - switch v.Kind() { - case reflect.Invalid: - value = "invalid" - - case reflect.Struct: - if t, ok := obj.(MappedNullable); ok { - dataMap, err := t.ToMap() - if err != nil { - return - } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) - return - } - if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) - return - } - value = v.Type().String() + " value" - case reflect.Slice: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - var lenIndValue = indValue.Len() - for i := 0; i < lenIndValue; i++ { - var arrayValue = indValue.Index(i) - var keyPrefixForCollectionType = keyPrefix - if style == "deepObject" { - keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" - } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) - } - return - - case reflect.Map: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - iter := indValue.MapRange() - for iter.Next() { - k, v := iter.Key(), iter.Value() - parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) - } - return - - case reflect.Interface: - fallthrough - case reflect.Ptr: - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) - return - - case reflect.Int, reflect.Int8, reflect.Int16, - reflect.Int32, reflect.Int64: - value = strconv.FormatInt(v.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, - reflect.Uint32, reflect.Uint64, reflect.Uintptr: - value = strconv.FormatUint(v.Uint(), 10) - case reflect.Float32, reflect.Float64: - value = strconv.FormatFloat(v.Float(), 'g', -1, 32) - case reflect.Bool: - value = strconv.FormatBool(v.Bool()) - case reflect.String: - value = v.String() - default: - value = v.Type().String() + " value" - } - } - - switch valuesMap := headerOrQueryParams.(type) { - case url.Values: - if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { - valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) - } else { - valuesMap.Add(keyPrefix, value) - } - break - case map[string]string: - valuesMap[keyPrefix] = value - break - } -} - -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, err -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfig() *config.Configuration { - return c.cfg -} - -type formFile struct { - fileBytes []byte - fileName string - formFileName string -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFiles []formFile) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - for _, formFile := range formFiles { - if len(formFile.fileBytes) > 0 && formFile.fileName != "" { - w.Boundary() - part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(formFile.fileBytes) - if err != nil { - return nil, err - } - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } - - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { - pieces := strings.Split(s, "=") - pieces[0] = queryDescape.Replace(pieces[0]) - return strings.Join(pieces, "=") - }) - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers[h] = []string{v} - } - localVarRequest.Header = headers - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - return localVarRequest, nil -} - -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if r, ok := v.(*io.Reader); ok { - *r = bytes.NewReader(b) - return nil - } - // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. - if p, ok := v.(*[]byte); ok { - *p = b - return nil - } - if f, ok := v.(*os.File); ok { - f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = f.Write(b) - if err != nil { - return - } - _, err = f.Seek(0, io.SeekStart) - return - } - if f, ok := v.(**os.File); ok { - *f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - if err != nil { - return - } - _, err = (*f).Seek(0, io.SeekStart) - return - } - if XmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if JsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err != nil { - return err - } - } else { - return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return errors.New("undefined response type") -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(filepath.Clean(path)) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if fp, ok := body.(*os.File); ok { - _, err = bodyBuf.ReadFrom(fp) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if JsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if XmlCheck.MatchString(contentType) { - var bs []byte - bs, err = xml.Marshal(body) - if err == nil { - bodyBuf.Write(bs) - } - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} - -// format error message using title and detail when model implements rfc7807 -func formatErrorMessage(status string, v interface{}) string { - str := "" - metaValue := reflect.ValueOf(v).Elem() - - if metaValue.Kind() == reflect.Struct { - field := metaValue.FieldByName("Title") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s", field.Interface()) - } - - field = metaValue.FieldByName("Detail") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s (%s)", str, field.Interface()) - } - } - - return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) -} diff --git a/services/cdn/v1betaapi/configuration.go b/services/cdn/v1betaapi/configuration.go deleted file mode 100644 index 6380749f3..000000000 --- a/services/cdn/v1betaapi/configuration.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1betaapi - -import ( - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -// NewConfiguration returns a new Configuration object -func NewConfiguration() *config.Configuration { - cfg := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "stackit-sdk-go/cdn", - Debug: false, - Servers: config.ServerConfigurations{ - { - URL: "https://cdn.api.stackit.cloud", - Description: "No description provided", - Variables: map[string]config.ServerVariable{ - "region": { - Description: "No description provided", - DefaultValue: "global", - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - return cfg -} diff --git a/services/cdn/v1betaapi/model_config.go b/services/cdn/v1betaapi/model_config.go deleted file mode 100644 index c1d3db92e..000000000 --- a/services/cdn/v1betaapi/model_config.go +++ /dev/null @@ -1,456 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the Config type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Config{} - -// Config struct for Config -type Config struct { - Backend ConfigBackend `json:"backend"` - // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. - BlockedCountries []string `json:"blockedCountries"` - // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIPs []string `json:"blockedIPs"` - // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) - DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` - LogSink *ConfigLogSink `json:"logSink,omitempty"` - // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. - MonthlyLimitBytes NullableInt64 `json:"monthlyLimitBytes,omitempty"` - Optimizer *Optimizer `json:"optimizer,omitempty"` - Regions []Region `json:"regions"` - Waf WafConfig `json:"waf"` - AdditionalProperties map[string]interface{} -} - -type _Config Config - -// NewConfig instantiates a new Config 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 NewConfig(backend ConfigBackend, blockedCountries []string, blockedIPs []string, regions []Region, waf WafConfig) *Config { - this := Config{} - this.Backend = backend - this.BlockedCountries = blockedCountries - this.BlockedIPs = blockedIPs - this.Regions = regions - this.Waf = waf - return &this -} - -// NewConfigWithDefaults instantiates a new Config 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 NewConfigWithDefaults() *Config { - this := Config{} - return &this -} - -// GetBackend returns the Backend field value -func (o *Config) GetBackend() ConfigBackend { - if o == nil { - var ret ConfigBackend - return ret - } - - return o.Backend -} - -// GetBackendOk returns a tuple with the Backend field value -// and a boolean to check if the value has been set. -func (o *Config) GetBackendOk() (*ConfigBackend, bool) { - if o == nil { - return nil, false - } - return &o.Backend, true -} - -// SetBackend sets field value -func (o *Config) SetBackend(v ConfigBackend) { - o.Backend = v -} - -// GetBlockedCountries returns the BlockedCountries field value -func (o *Config) GetBlockedCountries() []string { - if o == nil { - var ret []string - return ret - } - - return o.BlockedCountries -} - -// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value -// and a boolean to check if the value has been set. -func (o *Config) GetBlockedCountriesOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.BlockedCountries, true -} - -// SetBlockedCountries sets field value -func (o *Config) SetBlockedCountries(v []string) { - o.BlockedCountries = v -} - -// GetBlockedIPs returns the BlockedIPs field value -func (o *Config) GetBlockedIPs() []string { - if o == nil { - var ret []string - return ret - } - - return o.BlockedIPs -} - -// GetBlockedIPsOk returns a tuple with the BlockedIPs field value -// and a boolean to check if the value has been set. -func (o *Config) GetBlockedIPsOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.BlockedIPs, true -} - -// SetBlockedIPs sets field value -func (o *Config) SetBlockedIPs(v []string) { - o.BlockedIPs = v -} - -// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Config) GetDefaultCacheDuration() string { - if o == nil || IsNil(o.DefaultCacheDuration.Get()) { - var ret string - return ret - } - return *o.DefaultCacheDuration.Get() -} - -// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 *Config) GetDefaultCacheDurationOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DefaultCacheDuration.Get(), o.DefaultCacheDuration.IsSet() -} - -// HasDefaultCacheDuration returns a boolean if a field has been set. -func (o *Config) HasDefaultCacheDuration() bool { - if o != nil && o.DefaultCacheDuration.IsSet() { - return true - } - - return false -} - -// SetDefaultCacheDuration gets a reference to the given NullableString and assigns it to the DefaultCacheDuration field. -func (o *Config) SetDefaultCacheDuration(v string) { - o.DefaultCacheDuration.Set(&v) -} - -// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil -func (o *Config) SetDefaultCacheDurationNil() { - o.DefaultCacheDuration.Set(nil) -} - -// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil -func (o *Config) UnsetDefaultCacheDuration() { - o.DefaultCacheDuration.Unset() -} - -// GetLogSink returns the LogSink field value if set, zero value otherwise. -func (o *Config) GetLogSink() ConfigLogSink { - if o == nil || IsNil(o.LogSink) { - var ret ConfigLogSink - return ret - } - return *o.LogSink -} - -// GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Config) GetLogSinkOk() (*ConfigLogSink, bool) { - if o == nil || IsNil(o.LogSink) { - return nil, false - } - return o.LogSink, true -} - -// HasLogSink returns a boolean if a field has been set. -func (o *Config) HasLogSink() bool { - if o != nil && !IsNil(o.LogSink) { - return true - } - - return false -} - -// SetLogSink gets a reference to the given ConfigLogSink and assigns it to the LogSink field. -func (o *Config) SetLogSink(v ConfigLogSink) { - o.LogSink = &v -} - -// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Config) GetMonthlyLimitBytes() int64 { - if o == nil || IsNil(o.MonthlyLimitBytes.Get()) { - var ret int64 - return ret - } - return *o.MonthlyLimitBytes.Get() -} - -// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 *Config) GetMonthlyLimitBytesOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.MonthlyLimitBytes.Get(), o.MonthlyLimitBytes.IsSet() -} - -// HasMonthlyLimitBytes returns a boolean if a field has been set. -func (o *Config) HasMonthlyLimitBytes() bool { - if o != nil && o.MonthlyLimitBytes.IsSet() { - return true - } - - return false -} - -// SetMonthlyLimitBytes gets a reference to the given NullableInt64 and assigns it to the MonthlyLimitBytes field. -func (o *Config) SetMonthlyLimitBytes(v int64) { - o.MonthlyLimitBytes.Set(&v) -} - -// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil -func (o *Config) SetMonthlyLimitBytesNil() { - o.MonthlyLimitBytes.Set(nil) -} - -// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil -func (o *Config) UnsetMonthlyLimitBytes() { - o.MonthlyLimitBytes.Unset() -} - -// GetOptimizer returns the Optimizer field value if set, zero value otherwise. -func (o *Config) GetOptimizer() Optimizer { - if o == nil || IsNil(o.Optimizer) { - var ret Optimizer - return ret - } - return *o.Optimizer -} - -// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Config) GetOptimizerOk() (*Optimizer, bool) { - if o == nil || IsNil(o.Optimizer) { - return nil, false - } - return o.Optimizer, true -} - -// HasOptimizer returns a boolean if a field has been set. -func (o *Config) HasOptimizer() bool { - if o != nil && !IsNil(o.Optimizer) { - return true - } - - return false -} - -// SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. -func (o *Config) SetOptimizer(v Optimizer) { - o.Optimizer = &v -} - -// GetRegions returns the Regions field value -func (o *Config) GetRegions() []Region { - if o == nil { - var ret []Region - return ret - } - - return o.Regions -} - -// GetRegionsOk returns a tuple with the Regions field value -// and a boolean to check if the value has been set. -func (o *Config) GetRegionsOk() ([]Region, bool) { - if o == nil { - return nil, false - } - return o.Regions, true -} - -// SetRegions sets field value -func (o *Config) SetRegions(v []Region) { - o.Regions = v -} - -// GetWaf returns the Waf field value -func (o *Config) GetWaf() WafConfig { - if o == nil { - var ret WafConfig - return ret - } - - return o.Waf -} - -// GetWafOk returns a tuple with the Waf field value -// and a boolean to check if the value has been set. -func (o *Config) GetWafOk() (*WafConfig, bool) { - if o == nil { - return nil, false - } - return &o.Waf, true -} - -// SetWaf sets field value -func (o *Config) SetWaf(v WafConfig) { - o.Waf = v -} - -func (o Config) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Config) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["backend"] = o.Backend - toSerialize["blockedCountries"] = o.BlockedCountries - toSerialize["blockedIPs"] = o.BlockedIPs - if o.DefaultCacheDuration.IsSet() { - toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() - } - if !IsNil(o.LogSink) { - toSerialize["logSink"] = o.LogSink - } - if o.MonthlyLimitBytes.IsSet() { - toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes.Get() - } - if !IsNil(o.Optimizer) { - toSerialize["optimizer"] = o.Optimizer - } - toSerialize["regions"] = o.Regions - toSerialize["waf"] = o.Waf - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Config) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "backend", - "blockedCountries", - "blockedIPs", - "regions", - "waf", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varConfig := _Config{} - - err = json.Unmarshal(data, &varConfig) - - if err != nil { - return err - } - - *o = Config(varConfig) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "backend") - delete(additionalProperties, "blockedCountries") - delete(additionalProperties, "blockedIPs") - delete(additionalProperties, "defaultCacheDuration") - delete(additionalProperties, "logSink") - delete(additionalProperties, "monthlyLimitBytes") - delete(additionalProperties, "optimizer") - delete(additionalProperties, "regions") - delete(additionalProperties, "waf") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableConfig struct { - value *Config - isSet bool -} - -func (v NullableConfig) Get() *Config { - return v.value -} - -func (v *NullableConfig) Set(val *Config) { - v.value = val - v.isSet = true -} - -func (v NullableConfig) IsSet() bool { - return v.isSet -} - -func (v *NullableConfig) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfig(val *Config) *NullableConfig { - return &NullableConfig{value: val, isSet: true} -} - -func (v NullableConfig) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfig) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_config_backend.go b/services/cdn/v1betaapi/model_config_backend.go deleted file mode 100644 index 2858e8335..000000000 --- a/services/cdn/v1betaapi/model_config_backend.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// ConfigBackend - struct for ConfigBackend -type ConfigBackend struct { - HttpBackend *HttpBackend -} - -// HttpBackendAsConfigBackend is a convenience function that returns HttpBackend wrapped in ConfigBackend -func HttpBackendAsConfigBackend(v *HttpBackend) ConfigBackend { - return ConfigBackend{ - HttpBackend: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ConfigBackend) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'http' - if jsonDict["type"] == "http" { - // try to unmarshal JSON data into HttpBackend - err = json.Unmarshal(data, &dst.HttpBackend) - if err == nil { - return nil // data stored in dst.HttpBackend, return on the first match - } else { - dst.HttpBackend = nil - return fmt.Errorf("failed to unmarshal ConfigBackend as HttpBackend: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ConfigBackend) MarshalJSON() ([]byte, error) { - if src.HttpBackend != nil { - return json.Marshal(&src.HttpBackend) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ConfigBackend) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.HttpBackend != nil { - return obj.HttpBackend - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ConfigBackend) GetActualInstanceValue() interface{} { - if obj.HttpBackend != nil { - return *obj.HttpBackend - } - - // all schemas are nil - return nil -} - -type NullableConfigBackend struct { - value *ConfigBackend - isSet bool -} - -func (v NullableConfigBackend) Get() *ConfigBackend { - return v.value -} - -func (v *NullableConfigBackend) Set(val *ConfigBackend) { - v.value = val - v.isSet = true -} - -func (v NullableConfigBackend) IsSet() bool { - return v.isSet -} - -func (v *NullableConfigBackend) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfigBackend(val *ConfigBackend) *NullableConfigBackend { - return &NullableConfigBackend{value: val, isSet: true} -} - -func (v NullableConfigBackend) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfigBackend) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_config_log_sink.go b/services/cdn/v1betaapi/model_config_log_sink.go deleted file mode 100644 index 8f5f6114a..000000000 --- a/services/cdn/v1betaapi/model_config_log_sink.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// ConfigLogSink - struct for ConfigLogSink -type ConfigLogSink struct { - LokiLogSink *LokiLogSink -} - -// LokiLogSinkAsConfigLogSink is a convenience function that returns LokiLogSink wrapped in ConfigLogSink -func LokiLogSinkAsConfigLogSink(v *LokiLogSink) ConfigLogSink { - return ConfigLogSink{ - LokiLogSink: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ConfigLogSink) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'loki' - if jsonDict["type"] == "loki" { - // try to unmarshal JSON data into LokiLogSink - err = json.Unmarshal(data, &dst.LokiLogSink) - if err == nil { - return nil // data stored in dst.LokiLogSink, return on the first match - } else { - dst.LokiLogSink = nil - return fmt.Errorf("failed to unmarshal ConfigLogSink as LokiLogSink: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ConfigLogSink) MarshalJSON() ([]byte, error) { - if src.LokiLogSink != nil { - return json.Marshal(&src.LokiLogSink) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ConfigLogSink) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.LokiLogSink != nil { - return obj.LokiLogSink - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ConfigLogSink) GetActualInstanceValue() interface{} { - if obj.LokiLogSink != nil { - return *obj.LokiLogSink - } - - // all schemas are nil - return nil -} - -type NullableConfigLogSink struct { - value *ConfigLogSink - isSet bool -} - -func (v NullableConfigLogSink) Get() *ConfigLogSink { - return v.value -} - -func (v *NullableConfigLogSink) Set(val *ConfigLogSink) { - v.value = val - v.isSet = true -} - -func (v NullableConfigLogSink) IsSet() bool { - return v.isSet -} - -func (v *NullableConfigLogSink) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfigLogSink(val *ConfigLogSink) *NullableConfigLogSink { - return &NullableConfigLogSink{value: val, isSet: true} -} - -func (v NullableConfigLogSink) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfigLogSink) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_config_patch.go b/services/cdn/v1betaapi/model_config_patch.go deleted file mode 100644 index 9a5d8eb40..000000000 --- a/services/cdn/v1betaapi/model_config_patch.go +++ /dev/null @@ -1,486 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" -) - -// checks if the ConfigPatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ConfigPatch{} - -// ConfigPatch struct for ConfigPatch -type ConfigPatch struct { - Backend *ConfigPatchBackend `json:"backend,omitempty"` - // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. - BlockedCountries []string `json:"blockedCountries,omitempty"` - // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIPs []string `json:"blockedIPs,omitempty"` - // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) - DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` - LogSink NullableConfigPatchLogSink `json:"logSink,omitempty"` - // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. - MonthlyLimitBytes NullableInt64 `json:"monthlyLimitBytes,omitempty"` - Optimizer *OptimizerPatch `json:"optimizer,omitempty"` - Regions []Region `json:"regions,omitempty"` - Waf *WafConfigPatch `json:"waf,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ConfigPatch ConfigPatch - -// NewConfigPatch instantiates a new ConfigPatch 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 NewConfigPatch() *ConfigPatch { - this := ConfigPatch{} - return &this -} - -// NewConfigPatchWithDefaults instantiates a new ConfigPatch 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 NewConfigPatchWithDefaults() *ConfigPatch { - this := ConfigPatch{} - return &this -} - -// GetBackend returns the Backend field value if set, zero value otherwise. -func (o *ConfigPatch) GetBackend() ConfigPatchBackend { - if o == nil || IsNil(o.Backend) { - var ret ConfigPatchBackend - return ret - } - return *o.Backend -} - -// GetBackendOk returns a tuple with the Backend field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetBackendOk() (*ConfigPatchBackend, bool) { - if o == nil || IsNil(o.Backend) { - return nil, false - } - return o.Backend, true -} - -// HasBackend returns a boolean if a field has been set. -func (o *ConfigPatch) HasBackend() bool { - if o != nil && !IsNil(o.Backend) { - return true - } - - return false -} - -// SetBackend gets a reference to the given ConfigPatchBackend and assigns it to the Backend field. -func (o *ConfigPatch) SetBackend(v ConfigPatchBackend) { - o.Backend = &v -} - -// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. -func (o *ConfigPatch) GetBlockedCountries() []string { - if o == nil || IsNil(o.BlockedCountries) { - var ret []string - return ret - } - return o.BlockedCountries -} - -// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetBlockedCountriesOk() ([]string, bool) { - if o == nil || IsNil(o.BlockedCountries) { - return nil, false - } - return o.BlockedCountries, true -} - -// HasBlockedCountries returns a boolean if a field has been set. -func (o *ConfigPatch) HasBlockedCountries() bool { - if o != nil && !IsNil(o.BlockedCountries) { - return true - } - - return false -} - -// SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. -func (o *ConfigPatch) SetBlockedCountries(v []string) { - o.BlockedCountries = v -} - -// GetBlockedIPs returns the BlockedIPs field value if set, zero value otherwise. -func (o *ConfigPatch) GetBlockedIPs() []string { - if o == nil || IsNil(o.BlockedIPs) { - var ret []string - return ret - } - return o.BlockedIPs -} - -// GetBlockedIPsOk returns a tuple with the BlockedIPs field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetBlockedIPsOk() ([]string, bool) { - if o == nil || IsNil(o.BlockedIPs) { - return nil, false - } - return o.BlockedIPs, true -} - -// HasBlockedIPs returns a boolean if a field has been set. -func (o *ConfigPatch) HasBlockedIPs() bool { - if o != nil && !IsNil(o.BlockedIPs) { - return true - } - - return false -} - -// SetBlockedIPs gets a reference to the given []string and assigns it to the BlockedIPs field. -func (o *ConfigPatch) SetBlockedIPs(v []string) { - o.BlockedIPs = v -} - -// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ConfigPatch) GetDefaultCacheDuration() string { - if o == nil || IsNil(o.DefaultCacheDuration.Get()) { - var ret string - return ret - } - return *o.DefaultCacheDuration.Get() -} - -// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 *ConfigPatch) GetDefaultCacheDurationOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DefaultCacheDuration.Get(), o.DefaultCacheDuration.IsSet() -} - -// HasDefaultCacheDuration returns a boolean if a field has been set. -func (o *ConfigPatch) HasDefaultCacheDuration() bool { - if o != nil && o.DefaultCacheDuration.IsSet() { - return true - } - - return false -} - -// SetDefaultCacheDuration gets a reference to the given NullableString and assigns it to the DefaultCacheDuration field. -func (o *ConfigPatch) SetDefaultCacheDuration(v string) { - o.DefaultCacheDuration.Set(&v) -} - -// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil -func (o *ConfigPatch) SetDefaultCacheDurationNil() { - o.DefaultCacheDuration.Set(nil) -} - -// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil -func (o *ConfigPatch) UnsetDefaultCacheDuration() { - o.DefaultCacheDuration.Unset() -} - -// GetLogSink returns the LogSink field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ConfigPatch) GetLogSink() ConfigPatchLogSink { - if o == nil || IsNil(o.LogSink.Get()) { - var ret ConfigPatchLogSink - return ret - } - return *o.LogSink.Get() -} - -// GetLogSinkOk returns a tuple with the LogSink 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 *ConfigPatch) GetLogSinkOk() (*ConfigPatchLogSink, bool) { - if o == nil { - return nil, false - } - return o.LogSink.Get(), o.LogSink.IsSet() -} - -// HasLogSink returns a boolean if a field has been set. -func (o *ConfigPatch) HasLogSink() bool { - if o != nil && o.LogSink.IsSet() { - return true - } - - return false -} - -// SetLogSink gets a reference to the given NullableConfigPatchLogSink and assigns it to the LogSink field. -func (o *ConfigPatch) SetLogSink(v ConfigPatchLogSink) { - o.LogSink.Set(&v) -} - -// SetLogSinkNil sets the value for LogSink to be an explicit nil -func (o *ConfigPatch) SetLogSinkNil() { - o.LogSink.Set(nil) -} - -// UnsetLogSink ensures that no value is present for LogSink, not even an explicit nil -func (o *ConfigPatch) UnsetLogSink() { - o.LogSink.Unset() -} - -// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ConfigPatch) GetMonthlyLimitBytes() int64 { - if o == nil || IsNil(o.MonthlyLimitBytes.Get()) { - var ret int64 - return ret - } - return *o.MonthlyLimitBytes.Get() -} - -// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 *ConfigPatch) GetMonthlyLimitBytesOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.MonthlyLimitBytes.Get(), o.MonthlyLimitBytes.IsSet() -} - -// HasMonthlyLimitBytes returns a boolean if a field has been set. -func (o *ConfigPatch) HasMonthlyLimitBytes() bool { - if o != nil && o.MonthlyLimitBytes.IsSet() { - return true - } - - return false -} - -// SetMonthlyLimitBytes gets a reference to the given NullableInt64 and assigns it to the MonthlyLimitBytes field. -func (o *ConfigPatch) SetMonthlyLimitBytes(v int64) { - o.MonthlyLimitBytes.Set(&v) -} - -// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil -func (o *ConfigPatch) SetMonthlyLimitBytesNil() { - o.MonthlyLimitBytes.Set(nil) -} - -// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil -func (o *ConfigPatch) UnsetMonthlyLimitBytes() { - o.MonthlyLimitBytes.Unset() -} - -// GetOptimizer returns the Optimizer field value if set, zero value otherwise. -func (o *ConfigPatch) GetOptimizer() OptimizerPatch { - if o == nil || IsNil(o.Optimizer) { - var ret OptimizerPatch - return ret - } - return *o.Optimizer -} - -// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetOptimizerOk() (*OptimizerPatch, bool) { - if o == nil || IsNil(o.Optimizer) { - return nil, false - } - return o.Optimizer, true -} - -// HasOptimizer returns a boolean if a field has been set. -func (o *ConfigPatch) HasOptimizer() bool { - if o != nil && !IsNil(o.Optimizer) { - return true - } - - return false -} - -// SetOptimizer gets a reference to the given OptimizerPatch and assigns it to the Optimizer field. -func (o *ConfigPatch) SetOptimizer(v OptimizerPatch) { - o.Optimizer = &v -} - -// GetRegions returns the Regions field value if set, zero value otherwise. -func (o *ConfigPatch) GetRegions() []Region { - if o == nil || IsNil(o.Regions) { - var ret []Region - return ret - } - return o.Regions -} - -// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetRegionsOk() ([]Region, bool) { - if o == nil || IsNil(o.Regions) { - return nil, false - } - return o.Regions, true -} - -// HasRegions returns a boolean if a field has been set. -func (o *ConfigPatch) HasRegions() bool { - if o != nil && !IsNil(o.Regions) { - return true - } - - return false -} - -// SetRegions gets a reference to the given []Region and assigns it to the Regions field. -func (o *ConfigPatch) SetRegions(v []Region) { - o.Regions = v -} - -// GetWaf returns the Waf field value if set, zero value otherwise. -func (o *ConfigPatch) GetWaf() WafConfigPatch { - if o == nil || IsNil(o.Waf) { - var ret WafConfigPatch - return ret - } - return *o.Waf -} - -// GetWafOk returns a tuple with the Waf field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConfigPatch) GetWafOk() (*WafConfigPatch, bool) { - if o == nil || IsNil(o.Waf) { - return nil, false - } - return o.Waf, true -} - -// HasWaf returns a boolean if a field has been set. -func (o *ConfigPatch) HasWaf() bool { - if o != nil && !IsNil(o.Waf) { - return true - } - - return false -} - -// SetWaf gets a reference to the given WafConfigPatch and assigns it to the Waf field. -func (o *ConfigPatch) SetWaf(v WafConfigPatch) { - o.Waf = &v -} - -func (o ConfigPatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ConfigPatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Backend) { - toSerialize["backend"] = o.Backend - } - if !IsNil(o.BlockedCountries) { - toSerialize["blockedCountries"] = o.BlockedCountries - } - if !IsNil(o.BlockedIPs) { - toSerialize["blockedIPs"] = o.BlockedIPs - } - if o.DefaultCacheDuration.IsSet() { - toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() - } - if o.LogSink.IsSet() { - toSerialize["logSink"] = o.LogSink.Get() - } - if o.MonthlyLimitBytes.IsSet() { - toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes.Get() - } - if !IsNil(o.Optimizer) { - toSerialize["optimizer"] = o.Optimizer - } - if !IsNil(o.Regions) { - toSerialize["regions"] = o.Regions - } - if !IsNil(o.Waf) { - toSerialize["waf"] = o.Waf - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ConfigPatch) UnmarshalJSON(data []byte) (err error) { - varConfigPatch := _ConfigPatch{} - - err = json.Unmarshal(data, &varConfigPatch) - - if err != nil { - return err - } - - *o = ConfigPatch(varConfigPatch) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "backend") - delete(additionalProperties, "blockedCountries") - delete(additionalProperties, "blockedIPs") - delete(additionalProperties, "defaultCacheDuration") - delete(additionalProperties, "logSink") - delete(additionalProperties, "monthlyLimitBytes") - delete(additionalProperties, "optimizer") - delete(additionalProperties, "regions") - delete(additionalProperties, "waf") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableConfigPatch struct { - value *ConfigPatch - isSet bool -} - -func (v NullableConfigPatch) Get() *ConfigPatch { - return v.value -} - -func (v *NullableConfigPatch) Set(val *ConfigPatch) { - v.value = val - v.isSet = true -} - -func (v NullableConfigPatch) IsSet() bool { - return v.isSet -} - -func (v *NullableConfigPatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfigPatch(val *ConfigPatch) *NullableConfigPatch { - return &NullableConfigPatch{value: val, isSet: true} -} - -func (v NullableConfigPatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfigPatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_config_patch_backend.go b/services/cdn/v1betaapi/model_config_patch_backend.go deleted file mode 100644 index 6edcdaf87..000000000 --- a/services/cdn/v1betaapi/model_config_patch_backend.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// ConfigPatchBackend - struct for ConfigPatchBackend -type ConfigPatchBackend struct { - HttpBackendPatch *HttpBackendPatch -} - -// HttpBackendPatchAsConfigPatchBackend is a convenience function that returns HttpBackendPatch wrapped in ConfigPatchBackend -func HttpBackendPatchAsConfigPatchBackend(v *HttpBackendPatch) ConfigPatchBackend { - return ConfigPatchBackend{ - HttpBackendPatch: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ConfigPatchBackend) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'http' - if jsonDict["type"] == "http" { - // try to unmarshal JSON data into HttpBackendPatch - err = json.Unmarshal(data, &dst.HttpBackendPatch) - if err == nil { - return nil // data stored in dst.HttpBackendPatch, return on the first match - } else { - dst.HttpBackendPatch = nil - return fmt.Errorf("failed to unmarshal ConfigPatchBackend as HttpBackendPatch: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ConfigPatchBackend) MarshalJSON() ([]byte, error) { - if src.HttpBackendPatch != nil { - return json.Marshal(&src.HttpBackendPatch) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ConfigPatchBackend) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.HttpBackendPatch != nil { - return obj.HttpBackendPatch - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ConfigPatchBackend) GetActualInstanceValue() interface{} { - if obj.HttpBackendPatch != nil { - return *obj.HttpBackendPatch - } - - // all schemas are nil - return nil -} - -type NullableConfigPatchBackend struct { - value *ConfigPatchBackend - isSet bool -} - -func (v NullableConfigPatchBackend) Get() *ConfigPatchBackend { - return v.value -} - -func (v *NullableConfigPatchBackend) Set(val *ConfigPatchBackend) { - v.value = val - v.isSet = true -} - -func (v NullableConfigPatchBackend) IsSet() bool { - return v.isSet -} - -func (v *NullableConfigPatchBackend) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfigPatchBackend(val *ConfigPatchBackend) *NullableConfigPatchBackend { - return &NullableConfigPatchBackend{value: val, isSet: true} -} - -func (v NullableConfigPatchBackend) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfigPatchBackend) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_config_patch_log_sink.go b/services/cdn/v1betaapi/model_config_patch_log_sink.go deleted file mode 100644 index f07ecac2e..000000000 --- a/services/cdn/v1betaapi/model_config_patch_log_sink.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// ConfigPatchLogSink - struct for ConfigPatchLogSink -type ConfigPatchLogSink struct { - PatchLokiLogSink *PatchLokiLogSink -} - -// PatchLokiLogSinkAsConfigPatchLogSink is a convenience function that returns PatchLokiLogSink wrapped in ConfigPatchLogSink -func PatchLokiLogSinkAsConfigPatchLogSink(v *PatchLokiLogSink) ConfigPatchLogSink { - return ConfigPatchLogSink{ - PatchLokiLogSink: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *ConfigPatchLogSink) UnmarshalJSON(data []byte) error { - var err error - // this object is nullable so check if the payload is null or empty string - if string(data) == "" || string(data) == "{}" { - return nil - } - - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'loki' - if jsonDict["type"] == "loki" { - // try to unmarshal JSON data into PatchLokiLogSink - err = json.Unmarshal(data, &dst.PatchLokiLogSink) - if err == nil { - return nil // data stored in dst.PatchLokiLogSink, return on the first match - } else { - dst.PatchLokiLogSink = nil - return fmt.Errorf("failed to unmarshal ConfigPatchLogSink as PatchLokiLogSink: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src ConfigPatchLogSink) MarshalJSON() ([]byte, error) { - if src.PatchLokiLogSink != nil { - return json.Marshal(&src.PatchLokiLogSink) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *ConfigPatchLogSink) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.PatchLokiLogSink != nil { - return obj.PatchLokiLogSink - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj ConfigPatchLogSink) GetActualInstanceValue() interface{} { - if obj.PatchLokiLogSink != nil { - return *obj.PatchLokiLogSink - } - - // all schemas are nil - return nil -} - -type NullableConfigPatchLogSink struct { - value *ConfigPatchLogSink - isSet bool -} - -func (v NullableConfigPatchLogSink) Get() *ConfigPatchLogSink { - return v.value -} - -func (v *NullableConfigPatchLogSink) Set(val *ConfigPatchLogSink) { - v.value = val - v.isSet = true -} - -func (v NullableConfigPatchLogSink) IsSet() bool { - return v.isSet -} - -func (v *NullableConfigPatchLogSink) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConfigPatchLogSink(val *ConfigPatchLogSink) *NullableConfigPatchLogSink { - return &NullableConfigPatchLogSink{value: val, isSet: true} -} - -func (v NullableConfigPatchLogSink) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConfigPatchLogSink) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_create_distribution_payload.go b/services/cdn/v1betaapi/model_create_distribution_payload.go deleted file mode 100644 index 4cf96f3bf..000000000 --- a/services/cdn/v1betaapi/model_create_distribution_payload.go +++ /dev/null @@ -1,574 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateDistributionPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateDistributionPayload{} - -// CreateDistributionPayload struct for CreateDistributionPayload -type CreateDistributionPayload struct { - // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. - BlockedCountries []string `json:"blockedCountries,omitempty"` - // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. - BlockedIPs []string `json:"blockedIPs,omitempty"` - // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) - DefaultCacheDuration *string `json:"defaultCacheDuration,omitempty"` - // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You can not have a country be assigned to multiple alternative origins. - Geofencing *map[string][]string `json:"geofencing,omitempty"` - // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple POST-Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. - IntentId *string `json:"intentId,omitempty"` - LogSink *CreateDistributionPayloadLogSink `json:"logSink,omitempty"` - // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. - MonthlyLimitBytes *int64 `json:"monthlyLimitBytes,omitempty"` - Optimizer *Optimizer `json:"optimizer,omitempty"` - // Headers that will be sent with every request to the configured origin. WARNING: Do not store sensitive values in the headers. The data is stores as plain text. - OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` - // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` - OriginUrl string `json:"originUrl"` - // Define in which regions you would like your content to be cached. - Regions []Region `json:"regions"` - Waf *WafConfig `json:"waf,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _CreateDistributionPayload CreateDistributionPayload - -// NewCreateDistributionPayload instantiates a new CreateDistributionPayload 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 NewCreateDistributionPayload(originUrl string, regions []Region) *CreateDistributionPayload { - this := CreateDistributionPayload{} - this.OriginUrl = originUrl - this.Regions = regions - return &this -} - -// NewCreateDistributionPayloadWithDefaults instantiates a new CreateDistributionPayload 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 NewCreateDistributionPayloadWithDefaults() *CreateDistributionPayload { - this := CreateDistributionPayload{} - return &this -} - -// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetBlockedCountries() []string { - if o == nil || IsNil(o.BlockedCountries) { - var ret []string - return ret - } - return o.BlockedCountries -} - -// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetBlockedCountriesOk() ([]string, bool) { - if o == nil || IsNil(o.BlockedCountries) { - return nil, false - } - return o.BlockedCountries, true -} - -// HasBlockedCountries returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasBlockedCountries() bool { - if o != nil && !IsNil(o.BlockedCountries) { - return true - } - - return false -} - -// SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. -func (o *CreateDistributionPayload) SetBlockedCountries(v []string) { - o.BlockedCountries = v -} - -// GetBlockedIPs returns the BlockedIPs field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetBlockedIPs() []string { - if o == nil || IsNil(o.BlockedIPs) { - var ret []string - return ret - } - return o.BlockedIPs -} - -// GetBlockedIPsOk returns a tuple with the BlockedIPs field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetBlockedIPsOk() ([]string, bool) { - if o == nil || IsNil(o.BlockedIPs) { - return nil, false - } - return o.BlockedIPs, true -} - -// HasBlockedIPs returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasBlockedIPs() bool { - if o != nil && !IsNil(o.BlockedIPs) { - return true - } - - return false -} - -// SetBlockedIPs gets a reference to the given []string and assigns it to the BlockedIPs field. -func (o *CreateDistributionPayload) SetBlockedIPs(v []string) { - o.BlockedIPs = v -} - -// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetDefaultCacheDuration() string { - if o == nil || IsNil(o.DefaultCacheDuration) { - var ret string - return ret - } - return *o.DefaultCacheDuration -} - -// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetDefaultCacheDurationOk() (*string, bool) { - if o == nil || IsNil(o.DefaultCacheDuration) { - return nil, false - } - return o.DefaultCacheDuration, true -} - -// HasDefaultCacheDuration returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasDefaultCacheDuration() bool { - if o != nil && !IsNil(o.DefaultCacheDuration) { - return true - } - - return false -} - -// SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. -func (o *CreateDistributionPayload) SetDefaultCacheDuration(v string) { - o.DefaultCacheDuration = &v -} - -// GetGeofencing returns the Geofencing field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetGeofencing() map[string][]string { - if o == nil || IsNil(o.Geofencing) { - var ret map[string][]string - return ret - } - return *o.Geofencing -} - -// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetGeofencingOk() (*map[string][]string, bool) { - if o == nil || IsNil(o.Geofencing) { - return nil, false - } - return o.Geofencing, true -} - -// HasGeofencing returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasGeofencing() bool { - if o != nil && !IsNil(o.Geofencing) { - return true - } - - return false -} - -// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. -func (o *CreateDistributionPayload) SetGeofencing(v map[string][]string) { - o.Geofencing = &v -} - -// GetIntentId returns the IntentId field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetIntentId() string { - if o == nil || IsNil(o.IntentId) { - var ret string - return ret - } - return *o.IntentId -} - -// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetIntentIdOk() (*string, bool) { - if o == nil || IsNil(o.IntentId) { - return nil, false - } - return o.IntentId, true -} - -// HasIntentId returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasIntentId() bool { - if o != nil && !IsNil(o.IntentId) { - return true - } - - return false -} - -// SetIntentId gets a reference to the given string and assigns it to the IntentId field. -func (o *CreateDistributionPayload) SetIntentId(v string) { - o.IntentId = &v -} - -// GetLogSink returns the LogSink field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetLogSink() CreateDistributionPayloadLogSink { - if o == nil || IsNil(o.LogSink) { - var ret CreateDistributionPayloadLogSink - return ret - } - return *o.LogSink -} - -// GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetLogSinkOk() (*CreateDistributionPayloadLogSink, bool) { - if o == nil || IsNil(o.LogSink) { - return nil, false - } - return o.LogSink, true -} - -// HasLogSink returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasLogSink() bool { - if o != nil && !IsNil(o.LogSink) { - return true - } - - return false -} - -// SetLogSink gets a reference to the given CreateDistributionPayloadLogSink and assigns it to the LogSink field. -func (o *CreateDistributionPayload) SetLogSink(v CreateDistributionPayloadLogSink) { - o.LogSink = &v -} - -// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetMonthlyLimitBytes() int64 { - if o == nil || IsNil(o.MonthlyLimitBytes) { - var ret int64 - return ret - } - return *o.MonthlyLimitBytes -} - -// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetMonthlyLimitBytesOk() (*int64, bool) { - if o == nil || IsNil(o.MonthlyLimitBytes) { - return nil, false - } - return o.MonthlyLimitBytes, true -} - -// HasMonthlyLimitBytes returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasMonthlyLimitBytes() bool { - if o != nil && !IsNil(o.MonthlyLimitBytes) { - return true - } - - return false -} - -// SetMonthlyLimitBytes gets a reference to the given int64 and assigns it to the MonthlyLimitBytes field. -func (o *CreateDistributionPayload) SetMonthlyLimitBytes(v int64) { - o.MonthlyLimitBytes = &v -} - -// GetOptimizer returns the Optimizer field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetOptimizer() Optimizer { - if o == nil || IsNil(o.Optimizer) { - var ret Optimizer - return ret - } - return *o.Optimizer -} - -// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetOptimizerOk() (*Optimizer, bool) { - if o == nil || IsNil(o.Optimizer) { - return nil, false - } - return o.Optimizer, true -} - -// HasOptimizer returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasOptimizer() bool { - if o != nil && !IsNil(o.Optimizer) { - return true - } - - return false -} - -// SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. -func (o *CreateDistributionPayload) SetOptimizer(v Optimizer) { - o.Optimizer = &v -} - -// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetOriginRequestHeaders() map[string]string { - if o == nil || IsNil(o.OriginRequestHeaders) { - var ret map[string]string - return ret - } - return *o.OriginRequestHeaders -} - -// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetOriginRequestHeadersOk() (*map[string]string, bool) { - if o == nil || IsNil(o.OriginRequestHeaders) { - return nil, false - } - return o.OriginRequestHeaders, true -} - -// HasOriginRequestHeaders returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasOriginRequestHeaders() bool { - if o != nil && !IsNil(o.OriginRequestHeaders) { - return true - } - - return false -} - -// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. -func (o *CreateDistributionPayload) SetOriginRequestHeaders(v map[string]string) { - o.OriginRequestHeaders = &v -} - -// GetOriginUrl returns the OriginUrl field value -func (o *CreateDistributionPayload) GetOriginUrl() string { - if o == nil { - var ret string - return ret - } - - return o.OriginUrl -} - -// GetOriginUrlOk returns a tuple with the OriginUrl field value -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetOriginUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.OriginUrl, true -} - -// SetOriginUrl sets field value -func (o *CreateDistributionPayload) SetOriginUrl(v string) { - o.OriginUrl = v -} - -// GetRegions returns the Regions field value -func (o *CreateDistributionPayload) GetRegions() []Region { - if o == nil { - var ret []Region - return ret - } - - return o.Regions -} - -// GetRegionsOk returns a tuple with the Regions field value -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetRegionsOk() ([]Region, bool) { - if o == nil { - return nil, false - } - return o.Regions, true -} - -// SetRegions sets field value -func (o *CreateDistributionPayload) SetRegions(v []Region) { - o.Regions = v -} - -// GetWaf returns the Waf field value if set, zero value otherwise. -func (o *CreateDistributionPayload) GetWaf() WafConfig { - if o == nil || IsNil(o.Waf) { - var ret WafConfig - return ret - } - return *o.Waf -} - -// GetWafOk returns a tuple with the Waf field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDistributionPayload) GetWafOk() (*WafConfig, bool) { - if o == nil || IsNil(o.Waf) { - return nil, false - } - return o.Waf, true -} - -// HasWaf returns a boolean if a field has been set. -func (o *CreateDistributionPayload) HasWaf() bool { - if o != nil && !IsNil(o.Waf) { - return true - } - - return false -} - -// SetWaf gets a reference to the given WafConfig and assigns it to the Waf field. -func (o *CreateDistributionPayload) SetWaf(v WafConfig) { - o.Waf = &v -} - -func (o CreateDistributionPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.BlockedCountries) { - toSerialize["blockedCountries"] = o.BlockedCountries - } - if !IsNil(o.BlockedIPs) { - toSerialize["blockedIPs"] = o.BlockedIPs - } - if !IsNil(o.DefaultCacheDuration) { - toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration - } - if !IsNil(o.Geofencing) { - toSerialize["geofencing"] = o.Geofencing - } - if !IsNil(o.IntentId) { - toSerialize["intentId"] = o.IntentId - } - if !IsNil(o.LogSink) { - toSerialize["logSink"] = o.LogSink - } - if !IsNil(o.MonthlyLimitBytes) { - toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes - } - if !IsNil(o.Optimizer) { - toSerialize["optimizer"] = o.Optimizer - } - if !IsNil(o.OriginRequestHeaders) { - toSerialize["originRequestHeaders"] = o.OriginRequestHeaders - } - toSerialize["originUrl"] = o.OriginUrl - toSerialize["regions"] = o.Regions - if !IsNil(o.Waf) { - toSerialize["waf"] = o.Waf - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateDistributionPayload) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "originUrl", - "regions", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateDistributionPayload := _CreateDistributionPayload{} - - err = json.Unmarshal(data, &varCreateDistributionPayload) - - if err != nil { - return err - } - - *o = CreateDistributionPayload(varCreateDistributionPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "blockedCountries") - delete(additionalProperties, "blockedIPs") - delete(additionalProperties, "defaultCacheDuration") - delete(additionalProperties, "geofencing") - delete(additionalProperties, "intentId") - delete(additionalProperties, "logSink") - delete(additionalProperties, "monthlyLimitBytes") - delete(additionalProperties, "optimizer") - delete(additionalProperties, "originRequestHeaders") - delete(additionalProperties, "originUrl") - delete(additionalProperties, "regions") - delete(additionalProperties, "waf") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateDistributionPayload struct { - value *CreateDistributionPayload - isSet bool -} - -func (v NullableCreateDistributionPayload) Get() *CreateDistributionPayload { - return v.value -} - -func (v *NullableCreateDistributionPayload) Set(val *CreateDistributionPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateDistributionPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateDistributionPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateDistributionPayload(val *CreateDistributionPayload) *NullableCreateDistributionPayload { - return &NullableCreateDistributionPayload{value: val, isSet: true} -} - -func (v NullableCreateDistributionPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateDistributionPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_create_distribution_payload_log_sink.go b/services/cdn/v1betaapi/model_create_distribution_payload_log_sink.go deleted file mode 100644 index 26507387e..000000000 --- a/services/cdn/v1betaapi/model_create_distribution_payload_log_sink.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// CreateDistributionPayloadLogSink - struct for CreateDistributionPayloadLogSink -type CreateDistributionPayloadLogSink struct { - PatchLokiLogSink *PatchLokiLogSink -} - -// PatchLokiLogSinkAsCreateDistributionPayloadLogSink is a convenience function that returns PatchLokiLogSink wrapped in CreateDistributionPayloadLogSink -func PatchLokiLogSinkAsCreateDistributionPayloadLogSink(v *PatchLokiLogSink) CreateDistributionPayloadLogSink { - return CreateDistributionPayloadLogSink{ - PatchLokiLogSink: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *CreateDistributionPayloadLogSink) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'loki' - if jsonDict["type"] == "loki" { - // try to unmarshal JSON data into PatchLokiLogSink - err = json.Unmarshal(data, &dst.PatchLokiLogSink) - if err == nil { - return nil // data stored in dst.PatchLokiLogSink, return on the first match - } else { - dst.PatchLokiLogSink = nil - return fmt.Errorf("failed to unmarshal CreateDistributionPayloadLogSink as PatchLokiLogSink: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src CreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) { - if src.PatchLokiLogSink != nil { - return json.Marshal(&src.PatchLokiLogSink) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *CreateDistributionPayloadLogSink) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.PatchLokiLogSink != nil { - return obj.PatchLokiLogSink - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj CreateDistributionPayloadLogSink) GetActualInstanceValue() interface{} { - if obj.PatchLokiLogSink != nil { - return *obj.PatchLokiLogSink - } - - // all schemas are nil - return nil -} - -type NullableCreateDistributionPayloadLogSink struct { - value *CreateDistributionPayloadLogSink - isSet bool -} - -func (v NullableCreateDistributionPayloadLogSink) Get() *CreateDistributionPayloadLogSink { - return v.value -} - -func (v *NullableCreateDistributionPayloadLogSink) Set(val *CreateDistributionPayloadLogSink) { - v.value = val - v.isSet = true -} - -func (v NullableCreateDistributionPayloadLogSink) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateDistributionPayloadLogSink) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateDistributionPayloadLogSink(val *CreateDistributionPayloadLogSink) *NullableCreateDistributionPayloadLogSink { - return &NullableCreateDistributionPayloadLogSink{value: val, isSet: true} -} - -func (v NullableCreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateDistributionPayloadLogSink) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_create_distribution_response.go b/services/cdn/v1betaapi/model_create_distribution_response.go deleted file mode 100644 index 91e1ac84d..000000000 --- a/services/cdn/v1betaapi/model_create_distribution_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the CreateDistributionResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateDistributionResponse{} - -// CreateDistributionResponse struct for CreateDistributionResponse -type CreateDistributionResponse struct { - Distribution Distribution `json:"distribution"` - AdditionalProperties map[string]interface{} -} - -type _CreateDistributionResponse CreateDistributionResponse - -// NewCreateDistributionResponse instantiates a new CreateDistributionResponse 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 NewCreateDistributionResponse(distribution Distribution) *CreateDistributionResponse { - this := CreateDistributionResponse{} - this.Distribution = distribution - return &this -} - -// NewCreateDistributionResponseWithDefaults instantiates a new CreateDistributionResponse 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 NewCreateDistributionResponseWithDefaults() *CreateDistributionResponse { - this := CreateDistributionResponse{} - return &this -} - -// GetDistribution returns the Distribution field value -func (o *CreateDistributionResponse) GetDistribution() Distribution { - if o == nil { - var ret Distribution - return ret - } - - return o.Distribution -} - -// GetDistributionOk returns a tuple with the Distribution field value -// and a boolean to check if the value has been set. -func (o *CreateDistributionResponse) GetDistributionOk() (*Distribution, bool) { - if o == nil { - return nil, false - } - return &o.Distribution, true -} - -// SetDistribution sets field value -func (o *CreateDistributionResponse) SetDistribution(v Distribution) { - o.Distribution = v -} - -func (o CreateDistributionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateDistributionResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["distribution"] = o.Distribution - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateDistributionResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "distribution", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateDistributionResponse := _CreateDistributionResponse{} - - err = json.Unmarshal(data, &varCreateDistributionResponse) - - if err != nil { - return err - } - - *o = CreateDistributionResponse(varCreateDistributionResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "distribution") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCreateDistributionResponse struct { - value *CreateDistributionResponse - isSet bool -} - -func (v NullableCreateDistributionResponse) Get() *CreateDistributionResponse { - return v.value -} - -func (v *NullableCreateDistributionResponse) Set(val *CreateDistributionResponse) { - v.value = val - v.isSet = true -} - -func (v NullableCreateDistributionResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateDistributionResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateDistributionResponse(val *CreateDistributionResponse) *NullableCreateDistributionResponse { - return &NullableCreateDistributionResponse{value: val, isSet: true} -} - -func (v NullableCreateDistributionResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateDistributionResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_custom_domain.go b/services/cdn/v1betaapi/model_custom_domain.go deleted file mode 100644 index a28a52da9..000000000 --- a/services/cdn/v1betaapi/model_custom_domain.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the CustomDomain type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CustomDomain{} - -// CustomDomain Definition of a custom domain -type CustomDomain struct { - // This object is present if the custom domain has errors. - Errors []StatusError `json:"errors,omitempty"` - // The domain. Can be used as input for the GetCustomDomain endpoint - Name string `json:"name"` - Status DomainStatus `json:"status"` - AdditionalProperties map[string]interface{} -} - -type _CustomDomain CustomDomain - -// NewCustomDomain instantiates a new CustomDomain 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 NewCustomDomain(name string, status DomainStatus) *CustomDomain { - this := CustomDomain{} - this.Name = name - this.Status = status - return &this -} - -// NewCustomDomainWithDefaults instantiates a new CustomDomain 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 NewCustomDomainWithDefaults() *CustomDomain { - this := CustomDomain{} - return &this -} - -// GetErrors returns the Errors field value if set, zero value otherwise. -func (o *CustomDomain) GetErrors() []StatusError { - if o == nil || IsNil(o.Errors) { - var ret []StatusError - return ret - } - return o.Errors -} - -// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CustomDomain) GetErrorsOk() ([]StatusError, bool) { - if o == nil || IsNil(o.Errors) { - return nil, false - } - return o.Errors, true -} - -// HasErrors returns a boolean if a field has been set. -func (o *CustomDomain) HasErrors() bool { - if o != nil && !IsNil(o.Errors) { - return true - } - - return false -} - -// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. -func (o *CustomDomain) SetErrors(v []StatusError) { - o.Errors = v -} - -// GetName returns the Name field value -func (o *CustomDomain) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *CustomDomain) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *CustomDomain) SetName(v string) { - o.Name = v -} - -// GetStatus returns the Status field value -func (o *CustomDomain) GetStatus() DomainStatus { - if o == nil { - var ret DomainStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *CustomDomain) GetStatusOk() (*DomainStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *CustomDomain) SetStatus(v DomainStatus) { - o.Status = v -} - -func (o CustomDomain) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CustomDomain) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Errors) { - toSerialize["errors"] = o.Errors - } - toSerialize["name"] = o.Name - toSerialize["status"] = o.Status - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CustomDomain) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - "status", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCustomDomain := _CustomDomain{} - - err = json.Unmarshal(data, &varCustomDomain) - - if err != nil { - return err - } - - *o = CustomDomain(varCustomDomain) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "errors") - delete(additionalProperties, "name") - delete(additionalProperties, "status") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCustomDomain struct { - value *CustomDomain - isSet bool -} - -func (v NullableCustomDomain) Get() *CustomDomain { - return v.value -} - -func (v *NullableCustomDomain) Set(val *CustomDomain) { - v.value = val - v.isSet = true -} - -func (v NullableCustomDomain) IsSet() bool { - return v.isSet -} - -func (v *NullableCustomDomain) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCustomDomain(val *CustomDomain) *NullableCustomDomain { - return &NullableCustomDomain{value: val, isSet: true} -} - -func (v NullableCustomDomain) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCustomDomain) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_delete_custom_domain_response.go b/services/cdn/v1betaapi/model_delete_custom_domain_response.go deleted file mode 100644 index 67f50b154..000000000 --- a/services/cdn/v1betaapi/model_delete_custom_domain_response.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" -) - -// checks if the DeleteCustomDomainResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DeleteCustomDomainResponse{} - -// DeleteCustomDomainResponse Returns the custom domain that was deleted while the deletion has not completed yet. After the deletion was successful the response will be empty. -type DeleteCustomDomainResponse struct { - CustomDomain *CustomDomain `json:"customDomain,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _DeleteCustomDomainResponse DeleteCustomDomainResponse - -// NewDeleteCustomDomainResponse instantiates a new DeleteCustomDomainResponse 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 NewDeleteCustomDomainResponse() *DeleteCustomDomainResponse { - this := DeleteCustomDomainResponse{} - return &this -} - -// NewDeleteCustomDomainResponseWithDefaults instantiates a new DeleteCustomDomainResponse 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 NewDeleteCustomDomainResponseWithDefaults() *DeleteCustomDomainResponse { - this := DeleteCustomDomainResponse{} - return &this -} - -// GetCustomDomain returns the CustomDomain field value if set, zero value otherwise. -func (o *DeleteCustomDomainResponse) GetCustomDomain() CustomDomain { - if o == nil || IsNil(o.CustomDomain) { - var ret CustomDomain - return ret - } - return *o.CustomDomain -} - -// GetCustomDomainOk returns a tuple with the CustomDomain field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeleteCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { - if o == nil || IsNil(o.CustomDomain) { - return nil, false - } - return o.CustomDomain, true -} - -// HasCustomDomain returns a boolean if a field has been set. -func (o *DeleteCustomDomainResponse) HasCustomDomain() bool { - if o != nil && !IsNil(o.CustomDomain) { - return true - } - - return false -} - -// SetCustomDomain gets a reference to the given CustomDomain and assigns it to the CustomDomain field. -func (o *DeleteCustomDomainResponse) SetCustomDomain(v CustomDomain) { - o.CustomDomain = &v -} - -func (o DeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DeleteCustomDomainResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.CustomDomain) { - toSerialize["customDomain"] = o.CustomDomain - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DeleteCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { - varDeleteCustomDomainResponse := _DeleteCustomDomainResponse{} - - err = json.Unmarshal(data, &varDeleteCustomDomainResponse) - - if err != nil { - return err - } - - *o = DeleteCustomDomainResponse(varDeleteCustomDomainResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "customDomain") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDeleteCustomDomainResponse struct { - value *DeleteCustomDomainResponse - isSet bool -} - -func (v NullableDeleteCustomDomainResponse) Get() *DeleteCustomDomainResponse { - return v.value -} - -func (v *NullableDeleteCustomDomainResponse) Set(val *DeleteCustomDomainResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDeleteCustomDomainResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDeleteCustomDomainResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeleteCustomDomainResponse(val *DeleteCustomDomainResponse) *NullableDeleteCustomDomainResponse { - return &NullableDeleteCustomDomainResponse{value: val, isSet: true} -} - -func (v NullableDeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeleteCustomDomainResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_delete_distribution_response.go b/services/cdn/v1betaapi/model_delete_distribution_response.go deleted file mode 100644 index 32356d013..000000000 --- a/services/cdn/v1betaapi/model_delete_distribution_response.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" -) - -// checks if the DeleteDistributionResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DeleteDistributionResponse{} - -// DeleteDistributionResponse struct for DeleteDistributionResponse -type DeleteDistributionResponse struct { - Distribution *Distribution `json:"distribution,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _DeleteDistributionResponse DeleteDistributionResponse - -// NewDeleteDistributionResponse instantiates a new DeleteDistributionResponse 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 NewDeleteDistributionResponse() *DeleteDistributionResponse { - this := DeleteDistributionResponse{} - return &this -} - -// NewDeleteDistributionResponseWithDefaults instantiates a new DeleteDistributionResponse 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 NewDeleteDistributionResponseWithDefaults() *DeleteDistributionResponse { - this := DeleteDistributionResponse{} - return &this -} - -// GetDistribution returns the Distribution field value if set, zero value otherwise. -func (o *DeleteDistributionResponse) GetDistribution() Distribution { - if o == nil || IsNil(o.Distribution) { - var ret Distribution - return ret - } - return *o.Distribution -} - -// GetDistributionOk returns a tuple with the Distribution field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeleteDistributionResponse) GetDistributionOk() (*Distribution, bool) { - if o == nil || IsNil(o.Distribution) { - return nil, false - } - return o.Distribution, true -} - -// HasDistribution returns a boolean if a field has been set. -func (o *DeleteDistributionResponse) HasDistribution() bool { - if o != nil && !IsNil(o.Distribution) { - return true - } - - return false -} - -// SetDistribution gets a reference to the given Distribution and assigns it to the Distribution field. -func (o *DeleteDistributionResponse) SetDistribution(v Distribution) { - o.Distribution = &v -} - -func (o DeleteDistributionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DeleteDistributionResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Distribution) { - toSerialize["distribution"] = o.Distribution - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DeleteDistributionResponse) UnmarshalJSON(data []byte) (err error) { - varDeleteDistributionResponse := _DeleteDistributionResponse{} - - err = json.Unmarshal(data, &varDeleteDistributionResponse) - - if err != nil { - return err - } - - *o = DeleteDistributionResponse(varDeleteDistributionResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "distribution") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDeleteDistributionResponse struct { - value *DeleteDistributionResponse - isSet bool -} - -func (v NullableDeleteDistributionResponse) Get() *DeleteDistributionResponse { - return v.value -} - -func (v *NullableDeleteDistributionResponse) Set(val *DeleteDistributionResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDeleteDistributionResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDeleteDistributionResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeleteDistributionResponse(val *DeleteDistributionResponse) *NullableDeleteDistributionResponse { - return &NullableDeleteDistributionResponse{value: val, isSet: true} -} - -func (v NullableDeleteDistributionResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeleteDistributionResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_distribution.go b/services/cdn/v1betaapi/model_distribution.go deleted file mode 100644 index 9cfb86771..000000000 --- a/services/cdn/v1betaapi/model_distribution.go +++ /dev/null @@ -1,418 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the Distribution type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Distribution{} - -// Distribution struct for Distribution -type Distribution struct { - Config Config `json:"config"` - // RFC3339 string defining when the distribution was created - CreatedAt time.Time `json:"createdAt"` - Domains []Domain `json:"domains"` - // This object may be present if, and only if the distribution has encountered an error state. - Errors []StatusError `json:"errors,omitempty"` - Id string `json:"id"` - ProjectId string `json:"projectId"` - Status DistributionStatus `json:"status"` - // RFC3339 string which returns the last time the distribution configuration was modified. - UpdatedAt time.Time `json:"updatedAt"` - Waf *DistributionWaf `json:"waf,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Distribution Distribution - -// NewDistribution instantiates a new Distribution 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 NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status DistributionStatus, updatedAt time.Time) *Distribution { - this := Distribution{} - this.Config = config - this.CreatedAt = createdAt - this.Domains = domains - this.Id = id - this.ProjectId = projectId - this.Status = status - this.UpdatedAt = updatedAt - return &this -} - -// NewDistributionWithDefaults instantiates a new Distribution 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 NewDistributionWithDefaults() *Distribution { - this := Distribution{} - return &this -} - -// GetConfig returns the Config field value -func (o *Distribution) GetConfig() Config { - if o == nil { - var ret Config - 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 *Distribution) GetConfigOk() (*Config, bool) { - if o == nil { - return nil, false - } - return &o.Config, true -} - -// SetConfig sets field value -func (o *Distribution) SetConfig(v Config) { - o.Config = v -} - -// GetCreatedAt returns the CreatedAt field value -func (o *Distribution) 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 *Distribution) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.CreatedAt, true -} - -// SetCreatedAt sets field value -func (o *Distribution) SetCreatedAt(v time.Time) { - o.CreatedAt = v -} - -// GetDomains returns the Domains field value -func (o *Distribution) GetDomains() []Domain { - if o == nil { - var ret []Domain - return ret - } - - return o.Domains -} - -// GetDomainsOk returns a tuple with the Domains field value -// and a boolean to check if the value has been set. -func (o *Distribution) GetDomainsOk() ([]Domain, bool) { - if o == nil { - return nil, false - } - return o.Domains, true -} - -// SetDomains sets field value -func (o *Distribution) SetDomains(v []Domain) { - o.Domains = v -} - -// GetErrors returns the Errors field value if set, zero value otherwise. -func (o *Distribution) GetErrors() []StatusError { - if o == nil || IsNil(o.Errors) { - var ret []StatusError - return ret - } - return o.Errors -} - -// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Distribution) GetErrorsOk() ([]StatusError, bool) { - if o == nil || IsNil(o.Errors) { - return nil, false - } - return o.Errors, true -} - -// HasErrors returns a boolean if a field has been set. -func (o *Distribution) HasErrors() bool { - if o != nil && !IsNil(o.Errors) { - return true - } - - return false -} - -// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. -func (o *Distribution) SetErrors(v []StatusError) { - o.Errors = v -} - -// GetId returns the Id field value -func (o *Distribution) 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 *Distribution) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Distribution) SetId(v string) { - o.Id = v -} - -// GetProjectId returns the ProjectId field value -func (o *Distribution) GetProjectId() string { - if o == nil { - var ret string - return ret - } - - return o.ProjectId -} - -// GetProjectIdOk returns a tuple with the ProjectId field value -// and a boolean to check if the value has been set. -func (o *Distribution) GetProjectIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ProjectId, true -} - -// SetProjectId sets field value -func (o *Distribution) SetProjectId(v string) { - o.ProjectId = v -} - -// GetStatus returns the Status field value -func (o *Distribution) GetStatus() DistributionStatus { - if o == nil { - var ret DistributionStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *Distribution) GetStatusOk() (*DistributionStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *Distribution) SetStatus(v DistributionStatus) { - o.Status = v -} - -// GetUpdatedAt returns the UpdatedAt field value -func (o *Distribution) 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 *Distribution) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.UpdatedAt, true -} - -// SetUpdatedAt sets field value -func (o *Distribution) SetUpdatedAt(v time.Time) { - o.UpdatedAt = v -} - -// GetWaf returns the Waf field value if set, zero value otherwise. -func (o *Distribution) GetWaf() DistributionWaf { - if o == nil || IsNil(o.Waf) { - var ret DistributionWaf - return ret - } - return *o.Waf -} - -// GetWafOk returns a tuple with the Waf field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Distribution) GetWafOk() (*DistributionWaf, bool) { - if o == nil || IsNil(o.Waf) { - return nil, false - } - return o.Waf, true -} - -// HasWaf returns a boolean if a field has been set. -func (o *Distribution) HasWaf() bool { - if o != nil && !IsNil(o.Waf) { - return true - } - - return false -} - -// SetWaf gets a reference to the given DistributionWaf and assigns it to the Waf field. -func (o *Distribution) SetWaf(v DistributionWaf) { - o.Waf = &v -} - -func (o Distribution) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Distribution) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["config"] = o.Config - toSerialize["createdAt"] = o.CreatedAt - toSerialize["domains"] = o.Domains - if !IsNil(o.Errors) { - toSerialize["errors"] = o.Errors - } - toSerialize["id"] = o.Id - toSerialize["projectId"] = o.ProjectId - toSerialize["status"] = o.Status - toSerialize["updatedAt"] = o.UpdatedAt - if !IsNil(o.Waf) { - toSerialize["waf"] = o.Waf - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Distribution) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "config", - "createdAt", - "domains", - "id", - "projectId", - "status", - "updatedAt", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistribution := _Distribution{} - - err = json.Unmarshal(data, &varDistribution) - - if err != nil { - return err - } - - *o = Distribution(varDistribution) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "config") - delete(additionalProperties, "createdAt") - delete(additionalProperties, "domains") - delete(additionalProperties, "errors") - delete(additionalProperties, "id") - delete(additionalProperties, "projectId") - delete(additionalProperties, "status") - delete(additionalProperties, "updatedAt") - delete(additionalProperties, "waf") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistribution struct { - value *Distribution - isSet bool -} - -func (v NullableDistribution) Get() *Distribution { - return v.value -} - -func (v *NullableDistribution) Set(val *Distribution) { - v.value = val - v.isSet = true -} - -func (v NullableDistribution) IsSet() bool { - return v.isSet -} - -func (v *NullableDistribution) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistribution(val *Distribution) *NullableDistribution { - return &NullableDistribution{value: val, isSet: true} -} - -func (v NullableDistribution) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistribution) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_distribution_logs_record.go b/services/cdn/v1betaapi/model_distribution_logs_record.go deleted file mode 100644 index 9bc7f009e..000000000 --- a/services/cdn/v1betaapi/model_distribution_logs_record.go +++ /dev/null @@ -1,437 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the DistributionLogsRecord type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DistributionLogsRecord{} - -// DistributionLogsRecord struct for DistributionLogsRecord -type DistributionLogsRecord struct { - CacheHit bool `json:"cacheHit"` - DataCenterRegion string `json:"dataCenterRegion"` - DistributionID string `json:"distributionID"` - Host string `json:"host"` - Path string `json:"path"` - // ISO 3166-1 A2 compliant country code - RequestCountryCode string `json:"requestCountryCode"` - Size int64 `json:"size"` - StatusCode int32 `json:"statusCode"` - Timestamp time.Time `json:"timestamp"` - WafViolation *WAFViolation `json:"wafViolation,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _DistributionLogsRecord DistributionLogsRecord - -// NewDistributionLogsRecord instantiates a new DistributionLogsRecord 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 NewDistributionLogsRecord(cacheHit bool, dataCenterRegion string, distributionID string, host string, path string, requestCountryCode string, size int64, statusCode int32, timestamp time.Time) *DistributionLogsRecord { - this := DistributionLogsRecord{} - this.CacheHit = cacheHit - this.DataCenterRegion = dataCenterRegion - this.DistributionID = distributionID - this.Host = host - this.Path = path - this.RequestCountryCode = requestCountryCode - this.Size = size - this.StatusCode = statusCode - this.Timestamp = timestamp - return &this -} - -// NewDistributionLogsRecordWithDefaults instantiates a new DistributionLogsRecord 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 NewDistributionLogsRecordWithDefaults() *DistributionLogsRecord { - this := DistributionLogsRecord{} - return &this -} - -// GetCacheHit returns the CacheHit field value -func (o *DistributionLogsRecord) GetCacheHit() bool { - if o == nil { - var ret bool - return ret - } - - return o.CacheHit -} - -// GetCacheHitOk returns a tuple with the CacheHit field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetCacheHitOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.CacheHit, true -} - -// SetCacheHit sets field value -func (o *DistributionLogsRecord) SetCacheHit(v bool) { - o.CacheHit = v -} - -// GetDataCenterRegion returns the DataCenterRegion field value -func (o *DistributionLogsRecord) GetDataCenterRegion() string { - if o == nil { - var ret string - return ret - } - - return o.DataCenterRegion -} - -// GetDataCenterRegionOk returns a tuple with the DataCenterRegion field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetDataCenterRegionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DataCenterRegion, true -} - -// SetDataCenterRegion sets field value -func (o *DistributionLogsRecord) SetDataCenterRegion(v string) { - o.DataCenterRegion = v -} - -// GetDistributionID returns the DistributionID field value -func (o *DistributionLogsRecord) GetDistributionID() string { - if o == nil { - var ret string - return ret - } - - return o.DistributionID -} - -// GetDistributionIDOk returns a tuple with the DistributionID field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetDistributionIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DistributionID, true -} - -// SetDistributionID sets field value -func (o *DistributionLogsRecord) SetDistributionID(v string) { - o.DistributionID = v -} - -// GetHost returns the Host field value -func (o *DistributionLogsRecord) GetHost() string { - if o == nil { - var ret string - return ret - } - - return o.Host -} - -// GetHostOk returns a tuple with the Host field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetHostOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Host, true -} - -// SetHost sets field value -func (o *DistributionLogsRecord) SetHost(v string) { - o.Host = v -} - -// GetPath returns the Path field value -func (o *DistributionLogsRecord) GetPath() string { - if o == nil { - var ret string - return ret - } - - return o.Path -} - -// GetPathOk returns a tuple with the Path field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetPathOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Path, true -} - -// SetPath sets field value -func (o *DistributionLogsRecord) SetPath(v string) { - o.Path = v -} - -// GetRequestCountryCode returns the RequestCountryCode field value -func (o *DistributionLogsRecord) GetRequestCountryCode() string { - if o == nil { - var ret string - return ret - } - - return o.RequestCountryCode -} - -// GetRequestCountryCodeOk returns a tuple with the RequestCountryCode field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetRequestCountryCodeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RequestCountryCode, true -} - -// SetRequestCountryCode sets field value -func (o *DistributionLogsRecord) SetRequestCountryCode(v string) { - o.RequestCountryCode = v -} - -// GetSize returns the Size field value -func (o *DistributionLogsRecord) GetSize() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.Size -} - -// GetSizeOk returns a tuple with the Size field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetSizeOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.Size, true -} - -// SetSize sets field value -func (o *DistributionLogsRecord) SetSize(v int64) { - o.Size = v -} - -// GetStatusCode returns the StatusCode field value -func (o *DistributionLogsRecord) GetStatusCode() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.StatusCode -} - -// GetStatusCodeOk returns a tuple with the StatusCode field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetStatusCodeOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.StatusCode, true -} - -// SetStatusCode sets field value -func (o *DistributionLogsRecord) SetStatusCode(v int32) { - o.StatusCode = v -} - -// GetTimestamp returns the Timestamp field value -func (o *DistributionLogsRecord) GetTimestamp() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.Timestamp -} - -// GetTimestampOk returns a tuple with the Timestamp field value -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetTimestampOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.Timestamp, true -} - -// SetTimestamp sets field value -func (o *DistributionLogsRecord) SetTimestamp(v time.Time) { - o.Timestamp = v -} - -// GetWafViolation returns the WafViolation field value if set, zero value otherwise. -func (o *DistributionLogsRecord) GetWafViolation() WAFViolation { - if o == nil || IsNil(o.WafViolation) { - var ret WAFViolation - return ret - } - return *o.WafViolation -} - -// GetWafViolationOk returns a tuple with the WafViolation field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DistributionLogsRecord) GetWafViolationOk() (*WAFViolation, bool) { - if o == nil || IsNil(o.WafViolation) { - return nil, false - } - return o.WafViolation, true -} - -// HasWafViolation returns a boolean if a field has been set. -func (o *DistributionLogsRecord) HasWafViolation() bool { - if o != nil && !IsNil(o.WafViolation) { - return true - } - - return false -} - -// SetWafViolation gets a reference to the given WAFViolation and assigns it to the WafViolation field. -func (o *DistributionLogsRecord) SetWafViolation(v WAFViolation) { - o.WafViolation = &v -} - -func (o DistributionLogsRecord) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DistributionLogsRecord) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["cacheHit"] = o.CacheHit - toSerialize["dataCenterRegion"] = o.DataCenterRegion - toSerialize["distributionID"] = o.DistributionID - toSerialize["host"] = o.Host - toSerialize["path"] = o.Path - toSerialize["requestCountryCode"] = o.RequestCountryCode - toSerialize["size"] = o.Size - toSerialize["statusCode"] = o.StatusCode - toSerialize["timestamp"] = o.Timestamp - if !IsNil(o.WafViolation) { - toSerialize["wafViolation"] = o.WafViolation - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DistributionLogsRecord) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "cacheHit", - "dataCenterRegion", - "distributionID", - "host", - "path", - "requestCountryCode", - "size", - "statusCode", - "timestamp", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistributionLogsRecord := _DistributionLogsRecord{} - - err = json.Unmarshal(data, &varDistributionLogsRecord) - - if err != nil { - return err - } - - *o = DistributionLogsRecord(varDistributionLogsRecord) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "cacheHit") - delete(additionalProperties, "dataCenterRegion") - delete(additionalProperties, "distributionID") - delete(additionalProperties, "host") - delete(additionalProperties, "path") - delete(additionalProperties, "requestCountryCode") - delete(additionalProperties, "size") - delete(additionalProperties, "statusCode") - delete(additionalProperties, "timestamp") - delete(additionalProperties, "wafViolation") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistributionLogsRecord struct { - value *DistributionLogsRecord - isSet bool -} - -func (v NullableDistributionLogsRecord) Get() *DistributionLogsRecord { - return v.value -} - -func (v *NullableDistributionLogsRecord) Set(val *DistributionLogsRecord) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionLogsRecord) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionLogsRecord) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionLogsRecord(val *DistributionLogsRecord) *NullableDistributionLogsRecord { - return &NullableDistributionLogsRecord{value: val, isSet: true} -} - -func (v NullableDistributionLogsRecord) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionLogsRecord) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_distribution_statistics_record.go b/services/cdn/v1betaapi/model_distribution_statistics_record.go deleted file mode 100644 index 7446dad88..000000000 --- a/services/cdn/v1betaapi/model_distribution_statistics_record.go +++ /dev/null @@ -1,317 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the DistributionStatisticsRecord type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DistributionStatisticsRecord{} - -// DistributionStatisticsRecord Aggregated statistics of a distribution during a time interval -type DistributionStatisticsRecord struct { - // Number of cached requests that were served - CachedRequests int64 `json:"cachedRequests"` - // Total number of requests that were served - TotalRequests int64 `json:"totalRequests"` - // Total traffic in bytes that occurred during the time interval - TotalTrafficBytes int64 `json:"totalTrafficBytes"` - // Exclusive end of the time interval the statistics refer to - End time.Time `json:"end"` - Regions DistributionStatisticsRecordRegions `json:"regions"` - // Start of the time interval the statistics refer to - Start time.Time `json:"start"` - AdditionalProperties map[string]interface{} -} - -type _DistributionStatisticsRecord DistributionStatisticsRecord - -// NewDistributionStatisticsRecord instantiates a new DistributionStatisticsRecord 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 NewDistributionStatisticsRecord(cachedRequests int64, totalRequests int64, totalTrafficBytes int64, end time.Time, regions DistributionStatisticsRecordRegions, start time.Time) *DistributionStatisticsRecord { - this := DistributionStatisticsRecord{} - this.CachedRequests = cachedRequests - this.TotalRequests = totalRequests - this.TotalTrafficBytes = totalTrafficBytes - this.End = end - this.Regions = regions - this.Start = start - return &this -} - -// NewDistributionStatisticsRecordWithDefaults instantiates a new DistributionStatisticsRecord 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 NewDistributionStatisticsRecordWithDefaults() *DistributionStatisticsRecord { - this := DistributionStatisticsRecord{} - return &this -} - -// GetCachedRequests returns the CachedRequests field value -func (o *DistributionStatisticsRecord) GetCachedRequests() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.CachedRequests -} - -// GetCachedRequestsOk returns a tuple with the CachedRequests field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetCachedRequestsOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.CachedRequests, true -} - -// SetCachedRequests sets field value -func (o *DistributionStatisticsRecord) SetCachedRequests(v int64) { - o.CachedRequests = v -} - -// GetTotalRequests returns the TotalRequests field value -func (o *DistributionStatisticsRecord) GetTotalRequests() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.TotalRequests -} - -// GetTotalRequestsOk returns a tuple with the TotalRequests field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetTotalRequestsOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.TotalRequests, true -} - -// SetTotalRequests sets field value -func (o *DistributionStatisticsRecord) SetTotalRequests(v int64) { - o.TotalRequests = v -} - -// GetTotalTrafficBytes returns the TotalTrafficBytes field value -func (o *DistributionStatisticsRecord) GetTotalTrafficBytes() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.TotalTrafficBytes -} - -// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetTotalTrafficBytesOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.TotalTrafficBytes, true -} - -// SetTotalTrafficBytes sets field value -func (o *DistributionStatisticsRecord) SetTotalTrafficBytes(v int64) { - o.TotalTrafficBytes = v -} - -// GetEnd returns the End field value -func (o *DistributionStatisticsRecord) GetEnd() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.End -} - -// GetEndOk returns a tuple with the End field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetEndOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.End, true -} - -// SetEnd sets field value -func (o *DistributionStatisticsRecord) SetEnd(v time.Time) { - o.End = v -} - -// GetRegions returns the Regions field value -func (o *DistributionStatisticsRecord) GetRegions() DistributionStatisticsRecordRegions { - if o == nil { - var ret DistributionStatisticsRecordRegions - return ret - } - - return o.Regions -} - -// GetRegionsOk returns a tuple with the Regions field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetRegionsOk() (*DistributionStatisticsRecordRegions, bool) { - if o == nil { - return nil, false - } - return &o.Regions, true -} - -// SetRegions sets field value -func (o *DistributionStatisticsRecord) SetRegions(v DistributionStatisticsRecordRegions) { - o.Regions = v -} - -// GetStart returns the Start field value -func (o *DistributionStatisticsRecord) GetStart() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.Start -} - -// GetStartOk returns a tuple with the Start field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecord) GetStartOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.Start, true -} - -// SetStart sets field value -func (o *DistributionStatisticsRecord) SetStart(v time.Time) { - o.Start = v -} - -func (o DistributionStatisticsRecord) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DistributionStatisticsRecord) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["cachedRequests"] = o.CachedRequests - toSerialize["totalRequests"] = o.TotalRequests - toSerialize["totalTrafficBytes"] = o.TotalTrafficBytes - toSerialize["end"] = o.End - toSerialize["regions"] = o.Regions - toSerialize["start"] = o.Start - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DistributionStatisticsRecord) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "cachedRequests", - "totalRequests", - "totalTrafficBytes", - "end", - "regions", - "start", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistributionStatisticsRecord := _DistributionStatisticsRecord{} - - err = json.Unmarshal(data, &varDistributionStatisticsRecord) - - if err != nil { - return err - } - - *o = DistributionStatisticsRecord(varDistributionStatisticsRecord) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "cachedRequests") - delete(additionalProperties, "totalRequests") - delete(additionalProperties, "totalTrafficBytes") - delete(additionalProperties, "end") - delete(additionalProperties, "regions") - delete(additionalProperties, "start") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistributionStatisticsRecord struct { - value *DistributionStatisticsRecord - isSet bool -} - -func (v NullableDistributionStatisticsRecord) Get() *DistributionStatisticsRecord { - return v.value -} - -func (v *NullableDistributionStatisticsRecord) Set(val *DistributionStatisticsRecord) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionStatisticsRecord) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionStatisticsRecord) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionStatisticsRecord(val *DistributionStatisticsRecord) *NullableDistributionStatisticsRecord { - return &NullableDistributionStatisticsRecord{value: val, isSet: true} -} - -func (v NullableDistributionStatisticsRecord) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionStatisticsRecord) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_distribution_statistics_record_entry.go b/services/cdn/v1betaapi/model_distribution_statistics_record_entry.go deleted file mode 100644 index 211c77632..000000000 --- a/services/cdn/v1betaapi/model_distribution_statistics_record_entry.go +++ /dev/null @@ -1,227 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the DistributionStatisticsRecordEntry type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DistributionStatisticsRecordEntry{} - -// DistributionStatisticsRecordEntry struct for DistributionStatisticsRecordEntry -type DistributionStatisticsRecordEntry struct { - // Number of cached requests that were served - CachedRequests int64 `json:"cachedRequests"` - // Total number of requests that were served - TotalRequests int64 `json:"totalRequests"` - // Total traffic in bytes that occurred during the time interval - TotalTrafficBytes int64 `json:"totalTrafficBytes"` - AdditionalProperties map[string]interface{} -} - -type _DistributionStatisticsRecordEntry DistributionStatisticsRecordEntry - -// NewDistributionStatisticsRecordEntry instantiates a new DistributionStatisticsRecordEntry 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 NewDistributionStatisticsRecordEntry(cachedRequests int64, totalRequests int64, totalTrafficBytes int64) *DistributionStatisticsRecordEntry { - this := DistributionStatisticsRecordEntry{} - this.CachedRequests = cachedRequests - this.TotalRequests = totalRequests - this.TotalTrafficBytes = totalTrafficBytes - return &this -} - -// NewDistributionStatisticsRecordEntryWithDefaults instantiates a new DistributionStatisticsRecordEntry 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 NewDistributionStatisticsRecordEntryWithDefaults() *DistributionStatisticsRecordEntry { - this := DistributionStatisticsRecordEntry{} - return &this -} - -// GetCachedRequests returns the CachedRequests field value -func (o *DistributionStatisticsRecordEntry) GetCachedRequests() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.CachedRequests -} - -// GetCachedRequestsOk returns a tuple with the CachedRequests field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordEntry) GetCachedRequestsOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.CachedRequests, true -} - -// SetCachedRequests sets field value -func (o *DistributionStatisticsRecordEntry) SetCachedRequests(v int64) { - o.CachedRequests = v -} - -// GetTotalRequests returns the TotalRequests field value -func (o *DistributionStatisticsRecordEntry) GetTotalRequests() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.TotalRequests -} - -// GetTotalRequestsOk returns a tuple with the TotalRequests field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordEntry) GetTotalRequestsOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.TotalRequests, true -} - -// SetTotalRequests sets field value -func (o *DistributionStatisticsRecordEntry) SetTotalRequests(v int64) { - o.TotalRequests = v -} - -// GetTotalTrafficBytes returns the TotalTrafficBytes field value -func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytes() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.TotalTrafficBytes -} - -// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytesOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.TotalTrafficBytes, true -} - -// SetTotalTrafficBytes sets field value -func (o *DistributionStatisticsRecordEntry) SetTotalTrafficBytes(v int64) { - o.TotalTrafficBytes = v -} - -func (o DistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DistributionStatisticsRecordEntry) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["cachedRequests"] = o.CachedRequests - toSerialize["totalRequests"] = o.TotalRequests - toSerialize["totalTrafficBytes"] = o.TotalTrafficBytes - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DistributionStatisticsRecordEntry) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "cachedRequests", - "totalRequests", - "totalTrafficBytes", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistributionStatisticsRecordEntry := _DistributionStatisticsRecordEntry{} - - err = json.Unmarshal(data, &varDistributionStatisticsRecordEntry) - - if err != nil { - return err - } - - *o = DistributionStatisticsRecordEntry(varDistributionStatisticsRecordEntry) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "cachedRequests") - delete(additionalProperties, "totalRequests") - delete(additionalProperties, "totalTrafficBytes") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistributionStatisticsRecordEntry struct { - value *DistributionStatisticsRecordEntry - isSet bool -} - -func (v NullableDistributionStatisticsRecordEntry) Get() *DistributionStatisticsRecordEntry { - return v.value -} - -func (v *NullableDistributionStatisticsRecordEntry) Set(val *DistributionStatisticsRecordEntry) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionStatisticsRecordEntry) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionStatisticsRecordEntry) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionStatisticsRecordEntry(val *DistributionStatisticsRecordEntry) *NullableDistributionStatisticsRecordEntry { - return &NullableDistributionStatisticsRecordEntry{value: val, isSet: true} -} - -func (v NullableDistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionStatisticsRecordEntry) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_distribution_statistics_record_regions.go b/services/cdn/v1betaapi/model_distribution_statistics_record_regions.go deleted file mode 100644 index c34dfec4e..000000000 --- a/services/cdn/v1betaapi/model_distribution_statistics_record_regions.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the DistributionStatisticsRecordRegions type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DistributionStatisticsRecordRegions{} - -// DistributionStatisticsRecordRegions Mapping of regions to the metrics for this region for the defined time interval All regions are always present. If no traffic was reported for a region, it will still contain 0-filled properties -type DistributionStatisticsRecordRegions struct { - AF DistributionStatisticsRecordEntry `json:"AF"` - ASIA DistributionStatisticsRecordEntry `json:"ASIA"` - EU DistributionStatisticsRecordEntry `json:"EU"` - SA DistributionStatisticsRecordEntry `json:"SA"` - US DistributionStatisticsRecordEntry `json:"US"` - AdditionalProperties map[string]interface{} -} - -type _DistributionStatisticsRecordRegions DistributionStatisticsRecordRegions - -// NewDistributionStatisticsRecordRegions instantiates a new DistributionStatisticsRecordRegions 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 NewDistributionStatisticsRecordRegions(aF DistributionStatisticsRecordEntry, aSIA DistributionStatisticsRecordEntry, eU DistributionStatisticsRecordEntry, sA DistributionStatisticsRecordEntry, uS DistributionStatisticsRecordEntry) *DistributionStatisticsRecordRegions { - this := DistributionStatisticsRecordRegions{} - this.AF = aF - this.ASIA = aSIA - this.EU = eU - this.SA = sA - this.US = uS - return &this -} - -// NewDistributionStatisticsRecordRegionsWithDefaults instantiates a new DistributionStatisticsRecordRegions 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 NewDistributionStatisticsRecordRegionsWithDefaults() *DistributionStatisticsRecordRegions { - this := DistributionStatisticsRecordRegions{} - return &this -} - -// GetAF returns the AF field value -func (o *DistributionStatisticsRecordRegions) GetAF() DistributionStatisticsRecordEntry { - if o == nil { - var ret DistributionStatisticsRecordEntry - return ret - } - - return o.AF -} - -// GetAFOk returns a tuple with the AF field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordRegions) GetAFOk() (*DistributionStatisticsRecordEntry, bool) { - if o == nil { - return nil, false - } - return &o.AF, true -} - -// SetAF sets field value -func (o *DistributionStatisticsRecordRegions) SetAF(v DistributionStatisticsRecordEntry) { - o.AF = v -} - -// GetASIA returns the ASIA field value -func (o *DistributionStatisticsRecordRegions) GetASIA() DistributionStatisticsRecordEntry { - if o == nil { - var ret DistributionStatisticsRecordEntry - return ret - } - - return o.ASIA -} - -// GetASIAOk returns a tuple with the ASIA field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordRegions) GetASIAOk() (*DistributionStatisticsRecordEntry, bool) { - if o == nil { - return nil, false - } - return &o.ASIA, true -} - -// SetASIA sets field value -func (o *DistributionStatisticsRecordRegions) SetASIA(v DistributionStatisticsRecordEntry) { - o.ASIA = v -} - -// GetEU returns the EU field value -func (o *DistributionStatisticsRecordRegions) GetEU() DistributionStatisticsRecordEntry { - if o == nil { - var ret DistributionStatisticsRecordEntry - return ret - } - - return o.EU -} - -// GetEUOk returns a tuple with the EU field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordRegions) GetEUOk() (*DistributionStatisticsRecordEntry, bool) { - if o == nil { - return nil, false - } - return &o.EU, true -} - -// SetEU sets field value -func (o *DistributionStatisticsRecordRegions) SetEU(v DistributionStatisticsRecordEntry) { - o.EU = v -} - -// GetSA returns the SA field value -func (o *DistributionStatisticsRecordRegions) GetSA() DistributionStatisticsRecordEntry { - if o == nil { - var ret DistributionStatisticsRecordEntry - return ret - } - - return o.SA -} - -// GetSAOk returns a tuple with the SA field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordRegions) GetSAOk() (*DistributionStatisticsRecordEntry, bool) { - if o == nil { - return nil, false - } - return &o.SA, true -} - -// SetSA sets field value -func (o *DistributionStatisticsRecordRegions) SetSA(v DistributionStatisticsRecordEntry) { - o.SA = v -} - -// GetUS returns the US field value -func (o *DistributionStatisticsRecordRegions) GetUS() DistributionStatisticsRecordEntry { - if o == nil { - var ret DistributionStatisticsRecordEntry - return ret - } - - return o.US -} - -// GetUSOk returns a tuple with the US field value -// and a boolean to check if the value has been set. -func (o *DistributionStatisticsRecordRegions) GetUSOk() (*DistributionStatisticsRecordEntry, bool) { - if o == nil { - return nil, false - } - return &o.US, true -} - -// SetUS sets field value -func (o *DistributionStatisticsRecordRegions) SetUS(v DistributionStatisticsRecordEntry) { - o.US = v -} - -func (o DistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DistributionStatisticsRecordRegions) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["AF"] = o.AF - toSerialize["ASIA"] = o.ASIA - toSerialize["EU"] = o.EU - toSerialize["SA"] = o.SA - toSerialize["US"] = o.US - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DistributionStatisticsRecordRegions) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "AF", - "ASIA", - "EU", - "SA", - "US", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistributionStatisticsRecordRegions := _DistributionStatisticsRecordRegions{} - - err = json.Unmarshal(data, &varDistributionStatisticsRecordRegions) - - if err != nil { - return err - } - - *o = DistributionStatisticsRecordRegions(varDistributionStatisticsRecordRegions) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "AF") - delete(additionalProperties, "ASIA") - delete(additionalProperties, "EU") - delete(additionalProperties, "SA") - delete(additionalProperties, "US") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistributionStatisticsRecordRegions struct { - value *DistributionStatisticsRecordRegions - isSet bool -} - -func (v NullableDistributionStatisticsRecordRegions) Get() *DistributionStatisticsRecordRegions { - return v.value -} - -func (v *NullableDistributionStatisticsRecordRegions) Set(val *DistributionStatisticsRecordRegions) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionStatisticsRecordRegions) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionStatisticsRecordRegions) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionStatisticsRecordRegions(val *DistributionStatisticsRecordRegions) *NullableDistributionStatisticsRecordRegions { - return &NullableDistributionStatisticsRecordRegions{value: val, isSet: true} -} - -func (v NullableDistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionStatisticsRecordRegions) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_distribution_status.go b/services/cdn/v1betaapi/model_distribution_status.go deleted file mode 100644 index 433f2c86d..000000000 --- a/services/cdn/v1betaapi/model_distribution_status.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// DistributionStatus - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. -type DistributionStatus string - -// List of Distribution_status -const ( - DISTRIBUTIONSTATUS_CREATING DistributionStatus = "CREATING" - DISTRIBUTIONSTATUS_ACTIVE DistributionStatus = "ACTIVE" - DISTRIBUTIONSTATUS_UPDATING DistributionStatus = "UPDATING" - DISTRIBUTIONSTATUS_DELETING DistributionStatus = "DELETING" - DISTRIBUTIONSTATUS_ERROR DistributionStatus = "ERROR" - DISTRIBUTIONSTATUS_UNKNOWN_DEFAULT_OPEN_API DistributionStatus = "unknown_default_open_api" -) - -// All allowed values of DistributionStatus enum -var AllowedDistributionStatusEnumValues = []DistributionStatus{ - "CREATING", - "ACTIVE", - "UPDATING", - "DELETING", - "ERROR", - "unknown_default_open_api", -} - -func (v *DistributionStatus) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := DistributionStatus(value) - for _, existing := range AllowedDistributionStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = DISTRIBUTIONSTATUS_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewDistributionStatusFromValue returns a pointer to a valid DistributionStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewDistributionStatusFromValue(v string) (*DistributionStatus, error) { - ev := DistributionStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for DistributionStatus: valid values are %v", v, AllowedDistributionStatusEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v DistributionStatus) IsValid() bool { - for _, existing := range AllowedDistributionStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to Distribution_status value -func (v DistributionStatus) Ptr() *DistributionStatus { - return &v -} - -type NullableDistributionStatus struct { - value *DistributionStatus - isSet bool -} - -func (v NullableDistributionStatus) Get() *DistributionStatus { - return v.value -} - -func (v *NullableDistributionStatus) Set(val *DistributionStatus) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionStatus(val *DistributionStatus) *NullableDistributionStatus { - return &NullableDistributionStatus{value: val, isSet: true} -} - -func (v NullableDistributionStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_distribution_waf.go b/services/cdn/v1betaapi/model_distribution_waf.go deleted file mode 100644 index c793c52a1..000000000 --- a/services/cdn/v1betaapi/model_distribution_waf.go +++ /dev/null @@ -1,224 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the DistributionWaf type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DistributionWaf{} - -// DistributionWaf For this property to be present two pre-conditions must be met: - the WAF was enabled at least once - the query parameter ?withWafStatus is truthy This property contains the waf Status. At this point in time, this contains all resolved rules. Rules are split into 3 groups: - enabledRules - logOnlyRules - disabledRules **Do note that the global waf mode (Disabled, LogOnly, Enabled) is *NOT* reflected in this list!** -type DistributionWaf struct { - DisabledRules []WAFStatusRuleBlock `json:"disabledRules"` - EnabledRules []WAFStatusRuleBlock `json:"enabledRules"` - LogOnlyRules []WAFStatusRuleBlock `json:"logOnlyRules"` - AdditionalProperties map[string]interface{} -} - -type _DistributionWaf DistributionWaf - -// NewDistributionWaf instantiates a new DistributionWaf 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 NewDistributionWaf(disabledRules []WAFStatusRuleBlock, enabledRules []WAFStatusRuleBlock, logOnlyRules []WAFStatusRuleBlock) *DistributionWaf { - this := DistributionWaf{} - this.DisabledRules = disabledRules - this.EnabledRules = enabledRules - this.LogOnlyRules = logOnlyRules - return &this -} - -// NewDistributionWafWithDefaults instantiates a new DistributionWaf 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 NewDistributionWafWithDefaults() *DistributionWaf { - this := DistributionWaf{} - return &this -} - -// GetDisabledRules returns the DisabledRules field value -func (o *DistributionWaf) GetDisabledRules() []WAFStatusRuleBlock { - if o == nil { - var ret []WAFStatusRuleBlock - return ret - } - - return o.DisabledRules -} - -// GetDisabledRulesOk returns a tuple with the DisabledRules field value -// and a boolean to check if the value has been set. -func (o *DistributionWaf) GetDisabledRulesOk() ([]WAFStatusRuleBlock, bool) { - if o == nil { - return nil, false - } - return o.DisabledRules, true -} - -// SetDisabledRules sets field value -func (o *DistributionWaf) SetDisabledRules(v []WAFStatusRuleBlock) { - o.DisabledRules = v -} - -// GetEnabledRules returns the EnabledRules field value -func (o *DistributionWaf) GetEnabledRules() []WAFStatusRuleBlock { - if o == nil { - var ret []WAFStatusRuleBlock - return ret - } - - return o.EnabledRules -} - -// GetEnabledRulesOk returns a tuple with the EnabledRules field value -// and a boolean to check if the value has been set. -func (o *DistributionWaf) GetEnabledRulesOk() ([]WAFStatusRuleBlock, bool) { - if o == nil { - return nil, false - } - return o.EnabledRules, true -} - -// SetEnabledRules sets field value -func (o *DistributionWaf) SetEnabledRules(v []WAFStatusRuleBlock) { - o.EnabledRules = v -} - -// GetLogOnlyRules returns the LogOnlyRules field value -func (o *DistributionWaf) GetLogOnlyRules() []WAFStatusRuleBlock { - if o == nil { - var ret []WAFStatusRuleBlock - return ret - } - - return o.LogOnlyRules -} - -// GetLogOnlyRulesOk returns a tuple with the LogOnlyRules field value -// and a boolean to check if the value has been set. -func (o *DistributionWaf) GetLogOnlyRulesOk() ([]WAFStatusRuleBlock, bool) { - if o == nil { - return nil, false - } - return o.LogOnlyRules, true -} - -// SetLogOnlyRules sets field value -func (o *DistributionWaf) SetLogOnlyRules(v []WAFStatusRuleBlock) { - o.LogOnlyRules = v -} - -func (o DistributionWaf) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DistributionWaf) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["disabledRules"] = o.DisabledRules - toSerialize["enabledRules"] = o.EnabledRules - toSerialize["logOnlyRules"] = o.LogOnlyRules - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *DistributionWaf) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "disabledRules", - "enabledRules", - "logOnlyRules", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDistributionWaf := _DistributionWaf{} - - err = json.Unmarshal(data, &varDistributionWaf) - - if err != nil { - return err - } - - *o = DistributionWaf(varDistributionWaf) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "disabledRules") - delete(additionalProperties, "enabledRules") - delete(additionalProperties, "logOnlyRules") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDistributionWaf struct { - value *DistributionWaf - isSet bool -} - -func (v NullableDistributionWaf) Get() *DistributionWaf { - return v.value -} - -func (v *NullableDistributionWaf) Set(val *DistributionWaf) { - v.value = val - v.isSet = true -} - -func (v NullableDistributionWaf) IsSet() bool { - return v.isSet -} - -func (v *NullableDistributionWaf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDistributionWaf(val *DistributionWaf) *NullableDistributionWaf { - return &NullableDistributionWaf{value: val, isSet: true} -} - -func (v NullableDistributionWaf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDistributionWaf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_domain.go b/services/cdn/v1betaapi/model_domain.go deleted file mode 100644 index 75d5e8f19..000000000 --- a/services/cdn/v1betaapi/model_domain.go +++ /dev/null @@ -1,263 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the Domain type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Domain{} - -// Domain Definition of a custom or managed domain without any certificates or keys -type Domain struct { - // This object is present if the custom domain has errors. - Errors []StatusError `json:"errors,omitempty"` - // The domain. If this is a custom domain, you can call the GetCustomDomain Endpoint - Name string `json:"name"` - Status DomainStatus `json:"status"` - Type DomainType `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _Domain Domain - -// NewDomain instantiates a new Domain 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 NewDomain(name string, status DomainStatus, types DomainType) *Domain { - this := Domain{} - this.Name = name - this.Status = status - this.Type = types - return &this -} - -// NewDomainWithDefaults instantiates a new Domain 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 NewDomainWithDefaults() *Domain { - this := Domain{} - return &this -} - -// GetErrors returns the Errors field value if set, zero value otherwise. -func (o *Domain) GetErrors() []StatusError { - if o == nil || IsNil(o.Errors) { - var ret []StatusError - return ret - } - return o.Errors -} - -// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Domain) GetErrorsOk() ([]StatusError, bool) { - if o == nil || IsNil(o.Errors) { - return nil, false - } - return o.Errors, true -} - -// HasErrors returns a boolean if a field has been set. -func (o *Domain) HasErrors() bool { - if o != nil && !IsNil(o.Errors) { - return true - } - - return false -} - -// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. -func (o *Domain) SetErrors(v []StatusError) { - o.Errors = v -} - -// GetName returns the Name field value -func (o *Domain) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Domain) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Domain) SetName(v string) { - o.Name = v -} - -// GetStatus returns the Status field value -func (o *Domain) GetStatus() DomainStatus { - if o == nil { - var ret DomainStatus - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *Domain) GetStatusOk() (*DomainStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *Domain) SetStatus(v DomainStatus) { - o.Status = v -} - -// GetType returns the Type field value -func (o *Domain) GetType() DomainType { - if o == nil { - var ret DomainType - 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 *Domain) GetTypeOk() (*DomainType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *Domain) SetType(v DomainType) { - o.Type = v -} - -func (o Domain) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Domain) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Errors) { - toSerialize["errors"] = o.Errors - } - toSerialize["name"] = o.Name - toSerialize["status"] = o.Status - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Domain) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "name", - "status", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varDomain := _Domain{} - - err = json.Unmarshal(data, &varDomain) - - if err != nil { - return err - } - - *o = Domain(varDomain) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "errors") - delete(additionalProperties, "name") - delete(additionalProperties, "status") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDomain struct { - value *Domain - isSet bool -} - -func (v NullableDomain) Get() *Domain { - return v.value -} - -func (v *NullableDomain) Set(val *Domain) { - v.value = val - v.isSet = true -} - -func (v NullableDomain) IsSet() bool { - return v.isSet -} - -func (v *NullableDomain) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDomain(val *Domain) *NullableDomain { - return &NullableDomain{value: val, isSet: true} -} - -func (v NullableDomain) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDomain) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_domain_status.go b/services/cdn/v1betaapi/model_domain_status.go deleted file mode 100644 index 9bcb1c068..000000000 --- a/services/cdn/v1betaapi/model_domain_status.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// DomainStatus The status of the domain: CREATING indicates that the custom domain is being set up. UPDATING means that requested changes are being applied to the custom domain. ACTIVE means the custom domain is currently configured and active. DELETING means that the domain is in the process of being removed from the distribution. In case the domain has the ERROR state, more information will be available in the errors list. -type DomainStatus string - -// List of DomainStatus -const ( - DOMAINSTATUS_CREATING DomainStatus = "CREATING" - DOMAINSTATUS_ACTIVE DomainStatus = "ACTIVE" - DOMAINSTATUS_UPDATING DomainStatus = "UPDATING" - DOMAINSTATUS_DELETING DomainStatus = "DELETING" - DOMAINSTATUS_ERROR DomainStatus = "ERROR" - DOMAINSTATUS_UNKNOWN_DEFAULT_OPEN_API DomainStatus = "unknown_default_open_api" -) - -// All allowed values of DomainStatus enum -var AllowedDomainStatusEnumValues = []DomainStatus{ - "CREATING", - "ACTIVE", - "UPDATING", - "DELETING", - "ERROR", - "unknown_default_open_api", -} - -func (v *DomainStatus) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := DomainStatus(value) - for _, existing := range AllowedDomainStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = DOMAINSTATUS_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewDomainStatusFromValue returns a pointer to a valid DomainStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewDomainStatusFromValue(v string) (*DomainStatus, error) { - ev := DomainStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for DomainStatus: valid values are %v", v, AllowedDomainStatusEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v DomainStatus) IsValid() bool { - for _, existing := range AllowedDomainStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DomainStatus value -func (v DomainStatus) Ptr() *DomainStatus { - return &v -} - -type NullableDomainStatus struct { - value *DomainStatus - isSet bool -} - -func (v NullableDomainStatus) Get() *DomainStatus { - return v.value -} - -func (v *NullableDomainStatus) Set(val *DomainStatus) { - v.value = val - v.isSet = true -} - -func (v NullableDomainStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableDomainStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDomainStatus(val *DomainStatus) *NullableDomainStatus { - return &NullableDomainStatus{value: val, isSet: true} -} - -func (v NullableDomainStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDomainStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_domain_type.go b/services/cdn/v1betaapi/model_domain_type.go deleted file mode 100644 index c03f75773..000000000 --- a/services/cdn/v1betaapi/model_domain_type.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// DomainType Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint -type DomainType string - -// List of Domain_type -const ( - DOMAINTYPE_MANAGED DomainType = "managed" - DOMAINTYPE_CUSTOM DomainType = "custom" - DOMAINTYPE_UNKNOWN_DEFAULT_OPEN_API DomainType = "unknown_default_open_api" -) - -// All allowed values of DomainType enum -var AllowedDomainTypeEnumValues = []DomainType{ - "managed", - "custom", - "unknown_default_open_api", -} - -func (v *DomainType) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := DomainType(value) - for _, existing := range AllowedDomainTypeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = DOMAINTYPE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewDomainTypeFromValue returns a pointer to a valid DomainType -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewDomainTypeFromValue(v string) (*DomainType, error) { - ev := DomainType(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for DomainType: valid values are %v", v, AllowedDomainTypeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v DomainType) IsValid() bool { - for _, existing := range AllowedDomainTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to Domain_type value -func (v DomainType) Ptr() *DomainType { - return &v -} - -type NullableDomainType struct { - value *DomainType - isSet bool -} - -func (v NullableDomainType) Get() *DomainType { - return v.value -} - -func (v *NullableDomainType) Set(val *DomainType) { - v.value = val - v.isSet = true -} - -func (v NullableDomainType) IsSet() bool { - return v.isSet -} - -func (v *NullableDomainType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDomainType(val *DomainType) *NullableDomainType { - return &NullableDomainType{value: val, isSet: true} -} - -func (v NullableDomainType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDomainType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_error_details.go b/services/cdn/v1betaapi/model_error_details.go deleted file mode 100644 index 0b68c0de2..000000000 --- a/services/cdn/v1betaapi/model_error_details.go +++ /dev/null @@ -1,305 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the ErrorDetails type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ErrorDetails{} - -// ErrorDetails struct for ErrorDetails -type ErrorDetails struct { - // German description of the error - De *string `json:"de,omitempty"` - // Deprecated - Description string `json:"description"` - // English description of the error - En string `json:"en"` - // Optional field in the request this error detail refers to - Field *string `json:"field,omitempty"` - Key ErrorDetailsKey `json:"key"` - AdditionalProperties map[string]interface{} -} - -type _ErrorDetails ErrorDetails - -// NewErrorDetails instantiates a new ErrorDetails 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 NewErrorDetails(description string, en string, key ErrorDetailsKey) *ErrorDetails { - this := ErrorDetails{} - this.Description = description - this.En = en - this.Key = key - return &this -} - -// NewErrorDetailsWithDefaults instantiates a new ErrorDetails 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 NewErrorDetailsWithDefaults() *ErrorDetails { - this := ErrorDetails{} - return &this -} - -// GetDe returns the De field value if set, zero value otherwise. -func (o *ErrorDetails) GetDe() string { - if o == nil || IsNil(o.De) { - var ret string - return ret - } - return *o.De -} - -// GetDeOk returns a tuple with the De field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorDetails) GetDeOk() (*string, bool) { - if o == nil || IsNil(o.De) { - return nil, false - } - return o.De, true -} - -// HasDe returns a boolean if a field has been set. -func (o *ErrorDetails) HasDe() bool { - if o != nil && !IsNil(o.De) { - return true - } - - return false -} - -// SetDe gets a reference to the given string and assigns it to the De field. -func (o *ErrorDetails) SetDe(v string) { - o.De = &v -} - -// GetDescription returns the Description field value -// Deprecated -func (o *ErrorDetails) 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. -// Deprecated -func (o *ErrorDetails) GetDescriptionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Description, true -} - -// SetDescription sets field value -// Deprecated -func (o *ErrorDetails) SetDescription(v string) { - o.Description = v -} - -// GetEn returns the En field value -func (o *ErrorDetails) GetEn() string { - if o == nil { - var ret string - return ret - } - - return o.En -} - -// GetEnOk returns a tuple with the En field value -// and a boolean to check if the value has been set. -func (o *ErrorDetails) GetEnOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.En, true -} - -// SetEn sets field value -func (o *ErrorDetails) SetEn(v string) { - o.En = v -} - -// GetField returns the Field field value if set, zero value otherwise. -func (o *ErrorDetails) GetField() string { - if o == nil || IsNil(o.Field) { - var ret string - return ret - } - return *o.Field -} - -// GetFieldOk returns a tuple with the Field field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorDetails) GetFieldOk() (*string, bool) { - if o == nil || IsNil(o.Field) { - return nil, false - } - return o.Field, true -} - -// HasField returns a boolean if a field has been set. -func (o *ErrorDetails) HasField() bool { - if o != nil && !IsNil(o.Field) { - return true - } - - return false -} - -// SetField gets a reference to the given string and assigns it to the Field field. -func (o *ErrorDetails) SetField(v string) { - o.Field = &v -} - -// GetKey returns the Key field value -func (o *ErrorDetails) GetKey() ErrorDetailsKey { - if o == nil { - var ret ErrorDetailsKey - return ret - } - - return o.Key -} - -// GetKeyOk returns a tuple with the Key field value -// and a boolean to check if the value has been set. -func (o *ErrorDetails) GetKeyOk() (*ErrorDetailsKey, bool) { - if o == nil { - return nil, false - } - return &o.Key, true -} - -// SetKey sets field value -func (o *ErrorDetails) SetKey(v ErrorDetailsKey) { - o.Key = v -} - -func (o ErrorDetails) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ErrorDetails) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.De) { - toSerialize["de"] = o.De - } - toSerialize["description"] = o.Description - toSerialize["en"] = o.En - if !IsNil(o.Field) { - toSerialize["field"] = o.Field - } - toSerialize["key"] = o.Key - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ErrorDetails) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "description", - "en", - "key", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varErrorDetails := _ErrorDetails{} - - err = json.Unmarshal(data, &varErrorDetails) - - if err != nil { - return err - } - - *o = ErrorDetails(varErrorDetails) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "de") - delete(additionalProperties, "description") - delete(additionalProperties, "en") - delete(additionalProperties, "field") - delete(additionalProperties, "key") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableErrorDetails struct { - value *ErrorDetails - isSet bool -} - -func (v NullableErrorDetails) Get() *ErrorDetails { - return v.value -} - -func (v *NullableErrorDetails) Set(val *ErrorDetails) { - v.value = val - v.isSet = true -} - -func (v NullableErrorDetails) IsSet() bool { - return v.isSet -} - -func (v *NullableErrorDetails) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableErrorDetails(val *ErrorDetails) *NullableErrorDetails { - return &NullableErrorDetails{value: val, isSet: true} -} - -func (v NullableErrorDetails) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableErrorDetails) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_error_details_key.go b/services/cdn/v1betaapi/model_error_details_key.go deleted file mode 100644 index a2ebbb8e6..000000000 --- a/services/cdn/v1betaapi/model_error_details_key.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// ErrorDetailsKey the model 'ErrorDetailsKey' -type ErrorDetailsKey string - -// List of ErrorDetails_key -const ( - ERRORDETAILSKEY_UNKNOWN ErrorDetailsKey = "UNKNOWN" - ERRORDETAILSKEY_CUSTOM_DOMAIN_CNAME_MISSING ErrorDetailsKey = "CUSTOM_DOMAIN_CNAME_MISSING" - ERRORDETAILSKEY_INVALID_ARGUMENT ErrorDetailsKey = "INVALID_ARGUMENT" - ERRORDETAILSKEY_LOG_SINK_INSTANCE_UNAVAILABLE ErrorDetailsKey = "LOG_SINK_INSTANCE_UNAVAILABLE" - ERRORDETAILSKEY_UNKNOWN_DEFAULT_OPEN_API ErrorDetailsKey = "unknown_default_open_api" -) - -// All allowed values of ErrorDetailsKey enum -var AllowedErrorDetailsKeyEnumValues = []ErrorDetailsKey{ - "UNKNOWN", - "CUSTOM_DOMAIN_CNAME_MISSING", - "INVALID_ARGUMENT", - "LOG_SINK_INSTANCE_UNAVAILABLE", - "unknown_default_open_api", -} - -func (v *ErrorDetailsKey) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ErrorDetailsKey(value) - for _, existing := range AllowedErrorDetailsKeyEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = ERRORDETAILSKEY_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewErrorDetailsKeyFromValue returns a pointer to a valid ErrorDetailsKey -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewErrorDetailsKeyFromValue(v string) (*ErrorDetailsKey, error) { - ev := ErrorDetailsKey(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ErrorDetailsKey: valid values are %v", v, AllowedErrorDetailsKeyEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ErrorDetailsKey) IsValid() bool { - for _, existing := range AllowedErrorDetailsKeyEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ErrorDetails_key value -func (v ErrorDetailsKey) Ptr() *ErrorDetailsKey { - return &v -} - -type NullableErrorDetailsKey struct { - value *ErrorDetailsKey - isSet bool -} - -func (v NullableErrorDetailsKey) Get() *ErrorDetailsKey { - return v.value -} - -func (v *NullableErrorDetailsKey) Set(val *ErrorDetailsKey) { - v.value = val - v.isSet = true -} - -func (v NullableErrorDetailsKey) IsSet() bool { - return v.isSet -} - -func (v *NullableErrorDetailsKey) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableErrorDetailsKey(val *ErrorDetailsKey) *NullableErrorDetailsKey { - return &NullableErrorDetailsKey{value: val, isSet: true} -} - -func (v NullableErrorDetailsKey) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableErrorDetailsKey) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_find_cache_paths_response.go b/services/cdn/v1betaapi/model_find_cache_paths_response.go deleted file mode 100644 index 25f590341..000000000 --- a/services/cdn/v1betaapi/model_find_cache_paths_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the FindCachePathsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &FindCachePathsResponse{} - -// FindCachePathsResponse struct for FindCachePathsResponse -type FindCachePathsResponse struct { - Response []FindCachePathsResponseEntry `json:"response"` - AdditionalProperties map[string]interface{} -} - -type _FindCachePathsResponse FindCachePathsResponse - -// NewFindCachePathsResponse instantiates a new FindCachePathsResponse 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 NewFindCachePathsResponse(response []FindCachePathsResponseEntry) *FindCachePathsResponse { - this := FindCachePathsResponse{} - this.Response = response - return &this -} - -// NewFindCachePathsResponseWithDefaults instantiates a new FindCachePathsResponse 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 NewFindCachePathsResponseWithDefaults() *FindCachePathsResponse { - this := FindCachePathsResponse{} - return &this -} - -// GetResponse returns the Response field value -func (o *FindCachePathsResponse) GetResponse() []FindCachePathsResponseEntry { - if o == nil { - var ret []FindCachePathsResponseEntry - return ret - } - - return o.Response -} - -// GetResponseOk returns a tuple with the Response field value -// and a boolean to check if the value has been set. -func (o *FindCachePathsResponse) GetResponseOk() ([]FindCachePathsResponseEntry, bool) { - if o == nil { - return nil, false - } - return o.Response, true -} - -// SetResponse sets field value -func (o *FindCachePathsResponse) SetResponse(v []FindCachePathsResponseEntry) { - o.Response = v -} - -func (o FindCachePathsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o FindCachePathsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["response"] = o.Response - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *FindCachePathsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "response", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varFindCachePathsResponse := _FindCachePathsResponse{} - - err = json.Unmarshal(data, &varFindCachePathsResponse) - - if err != nil { - return err - } - - *o = FindCachePathsResponse(varFindCachePathsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "response") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableFindCachePathsResponse struct { - value *FindCachePathsResponse - isSet bool -} - -func (v NullableFindCachePathsResponse) Get() *FindCachePathsResponse { - return v.value -} - -func (v *NullableFindCachePathsResponse) Set(val *FindCachePathsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableFindCachePathsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableFindCachePathsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFindCachePathsResponse(val *FindCachePathsResponse) *NullableFindCachePathsResponse { - return &NullableFindCachePathsResponse{value: val, isSet: true} -} - -func (v NullableFindCachePathsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFindCachePathsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_find_cache_paths_response_entry.go b/services/cdn/v1betaapi/model_find_cache_paths_response_entry.go deleted file mode 100644 index ff86fe8a8..000000000 --- a/services/cdn/v1betaapi/model_find_cache_paths_response_entry.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the FindCachePathsResponseEntry type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &FindCachePathsResponseEntry{} - -// FindCachePathsResponseEntry struct for FindCachePathsResponseEntry -type FindCachePathsResponseEntry struct { - // Defines one path that was previously used as part of a granular purge - Path string `json:"path"` - AdditionalProperties map[string]interface{} -} - -type _FindCachePathsResponseEntry FindCachePathsResponseEntry - -// NewFindCachePathsResponseEntry instantiates a new FindCachePathsResponseEntry 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 NewFindCachePathsResponseEntry(path string) *FindCachePathsResponseEntry { - this := FindCachePathsResponseEntry{} - this.Path = path - return &this -} - -// NewFindCachePathsResponseEntryWithDefaults instantiates a new FindCachePathsResponseEntry 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 NewFindCachePathsResponseEntryWithDefaults() *FindCachePathsResponseEntry { - this := FindCachePathsResponseEntry{} - return &this -} - -// GetPath returns the Path field value -func (o *FindCachePathsResponseEntry) GetPath() string { - if o == nil { - var ret string - return ret - } - - return o.Path -} - -// GetPathOk returns a tuple with the Path field value -// and a boolean to check if the value has been set. -func (o *FindCachePathsResponseEntry) GetPathOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Path, true -} - -// SetPath sets field value -func (o *FindCachePathsResponseEntry) SetPath(v string) { - o.Path = v -} - -func (o FindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o FindCachePathsResponseEntry) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["path"] = o.Path - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *FindCachePathsResponseEntry) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "path", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varFindCachePathsResponseEntry := _FindCachePathsResponseEntry{} - - err = json.Unmarshal(data, &varFindCachePathsResponseEntry) - - if err != nil { - return err - } - - *o = FindCachePathsResponseEntry(varFindCachePathsResponseEntry) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "path") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableFindCachePathsResponseEntry struct { - value *FindCachePathsResponseEntry - isSet bool -} - -func (v NullableFindCachePathsResponseEntry) Get() *FindCachePathsResponseEntry { - return v.value -} - -func (v *NullableFindCachePathsResponseEntry) Set(val *FindCachePathsResponseEntry) { - v.value = val - v.isSet = true -} - -func (v NullableFindCachePathsResponseEntry) IsSet() bool { - return v.isSet -} - -func (v *NullableFindCachePathsResponseEntry) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFindCachePathsResponseEntry(val *FindCachePathsResponseEntry) *NullableFindCachePathsResponseEntry { - return &NullableFindCachePathsResponseEntry{value: val, isSet: true} -} - -func (v NullableFindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFindCachePathsResponseEntry) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_generic_json_response.go b/services/cdn/v1betaapi/model_generic_json_response.go deleted file mode 100644 index 864426872..000000000 --- a/services/cdn/v1betaapi/model_generic_json_response.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the GenericJSONResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GenericJSONResponse{} - -// GenericJSONResponse struct for GenericJSONResponse -type GenericJSONResponse struct { - // Listing of issues with your request - Details []ErrorDetails `json:"details,omitempty"` - Message string `json:"message"` - AdditionalProperties map[string]interface{} -} - -type _GenericJSONResponse GenericJSONResponse - -// NewGenericJSONResponse instantiates a new GenericJSONResponse 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 NewGenericJSONResponse(message string) *GenericJSONResponse { - this := GenericJSONResponse{} - this.Message = message - return &this -} - -// NewGenericJSONResponseWithDefaults instantiates a new GenericJSONResponse 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 NewGenericJSONResponseWithDefaults() *GenericJSONResponse { - this := GenericJSONResponse{} - return &this -} - -// GetDetails returns the Details field value if set, zero value otherwise. -func (o *GenericJSONResponse) GetDetails() []ErrorDetails { - if o == nil || IsNil(o.Details) { - var ret []ErrorDetails - return ret - } - return o.Details -} - -// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GenericJSONResponse) GetDetailsOk() ([]ErrorDetails, bool) { - if o == nil || IsNil(o.Details) { - return nil, false - } - return o.Details, true -} - -// HasDetails returns a boolean if a field has been set. -func (o *GenericJSONResponse) HasDetails() bool { - if o != nil && !IsNil(o.Details) { - return true - } - - return false -} - -// SetDetails gets a reference to the given []ErrorDetails and assigns it to the Details field. -func (o *GenericJSONResponse) SetDetails(v []ErrorDetails) { - o.Details = v -} - -// GetMessage returns the Message field value -func (o *GenericJSONResponse) GetMessage() string { - if o == nil { - var ret string - return ret - } - - return o.Message -} - -// GetMessageOk returns a tuple with the Message field value -// and a boolean to check if the value has been set. -func (o *GenericJSONResponse) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Message, true -} - -// SetMessage sets field value -func (o *GenericJSONResponse) SetMessage(v string) { - o.Message = v -} - -func (o GenericJSONResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GenericJSONResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Details) { - toSerialize["details"] = o.Details - } - toSerialize["message"] = o.Message - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GenericJSONResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "message", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGenericJSONResponse := _GenericJSONResponse{} - - err = json.Unmarshal(data, &varGenericJSONResponse) - - if err != nil { - return err - } - - *o = GenericJSONResponse(varGenericJSONResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "details") - delete(additionalProperties, "message") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGenericJSONResponse struct { - value *GenericJSONResponse - isSet bool -} - -func (v NullableGenericJSONResponse) Get() *GenericJSONResponse { - return v.value -} - -func (v *NullableGenericJSONResponse) Set(val *GenericJSONResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGenericJSONResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGenericJSONResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGenericJSONResponse(val *GenericJSONResponse) *NullableGenericJSONResponse { - return &NullableGenericJSONResponse{value: val, isSet: true} -} - -func (v NullableGenericJSONResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGenericJSONResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_cache_info_response.go b/services/cdn/v1betaapi/model_get_cache_info_response.go deleted file mode 100644 index 5b84abd40..000000000 --- a/services/cdn/v1betaapi/model_get_cache_info_response.go +++ /dev/null @@ -1,199 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the GetCacheInfoResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCacheInfoResponse{} - -// GetCacheInfoResponse struct for GetCacheInfoResponse -type GetCacheInfoResponse struct { - History []GetCacheInfoResponseHistoryEntry `json:"history"` - // Returns the last time the cache was purged by calling the PurgeCache endpoint. Time represented as RFC3339 compliant string. If the cache was never purged, this returns `null` - LastPurgeTime NullableTime `json:"lastPurgeTime"` - AdditionalProperties map[string]interface{} -} - -type _GetCacheInfoResponse GetCacheInfoResponse - -// NewGetCacheInfoResponse instantiates a new GetCacheInfoResponse 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 NewGetCacheInfoResponse(history []GetCacheInfoResponseHistoryEntry, lastPurgeTime NullableTime) *GetCacheInfoResponse { - this := GetCacheInfoResponse{} - this.History = history - this.LastPurgeTime = lastPurgeTime - return &this -} - -// NewGetCacheInfoResponseWithDefaults instantiates a new GetCacheInfoResponse 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 NewGetCacheInfoResponseWithDefaults() *GetCacheInfoResponse { - this := GetCacheInfoResponse{} - return &this -} - -// GetHistory returns the History field value -func (o *GetCacheInfoResponse) GetHistory() []GetCacheInfoResponseHistoryEntry { - if o == nil { - var ret []GetCacheInfoResponseHistoryEntry - return ret - } - - return o.History -} - -// GetHistoryOk returns a tuple with the History field value -// and a boolean to check if the value has been set. -func (o *GetCacheInfoResponse) GetHistoryOk() ([]GetCacheInfoResponseHistoryEntry, bool) { - if o == nil { - return nil, false - } - return o.History, true -} - -// SetHistory sets field value -func (o *GetCacheInfoResponse) SetHistory(v []GetCacheInfoResponseHistoryEntry) { - o.History = v -} - -// GetLastPurgeTime returns the LastPurgeTime field value -// If the value is explicit nil, the zero value for time.Time will be returned -func (o *GetCacheInfoResponse) GetLastPurgeTime() time.Time { - if o == nil || o.LastPurgeTime.Get() == nil { - var ret time.Time - return ret - } - - return *o.LastPurgeTime.Get() -} - -// GetLastPurgeTimeOk returns a tuple with the LastPurgeTime field value -// 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 *GetCacheInfoResponse) GetLastPurgeTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.LastPurgeTime.Get(), o.LastPurgeTime.IsSet() -} - -// SetLastPurgeTime sets field value -func (o *GetCacheInfoResponse) SetLastPurgeTime(v time.Time) { - o.LastPurgeTime.Set(&v) -} - -func (o GetCacheInfoResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetCacheInfoResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["history"] = o.History - toSerialize["lastPurgeTime"] = o.LastPurgeTime.Get() - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetCacheInfoResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "history", - "lastPurgeTime", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetCacheInfoResponse := _GetCacheInfoResponse{} - - err = json.Unmarshal(data, &varGetCacheInfoResponse) - - if err != nil { - return err - } - - *o = GetCacheInfoResponse(varGetCacheInfoResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "history") - delete(additionalProperties, "lastPurgeTime") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetCacheInfoResponse struct { - value *GetCacheInfoResponse - isSet bool -} - -func (v NullableGetCacheInfoResponse) Get() *GetCacheInfoResponse { - return v.value -} - -func (v *NullableGetCacheInfoResponse) Set(val *GetCacheInfoResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetCacheInfoResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCacheInfoResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCacheInfoResponse(val *GetCacheInfoResponse) *NullableGetCacheInfoResponse { - return &NullableGetCacheInfoResponse{value: val, isSet: true} -} - -func (v NullableGetCacheInfoResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCacheInfoResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_cache_info_response_history_entry.go b/services/cdn/v1betaapi/model_get_cache_info_response_history_entry.go deleted file mode 100644 index 0934c5cc3..000000000 --- a/services/cdn/v1betaapi/model_get_cache_info_response_history_entry.go +++ /dev/null @@ -1,229 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the GetCacheInfoResponseHistoryEntry type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCacheInfoResponseHistoryEntry{} - -// GetCacheInfoResponseHistoryEntry struct for GetCacheInfoResponseHistoryEntry -type GetCacheInfoResponseHistoryEntry struct { - // Deprecated - OccuredAt time.Time `json:"occuredAt"` - OccurredAt time.Time `json:"occurredAt"` - Type GetCacheInfoResponseHistoryEntryType `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _GetCacheInfoResponseHistoryEntry GetCacheInfoResponseHistoryEntry - -// NewGetCacheInfoResponseHistoryEntry instantiates a new GetCacheInfoResponseHistoryEntry 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 NewGetCacheInfoResponseHistoryEntry(occuredAt time.Time, occurredAt time.Time, types GetCacheInfoResponseHistoryEntryType) *GetCacheInfoResponseHistoryEntry { - this := GetCacheInfoResponseHistoryEntry{} - this.OccuredAt = occuredAt - this.OccurredAt = occurredAt - this.Type = types - return &this -} - -// NewGetCacheInfoResponseHistoryEntryWithDefaults instantiates a new GetCacheInfoResponseHistoryEntry 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 NewGetCacheInfoResponseHistoryEntryWithDefaults() *GetCacheInfoResponseHistoryEntry { - this := GetCacheInfoResponseHistoryEntry{} - return &this -} - -// GetOccuredAt returns the OccuredAt field value -// Deprecated -func (o *GetCacheInfoResponseHistoryEntry) GetOccuredAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.OccuredAt -} - -// GetOccuredAtOk returns a tuple with the OccuredAt field value -// and a boolean to check if the value has been set. -// Deprecated -func (o *GetCacheInfoResponseHistoryEntry) GetOccuredAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.OccuredAt, true -} - -// SetOccuredAt sets field value -// Deprecated -func (o *GetCacheInfoResponseHistoryEntry) SetOccuredAt(v time.Time) { - o.OccuredAt = v -} - -// GetOccurredAt returns the OccurredAt field value -func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAt() time.Time { - if o == nil { - var ret time.Time - return ret - } - - return o.OccurredAt -} - -// GetOccurredAtOk returns a tuple with the OccurredAt field value -// and a boolean to check if the value has been set. -func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.OccurredAt, true -} - -// SetOccurredAt sets field value -func (o *GetCacheInfoResponseHistoryEntry) SetOccurredAt(v time.Time) { - o.OccurredAt = v -} - -// GetType returns the Type field value -func (o *GetCacheInfoResponseHistoryEntry) GetType() GetCacheInfoResponseHistoryEntryType { - if o == nil { - var ret GetCacheInfoResponseHistoryEntryType - 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 *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*GetCacheInfoResponseHistoryEntryType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *GetCacheInfoResponseHistoryEntry) SetType(v GetCacheInfoResponseHistoryEntryType) { - o.Type = v -} - -func (o GetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetCacheInfoResponseHistoryEntry) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["occuredAt"] = o.OccuredAt - toSerialize["occurredAt"] = o.OccurredAt - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetCacheInfoResponseHistoryEntry) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "occuredAt", - "occurredAt", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetCacheInfoResponseHistoryEntry := _GetCacheInfoResponseHistoryEntry{} - - err = json.Unmarshal(data, &varGetCacheInfoResponseHistoryEntry) - - if err != nil { - return err - } - - *o = GetCacheInfoResponseHistoryEntry(varGetCacheInfoResponseHistoryEntry) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "occuredAt") - delete(additionalProperties, "occurredAt") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetCacheInfoResponseHistoryEntry struct { - value *GetCacheInfoResponseHistoryEntry - isSet bool -} - -func (v NullableGetCacheInfoResponseHistoryEntry) Get() *GetCacheInfoResponseHistoryEntry { - return v.value -} - -func (v *NullableGetCacheInfoResponseHistoryEntry) Set(val *GetCacheInfoResponseHistoryEntry) { - v.value = val - v.isSet = true -} - -func (v NullableGetCacheInfoResponseHistoryEntry) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCacheInfoResponseHistoryEntry) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCacheInfoResponseHistoryEntry(val *GetCacheInfoResponseHistoryEntry) *NullableGetCacheInfoResponseHistoryEntry { - return &NullableGetCacheInfoResponseHistoryEntry{value: val, isSet: true} -} - -func (v NullableGetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCacheInfoResponseHistoryEntry) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_cache_info_response_history_entry_type.go b/services/cdn/v1betaapi/model_get_cache_info_response_history_entry_type.go deleted file mode 100644 index b21ff8df3..000000000 --- a/services/cdn/v1betaapi/model_get_cache_info_response_history_entry_type.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// GetCacheInfoResponseHistoryEntryType the model 'GetCacheInfoResponseHistoryEntryType' -type GetCacheInfoResponseHistoryEntryType string - -// List of GetCacheInfoResponseHistoryEntry_type -const ( - GETCACHEINFORESPONSEHISTORYENTRYTYPE_FULL GetCacheInfoResponseHistoryEntryType = "full" - GETCACHEINFORESPONSEHISTORYENTRYTYPE_GRANULAR GetCacheInfoResponseHistoryEntryType = "granular" - GETCACHEINFORESPONSEHISTORYENTRYTYPE_UNKNOWN_DEFAULT_OPEN_API GetCacheInfoResponseHistoryEntryType = "unknown_default_open_api" -) - -// All allowed values of GetCacheInfoResponseHistoryEntryType enum -var AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues = []GetCacheInfoResponseHistoryEntryType{ - "full", - "granular", - "unknown_default_open_api", -} - -func (v *GetCacheInfoResponseHistoryEntryType) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetCacheInfoResponseHistoryEntryType(value) - for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETCACHEINFORESPONSEHISTORYENTRYTYPE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetCacheInfoResponseHistoryEntryTypeFromValue returns a pointer to a valid GetCacheInfoResponseHistoryEntryType -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetCacheInfoResponseHistoryEntryTypeFromValue(v string) (*GetCacheInfoResponseHistoryEntryType, error) { - ev := GetCacheInfoResponseHistoryEntryType(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetCacheInfoResponseHistoryEntryType: valid values are %v", v, AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetCacheInfoResponseHistoryEntryType) IsValid() bool { - for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetCacheInfoResponseHistoryEntry_type value -func (v GetCacheInfoResponseHistoryEntryType) Ptr() *GetCacheInfoResponseHistoryEntryType { - return &v -} - -type NullableGetCacheInfoResponseHistoryEntryType struct { - value *GetCacheInfoResponseHistoryEntryType - isSet bool -} - -func (v NullableGetCacheInfoResponseHistoryEntryType) Get() *GetCacheInfoResponseHistoryEntryType { - return v.value -} - -func (v *NullableGetCacheInfoResponseHistoryEntryType) Set(val *GetCacheInfoResponseHistoryEntryType) { - v.value = val - v.isSet = true -} - -func (v NullableGetCacheInfoResponseHistoryEntryType) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCacheInfoResponseHistoryEntryType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCacheInfoResponseHistoryEntryType(val *GetCacheInfoResponseHistoryEntryType) *NullableGetCacheInfoResponseHistoryEntryType { - return &NullableGetCacheInfoResponseHistoryEntryType{value: val, isSet: true} -} - -func (v NullableGetCacheInfoResponseHistoryEntryType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCacheInfoResponseHistoryEntryType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_custom_domain_custom_certificate.go b/services/cdn/v1betaapi/model_get_custom_domain_custom_certificate.go deleted file mode 100644 index 8f2dafb50..000000000 --- a/services/cdn/v1betaapi/model_get_custom_domain_custom_certificate.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCustomDomainCustomCertificate{} - -// GetCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. -type GetCustomDomainCustomCertificate struct { - Type string `json:"type"` - // Whenever a new custom certificate is added the version is increased by 1. - Version int32 `json:"version"` - AdditionalProperties map[string]interface{} -} - -type _GetCustomDomainCustomCertificate GetCustomDomainCustomCertificate - -// NewGetCustomDomainCustomCertificate instantiates a new GetCustomDomainCustomCertificate 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 NewGetCustomDomainCustomCertificate(types string, version int32) *GetCustomDomainCustomCertificate { - this := GetCustomDomainCustomCertificate{} - this.Type = types - this.Version = version - return &this -} - -// NewGetCustomDomainCustomCertificateWithDefaults instantiates a new GetCustomDomainCustomCertificate 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 NewGetCustomDomainCustomCertificateWithDefaults() *GetCustomDomainCustomCertificate { - this := GetCustomDomainCustomCertificate{} - return &this -} - -// GetType returns the Type field value -func (o *GetCustomDomainCustomCertificate) 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 *GetCustomDomainCustomCertificate) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *GetCustomDomainCustomCertificate) SetType(v string) { - o.Type = v -} - -// GetVersion returns the Version field value -func (o *GetCustomDomainCustomCertificate) GetVersion() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Version -} - -// GetVersionOk returns a tuple with the Version field value -// and a boolean to check if the value has been set. -func (o *GetCustomDomainCustomCertificate) GetVersionOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Version, true -} - -// SetVersion sets field value -func (o *GetCustomDomainCustomCertificate) SetVersion(v int32) { - o.Version = v -} - -func (o GetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - toSerialize["version"] = o.Version - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetCustomDomainCustomCertificate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - "version", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetCustomDomainCustomCertificate := _GetCustomDomainCustomCertificate{} - - err = json.Unmarshal(data, &varGetCustomDomainCustomCertificate) - - if err != nil { - return err - } - - *o = GetCustomDomainCustomCertificate(varGetCustomDomainCustomCertificate) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - delete(additionalProperties, "version") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetCustomDomainCustomCertificate struct { - value *GetCustomDomainCustomCertificate - isSet bool -} - -func (v NullableGetCustomDomainCustomCertificate) Get() *GetCustomDomainCustomCertificate { - return v.value -} - -func (v *NullableGetCustomDomainCustomCertificate) Set(val *GetCustomDomainCustomCertificate) { - v.value = val - v.isSet = true -} - -func (v NullableGetCustomDomainCustomCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCustomDomainCustomCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCustomDomainCustomCertificate(val *GetCustomDomainCustomCertificate) *NullableGetCustomDomainCustomCertificate { - return &NullableGetCustomDomainCustomCertificate{value: val, isSet: true} -} - -func (v NullableGetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_custom_domain_managed_certificate.go b/services/cdn/v1betaapi/model_get_custom_domain_managed_certificate.go deleted file mode 100644 index a4bb2e525..000000000 --- a/services/cdn/v1betaapi/model_get_custom_domain_managed_certificate.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCustomDomainManagedCertificate{} - -// GetCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you -type GetCustomDomainManagedCertificate struct { - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _GetCustomDomainManagedCertificate GetCustomDomainManagedCertificate - -// NewGetCustomDomainManagedCertificate instantiates a new GetCustomDomainManagedCertificate 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 NewGetCustomDomainManagedCertificate(types string) *GetCustomDomainManagedCertificate { - this := GetCustomDomainManagedCertificate{} - this.Type = types - return &this -} - -// NewGetCustomDomainManagedCertificateWithDefaults instantiates a new GetCustomDomainManagedCertificate 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 NewGetCustomDomainManagedCertificateWithDefaults() *GetCustomDomainManagedCertificate { - this := GetCustomDomainManagedCertificate{} - return &this -} - -// GetType returns the Type field value -func (o *GetCustomDomainManagedCertificate) 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 *GetCustomDomainManagedCertificate) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *GetCustomDomainManagedCertificate) SetType(v string) { - o.Type = v -} - -func (o GetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetCustomDomainManagedCertificate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetCustomDomainManagedCertificate := _GetCustomDomainManagedCertificate{} - - err = json.Unmarshal(data, &varGetCustomDomainManagedCertificate) - - if err != nil { - return err - } - - *o = GetCustomDomainManagedCertificate(varGetCustomDomainManagedCertificate) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetCustomDomainManagedCertificate struct { - value *GetCustomDomainManagedCertificate - isSet bool -} - -func (v NullableGetCustomDomainManagedCertificate) Get() *GetCustomDomainManagedCertificate { - return v.value -} - -func (v *NullableGetCustomDomainManagedCertificate) Set(val *GetCustomDomainManagedCertificate) { - v.value = val - v.isSet = true -} - -func (v NullableGetCustomDomainManagedCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCustomDomainManagedCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCustomDomainManagedCertificate(val *GetCustomDomainManagedCertificate) *NullableGetCustomDomainManagedCertificate { - return &NullableGetCustomDomainManagedCertificate{value: val, isSet: true} -} - -func (v NullableGetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_custom_domain_response.go b/services/cdn/v1betaapi/model_get_custom_domain_response.go deleted file mode 100644 index 73c83f8ad..000000000 --- a/services/cdn/v1betaapi/model_get_custom_domain_response.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetCustomDomainResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCustomDomainResponse{} - -// GetCustomDomainResponse struct for GetCustomDomainResponse -type GetCustomDomainResponse struct { - Certificate GetCustomDomainResponseCertificate `json:"certificate"` - CustomDomain CustomDomain `json:"customDomain"` - // Deprecated - Domain string `json:"domain" validate:"regexp=^[.\\-A-Za-z0-9]*$"` - AdditionalProperties map[string]interface{} -} - -type _GetCustomDomainResponse GetCustomDomainResponse - -// NewGetCustomDomainResponse instantiates a new GetCustomDomainResponse 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 NewGetCustomDomainResponse(certificate GetCustomDomainResponseCertificate, customDomain CustomDomain, domain string) *GetCustomDomainResponse { - this := GetCustomDomainResponse{} - this.Certificate = certificate - this.CustomDomain = customDomain - this.Domain = domain - return &this -} - -// NewGetCustomDomainResponseWithDefaults instantiates a new GetCustomDomainResponse 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 NewGetCustomDomainResponseWithDefaults() *GetCustomDomainResponse { - this := GetCustomDomainResponse{} - return &this -} - -// GetCertificate returns the Certificate field value -func (o *GetCustomDomainResponse) GetCertificate() GetCustomDomainResponseCertificate { - if o == nil { - var ret GetCustomDomainResponseCertificate - return ret - } - - return o.Certificate -} - -// GetCertificateOk returns a tuple with the Certificate field value -// and a boolean to check if the value has been set. -func (o *GetCustomDomainResponse) GetCertificateOk() (*GetCustomDomainResponseCertificate, bool) { - if o == nil { - return nil, false - } - return &o.Certificate, true -} - -// SetCertificate sets field value -func (o *GetCustomDomainResponse) SetCertificate(v GetCustomDomainResponseCertificate) { - o.Certificate = v -} - -// GetCustomDomain returns the CustomDomain field value -func (o *GetCustomDomainResponse) GetCustomDomain() CustomDomain { - if o == nil { - var ret CustomDomain - return ret - } - - return o.CustomDomain -} - -// GetCustomDomainOk returns a tuple with the CustomDomain field value -// and a boolean to check if the value has been set. -func (o *GetCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { - if o == nil { - return nil, false - } - return &o.CustomDomain, true -} - -// SetCustomDomain sets field value -func (o *GetCustomDomainResponse) SetCustomDomain(v CustomDomain) { - o.CustomDomain = v -} - -// GetDomain returns the Domain field value -// Deprecated -func (o *GetCustomDomainResponse) GetDomain() string { - if o == nil { - var ret string - return ret - } - - return o.Domain -} - -// GetDomainOk returns a tuple with the Domain field value -// and a boolean to check if the value has been set. -// Deprecated -func (o *GetCustomDomainResponse) GetDomainOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Domain, true -} - -// SetDomain sets field value -// Deprecated -func (o *GetCustomDomainResponse) SetDomain(v string) { - o.Domain = v -} - -func (o GetCustomDomainResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetCustomDomainResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["certificate"] = o.Certificate - toSerialize["customDomain"] = o.CustomDomain - toSerialize["domain"] = o.Domain - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "certificate", - "customDomain", - "domain", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetCustomDomainResponse := _GetCustomDomainResponse{} - - err = json.Unmarshal(data, &varGetCustomDomainResponse) - - if err != nil { - return err - } - - *o = GetCustomDomainResponse(varGetCustomDomainResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "certificate") - delete(additionalProperties, "customDomain") - delete(additionalProperties, "domain") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetCustomDomainResponse struct { - value *GetCustomDomainResponse - isSet bool -} - -func (v NullableGetCustomDomainResponse) Get() *GetCustomDomainResponse { - return v.value -} - -func (v *NullableGetCustomDomainResponse) Set(val *GetCustomDomainResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetCustomDomainResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCustomDomainResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCustomDomainResponse(val *GetCustomDomainResponse) *NullableGetCustomDomainResponse { - return &NullableGetCustomDomainResponse{value: val, isSet: true} -} - -func (v NullableGetCustomDomainResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCustomDomainResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_custom_domain_response_certificate.go b/services/cdn/v1betaapi/model_get_custom_domain_response_certificate.go deleted file mode 100644 index d110f28bf..000000000 --- a/services/cdn/v1betaapi/model_get_custom_domain_response_certificate.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// GetCustomDomainResponseCertificate - struct for GetCustomDomainResponseCertificate -type GetCustomDomainResponseCertificate struct { - GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate - GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate -} - -// GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in GetCustomDomainResponseCertificate -func GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) GetCustomDomainResponseCertificate { - return GetCustomDomainResponseCertificate{ - GetCustomDomainCustomCertificate: v, - } -} - -// GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in GetCustomDomainResponseCertificate -func GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) GetCustomDomainResponseCertificate { - return GetCustomDomainResponseCertificate{ - GetCustomDomainManagedCertificate: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *GetCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'custom' - if jsonDict["type"] == "custom" { - // try to unmarshal JSON data into GetCustomDomainCustomCertificate - err = json.Unmarshal(data, &dst.GetCustomDomainCustomCertificate) - if err == nil { - return nil // data stored in dst.GetCustomDomainCustomCertificate, return on the first match - } else { - dst.GetCustomDomainCustomCertificate = nil - return fmt.Errorf("failed to unmarshal GetCustomDomainResponseCertificate as GetCustomDomainCustomCertificate: %s", err.Error()) - } - } - - // check if the discriminator value is 'managed' - if jsonDict["type"] == "managed" { - // try to unmarshal JSON data into GetCustomDomainManagedCertificate - err = json.Unmarshal(data, &dst.GetCustomDomainManagedCertificate) - if err == nil { - return nil // data stored in dst.GetCustomDomainManagedCertificate, return on the first match - } else { - dst.GetCustomDomainManagedCertificate = nil - return fmt.Errorf("failed to unmarshal GetCustomDomainResponseCertificate as GetCustomDomainManagedCertificate: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src GetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { - if src.GetCustomDomainCustomCertificate != nil { - return json.Marshal(&src.GetCustomDomainCustomCertificate) - } - - if src.GetCustomDomainManagedCertificate != nil { - return json.Marshal(&src.GetCustomDomainManagedCertificate) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *GetCustomDomainResponseCertificate) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.GetCustomDomainCustomCertificate != nil { - return obj.GetCustomDomainCustomCertificate - } - - if obj.GetCustomDomainManagedCertificate != nil { - return obj.GetCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj GetCustomDomainResponseCertificate) GetActualInstanceValue() interface{} { - if obj.GetCustomDomainCustomCertificate != nil { - return *obj.GetCustomDomainCustomCertificate - } - - if obj.GetCustomDomainManagedCertificate != nil { - return *obj.GetCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -type NullableGetCustomDomainResponseCertificate struct { - value *GetCustomDomainResponseCertificate - isSet bool -} - -func (v NullableGetCustomDomainResponseCertificate) Get() *GetCustomDomainResponseCertificate { - return v.value -} - -func (v *NullableGetCustomDomainResponseCertificate) Set(val *GetCustomDomainResponseCertificate) { - v.value = val - v.isSet = true -} - -func (v NullableGetCustomDomainResponseCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCustomDomainResponseCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCustomDomainResponseCertificate(val *GetCustomDomainResponseCertificate) *NullableGetCustomDomainResponseCertificate { - return &NullableGetCustomDomainResponseCertificate{value: val, isSet: true} -} - -func (v NullableGetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_distribution_response.go b/services/cdn/v1betaapi/model_get_distribution_response.go deleted file mode 100644 index 8c779da79..000000000 --- a/services/cdn/v1betaapi/model_get_distribution_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetDistributionResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetDistributionResponse{} - -// GetDistributionResponse struct for GetDistributionResponse -type GetDistributionResponse struct { - Distribution Distribution `json:"distribution"` - AdditionalProperties map[string]interface{} -} - -type _GetDistributionResponse GetDistributionResponse - -// NewGetDistributionResponse instantiates a new GetDistributionResponse 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 NewGetDistributionResponse(distribution Distribution) *GetDistributionResponse { - this := GetDistributionResponse{} - this.Distribution = distribution - return &this -} - -// NewGetDistributionResponseWithDefaults instantiates a new GetDistributionResponse 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 NewGetDistributionResponseWithDefaults() *GetDistributionResponse { - this := GetDistributionResponse{} - return &this -} - -// GetDistribution returns the Distribution field value -func (o *GetDistributionResponse) GetDistribution() Distribution { - if o == nil { - var ret Distribution - return ret - } - - return o.Distribution -} - -// GetDistributionOk returns a tuple with the Distribution field value -// and a boolean to check if the value has been set. -func (o *GetDistributionResponse) GetDistributionOk() (*Distribution, bool) { - if o == nil { - return nil, false - } - return &o.Distribution, true -} - -// SetDistribution sets field value -func (o *GetDistributionResponse) SetDistribution(v Distribution) { - o.Distribution = v -} - -func (o GetDistributionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetDistributionResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["distribution"] = o.Distribution - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetDistributionResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "distribution", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetDistributionResponse := _GetDistributionResponse{} - - err = json.Unmarshal(data, &varGetDistributionResponse) - - if err != nil { - return err - } - - *o = GetDistributionResponse(varGetDistributionResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "distribution") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetDistributionResponse struct { - value *GetDistributionResponse - isSet bool -} - -func (v NullableGetDistributionResponse) Get() *GetDistributionResponse { - return v.value -} - -func (v *NullableGetDistributionResponse) Set(val *GetDistributionResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetDistributionResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetDistributionResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetDistributionResponse(val *GetDistributionResponse) *NullableGetDistributionResponse { - return &NullableGetDistributionResponse{value: val, isSet: true} -} - -func (v NullableGetDistributionResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetDistributionResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_logs_response.go b/services/cdn/v1betaapi/model_get_logs_response.go deleted file mode 100644 index 6deba5bd1..000000000 --- a/services/cdn/v1betaapi/model_get_logs_response.go +++ /dev/null @@ -1,203 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetLogsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetLogsResponse{} - -// GetLogsResponse struct for GetLogsResponse -type GetLogsResponse struct { - Logs []DistributionLogsRecord `json:"logs"` - NextPageIdentifier *string `json:"nextPageIdentifier,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _GetLogsResponse GetLogsResponse - -// NewGetLogsResponse instantiates a new GetLogsResponse 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 NewGetLogsResponse(logs []DistributionLogsRecord) *GetLogsResponse { - this := GetLogsResponse{} - this.Logs = logs - return &this -} - -// NewGetLogsResponseWithDefaults instantiates a new GetLogsResponse 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 NewGetLogsResponseWithDefaults() *GetLogsResponse { - this := GetLogsResponse{} - return &this -} - -// GetLogs returns the Logs field value -func (o *GetLogsResponse) GetLogs() []DistributionLogsRecord { - if o == nil { - var ret []DistributionLogsRecord - return ret - } - - return o.Logs -} - -// GetLogsOk returns a tuple with the Logs field value -// and a boolean to check if the value has been set. -func (o *GetLogsResponse) GetLogsOk() ([]DistributionLogsRecord, bool) { - if o == nil { - return nil, false - } - return o.Logs, true -} - -// SetLogs sets field value -func (o *GetLogsResponse) SetLogs(v []DistributionLogsRecord) { - o.Logs = v -} - -// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. -func (o *GetLogsResponse) GetNextPageIdentifier() string { - if o == nil || IsNil(o.NextPageIdentifier) { - var ret string - return ret - } - return *o.NextPageIdentifier -} - -// GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetLogsResponse) GetNextPageIdentifierOk() (*string, bool) { - if o == nil || IsNil(o.NextPageIdentifier) { - return nil, false - } - return o.NextPageIdentifier, true -} - -// HasNextPageIdentifier returns a boolean if a field has been set. -func (o *GetLogsResponse) HasNextPageIdentifier() bool { - if o != nil && !IsNil(o.NextPageIdentifier) { - return true - } - - return false -} - -// SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. -func (o *GetLogsResponse) SetNextPageIdentifier(v string) { - o.NextPageIdentifier = &v -} - -func (o GetLogsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetLogsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["logs"] = o.Logs - if !IsNil(o.NextPageIdentifier) { - toSerialize["nextPageIdentifier"] = o.NextPageIdentifier - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetLogsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "logs", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetLogsResponse := _GetLogsResponse{} - - err = json.Unmarshal(data, &varGetLogsResponse) - - if err != nil { - return err - } - - *o = GetLogsResponse(varGetLogsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "logs") - delete(additionalProperties, "nextPageIdentifier") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetLogsResponse struct { - value *GetLogsResponse - isSet bool -} - -func (v NullableGetLogsResponse) Get() *GetLogsResponse { - return v.value -} - -func (v *NullableGetLogsResponse) Set(val *GetLogsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsResponse(val *GetLogsResponse) *NullableGetLogsResponse { - return &NullableGetLogsResponse{value: val, isSet: true} -} - -func (v NullableGetLogsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_logs_search_filters_response.go b/services/cdn/v1betaapi/model_get_logs_search_filters_response.go deleted file mode 100644 index 0864d5d9c..000000000 --- a/services/cdn/v1betaapi/model_get_logs_search_filters_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetLogsSearchFiltersResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetLogsSearchFiltersResponse{} - -// GetLogsSearchFiltersResponse struct for GetLogsSearchFiltersResponse -type GetLogsSearchFiltersResponse struct { - Filters []string `json:"filters"` - AdditionalProperties map[string]interface{} -} - -type _GetLogsSearchFiltersResponse GetLogsSearchFiltersResponse - -// NewGetLogsSearchFiltersResponse instantiates a new GetLogsSearchFiltersResponse 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 NewGetLogsSearchFiltersResponse(filters []string) *GetLogsSearchFiltersResponse { - this := GetLogsSearchFiltersResponse{} - this.Filters = filters - return &this -} - -// NewGetLogsSearchFiltersResponseWithDefaults instantiates a new GetLogsSearchFiltersResponse 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 NewGetLogsSearchFiltersResponseWithDefaults() *GetLogsSearchFiltersResponse { - this := GetLogsSearchFiltersResponse{} - return &this -} - -// GetFilters returns the Filters field value -func (o *GetLogsSearchFiltersResponse) GetFilters() []string { - if o == nil { - var ret []string - return ret - } - - return o.Filters -} - -// GetFiltersOk returns a tuple with the Filters field value -// and a boolean to check if the value has been set. -func (o *GetLogsSearchFiltersResponse) GetFiltersOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.Filters, true -} - -// SetFilters sets field value -func (o *GetLogsSearchFiltersResponse) SetFilters(v []string) { - o.Filters = v -} - -func (o GetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetLogsSearchFiltersResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["filters"] = o.Filters - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetLogsSearchFiltersResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "filters", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetLogsSearchFiltersResponse := _GetLogsSearchFiltersResponse{} - - err = json.Unmarshal(data, &varGetLogsSearchFiltersResponse) - - if err != nil { - return err - } - - *o = GetLogsSearchFiltersResponse(varGetLogsSearchFiltersResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "filters") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetLogsSearchFiltersResponse struct { - value *GetLogsSearchFiltersResponse - isSet bool -} - -func (v NullableGetLogsSearchFiltersResponse) Get() *GetLogsSearchFiltersResponse { - return v.value -} - -func (v *NullableGetLogsSearchFiltersResponse) Set(val *GetLogsSearchFiltersResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsSearchFiltersResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsSearchFiltersResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsSearchFiltersResponse(val *GetLogsSearchFiltersResponse) *NullableGetLogsSearchFiltersResponse { - return &NullableGetLogsSearchFiltersResponse{value: val, isSet: true} -} - -func (v NullableGetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsSearchFiltersResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_logs_sort_by_parameter.go b/services/cdn/v1betaapi/model_get_logs_sort_by_parameter.go deleted file mode 100644 index 79848ce12..000000000 --- a/services/cdn/v1betaapi/model_get_logs_sort_by_parameter.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// GetLogsSortByParameter the model 'GetLogsSortByParameter' -type GetLogsSortByParameter string - -// List of GetLogs_sortBy_parameter -const ( - GETLOGSSORTBYPARAMETER_TIMESTAMP GetLogsSortByParameter = "timestamp" - GETLOGSSORTBYPARAMETER_DATA_CENTER_REGION GetLogsSortByParameter = "dataCenterRegion" - GETLOGSSORTBYPARAMETER_REQUEST_COUNTRY_CODE GetLogsSortByParameter = "requestCountryCode" - GETLOGSSORTBYPARAMETER_STATUS_CODE GetLogsSortByParameter = "statusCode" - GETLOGSSORTBYPARAMETER_CACHE_HIT GetLogsSortByParameter = "cacheHit" - GETLOGSSORTBYPARAMETER_SIZE GetLogsSortByParameter = "size" - GETLOGSSORTBYPARAMETER_PATH GetLogsSortByParameter = "path" - GETLOGSSORTBYPARAMETER_HOST GetLogsSortByParameter = "host" - GETLOGSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetLogsSortByParameter = "unknown_default_open_api" -) - -// All allowed values of GetLogsSortByParameter enum -var AllowedGetLogsSortByParameterEnumValues = []GetLogsSortByParameter{ - "timestamp", - "dataCenterRegion", - "requestCountryCode", - "statusCode", - "cacheHit", - "size", - "path", - "host", - "unknown_default_open_api", -} - -func (v *GetLogsSortByParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetLogsSortByParameter(value) - for _, existing := range AllowedGetLogsSortByParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETLOGSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetLogsSortByParameterFromValue returns a pointer to a valid GetLogsSortByParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetLogsSortByParameterFromValue(v string) (*GetLogsSortByParameter, error) { - ev := GetLogsSortByParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetLogsSortByParameter: valid values are %v", v, AllowedGetLogsSortByParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetLogsSortByParameter) IsValid() bool { - for _, existing := range AllowedGetLogsSortByParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetLogs_sortBy_parameter value -func (v GetLogsSortByParameter) Ptr() *GetLogsSortByParameter { - return &v -} - -type NullableGetLogsSortByParameter struct { - value *GetLogsSortByParameter - isSet bool -} - -func (v NullableGetLogsSortByParameter) Get() *GetLogsSortByParameter { - return v.value -} - -func (v *NullableGetLogsSortByParameter) Set(val *GetLogsSortByParameter) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsSortByParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsSortByParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsSortByParameter(val *GetLogsSortByParameter) *NullableGetLogsSortByParameter { - return &NullableGetLogsSortByParameter{value: val, isSet: true} -} - -func (v NullableGetLogsSortByParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsSortByParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_logs_sort_order_parameter.go b/services/cdn/v1betaapi/model_get_logs_sort_order_parameter.go deleted file mode 100644 index 0b93dcf47..000000000 --- a/services/cdn/v1betaapi/model_get_logs_sort_order_parameter.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// GetLogsSortOrderParameter the model 'GetLogsSortOrderParameter' -type GetLogsSortOrderParameter string - -// List of GetLogs_sortOrder_parameter -const ( - GETLOGSSORTORDERPARAMETER_ASCENDING GetLogsSortOrderParameter = "ascending" - GETLOGSSORTORDERPARAMETER_DESCENDING GetLogsSortOrderParameter = "descending" - GETLOGSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetLogsSortOrderParameter = "unknown_default_open_api" -) - -// All allowed values of GetLogsSortOrderParameter enum -var AllowedGetLogsSortOrderParameterEnumValues = []GetLogsSortOrderParameter{ - "ascending", - "descending", - "unknown_default_open_api", -} - -func (v *GetLogsSortOrderParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetLogsSortOrderParameter(value) - for _, existing := range AllowedGetLogsSortOrderParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETLOGSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetLogsSortOrderParameterFromValue returns a pointer to a valid GetLogsSortOrderParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetLogsSortOrderParameterFromValue(v string) (*GetLogsSortOrderParameter, error) { - ev := GetLogsSortOrderParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetLogsSortOrderParameter: valid values are %v", v, AllowedGetLogsSortOrderParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetLogsSortOrderParameter) IsValid() bool { - for _, existing := range AllowedGetLogsSortOrderParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetLogs_sortOrder_parameter value -func (v GetLogsSortOrderParameter) Ptr() *GetLogsSortOrderParameter { - return &v -} - -type NullableGetLogsSortOrderParameter struct { - value *GetLogsSortOrderParameter - isSet bool -} - -func (v NullableGetLogsSortOrderParameter) Get() *GetLogsSortOrderParameter { - return v.value -} - -func (v *NullableGetLogsSortOrderParameter) Set(val *GetLogsSortOrderParameter) { - v.value = val - v.isSet = true -} - -func (v NullableGetLogsSortOrderParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableGetLogsSortOrderParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetLogsSortOrderParameter(val *GetLogsSortOrderParameter) *NullableGetLogsSortOrderParameter { - return &NullableGetLogsSortOrderParameter{value: val, isSet: true} -} - -func (v NullableGetLogsSortOrderParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetLogsSortOrderParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_statistics_interval_parameter.go b/services/cdn/v1betaapi/model_get_statistics_interval_parameter.go deleted file mode 100644 index cecb5a4fc..000000000 --- a/services/cdn/v1betaapi/model_get_statistics_interval_parameter.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// GetStatisticsIntervalParameter the model 'GetStatisticsIntervalParameter' -type GetStatisticsIntervalParameter string - -// List of GetStatistics_interval_parameter -const ( - GETSTATISTICSINTERVALPARAMETER_HOURLY GetStatisticsIntervalParameter = "hourly" - GETSTATISTICSINTERVALPARAMETER_DAILY GetStatisticsIntervalParameter = "daily" - GETSTATISTICSINTERVALPARAMETER_MONTHLY GetStatisticsIntervalParameter = "monthly" - GETSTATISTICSINTERVALPARAMETER_YEARLY GetStatisticsIntervalParameter = "yearly" - GETSTATISTICSINTERVALPARAMETER_UNKNOWN_DEFAULT_OPEN_API GetStatisticsIntervalParameter = "unknown_default_open_api" -) - -// All allowed values of GetStatisticsIntervalParameter enum -var AllowedGetStatisticsIntervalParameterEnumValues = []GetStatisticsIntervalParameter{ - "hourly", - "daily", - "monthly", - "yearly", - "unknown_default_open_api", -} - -func (v *GetStatisticsIntervalParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetStatisticsIntervalParameter(value) - for _, existing := range AllowedGetStatisticsIntervalParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = GETSTATISTICSINTERVALPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewGetStatisticsIntervalParameterFromValue returns a pointer to a valid GetStatisticsIntervalParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetStatisticsIntervalParameterFromValue(v string) (*GetStatisticsIntervalParameter, error) { - ev := GetStatisticsIntervalParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetStatisticsIntervalParameter: valid values are %v", v, AllowedGetStatisticsIntervalParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetStatisticsIntervalParameter) IsValid() bool { - for _, existing := range AllowedGetStatisticsIntervalParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetStatistics_interval_parameter value -func (v GetStatisticsIntervalParameter) Ptr() *GetStatisticsIntervalParameter { - return &v -} - -type NullableGetStatisticsIntervalParameter struct { - value *GetStatisticsIntervalParameter - isSet bool -} - -func (v NullableGetStatisticsIntervalParameter) Get() *GetStatisticsIntervalParameter { - return v.value -} - -func (v *NullableGetStatisticsIntervalParameter) Set(val *GetStatisticsIntervalParameter) { - v.value = val - v.isSet = true -} - -func (v NullableGetStatisticsIntervalParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableGetStatisticsIntervalParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetStatisticsIntervalParameter(val *GetStatisticsIntervalParameter) *NullableGetStatisticsIntervalParameter { - return &NullableGetStatisticsIntervalParameter{value: val, isSet: true} -} - -func (v NullableGetStatisticsIntervalParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetStatisticsIntervalParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_get_statistics_response.go b/services/cdn/v1betaapi/model_get_statistics_response.go deleted file mode 100644 index 02f852a08..000000000 --- a/services/cdn/v1betaapi/model_get_statistics_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the GetStatisticsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetStatisticsResponse{} - -// GetStatisticsResponse struct for GetStatisticsResponse -type GetStatisticsResponse struct { - Records []DistributionStatisticsRecord `json:"records"` - AdditionalProperties map[string]interface{} -} - -type _GetStatisticsResponse GetStatisticsResponse - -// NewGetStatisticsResponse instantiates a new GetStatisticsResponse 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 NewGetStatisticsResponse(records []DistributionStatisticsRecord) *GetStatisticsResponse { - this := GetStatisticsResponse{} - this.Records = records - return &this -} - -// NewGetStatisticsResponseWithDefaults instantiates a new GetStatisticsResponse 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 NewGetStatisticsResponseWithDefaults() *GetStatisticsResponse { - this := GetStatisticsResponse{} - return &this -} - -// GetRecords returns the Records field value -func (o *GetStatisticsResponse) GetRecords() []DistributionStatisticsRecord { - if o == nil { - var ret []DistributionStatisticsRecord - return ret - } - - return o.Records -} - -// GetRecordsOk returns a tuple with the Records field value -// and a boolean to check if the value has been set. -func (o *GetStatisticsResponse) GetRecordsOk() ([]DistributionStatisticsRecord, bool) { - if o == nil { - return nil, false - } - return o.Records, true -} - -// SetRecords sets field value -func (o *GetStatisticsResponse) SetRecords(v []DistributionStatisticsRecord) { - o.Records = v -} - -func (o GetStatisticsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetStatisticsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["records"] = o.Records - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetStatisticsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "records", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varGetStatisticsResponse := _GetStatisticsResponse{} - - err = json.Unmarshal(data, &varGetStatisticsResponse) - - if err != nil { - return err - } - - *o = GetStatisticsResponse(varGetStatisticsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "records") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetStatisticsResponse struct { - value *GetStatisticsResponse - isSet bool -} - -func (v NullableGetStatisticsResponse) Get() *GetStatisticsResponse { - return v.value -} - -func (v *NullableGetStatisticsResponse) Set(val *GetStatisticsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetStatisticsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetStatisticsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetStatisticsResponse(val *GetStatisticsResponse) *NullableGetStatisticsResponse { - return &NullableGetStatisticsResponse{value: val, isSet: true} -} - -func (v NullableGetStatisticsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetStatisticsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_http_backend.go b/services/cdn/v1betaapi/model_http_backend.go deleted file mode 100644 index d132dbd34..000000000 --- a/services/cdn/v1betaapi/model_http_backend.go +++ /dev/null @@ -1,255 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the HttpBackend type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &HttpBackend{} - -// HttpBackend struct for HttpBackend -type HttpBackend struct { - // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. - Geofencing map[string][]string `json:"geofencing"` - // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. - OriginRequestHeaders map[string]string `json:"originRequestHeaders"` - OriginUrl string `json:"originUrl"` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _HttpBackend HttpBackend - -// NewHttpBackend instantiates a new HttpBackend 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 NewHttpBackend(geofencing map[string][]string, originRequestHeaders map[string]string, originUrl string, types string) *HttpBackend { - this := HttpBackend{} - this.Geofencing = geofencing - this.OriginRequestHeaders = originRequestHeaders - this.OriginUrl = originUrl - this.Type = types - return &this -} - -// NewHttpBackendWithDefaults instantiates a new HttpBackend 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 NewHttpBackendWithDefaults() *HttpBackend { - this := HttpBackend{} - return &this -} - -// GetGeofencing returns the Geofencing field value -func (o *HttpBackend) GetGeofencing() map[string][]string { - if o == nil { - var ret map[string][]string - return ret - } - - return o.Geofencing -} - -// GetGeofencingOk returns a tuple with the Geofencing field value -// and a boolean to check if the value has been set. -func (o *HttpBackend) GetGeofencingOk() (*map[string][]string, bool) { - if o == nil { - return nil, false - } - return &o.Geofencing, true -} - -// SetGeofencing sets field value -func (o *HttpBackend) SetGeofencing(v map[string][]string) { - o.Geofencing = v -} - -// GetOriginRequestHeaders returns the OriginRequestHeaders field value -func (o *HttpBackend) GetOriginRequestHeaders() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.OriginRequestHeaders -} - -// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value -// and a boolean to check if the value has been set. -func (o *HttpBackend) GetOriginRequestHeadersOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.OriginRequestHeaders, true -} - -// SetOriginRequestHeaders sets field value -func (o *HttpBackend) SetOriginRequestHeaders(v map[string]string) { - o.OriginRequestHeaders = v -} - -// GetOriginUrl returns the OriginUrl field value -func (o *HttpBackend) GetOriginUrl() string { - if o == nil { - var ret string - return ret - } - - return o.OriginUrl -} - -// GetOriginUrlOk returns a tuple with the OriginUrl field value -// and a boolean to check if the value has been set. -func (o *HttpBackend) GetOriginUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.OriginUrl, true -} - -// SetOriginUrl sets field value -func (o *HttpBackend) SetOriginUrl(v string) { - o.OriginUrl = v -} - -// GetType returns the Type field value -func (o *HttpBackend) 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 *HttpBackend) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *HttpBackend) SetType(v string) { - o.Type = v -} - -func (o HttpBackend) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o HttpBackend) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["geofencing"] = o.Geofencing - toSerialize["originRequestHeaders"] = o.OriginRequestHeaders - toSerialize["originUrl"] = o.OriginUrl - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *HttpBackend) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "geofencing", - "originRequestHeaders", - "originUrl", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varHttpBackend := _HttpBackend{} - - err = json.Unmarshal(data, &varHttpBackend) - - if err != nil { - return err - } - - *o = HttpBackend(varHttpBackend) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "geofencing") - delete(additionalProperties, "originRequestHeaders") - delete(additionalProperties, "originUrl") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableHttpBackend struct { - value *HttpBackend - isSet bool -} - -func (v NullableHttpBackend) Get() *HttpBackend { - return v.value -} - -func (v *NullableHttpBackend) Set(val *HttpBackend) { - v.value = val - v.isSet = true -} - -func (v NullableHttpBackend) IsSet() bool { - return v.isSet -} - -func (v *NullableHttpBackend) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHttpBackend(val *HttpBackend) *NullableHttpBackend { - return &NullableHttpBackend{value: val, isSet: true} -} - -func (v NullableHttpBackend) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHttpBackend) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_http_backend_patch.go b/services/cdn/v1betaapi/model_http_backend_patch.go deleted file mode 100644 index 686c976f1..000000000 --- a/services/cdn/v1betaapi/model_http_backend_patch.go +++ /dev/null @@ -1,280 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the HttpBackendPatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &HttpBackendPatch{} - -// HttpBackendPatch A partial HTTP Backend -type HttpBackendPatch struct { - // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. - Geofencing *map[string][]string `json:"geofencing,omitempty"` - // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. - OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` - OriginUrl *string `json:"originUrl,omitempty"` - // This property is required to determine the used backend type. - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _HttpBackendPatch HttpBackendPatch - -// NewHttpBackendPatch instantiates a new HttpBackendPatch 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 NewHttpBackendPatch(types string) *HttpBackendPatch { - this := HttpBackendPatch{} - this.Type = types - return &this -} - -// NewHttpBackendPatchWithDefaults instantiates a new HttpBackendPatch 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 NewHttpBackendPatchWithDefaults() *HttpBackendPatch { - this := HttpBackendPatch{} - return &this -} - -// GetGeofencing returns the Geofencing field value if set, zero value otherwise. -func (o *HttpBackendPatch) GetGeofencing() map[string][]string { - if o == nil || IsNil(o.Geofencing) { - var ret map[string][]string - return ret - } - return *o.Geofencing -} - -// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HttpBackendPatch) GetGeofencingOk() (*map[string][]string, bool) { - if o == nil || IsNil(o.Geofencing) { - return nil, false - } - return o.Geofencing, true -} - -// HasGeofencing returns a boolean if a field has been set. -func (o *HttpBackendPatch) HasGeofencing() bool { - if o != nil && !IsNil(o.Geofencing) { - return true - } - - return false -} - -// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. -func (o *HttpBackendPatch) SetGeofencing(v map[string][]string) { - o.Geofencing = &v -} - -// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. -func (o *HttpBackendPatch) GetOriginRequestHeaders() map[string]string { - if o == nil || IsNil(o.OriginRequestHeaders) { - var ret map[string]string - return ret - } - return *o.OriginRequestHeaders -} - -// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HttpBackendPatch) GetOriginRequestHeadersOk() (*map[string]string, bool) { - if o == nil || IsNil(o.OriginRequestHeaders) { - return nil, false - } - return o.OriginRequestHeaders, true -} - -// HasOriginRequestHeaders returns a boolean if a field has been set. -func (o *HttpBackendPatch) HasOriginRequestHeaders() bool { - if o != nil && !IsNil(o.OriginRequestHeaders) { - return true - } - - return false -} - -// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. -func (o *HttpBackendPatch) SetOriginRequestHeaders(v map[string]string) { - o.OriginRequestHeaders = &v -} - -// GetOriginUrl returns the OriginUrl field value if set, zero value otherwise. -func (o *HttpBackendPatch) GetOriginUrl() string { - if o == nil || IsNil(o.OriginUrl) { - var ret string - return ret - } - return *o.OriginUrl -} - -// GetOriginUrlOk returns a tuple with the OriginUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HttpBackendPatch) GetOriginUrlOk() (*string, bool) { - if o == nil || IsNil(o.OriginUrl) { - return nil, false - } - return o.OriginUrl, true -} - -// HasOriginUrl returns a boolean if a field has been set. -func (o *HttpBackendPatch) HasOriginUrl() bool { - if o != nil && !IsNil(o.OriginUrl) { - return true - } - - return false -} - -// SetOriginUrl gets a reference to the given string and assigns it to the OriginUrl field. -func (o *HttpBackendPatch) SetOriginUrl(v string) { - o.OriginUrl = &v -} - -// GetType returns the Type field value -func (o *HttpBackendPatch) 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 *HttpBackendPatch) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *HttpBackendPatch) SetType(v string) { - o.Type = v -} - -func (o HttpBackendPatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o HttpBackendPatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Geofencing) { - toSerialize["geofencing"] = o.Geofencing - } - if !IsNil(o.OriginRequestHeaders) { - toSerialize["originRequestHeaders"] = o.OriginRequestHeaders - } - if !IsNil(o.OriginUrl) { - toSerialize["originUrl"] = o.OriginUrl - } - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *HttpBackendPatch) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varHttpBackendPatch := _HttpBackendPatch{} - - err = json.Unmarshal(data, &varHttpBackendPatch) - - if err != nil { - return err - } - - *o = HttpBackendPatch(varHttpBackendPatch) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "geofencing") - delete(additionalProperties, "originRequestHeaders") - delete(additionalProperties, "originUrl") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableHttpBackendPatch struct { - value *HttpBackendPatch - isSet bool -} - -func (v NullableHttpBackendPatch) Get() *HttpBackendPatch { - return v.value -} - -func (v *NullableHttpBackendPatch) Set(val *HttpBackendPatch) { - v.value = val - v.isSet = true -} - -func (v NullableHttpBackendPatch) IsSet() bool { - return v.isSet -} - -func (v *NullableHttpBackendPatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHttpBackendPatch(val *HttpBackendPatch) *NullableHttpBackendPatch { - return &NullableHttpBackendPatch{value: val, isSet: true} -} - -func (v NullableHttpBackendPatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHttpBackendPatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_list_distributions_response.go b/services/cdn/v1betaapi/model_list_distributions_response.go deleted file mode 100644 index cb403a287..000000000 --- a/services/cdn/v1betaapi/model_list_distributions_response.go +++ /dev/null @@ -1,203 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the ListDistributionsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListDistributionsResponse{} - -// ListDistributionsResponse struct for ListDistributionsResponse -type ListDistributionsResponse struct { - Distributions []Distribution `json:"distributions"` - NextPageIdentifier *string `json:"nextPageIdentifier,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ListDistributionsResponse ListDistributionsResponse - -// NewListDistributionsResponse instantiates a new ListDistributionsResponse 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 NewListDistributionsResponse(distributions []Distribution) *ListDistributionsResponse { - this := ListDistributionsResponse{} - this.Distributions = distributions - return &this -} - -// NewListDistributionsResponseWithDefaults instantiates a new ListDistributionsResponse 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 NewListDistributionsResponseWithDefaults() *ListDistributionsResponse { - this := ListDistributionsResponse{} - return &this -} - -// GetDistributions returns the Distributions field value -func (o *ListDistributionsResponse) GetDistributions() []Distribution { - if o == nil { - var ret []Distribution - return ret - } - - return o.Distributions -} - -// GetDistributionsOk returns a tuple with the Distributions field value -// and a boolean to check if the value has been set. -func (o *ListDistributionsResponse) GetDistributionsOk() ([]Distribution, bool) { - if o == nil { - return nil, false - } - return o.Distributions, true -} - -// SetDistributions sets field value -func (o *ListDistributionsResponse) SetDistributions(v []Distribution) { - o.Distributions = v -} - -// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. -func (o *ListDistributionsResponse) GetNextPageIdentifier() string { - if o == nil || IsNil(o.NextPageIdentifier) { - var ret string - return ret - } - return *o.NextPageIdentifier -} - -// GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListDistributionsResponse) GetNextPageIdentifierOk() (*string, bool) { - if o == nil || IsNil(o.NextPageIdentifier) { - return nil, false - } - return o.NextPageIdentifier, true -} - -// HasNextPageIdentifier returns a boolean if a field has been set. -func (o *ListDistributionsResponse) HasNextPageIdentifier() bool { - if o != nil && !IsNil(o.NextPageIdentifier) { - return true - } - - return false -} - -// SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. -func (o *ListDistributionsResponse) SetNextPageIdentifier(v string) { - o.NextPageIdentifier = &v -} - -func (o ListDistributionsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListDistributionsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["distributions"] = o.Distributions - if !IsNil(o.NextPageIdentifier) { - toSerialize["nextPageIdentifier"] = o.NextPageIdentifier - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListDistributionsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "distributions", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListDistributionsResponse := _ListDistributionsResponse{} - - err = json.Unmarshal(data, &varListDistributionsResponse) - - if err != nil { - return err - } - - *o = ListDistributionsResponse(varListDistributionsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "distributions") - delete(additionalProperties, "nextPageIdentifier") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableListDistributionsResponse struct { - value *ListDistributionsResponse - isSet bool -} - -func (v NullableListDistributionsResponse) Get() *ListDistributionsResponse { - return v.value -} - -func (v *NullableListDistributionsResponse) Set(val *ListDistributionsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListDistributionsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListDistributionsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListDistributionsResponse(val *ListDistributionsResponse) *NullableListDistributionsResponse { - return &NullableListDistributionsResponse{value: val, isSet: true} -} - -func (v NullableListDistributionsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListDistributionsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_list_distributions_sort_by_parameter.go b/services/cdn/v1betaapi/model_list_distributions_sort_by_parameter.go deleted file mode 100644 index c380c0982..000000000 --- a/services/cdn/v1betaapi/model_list_distributions_sort_by_parameter.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// ListDistributionsSortByParameter the model 'ListDistributionsSortByParameter' -type ListDistributionsSortByParameter string - -// List of ListDistributions_sortBy_parameter -const ( - LISTDISTRIBUTIONSSORTBYPARAMETER_ID ListDistributionsSortByParameter = "id" - LISTDISTRIBUTIONSSORTBYPARAMETER_UPDATED_AT ListDistributionsSortByParameter = "updatedAt" - LISTDISTRIBUTIONSSORTBYPARAMETER_CREATED_AT ListDistributionsSortByParameter = "createdAt" - LISTDISTRIBUTIONSSORTBYPARAMETER_ORIGIN_URL ListDistributionsSortByParameter = "originUrl" - LISTDISTRIBUTIONSSORTBYPARAMETER_STATUS ListDistributionsSortByParameter = "status" - LISTDISTRIBUTIONSSORTBYPARAMETER_ORIGIN_URL_RELATED ListDistributionsSortByParameter = "originUrlRelated" - LISTDISTRIBUTIONSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDistributionsSortByParameter = "unknown_default_open_api" -) - -// All allowed values of ListDistributionsSortByParameter enum -var AllowedListDistributionsSortByParameterEnumValues = []ListDistributionsSortByParameter{ - "id", - "updatedAt", - "createdAt", - "originUrl", - "status", - "originUrlRelated", - "unknown_default_open_api", -} - -func (v *ListDistributionsSortByParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListDistributionsSortByParameter(value) - for _, existing := range AllowedListDistributionsSortByParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTDISTRIBUTIONSSORTBYPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListDistributionsSortByParameterFromValue returns a pointer to a valid ListDistributionsSortByParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListDistributionsSortByParameterFromValue(v string) (*ListDistributionsSortByParameter, error) { - ev := ListDistributionsSortByParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListDistributionsSortByParameter: valid values are %v", v, AllowedListDistributionsSortByParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListDistributionsSortByParameter) IsValid() bool { - for _, existing := range AllowedListDistributionsSortByParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListDistributions_sortBy_parameter value -func (v ListDistributionsSortByParameter) Ptr() *ListDistributionsSortByParameter { - return &v -} - -type NullableListDistributionsSortByParameter struct { - value *ListDistributionsSortByParameter - isSet bool -} - -func (v NullableListDistributionsSortByParameter) Get() *ListDistributionsSortByParameter { - return v.value -} - -func (v *NullableListDistributionsSortByParameter) Set(val *ListDistributionsSortByParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListDistributionsSortByParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListDistributionsSortByParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListDistributionsSortByParameter(val *ListDistributionsSortByParameter) *NullableListDistributionsSortByParameter { - return &NullableListDistributionsSortByParameter{value: val, isSet: true} -} - -func (v NullableListDistributionsSortByParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListDistributionsSortByParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_list_distributions_sort_order_parameter.go b/services/cdn/v1betaapi/model_list_distributions_sort_order_parameter.go deleted file mode 100644 index 35ad04c69..000000000 --- a/services/cdn/v1betaapi/model_list_distributions_sort_order_parameter.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// ListDistributionsSortOrderParameter the model 'ListDistributionsSortOrderParameter' -type ListDistributionsSortOrderParameter string - -// List of ListDistributions_sortOrder_parameter -const ( - LISTDISTRIBUTIONSSORTORDERPARAMETER_ASCENDING ListDistributionsSortOrderParameter = "ascending" - LISTDISTRIBUTIONSSORTORDERPARAMETER_DESCENDING ListDistributionsSortOrderParameter = "descending" - LISTDISTRIBUTIONSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API ListDistributionsSortOrderParameter = "unknown_default_open_api" -) - -// All allowed values of ListDistributionsSortOrderParameter enum -var AllowedListDistributionsSortOrderParameterEnumValues = []ListDistributionsSortOrderParameter{ - "ascending", - "descending", - "unknown_default_open_api", -} - -func (v *ListDistributionsSortOrderParameter) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ListDistributionsSortOrderParameter(value) - for _, existing := range AllowedListDistributionsSortOrderParameterEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = LISTDISTRIBUTIONSSORTORDERPARAMETER_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewListDistributionsSortOrderParameterFromValue returns a pointer to a valid ListDistributionsSortOrderParameter -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewListDistributionsSortOrderParameterFromValue(v string) (*ListDistributionsSortOrderParameter, error) { - ev := ListDistributionsSortOrderParameter(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ListDistributionsSortOrderParameter: valid values are %v", v, AllowedListDistributionsSortOrderParameterEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ListDistributionsSortOrderParameter) IsValid() bool { - for _, existing := range AllowedListDistributionsSortOrderParameterEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListDistributions_sortOrder_parameter value -func (v ListDistributionsSortOrderParameter) Ptr() *ListDistributionsSortOrderParameter { - return &v -} - -type NullableListDistributionsSortOrderParameter struct { - value *ListDistributionsSortOrderParameter - isSet bool -} - -func (v NullableListDistributionsSortOrderParameter) Get() *ListDistributionsSortOrderParameter { - return v.value -} - -func (v *NullableListDistributionsSortOrderParameter) Set(val *ListDistributionsSortOrderParameter) { - v.value = val - v.isSet = true -} - -func (v NullableListDistributionsSortOrderParameter) IsSet() bool { - return v.isSet -} - -func (v *NullableListDistributionsSortOrderParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListDistributionsSortOrderParameter(val *ListDistributionsSortOrderParameter) *NullableListDistributionsSortOrderParameter { - return &NullableListDistributionsSortOrderParameter{value: val, isSet: true} -} - -func (v NullableListDistributionsSortOrderParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListDistributionsSortOrderParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_list_waf_collections_response.go b/services/cdn/v1betaapi/model_list_waf_collections_response.go deleted file mode 100644 index 964e854b8..000000000 --- a/services/cdn/v1betaapi/model_list_waf_collections_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the ListWAFCollectionsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListWAFCollectionsResponse{} - -// ListWAFCollectionsResponse struct for ListWAFCollectionsResponse -type ListWAFCollectionsResponse struct { - Collections []WAFRuleCollection `json:"collections"` - AdditionalProperties map[string]interface{} -} - -type _ListWAFCollectionsResponse ListWAFCollectionsResponse - -// NewListWAFCollectionsResponse instantiates a new ListWAFCollectionsResponse 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 NewListWAFCollectionsResponse(collections []WAFRuleCollection) *ListWAFCollectionsResponse { - this := ListWAFCollectionsResponse{} - this.Collections = collections - return &this -} - -// NewListWAFCollectionsResponseWithDefaults instantiates a new ListWAFCollectionsResponse 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 NewListWAFCollectionsResponseWithDefaults() *ListWAFCollectionsResponse { - this := ListWAFCollectionsResponse{} - return &this -} - -// GetCollections returns the Collections field value -func (o *ListWAFCollectionsResponse) GetCollections() []WAFRuleCollection { - if o == nil { - var ret []WAFRuleCollection - return ret - } - - return o.Collections -} - -// GetCollectionsOk returns a tuple with the Collections field value -// and a boolean to check if the value has been set. -func (o *ListWAFCollectionsResponse) GetCollectionsOk() ([]WAFRuleCollection, bool) { - if o == nil { - return nil, false - } - return o.Collections, true -} - -// SetCollections sets field value -func (o *ListWAFCollectionsResponse) SetCollections(v []WAFRuleCollection) { - o.Collections = v -} - -func (o ListWAFCollectionsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListWAFCollectionsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["collections"] = o.Collections - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListWAFCollectionsResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "collections", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varListWAFCollectionsResponse := _ListWAFCollectionsResponse{} - - err = json.Unmarshal(data, &varListWAFCollectionsResponse) - - if err != nil { - return err - } - - *o = ListWAFCollectionsResponse(varListWAFCollectionsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "collections") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableListWAFCollectionsResponse struct { - value *ListWAFCollectionsResponse - isSet bool -} - -func (v NullableListWAFCollectionsResponse) Get() *ListWAFCollectionsResponse { - return v.value -} - -func (v *NullableListWAFCollectionsResponse) Set(val *ListWAFCollectionsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListWAFCollectionsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListWAFCollectionsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListWAFCollectionsResponse(val *ListWAFCollectionsResponse) *NullableListWAFCollectionsResponse { - return &NullableListWAFCollectionsResponse{value: val, isSet: true} -} - -func (v NullableListWAFCollectionsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListWAFCollectionsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_loki_log_sink.go b/services/cdn/v1betaapi/model_loki_log_sink.go deleted file mode 100644 index 4a976dd2e..000000000 --- a/services/cdn/v1betaapi/model_loki_log_sink.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the LokiLogSink type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &LokiLogSink{} - -// LokiLogSink struct for LokiLogSink -type LokiLogSink struct { - PushUrl string `json:"pushUrl"` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _LokiLogSink LokiLogSink - -// NewLokiLogSink instantiates a new LokiLogSink 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 NewLokiLogSink(pushUrl string, types string) *LokiLogSink { - this := LokiLogSink{} - this.PushUrl = pushUrl - this.Type = types - return &this -} - -// NewLokiLogSinkWithDefaults instantiates a new LokiLogSink 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 NewLokiLogSinkWithDefaults() *LokiLogSink { - this := LokiLogSink{} - return &this -} - -// GetPushUrl returns the PushUrl field value -func (o *LokiLogSink) GetPushUrl() string { - if o == nil { - var ret string - return ret - } - - return o.PushUrl -} - -// GetPushUrlOk returns a tuple with the PushUrl field value -// and a boolean to check if the value has been set. -func (o *LokiLogSink) GetPushUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PushUrl, true -} - -// SetPushUrl sets field value -func (o *LokiLogSink) SetPushUrl(v string) { - o.PushUrl = v -} - -// GetType returns the Type field value -func (o *LokiLogSink) 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 *LokiLogSink) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *LokiLogSink) SetType(v string) { - o.Type = v -} - -func (o LokiLogSink) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o LokiLogSink) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["pushUrl"] = o.PushUrl - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *LokiLogSink) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "pushUrl", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varLokiLogSink := _LokiLogSink{} - - err = json.Unmarshal(data, &varLokiLogSink) - - if err != nil { - return err - } - - *o = LokiLogSink(varLokiLogSink) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "pushUrl") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableLokiLogSink struct { - value *LokiLogSink - isSet bool -} - -func (v NullableLokiLogSink) Get() *LokiLogSink { - return v.value -} - -func (v *NullableLokiLogSink) Set(val *LokiLogSink) { - v.value = val - v.isSet = true -} - -func (v NullableLokiLogSink) IsSet() bool { - return v.isSet -} - -func (v *NullableLokiLogSink) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableLokiLogSink(val *LokiLogSink) *NullableLokiLogSink { - return &NullableLokiLogSink{value: val, isSet: true} -} - -func (v NullableLokiLogSink) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableLokiLogSink) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_optimizer.go b/services/cdn/v1betaapi/model_optimizer.go deleted file mode 100644 index 9a3e7f243..000000000 --- a/services/cdn/v1betaapi/model_optimizer.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the Optimizer type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Optimizer{} - -// Optimizer Optimizer is paid feature, a real-time on the fly image manipulation and optimization service that automatically optimizes your images for faster image delivery. -type Optimizer struct { - // Determines if the optimizer should be enabled for this distribution and incurs a monthly fee - Enabled bool `json:"enabled"` - AdditionalProperties map[string]interface{} -} - -type _Optimizer Optimizer - -// NewOptimizer instantiates a new Optimizer 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 NewOptimizer(enabled bool) *Optimizer { - this := Optimizer{} - this.Enabled = enabled - return &this -} - -// NewOptimizerWithDefaults instantiates a new Optimizer 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 NewOptimizerWithDefaults() *Optimizer { - this := Optimizer{} - return &this -} - -// GetEnabled returns the Enabled field value -func (o *Optimizer) GetEnabled() bool { - if o == nil { - var ret bool - return ret - } - - return o.Enabled -} - -// GetEnabledOk returns a tuple with the Enabled field value -// and a boolean to check if the value has been set. -func (o *Optimizer) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Enabled, true -} - -// SetEnabled sets field value -func (o *Optimizer) SetEnabled(v bool) { - o.Enabled = v -} - -func (o Optimizer) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Optimizer) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["enabled"] = o.Enabled - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Optimizer) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "enabled", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varOptimizer := _Optimizer{} - - err = json.Unmarshal(data, &varOptimizer) - - if err != nil { - return err - } - - *o = Optimizer(varOptimizer) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "enabled") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableOptimizer struct { - value *Optimizer - isSet bool -} - -func (v NullableOptimizer) Get() *Optimizer { - return v.value -} - -func (v *NullableOptimizer) Set(val *Optimizer) { - v.value = val - v.isSet = true -} - -func (v NullableOptimizer) IsSet() bool { - return v.isSet -} - -func (v *NullableOptimizer) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOptimizer(val *Optimizer) *NullableOptimizer { - return &NullableOptimizer{value: val, isSet: true} -} - -func (v NullableOptimizer) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOptimizer) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_optimizer_patch.go b/services/cdn/v1betaapi/model_optimizer_patch.go deleted file mode 100644 index 8249db232..000000000 --- a/services/cdn/v1betaapi/model_optimizer_patch.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" -) - -// checks if the OptimizerPatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &OptimizerPatch{} - -// OptimizerPatch struct for OptimizerPatch -type OptimizerPatch struct { - Enabled *bool `json:"enabled,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _OptimizerPatch OptimizerPatch - -// NewOptimizerPatch instantiates a new OptimizerPatch 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 NewOptimizerPatch() *OptimizerPatch { - this := OptimizerPatch{} - return &this -} - -// NewOptimizerPatchWithDefaults instantiates a new OptimizerPatch 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 NewOptimizerPatchWithDefaults() *OptimizerPatch { - this := OptimizerPatch{} - return &this -} - -// GetEnabled returns the Enabled field value if set, zero value otherwise. -func (o *OptimizerPatch) GetEnabled() bool { - if o == nil || IsNil(o.Enabled) { - 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 *OptimizerPatch) GetEnabledOk() (*bool, bool) { - if o == nil || IsNil(o.Enabled) { - return nil, false - } - return o.Enabled, true -} - -// HasEnabled returns a boolean if a field has been set. -func (o *OptimizerPatch) HasEnabled() bool { - if o != nil && !IsNil(o.Enabled) { - return true - } - - return false -} - -// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. -func (o *OptimizerPatch) SetEnabled(v bool) { - o.Enabled = &v -} - -func (o OptimizerPatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o OptimizerPatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Enabled) { - toSerialize["enabled"] = o.Enabled - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *OptimizerPatch) UnmarshalJSON(data []byte) (err error) { - varOptimizerPatch := _OptimizerPatch{} - - err = json.Unmarshal(data, &varOptimizerPatch) - - if err != nil { - return err - } - - *o = OptimizerPatch(varOptimizerPatch) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "enabled") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableOptimizerPatch struct { - value *OptimizerPatch - isSet bool -} - -func (v NullableOptimizerPatch) Get() *OptimizerPatch { - return v.value -} - -func (v *NullableOptimizerPatch) Set(val *OptimizerPatch) { - v.value = val - v.isSet = true -} - -func (v NullableOptimizerPatch) IsSet() bool { - return v.isSet -} - -func (v *NullableOptimizerPatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOptimizerPatch(val *OptimizerPatch) *NullableOptimizerPatch { - return &NullableOptimizerPatch{value: val, isSet: true} -} - -func (v NullableOptimizerPatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOptimizerPatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_patch_distribution_payload.go b/services/cdn/v1betaapi/model_patch_distribution_payload.go deleted file mode 100644 index ebccfe1b2..000000000 --- a/services/cdn/v1betaapi/model_patch_distribution_payload.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" -) - -// checks if the PatchDistributionPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PatchDistributionPayload{} - -// PatchDistributionPayload Defines a partial distribution. Set values -type PatchDistributionPayload struct { - Config *ConfigPatch `json:"config,omitempty"` - // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. - IntentId *string `json:"intentId,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PatchDistributionPayload PatchDistributionPayload - -// NewPatchDistributionPayload instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayload() *PatchDistributionPayload { - this := PatchDistributionPayload{} - return &this -} - -// NewPatchDistributionPayloadWithDefaults instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayloadWithDefaults() *PatchDistributionPayload { - this := PatchDistributionPayload{} - return &this -} - -// GetConfig returns the Config field value if set, zero value otherwise. -func (o *PatchDistributionPayload) GetConfig() ConfigPatch { - if o == nil || IsNil(o.Config) { - var ret ConfigPatch - return ret - } - return *o.Config -} - -// GetConfigOk returns a tuple with the Config field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PatchDistributionPayload) GetConfigOk() (*ConfigPatch, bool) { - if o == nil || IsNil(o.Config) { - return nil, false - } - return o.Config, true -} - -// HasConfig returns a boolean if a field has been set. -func (o *PatchDistributionPayload) HasConfig() bool { - if o != nil && !IsNil(o.Config) { - return true - } - - return false -} - -// SetConfig gets a reference to the given ConfigPatch and assigns it to the Config field. -func (o *PatchDistributionPayload) SetConfig(v ConfigPatch) { - o.Config = &v -} - -// GetIntentId returns the IntentId field value if set, zero value otherwise. -func (o *PatchDistributionPayload) GetIntentId() string { - if o == nil || IsNil(o.IntentId) { - var ret string - return ret - } - return *o.IntentId -} - -// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PatchDistributionPayload) GetIntentIdOk() (*string, bool) { - if o == nil || IsNil(o.IntentId) { - return nil, false - } - return o.IntentId, true -} - -// HasIntentId returns a boolean if a field has been set. -func (o *PatchDistributionPayload) HasIntentId() bool { - if o != nil && !IsNil(o.IntentId) { - return true - } - - return false -} - -// SetIntentId gets a reference to the given string and assigns it to the IntentId field. -func (o *PatchDistributionPayload) SetIntentId(v string) { - o.IntentId = &v -} - -func (o PatchDistributionPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PatchDistributionPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Config) { - toSerialize["config"] = o.Config - } - if !IsNil(o.IntentId) { - toSerialize["intentId"] = o.IntentId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PatchDistributionPayload) UnmarshalJSON(data []byte) (err error) { - varPatchDistributionPayload := _PatchDistributionPayload{} - - err = json.Unmarshal(data, &varPatchDistributionPayload) - - if err != nil { - return err - } - - *o = PatchDistributionPayload(varPatchDistributionPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "config") - delete(additionalProperties, "intentId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePatchDistributionPayload struct { - value *PatchDistributionPayload - isSet bool -} - -func (v NullablePatchDistributionPayload) Get() *PatchDistributionPayload { - return v.value -} - -func (v *NullablePatchDistributionPayload) Set(val *PatchDistributionPayload) { - v.value = val - v.isSet = true -} - -func (v NullablePatchDistributionPayload) IsSet() bool { - return v.isSet -} - -func (v *NullablePatchDistributionPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePatchDistributionPayload(val *PatchDistributionPayload) *NullablePatchDistributionPayload { - return &NullablePatchDistributionPayload{value: val, isSet: true} -} - -func (v NullablePatchDistributionPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePatchDistributionPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_patch_distribution_response.go b/services/cdn/v1betaapi/model_patch_distribution_response.go deleted file mode 100644 index a6363b40c..000000000 --- a/services/cdn/v1betaapi/model_patch_distribution_response.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the PatchDistributionResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PatchDistributionResponse{} - -// PatchDistributionResponse struct for PatchDistributionResponse -type PatchDistributionResponse struct { - Distribution Distribution `json:"distribution"` - AdditionalProperties map[string]interface{} -} - -type _PatchDistributionResponse PatchDistributionResponse - -// NewPatchDistributionResponse instantiates a new PatchDistributionResponse 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 NewPatchDistributionResponse(distribution Distribution) *PatchDistributionResponse { - this := PatchDistributionResponse{} - this.Distribution = distribution - return &this -} - -// NewPatchDistributionResponseWithDefaults instantiates a new PatchDistributionResponse 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 NewPatchDistributionResponseWithDefaults() *PatchDistributionResponse { - this := PatchDistributionResponse{} - return &this -} - -// GetDistribution returns the Distribution field value -func (o *PatchDistributionResponse) GetDistribution() Distribution { - if o == nil { - var ret Distribution - return ret - } - - return o.Distribution -} - -// GetDistributionOk returns a tuple with the Distribution field value -// and a boolean to check if the value has been set. -func (o *PatchDistributionResponse) GetDistributionOk() (*Distribution, bool) { - if o == nil { - return nil, false - } - return &o.Distribution, true -} - -// SetDistribution sets field value -func (o *PatchDistributionResponse) SetDistribution(v Distribution) { - o.Distribution = v -} - -func (o PatchDistributionResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PatchDistributionResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["distribution"] = o.Distribution - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PatchDistributionResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "distribution", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPatchDistributionResponse := _PatchDistributionResponse{} - - err = json.Unmarshal(data, &varPatchDistributionResponse) - - if err != nil { - return err - } - - *o = PatchDistributionResponse(varPatchDistributionResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "distribution") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePatchDistributionResponse struct { - value *PatchDistributionResponse - isSet bool -} - -func (v NullablePatchDistributionResponse) Get() *PatchDistributionResponse { - return v.value -} - -func (v *NullablePatchDistributionResponse) Set(val *PatchDistributionResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePatchDistributionResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePatchDistributionResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePatchDistributionResponse(val *PatchDistributionResponse) *NullablePatchDistributionResponse { - return &NullablePatchDistributionResponse{value: val, isSet: true} -} - -func (v NullablePatchDistributionResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePatchDistributionResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_purge_cache_payload.go b/services/cdn/v1betaapi/model_purge_cache_payload.go deleted file mode 100644 index 9a803a0de..000000000 --- a/services/cdn/v1betaapi/model_purge_cache_payload.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" -) - -// checks if the PurgeCachePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PurgeCachePayload{} - -// PurgeCachePayload struct for PurgeCachePayload -type PurgeCachePayload struct { - // Defines an optional path. If this is set, a granular purge is done. If missing, the entire cache is invalidated. During a granular cache purge, only the provided path is purged. Please do not that for example `/some/path` and `/some/path.txt` are considered different paths. - Path *string `json:"path,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PurgeCachePayload PurgeCachePayload - -// NewPurgeCachePayload instantiates a new PurgeCachePayload 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 NewPurgeCachePayload() *PurgeCachePayload { - this := PurgeCachePayload{} - return &this -} - -// NewPurgeCachePayloadWithDefaults instantiates a new PurgeCachePayload 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 NewPurgeCachePayloadWithDefaults() *PurgeCachePayload { - this := PurgeCachePayload{} - return &this -} - -// GetPath returns the Path field value if set, zero value otherwise. -func (o *PurgeCachePayload) GetPath() string { - if o == nil || IsNil(o.Path) { - var ret string - return ret - } - return *o.Path -} - -// GetPathOk returns a tuple with the Path field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PurgeCachePayload) GetPathOk() (*string, bool) { - if o == nil || IsNil(o.Path) { - return nil, false - } - return o.Path, true -} - -// HasPath returns a boolean if a field has been set. -func (o *PurgeCachePayload) HasPath() bool { - if o != nil && !IsNil(o.Path) { - return true - } - - return false -} - -// SetPath gets a reference to the given string and assigns it to the Path field. -func (o *PurgeCachePayload) SetPath(v string) { - o.Path = &v -} - -func (o PurgeCachePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PurgeCachePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Path) { - toSerialize["path"] = o.Path - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PurgeCachePayload) UnmarshalJSON(data []byte) (err error) { - varPurgeCachePayload := _PurgeCachePayload{} - - err = json.Unmarshal(data, &varPurgeCachePayload) - - if err != nil { - return err - } - - *o = PurgeCachePayload(varPurgeCachePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "path") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePurgeCachePayload struct { - value *PurgeCachePayload - isSet bool -} - -func (v NullablePurgeCachePayload) Get() *PurgeCachePayload { - return v.value -} - -func (v *NullablePurgeCachePayload) Set(val *PurgeCachePayload) { - v.value = val - v.isSet = true -} - -func (v NullablePurgeCachePayload) IsSet() bool { - return v.isSet -} - -func (v *NullablePurgeCachePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePurgeCachePayload(val *PurgeCachePayload) *NullablePurgeCachePayload { - return &NullablePurgeCachePayload{value: val, isSet: true} -} - -func (v NullablePurgeCachePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePurgeCachePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_custom_certificate.go b/services/cdn/v1betaapi/model_put_custom_domain_custom_certificate.go deleted file mode 100644 index 9bd40e211..000000000 --- a/services/cdn/v1betaapi/model_put_custom_domain_custom_certificate.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the PutCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PutCustomDomainCustomCertificate{} - -// PutCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. -type PutCustomDomainCustomCertificate struct { - // base64-encoded PEM-encoded certificate - Certificate string `json:"certificate"` - // base64-encoded PEM encoded key - Key string `json:"key"` - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _PutCustomDomainCustomCertificate PutCustomDomainCustomCertificate - -// NewPutCustomDomainCustomCertificate instantiates a new PutCustomDomainCustomCertificate 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 NewPutCustomDomainCustomCertificate(certificate string, key string, types string) *PutCustomDomainCustomCertificate { - this := PutCustomDomainCustomCertificate{} - this.Certificate = certificate - this.Key = key - this.Type = types - return &this -} - -// NewPutCustomDomainCustomCertificateWithDefaults instantiates a new PutCustomDomainCustomCertificate 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 NewPutCustomDomainCustomCertificateWithDefaults() *PutCustomDomainCustomCertificate { - this := PutCustomDomainCustomCertificate{} - return &this -} - -// GetCertificate returns the Certificate field value -func (o *PutCustomDomainCustomCertificate) GetCertificate() string { - if o == nil { - var ret string - return ret - } - - return o.Certificate -} - -// GetCertificateOk returns a tuple with the Certificate field value -// and a boolean to check if the value has been set. -func (o *PutCustomDomainCustomCertificate) GetCertificateOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Certificate, true -} - -// SetCertificate sets field value -func (o *PutCustomDomainCustomCertificate) SetCertificate(v string) { - o.Certificate = v -} - -// GetKey returns the Key field value -func (o *PutCustomDomainCustomCertificate) GetKey() string { - if o == nil { - var ret string - return ret - } - - return o.Key -} - -// GetKeyOk returns a tuple with the Key field value -// and a boolean to check if the value has been set. -func (o *PutCustomDomainCustomCertificate) GetKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Key, true -} - -// SetKey sets field value -func (o *PutCustomDomainCustomCertificate) SetKey(v string) { - o.Key = v -} - -// GetType returns the Type field value -func (o *PutCustomDomainCustomCertificate) 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 *PutCustomDomainCustomCertificate) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *PutCustomDomainCustomCertificate) SetType(v string) { - o.Type = v -} - -func (o PutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PutCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["certificate"] = o.Certificate - toSerialize["key"] = o.Key - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PutCustomDomainCustomCertificate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "certificate", - "key", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPutCustomDomainCustomCertificate := _PutCustomDomainCustomCertificate{} - - err = json.Unmarshal(data, &varPutCustomDomainCustomCertificate) - - if err != nil { - return err - } - - *o = PutCustomDomainCustomCertificate(varPutCustomDomainCustomCertificate) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "certificate") - delete(additionalProperties, "key") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePutCustomDomainCustomCertificate struct { - value *PutCustomDomainCustomCertificate - isSet bool -} - -func (v NullablePutCustomDomainCustomCertificate) Get() *PutCustomDomainCustomCertificate { - return v.value -} - -func (v *NullablePutCustomDomainCustomCertificate) Set(val *PutCustomDomainCustomCertificate) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainCustomCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainCustomCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainCustomCertificate(val *PutCustomDomainCustomCertificate) *NullablePutCustomDomainCustomCertificate { - return &NullablePutCustomDomainCustomCertificate{value: val, isSet: true} -} - -func (v NullablePutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_managed_certificate.go b/services/cdn/v1betaapi/model_put_custom_domain_managed_certificate.go deleted file mode 100644 index 0ad776a78..000000000 --- a/services/cdn/v1betaapi/model_put_custom_domain_managed_certificate.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the PutCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PutCustomDomainManagedCertificate{} - -// PutCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you -type PutCustomDomainManagedCertificate struct { - Type string `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _PutCustomDomainManagedCertificate PutCustomDomainManagedCertificate - -// NewPutCustomDomainManagedCertificate instantiates a new PutCustomDomainManagedCertificate 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 NewPutCustomDomainManagedCertificate(types string) *PutCustomDomainManagedCertificate { - this := PutCustomDomainManagedCertificate{} - this.Type = types - return &this -} - -// NewPutCustomDomainManagedCertificateWithDefaults instantiates a new PutCustomDomainManagedCertificate 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 NewPutCustomDomainManagedCertificateWithDefaults() *PutCustomDomainManagedCertificate { - this := PutCustomDomainManagedCertificate{} - return &this -} - -// GetType returns the Type field value -func (o *PutCustomDomainManagedCertificate) 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 *PutCustomDomainManagedCertificate) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *PutCustomDomainManagedCertificate) SetType(v string) { - o.Type = v -} - -func (o PutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PutCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PutCustomDomainManagedCertificate) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPutCustomDomainManagedCertificate := _PutCustomDomainManagedCertificate{} - - err = json.Unmarshal(data, &varPutCustomDomainManagedCertificate) - - if err != nil { - return err - } - - *o = PutCustomDomainManagedCertificate(varPutCustomDomainManagedCertificate) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePutCustomDomainManagedCertificate struct { - value *PutCustomDomainManagedCertificate - isSet bool -} - -func (v NullablePutCustomDomainManagedCertificate) Get() *PutCustomDomainManagedCertificate { - return v.value -} - -func (v *NullablePutCustomDomainManagedCertificate) Set(val *PutCustomDomainManagedCertificate) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainManagedCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainManagedCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainManagedCertificate(val *PutCustomDomainManagedCertificate) *NullablePutCustomDomainManagedCertificate { - return &NullablePutCustomDomainManagedCertificate{value: val, isSet: true} -} - -func (v NullablePutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_payload.go b/services/cdn/v1betaapi/model_put_custom_domain_payload.go deleted file mode 100644 index d05af3f5f..000000000 --- a/services/cdn/v1betaapi/model_put_custom_domain_payload.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" -) - -// checks if the PutCustomDomainPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PutCustomDomainPayload{} - -// PutCustomDomainPayload struct for PutCustomDomainPayload -type PutCustomDomainPayload struct { - Certificate *PutCustomDomainPayloadCertificate `json:"certificate,omitempty"` - // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. - IntentId *string `json:"intentId,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PutCustomDomainPayload PutCustomDomainPayload - -// NewPutCustomDomainPayload instantiates a new PutCustomDomainPayload 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 NewPutCustomDomainPayload() *PutCustomDomainPayload { - this := PutCustomDomainPayload{} - return &this -} - -// NewPutCustomDomainPayloadWithDefaults instantiates a new PutCustomDomainPayload 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 NewPutCustomDomainPayloadWithDefaults() *PutCustomDomainPayload { - this := PutCustomDomainPayload{} - return &this -} - -// GetCertificate returns the Certificate field value if set, zero value otherwise. -func (o *PutCustomDomainPayload) GetCertificate() PutCustomDomainPayloadCertificate { - if o == nil || IsNil(o.Certificate) { - var ret PutCustomDomainPayloadCertificate - return ret - } - return *o.Certificate -} - -// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PutCustomDomainPayload) GetCertificateOk() (*PutCustomDomainPayloadCertificate, bool) { - if o == nil || IsNil(o.Certificate) { - return nil, false - } - return o.Certificate, true -} - -// HasCertificate returns a boolean if a field has been set. -func (o *PutCustomDomainPayload) HasCertificate() bool { - if o != nil && !IsNil(o.Certificate) { - return true - } - - return false -} - -// SetCertificate gets a reference to the given PutCustomDomainPayloadCertificate and assigns it to the Certificate field. -func (o *PutCustomDomainPayload) SetCertificate(v PutCustomDomainPayloadCertificate) { - o.Certificate = &v -} - -// GetIntentId returns the IntentId field value if set, zero value otherwise. -func (o *PutCustomDomainPayload) GetIntentId() string { - if o == nil || IsNil(o.IntentId) { - var ret string - return ret - } - return *o.IntentId -} - -// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PutCustomDomainPayload) GetIntentIdOk() (*string, bool) { - if o == nil || IsNil(o.IntentId) { - return nil, false - } - return o.IntentId, true -} - -// HasIntentId returns a boolean if a field has been set. -func (o *PutCustomDomainPayload) HasIntentId() bool { - if o != nil && !IsNil(o.IntentId) { - return true - } - - return false -} - -// SetIntentId gets a reference to the given string and assigns it to the IntentId field. -func (o *PutCustomDomainPayload) SetIntentId(v string) { - o.IntentId = &v -} - -func (o PutCustomDomainPayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PutCustomDomainPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Certificate) { - toSerialize["certificate"] = o.Certificate - } - if !IsNil(o.IntentId) { - toSerialize["intentId"] = o.IntentId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PutCustomDomainPayload) UnmarshalJSON(data []byte) (err error) { - varPutCustomDomainPayload := _PutCustomDomainPayload{} - - err = json.Unmarshal(data, &varPutCustomDomainPayload) - - if err != nil { - return err - } - - *o = PutCustomDomainPayload(varPutCustomDomainPayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "certificate") - delete(additionalProperties, "intentId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePutCustomDomainPayload struct { - value *PutCustomDomainPayload - isSet bool -} - -func (v NullablePutCustomDomainPayload) Get() *PutCustomDomainPayload { - return v.value -} - -func (v *NullablePutCustomDomainPayload) Set(val *PutCustomDomainPayload) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainPayload) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainPayload(val *PutCustomDomainPayload) *NullablePutCustomDomainPayload { - return &NullablePutCustomDomainPayload{value: val, isSet: true} -} - -func (v NullablePutCustomDomainPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_payload_certificate.go b/services/cdn/v1betaapi/model_put_custom_domain_payload_certificate.go deleted file mode 100644 index 0c23c8d11..000000000 --- a/services/cdn/v1betaapi/model_put_custom_domain_payload_certificate.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// PutCustomDomainPayloadCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted -type PutCustomDomainPayloadCertificate struct { - PutCustomDomainCustomCertificate *PutCustomDomainCustomCertificate - PutCustomDomainManagedCertificate *PutCustomDomainManagedCertificate -} - -// PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainCustomCertificate wrapped in PutCustomDomainPayloadCertificate -func PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainCustomCertificate) PutCustomDomainPayloadCertificate { - return PutCustomDomainPayloadCertificate{ - PutCustomDomainCustomCertificate: v, - } -} - -// PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainManagedCertificate wrapped in PutCustomDomainPayloadCertificate -func PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainManagedCertificate) PutCustomDomainPayloadCertificate { - return PutCustomDomainPayloadCertificate{ - PutCustomDomainManagedCertificate: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *PutCustomDomainPayloadCertificate) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'custom' - if jsonDict["type"] == "custom" { - // try to unmarshal JSON data into PutCustomDomainCustomCertificate - err = json.Unmarshal(data, &dst.PutCustomDomainCustomCertificate) - if err == nil { - return nil // data stored in dst.PutCustomDomainCustomCertificate, return on the first match - } else { - dst.PutCustomDomainCustomCertificate = nil - return fmt.Errorf("failed to unmarshal PutCustomDomainPayloadCertificate as PutCustomDomainCustomCertificate: %s", err.Error()) - } - } - - // check if the discriminator value is 'managed' - if jsonDict["type"] == "managed" { - // try to unmarshal JSON data into PutCustomDomainManagedCertificate - err = json.Unmarshal(data, &dst.PutCustomDomainManagedCertificate) - if err == nil { - return nil // data stored in dst.PutCustomDomainManagedCertificate, return on the first match - } else { - dst.PutCustomDomainManagedCertificate = nil - return fmt.Errorf("failed to unmarshal PutCustomDomainPayloadCertificate as PutCustomDomainManagedCertificate: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src PutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { - if src.PutCustomDomainCustomCertificate != nil { - return json.Marshal(&src.PutCustomDomainCustomCertificate) - } - - if src.PutCustomDomainManagedCertificate != nil { - return json.Marshal(&src.PutCustomDomainManagedCertificate) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *PutCustomDomainPayloadCertificate) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.PutCustomDomainCustomCertificate != nil { - return obj.PutCustomDomainCustomCertificate - } - - if obj.PutCustomDomainManagedCertificate != nil { - return obj.PutCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj PutCustomDomainPayloadCertificate) GetActualInstanceValue() interface{} { - if obj.PutCustomDomainCustomCertificate != nil { - return *obj.PutCustomDomainCustomCertificate - } - - if obj.PutCustomDomainManagedCertificate != nil { - return *obj.PutCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -type NullablePutCustomDomainPayloadCertificate struct { - value *PutCustomDomainPayloadCertificate - isSet bool -} - -func (v NullablePutCustomDomainPayloadCertificate) Get() *PutCustomDomainPayloadCertificate { - return v.value -} - -func (v *NullablePutCustomDomainPayloadCertificate) Set(val *PutCustomDomainPayloadCertificate) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainPayloadCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainPayloadCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainPayloadCertificate(val *PutCustomDomainPayloadCertificate) *NullablePutCustomDomainPayloadCertificate { - return &NullablePutCustomDomainPayloadCertificate{value: val, isSet: true} -} - -func (v NullablePutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainPayloadCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_response.go b/services/cdn/v1betaapi/model_put_custom_domain_response.go deleted file mode 100644 index 0abd6bfd1..000000000 --- a/services/cdn/v1betaapi/model_put_custom_domain_response.go +++ /dev/null @@ -1,236 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the PutCustomDomainResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PutCustomDomainResponse{} - -// PutCustomDomainResponse struct for PutCustomDomainResponse -type PutCustomDomainResponse struct { - Certificate *PutCustomDomainResponseCertificate `json:"certificate,omitempty"` - CustomDomain CustomDomain `json:"customDomain"` - // Deprecated - Domain string `json:"domain" validate:"regexp=^[.\\-A-Za-z0-9]*$"` - AdditionalProperties map[string]interface{} -} - -type _PutCustomDomainResponse PutCustomDomainResponse - -// NewPutCustomDomainResponse instantiates a new PutCustomDomainResponse 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 NewPutCustomDomainResponse(customDomain CustomDomain, domain string) *PutCustomDomainResponse { - this := PutCustomDomainResponse{} - this.CustomDomain = customDomain - this.Domain = domain - return &this -} - -// NewPutCustomDomainResponseWithDefaults instantiates a new PutCustomDomainResponse 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 NewPutCustomDomainResponseWithDefaults() *PutCustomDomainResponse { - this := PutCustomDomainResponse{} - return &this -} - -// GetCertificate returns the Certificate field value if set, zero value otherwise. -func (o *PutCustomDomainResponse) GetCertificate() PutCustomDomainResponseCertificate { - if o == nil || IsNil(o.Certificate) { - var ret PutCustomDomainResponseCertificate - return ret - } - return *o.Certificate -} - -// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PutCustomDomainResponse) GetCertificateOk() (*PutCustomDomainResponseCertificate, bool) { - if o == nil || IsNil(o.Certificate) { - return nil, false - } - return o.Certificate, true -} - -// HasCertificate returns a boolean if a field has been set. -func (o *PutCustomDomainResponse) HasCertificate() bool { - if o != nil && !IsNil(o.Certificate) { - return true - } - - return false -} - -// SetCertificate gets a reference to the given PutCustomDomainResponseCertificate and assigns it to the Certificate field. -func (o *PutCustomDomainResponse) SetCertificate(v PutCustomDomainResponseCertificate) { - o.Certificate = &v -} - -// GetCustomDomain returns the CustomDomain field value -func (o *PutCustomDomainResponse) GetCustomDomain() CustomDomain { - if o == nil { - var ret CustomDomain - return ret - } - - return o.CustomDomain -} - -// GetCustomDomainOk returns a tuple with the CustomDomain field value -// and a boolean to check if the value has been set. -func (o *PutCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { - if o == nil { - return nil, false - } - return &o.CustomDomain, true -} - -// SetCustomDomain sets field value -func (o *PutCustomDomainResponse) SetCustomDomain(v CustomDomain) { - o.CustomDomain = v -} - -// GetDomain returns the Domain field value -// Deprecated -func (o *PutCustomDomainResponse) GetDomain() string { - if o == nil { - var ret string - return ret - } - - return o.Domain -} - -// GetDomainOk returns a tuple with the Domain field value -// and a boolean to check if the value has been set. -// Deprecated -func (o *PutCustomDomainResponse) GetDomainOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Domain, true -} - -// SetDomain sets field value -// Deprecated -func (o *PutCustomDomainResponse) SetDomain(v string) { - o.Domain = v -} - -func (o PutCustomDomainResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PutCustomDomainResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Certificate) { - toSerialize["certificate"] = o.Certificate - } - toSerialize["customDomain"] = o.CustomDomain - toSerialize["domain"] = o.Domain - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PutCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "customDomain", - "domain", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varPutCustomDomainResponse := _PutCustomDomainResponse{} - - err = json.Unmarshal(data, &varPutCustomDomainResponse) - - if err != nil { - return err - } - - *o = PutCustomDomainResponse(varPutCustomDomainResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "certificate") - delete(additionalProperties, "customDomain") - delete(additionalProperties, "domain") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePutCustomDomainResponse struct { - value *PutCustomDomainResponse - isSet bool -} - -func (v NullablePutCustomDomainResponse) Get() *PutCustomDomainResponse { - return v.value -} - -func (v *NullablePutCustomDomainResponse) Set(val *PutCustomDomainResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainResponse(val *PutCustomDomainResponse) *NullablePutCustomDomainResponse { - return &NullablePutCustomDomainResponse{value: val, isSet: true} -} - -func (v NullablePutCustomDomainResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_response_certificate.go b/services/cdn/v1betaapi/model_put_custom_domain_response_certificate.go deleted file mode 100644 index 094a4f516..000000000 --- a/services/cdn/v1betaapi/model_put_custom_domain_response_certificate.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// PutCustomDomainResponseCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted -type PutCustomDomainResponseCertificate struct { - GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate - GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate -} - -// GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in PutCustomDomainResponseCertificate -func GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) PutCustomDomainResponseCertificate { - return PutCustomDomainResponseCertificate{ - GetCustomDomainCustomCertificate: v, - } -} - -// GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in PutCustomDomainResponseCertificate -func GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) PutCustomDomainResponseCertificate { - return PutCustomDomainResponseCertificate{ - GetCustomDomainManagedCertificate: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *PutCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { - var err error - // use discriminator value to speed up the lookup - var jsonDict map[string]interface{} - err = newStrictDecoder(data).Decode(&jsonDict) - if err != nil { - return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") - } - - // check if the discriminator value is 'custom' - if jsonDict["type"] == "custom" { - // try to unmarshal JSON data into GetCustomDomainCustomCertificate - err = json.Unmarshal(data, &dst.GetCustomDomainCustomCertificate) - if err == nil { - return nil // data stored in dst.GetCustomDomainCustomCertificate, return on the first match - } else { - dst.GetCustomDomainCustomCertificate = nil - return fmt.Errorf("failed to unmarshal PutCustomDomainResponseCertificate as GetCustomDomainCustomCertificate: %s", err.Error()) - } - } - - // check if the discriminator value is 'managed' - if jsonDict["type"] == "managed" { - // try to unmarshal JSON data into GetCustomDomainManagedCertificate - err = json.Unmarshal(data, &dst.GetCustomDomainManagedCertificate) - if err == nil { - return nil // data stored in dst.GetCustomDomainManagedCertificate, return on the first match - } else { - dst.GetCustomDomainManagedCertificate = nil - return fmt.Errorf("failed to unmarshal PutCustomDomainResponseCertificate as GetCustomDomainManagedCertificate: %s", err.Error()) - } - } - - return nil -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src PutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { - if src.GetCustomDomainCustomCertificate != nil { - return json.Marshal(&src.GetCustomDomainCustomCertificate) - } - - if src.GetCustomDomainManagedCertificate != nil { - return json.Marshal(&src.GetCustomDomainManagedCertificate) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *PutCustomDomainResponseCertificate) GetActualInstance() interface{} { - if obj == nil { - return nil - } - if obj.GetCustomDomainCustomCertificate != nil { - return obj.GetCustomDomainCustomCertificate - } - - if obj.GetCustomDomainManagedCertificate != nil { - return obj.GetCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -// Get the actual instance value -func (obj PutCustomDomainResponseCertificate) GetActualInstanceValue() interface{} { - if obj.GetCustomDomainCustomCertificate != nil { - return *obj.GetCustomDomainCustomCertificate - } - - if obj.GetCustomDomainManagedCertificate != nil { - return *obj.GetCustomDomainManagedCertificate - } - - // all schemas are nil - return nil -} - -type NullablePutCustomDomainResponseCertificate struct { - value *PutCustomDomainResponseCertificate - isSet bool -} - -func (v NullablePutCustomDomainResponseCertificate) Get() *PutCustomDomainResponseCertificate { - return v.value -} - -func (v *NullablePutCustomDomainResponseCertificate) Set(val *PutCustomDomainResponseCertificate) { - v.value = val - v.isSet = true -} - -func (v NullablePutCustomDomainResponseCertificate) IsSet() bool { - return v.isSet -} - -func (v *NullablePutCustomDomainResponseCertificate) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePutCustomDomainResponseCertificate(val *PutCustomDomainResponseCertificate) *NullablePutCustomDomainResponseCertificate { - return &NullablePutCustomDomainResponseCertificate{value: val, isSet: true} -} - -func (v NullablePutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePutCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_region.go b/services/cdn/v1betaapi/model_region.go deleted file mode 100644 index 22974df89..000000000 --- a/services/cdn/v1betaapi/model_region.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// Region The following regions exist: - `EU` - Europe - `US` - United States / North America - `AF` - Africa - `SA` - South America - `ASIA` - Asia and Oceania -type Region string - -// List of Region -const ( - REGION_EU Region = "EU" - REGION_US Region = "US" - REGION_AF Region = "AF" - REGION_SA Region = "SA" - REGION_ASIA Region = "ASIA" - REGION_UNKNOWN_DEFAULT_OPEN_API Region = "unknown_default_open_api" -) - -// All allowed values of Region enum -var AllowedRegionEnumValues = []Region{ - "EU", - "US", - "AF", - "SA", - "ASIA", - "unknown_default_open_api", -} - -func (v *Region) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := Region(value) - for _, existing := range AllowedRegionEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = REGION_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewRegionFromValue returns a pointer to a valid Region -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewRegionFromValue(v string) (*Region, error) { - ev := Region(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for Region: valid values are %v", v, AllowedRegionEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v Region) IsValid() bool { - for _, existing := range AllowedRegionEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to Region value -func (v Region) Ptr() *Region { - return &v -} - -type NullableRegion struct { - value *Region - isSet bool -} - -func (v NullableRegion) Get() *Region { - return v.value -} - -func (v *NullableRegion) Set(val *Region) { - v.value = val - v.isSet = true -} - -func (v NullableRegion) IsSet() bool { - return v.isSet -} - -func (v *NullableRegion) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRegion(val *Region) *NullableRegion { - return &NullableRegion{value: val, isSet: true} -} - -func (v NullableRegion) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRegion) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_status_error.go b/services/cdn/v1betaapi/model_status_error.go deleted file mode 100644 index 3592a715a..000000000 --- a/services/cdn/v1betaapi/model_status_error.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the StatusError type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &StatusError{} - -// StatusError struct for StatusError -type StatusError struct { - // A german translation string corresponding to the error key. Note that we do not guarantee german translations are present. - De *string `json:"de,omitempty"` - // An english translation string corresponding to the error key. An english translation key is always present. - En string `json:"en"` - Key StatusErrorKey `json:"key"` - AdditionalProperties map[string]interface{} -} - -type _StatusError StatusError - -// NewStatusError instantiates a new StatusError 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 NewStatusError(en string, key StatusErrorKey) *StatusError { - this := StatusError{} - this.En = en - this.Key = key - return &this -} - -// NewStatusErrorWithDefaults instantiates a new StatusError 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 NewStatusErrorWithDefaults() *StatusError { - this := StatusError{} - return &this -} - -// GetDe returns the De field value if set, zero value otherwise. -func (o *StatusError) GetDe() string { - if o == nil || IsNil(o.De) { - var ret string - return ret - } - return *o.De -} - -// GetDeOk returns a tuple with the De field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StatusError) GetDeOk() (*string, bool) { - if o == nil || IsNil(o.De) { - return nil, false - } - return o.De, true -} - -// HasDe returns a boolean if a field has been set. -func (o *StatusError) HasDe() bool { - if o != nil && !IsNil(o.De) { - return true - } - - return false -} - -// SetDe gets a reference to the given string and assigns it to the De field. -func (o *StatusError) SetDe(v string) { - o.De = &v -} - -// GetEn returns the En field value -func (o *StatusError) GetEn() string { - if o == nil { - var ret string - return ret - } - - return o.En -} - -// GetEnOk returns a tuple with the En field value -// and a boolean to check if the value has been set. -func (o *StatusError) GetEnOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.En, true -} - -// SetEn sets field value -func (o *StatusError) SetEn(v string) { - o.En = v -} - -// GetKey returns the Key field value -func (o *StatusError) GetKey() StatusErrorKey { - if o == nil { - var ret StatusErrorKey - return ret - } - - return o.Key -} - -// GetKeyOk returns a tuple with the Key field value -// and a boolean to check if the value has been set. -func (o *StatusError) GetKeyOk() (*StatusErrorKey, bool) { - if o == nil { - return nil, false - } - return &o.Key, true -} - -// SetKey sets field value -func (o *StatusError) SetKey(v StatusErrorKey) { - o.Key = v -} - -func (o StatusError) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o StatusError) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.De) { - toSerialize["de"] = o.De - } - toSerialize["en"] = o.En - toSerialize["key"] = o.Key - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *StatusError) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "en", - "key", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varStatusError := _StatusError{} - - err = json.Unmarshal(data, &varStatusError) - - if err != nil { - return err - } - - *o = StatusError(varStatusError) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "de") - delete(additionalProperties, "en") - delete(additionalProperties, "key") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableStatusError struct { - value *StatusError - isSet bool -} - -func (v NullableStatusError) Get() *StatusError { - return v.value -} - -func (v *NullableStatusError) Set(val *StatusError) { - v.value = val - v.isSet = true -} - -func (v NullableStatusError) IsSet() bool { - return v.isSet -} - -func (v *NullableStatusError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableStatusError(val *StatusError) *NullableStatusError { - return &NullableStatusError{value: val, isSet: true} -} - -func (v NullableStatusError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableStatusError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_status_error_key.go b/services/cdn/v1betaapi/model_status_error_key.go deleted file mode 100644 index e0662614d..000000000 --- a/services/cdn/v1betaapi/model_status_error_key.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// StatusErrorKey An enum value that describes a Status Error. -type StatusErrorKey string - -// List of StatusError_key -const ( - STATUSERRORKEY_UNKNOWN StatusErrorKey = "UNKNOWN" - STATUSERRORKEY_CUSTOM_DOMAIN_CNAME_MISSING StatusErrorKey = "CUSTOM_DOMAIN_CNAME_MISSING" - STATUSERRORKEY_CUSTOM_DOMAIN_ALREADY_IN_USE StatusErrorKey = "CUSTOM_DOMAIN_ALREADY_IN_USE" - STATUSERRORKEY_PUBLIC_BETA_QUOTA_REACHED StatusErrorKey = "PUBLIC_BETA_QUOTA_REACHED" - STATUSERRORKEY_LOG_SINK_INSTANCE_UNAVAILABLE StatusErrorKey = "LOG_SINK_INSTANCE_UNAVAILABLE" - STATUSERRORKEY_EXTERNAL_QUOTA_REACHED StatusErrorKey = "EXTERNAL_QUOTA_REACHED" - STATUSERRORKEY_UNKNOWN_DEFAULT_OPEN_API StatusErrorKey = "unknown_default_open_api" -) - -// All allowed values of StatusErrorKey enum -var AllowedStatusErrorKeyEnumValues = []StatusErrorKey{ - "UNKNOWN", - "CUSTOM_DOMAIN_CNAME_MISSING", - "CUSTOM_DOMAIN_ALREADY_IN_USE", - "PUBLIC_BETA_QUOTA_REACHED", - "LOG_SINK_INSTANCE_UNAVAILABLE", - "EXTERNAL_QUOTA_REACHED", - "unknown_default_open_api", -} - -func (v *StatusErrorKey) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := StatusErrorKey(value) - for _, existing := range AllowedStatusErrorKeyEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = STATUSERRORKEY_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewStatusErrorKeyFromValue returns a pointer to a valid StatusErrorKey -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewStatusErrorKeyFromValue(v string) (*StatusErrorKey, error) { - ev := StatusErrorKey(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for StatusErrorKey: valid values are %v", v, AllowedStatusErrorKeyEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v StatusErrorKey) IsValid() bool { - for _, existing := range AllowedStatusErrorKeyEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to StatusError_key value -func (v StatusErrorKey) Ptr() *StatusErrorKey { - return &v -} - -type NullableStatusErrorKey struct { - value *StatusErrorKey - isSet bool -} - -func (v NullableStatusErrorKey) Get() *StatusErrorKey { - return v.value -} - -func (v *NullableStatusErrorKey) Set(val *StatusErrorKey) { - v.value = val - v.isSet = true -} - -func (v NullableStatusErrorKey) IsSet() bool { - return v.isSet -} - -func (v *NullableStatusErrorKey) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableStatusErrorKey(val *StatusErrorKey) *NullableStatusErrorKey { - return &NullableStatusErrorKey{value: val, isSet: true} -} - -func (v NullableStatusErrorKey) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableStatusErrorKey) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_config.go b/services/cdn/v1betaapi/model_waf_config.go deleted file mode 100644 index 431d1e10e..000000000 --- a/services/cdn/v1betaapi/model_waf_config.go +++ /dev/null @@ -1,373 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the WafConfig type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafConfig{} - -// WafConfig Configuration of the WAF of a distribution -type WafConfig struct { - AllowedHttpMethods []string `json:"allowedHttpMethods,omitempty"` - AllowedHttpVersions []string `json:"allowedHttpVersions,omitempty"` - AllowedRequestContentTypes []string `json:"allowedRequestContentTypes,omitempty"` - // IDs of the WAF rules that are **explicitly** enabled for this distribution. If this rule is in a disabled / log Only RuleGroup or Collection, it will be enabled regardless as `enabledRuleIds` overrides those in specificity. Do note that rules can also be enabled because a Rulegroup or Collection is enabled. **DO NOT** use this property to find all active rules. Instead, pass `?withWafStatus=true` as a query parameter to `GetDistribution` or `ListDistributions`. This will expose the `waf` Property on distribution Level. From there you can `$.waf.enabledRules.map(e => e.id)` to get a list of all enabled rules. - EnabledRuleIds []string `json:"enabledRuleIds"` - Mode WafMode `json:"mode"` - ParanoiaLevel *WafParanoiaLevel `json:"paranoiaLevel,omitempty"` - Type WafType `json:"type"` - AdditionalProperties map[string]interface{} -} - -type _WafConfig WafConfig - -// NewWafConfig instantiates a new WafConfig 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 NewWafConfig(enabledRuleIds []string, mode WafMode, types WafType) *WafConfig { - this := WafConfig{} - this.EnabledRuleIds = enabledRuleIds - this.Mode = mode - this.Type = types - return &this -} - -// NewWafConfigWithDefaults instantiates a new WafConfig 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 NewWafConfigWithDefaults() *WafConfig { - this := WafConfig{} - return &this -} - -// GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. -func (o *WafConfig) GetAllowedHttpMethods() []string { - if o == nil || IsNil(o.AllowedHttpMethods) { - var ret []string - return ret - } - return o.AllowedHttpMethods -} - -// GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetAllowedHttpMethodsOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedHttpMethods) { - return nil, false - } - return o.AllowedHttpMethods, true -} - -// HasAllowedHttpMethods returns a boolean if a field has been set. -func (o *WafConfig) HasAllowedHttpMethods() bool { - if o != nil && !IsNil(o.AllowedHttpMethods) { - return true - } - - return false -} - -// SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. -func (o *WafConfig) SetAllowedHttpMethods(v []string) { - o.AllowedHttpMethods = v -} - -// GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. -func (o *WafConfig) GetAllowedHttpVersions() []string { - if o == nil || IsNil(o.AllowedHttpVersions) { - var ret []string - return ret - } - return o.AllowedHttpVersions -} - -// GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetAllowedHttpVersionsOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedHttpVersions) { - return nil, false - } - return o.AllowedHttpVersions, true -} - -// HasAllowedHttpVersions returns a boolean if a field has been set. -func (o *WafConfig) HasAllowedHttpVersions() bool { - if o != nil && !IsNil(o.AllowedHttpVersions) { - return true - } - - return false -} - -// SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. -func (o *WafConfig) SetAllowedHttpVersions(v []string) { - o.AllowedHttpVersions = v -} - -// GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. -func (o *WafConfig) GetAllowedRequestContentTypes() []string { - if o == nil || IsNil(o.AllowedRequestContentTypes) { - var ret []string - return ret - } - return o.AllowedRequestContentTypes -} - -// GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetAllowedRequestContentTypesOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedRequestContentTypes) { - return nil, false - } - return o.AllowedRequestContentTypes, true -} - -// HasAllowedRequestContentTypes returns a boolean if a field has been set. -func (o *WafConfig) HasAllowedRequestContentTypes() bool { - if o != nil && !IsNil(o.AllowedRequestContentTypes) { - return true - } - - return false -} - -// SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. -func (o *WafConfig) SetAllowedRequestContentTypes(v []string) { - o.AllowedRequestContentTypes = v -} - -// GetEnabledRuleIds returns the EnabledRuleIds field value -func (o *WafConfig) GetEnabledRuleIds() []string { - if o == nil { - var ret []string - return ret - } - - return o.EnabledRuleIds -} - -// GetEnabledRuleIdsOk returns a tuple with the EnabledRuleIds field value -// and a boolean to check if the value has been set. -func (o *WafConfig) GetEnabledRuleIdsOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.EnabledRuleIds, true -} - -// SetEnabledRuleIds sets field value -func (o *WafConfig) SetEnabledRuleIds(v []string) { - o.EnabledRuleIds = v -} - -// GetMode returns the Mode field value -func (o *WafConfig) GetMode() WafMode { - if o == nil { - var ret WafMode - return ret - } - - return o.Mode -} - -// GetModeOk returns a tuple with the Mode field value -// and a boolean to check if the value has been set. -func (o *WafConfig) GetModeOk() (*WafMode, bool) { - if o == nil { - return nil, false - } - return &o.Mode, true -} - -// SetMode sets field value -func (o *WafConfig) SetMode(v WafMode) { - o.Mode = v -} - -// GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. -func (o *WafConfig) GetParanoiaLevel() WafParanoiaLevel { - if o == nil || IsNil(o.ParanoiaLevel) { - var ret WafParanoiaLevel - return ret - } - return *o.ParanoiaLevel -} - -// GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfig) GetParanoiaLevelOk() (*WafParanoiaLevel, bool) { - if o == nil || IsNil(o.ParanoiaLevel) { - return nil, false - } - return o.ParanoiaLevel, true -} - -// HasParanoiaLevel returns a boolean if a field has been set. -func (o *WafConfig) HasParanoiaLevel() bool { - if o != nil && !IsNil(o.ParanoiaLevel) { - return true - } - - return false -} - -// SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. -func (o *WafConfig) SetParanoiaLevel(v WafParanoiaLevel) { - o.ParanoiaLevel = &v -} - -// GetType returns the Type field value -func (o *WafConfig) GetType() WafType { - if o == nil { - var ret WafType - 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 *WafConfig) GetTypeOk() (*WafType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *WafConfig) SetType(v WafType) { - o.Type = v -} - -func (o WafConfig) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafConfig) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.AllowedHttpMethods) { - toSerialize["allowedHttpMethods"] = o.AllowedHttpMethods - } - if !IsNil(o.AllowedHttpVersions) { - toSerialize["allowedHttpVersions"] = o.AllowedHttpVersions - } - if !IsNil(o.AllowedRequestContentTypes) { - toSerialize["allowedRequestContentTypes"] = o.AllowedRequestContentTypes - } - toSerialize["enabledRuleIds"] = o.EnabledRuleIds - toSerialize["mode"] = o.Mode - if !IsNil(o.ParanoiaLevel) { - toSerialize["paranoiaLevel"] = o.ParanoiaLevel - } - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafConfig) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "enabledRuleIds", - "mode", - "type", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWafConfig := _WafConfig{} - - err = json.Unmarshal(data, &varWafConfig) - - if err != nil { - return err - } - - *o = WafConfig(varWafConfig) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "allowedHttpMethods") - delete(additionalProperties, "allowedHttpVersions") - delete(additionalProperties, "allowedRequestContentTypes") - delete(additionalProperties, "enabledRuleIds") - delete(additionalProperties, "mode") - delete(additionalProperties, "paranoiaLevel") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafConfig struct { - value *WafConfig - isSet bool -} - -func (v NullableWafConfig) Get() *WafConfig { - return v.value -} - -func (v *NullableWafConfig) Set(val *WafConfig) { - v.value = val - v.isSet = true -} - -func (v NullableWafConfig) IsSet() bool { - return v.isSet -} - -func (v *NullableWafConfig) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafConfig(val *WafConfig) *NullableWafConfig { - return &NullableWafConfig{value: val, isSet: true} -} - -func (v NullableWafConfig) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafConfig) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_config_patch.go b/services/cdn/v1betaapi/model_waf_config_patch.go deleted file mode 100644 index 2142a7a48..000000000 --- a/services/cdn/v1betaapi/model_waf_config_patch.go +++ /dev/null @@ -1,338 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" -) - -// checks if the WafConfigPatch type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WafConfigPatch{} - -// WafConfigPatch struct for WafConfigPatch -type WafConfigPatch struct { - AllowedHttpMethods []string `json:"allowedHttpMethods,omitempty"` - AllowedHttpVersions []string `json:"allowedHttpVersions,omitempty"` - AllowedRequestContentTypes []string `json:"allowedRequestContentTypes,omitempty"` - Mode *WafMode `json:"mode,omitempty"` - ParanoiaLevel *WafParanoiaLevel `json:"paranoiaLevel,omitempty"` - Type *WafType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _WafConfigPatch WafConfigPatch - -// NewWafConfigPatch instantiates a new WafConfigPatch 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 NewWafConfigPatch() *WafConfigPatch { - this := WafConfigPatch{} - return &this -} - -// NewWafConfigPatchWithDefaults instantiates a new WafConfigPatch 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 NewWafConfigPatchWithDefaults() *WafConfigPatch { - this := WafConfigPatch{} - return &this -} - -// GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. -func (o *WafConfigPatch) GetAllowedHttpMethods() []string { - if o == nil || IsNil(o.AllowedHttpMethods) { - var ret []string - return ret - } - return o.AllowedHttpMethods -} - -// GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetAllowedHttpMethodsOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedHttpMethods) { - return nil, false - } - return o.AllowedHttpMethods, true -} - -// HasAllowedHttpMethods returns a boolean if a field has been set. -func (o *WafConfigPatch) HasAllowedHttpMethods() bool { - if o != nil && !IsNil(o.AllowedHttpMethods) { - return true - } - - return false -} - -// SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. -func (o *WafConfigPatch) SetAllowedHttpMethods(v []string) { - o.AllowedHttpMethods = v -} - -// GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. -func (o *WafConfigPatch) GetAllowedHttpVersions() []string { - if o == nil || IsNil(o.AllowedHttpVersions) { - var ret []string - return ret - } - return o.AllowedHttpVersions -} - -// GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetAllowedHttpVersionsOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedHttpVersions) { - return nil, false - } - return o.AllowedHttpVersions, true -} - -// HasAllowedHttpVersions returns a boolean if a field has been set. -func (o *WafConfigPatch) HasAllowedHttpVersions() bool { - if o != nil && !IsNil(o.AllowedHttpVersions) { - return true - } - - return false -} - -// SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. -func (o *WafConfigPatch) SetAllowedHttpVersions(v []string) { - o.AllowedHttpVersions = v -} - -// GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. -func (o *WafConfigPatch) GetAllowedRequestContentTypes() []string { - if o == nil || IsNil(o.AllowedRequestContentTypes) { - var ret []string - return ret - } - return o.AllowedRequestContentTypes -} - -// GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetAllowedRequestContentTypesOk() ([]string, bool) { - if o == nil || IsNil(o.AllowedRequestContentTypes) { - return nil, false - } - return o.AllowedRequestContentTypes, true -} - -// HasAllowedRequestContentTypes returns a boolean if a field has been set. -func (o *WafConfigPatch) HasAllowedRequestContentTypes() bool { - if o != nil && !IsNil(o.AllowedRequestContentTypes) { - return true - } - - return false -} - -// SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. -func (o *WafConfigPatch) SetAllowedRequestContentTypes(v []string) { - o.AllowedRequestContentTypes = v -} - -// GetMode returns the Mode field value if set, zero value otherwise. -func (o *WafConfigPatch) GetMode() WafMode { - if o == nil || IsNil(o.Mode) { - var ret WafMode - return ret - } - return *o.Mode -} - -// GetModeOk returns a tuple with the Mode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetModeOk() (*WafMode, bool) { - if o == nil || IsNil(o.Mode) { - return nil, false - } - return o.Mode, true -} - -// HasMode returns a boolean if a field has been set. -func (o *WafConfigPatch) HasMode() bool { - if o != nil && !IsNil(o.Mode) { - return true - } - - return false -} - -// SetMode gets a reference to the given WafMode and assigns it to the Mode field. -func (o *WafConfigPatch) SetMode(v WafMode) { - o.Mode = &v -} - -// GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. -func (o *WafConfigPatch) GetParanoiaLevel() WafParanoiaLevel { - if o == nil || IsNil(o.ParanoiaLevel) { - var ret WafParanoiaLevel - return ret - } - return *o.ParanoiaLevel -} - -// GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetParanoiaLevelOk() (*WafParanoiaLevel, bool) { - if o == nil || IsNil(o.ParanoiaLevel) { - return nil, false - } - return o.ParanoiaLevel, true -} - -// HasParanoiaLevel returns a boolean if a field has been set. -func (o *WafConfigPatch) HasParanoiaLevel() bool { - if o != nil && !IsNil(o.ParanoiaLevel) { - return true - } - - return false -} - -// SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. -func (o *WafConfigPatch) SetParanoiaLevel(v WafParanoiaLevel) { - o.ParanoiaLevel = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *WafConfigPatch) GetType() WafType { - if o == nil || IsNil(o.Type) { - var ret WafType - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WafConfigPatch) GetTypeOk() (*WafType, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *WafConfigPatch) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false -} - -// SetType gets a reference to the given WafType and assigns it to the Type field. -func (o *WafConfigPatch) SetType(v WafType) { - o.Type = &v -} - -func (o WafConfigPatch) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WafConfigPatch) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.AllowedHttpMethods) { - toSerialize["allowedHttpMethods"] = o.AllowedHttpMethods - } - if !IsNil(o.AllowedHttpVersions) { - toSerialize["allowedHttpVersions"] = o.AllowedHttpVersions - } - if !IsNil(o.AllowedRequestContentTypes) { - toSerialize["allowedRequestContentTypes"] = o.AllowedRequestContentTypes - } - if !IsNil(o.Mode) { - toSerialize["mode"] = o.Mode - } - if !IsNil(o.ParanoiaLevel) { - toSerialize["paranoiaLevel"] = o.ParanoiaLevel - } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WafConfigPatch) UnmarshalJSON(data []byte) (err error) { - varWafConfigPatch := _WafConfigPatch{} - - err = json.Unmarshal(data, &varWafConfigPatch) - - if err != nil { - return err - } - - *o = WafConfigPatch(varWafConfigPatch) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "allowedHttpMethods") - delete(additionalProperties, "allowedHttpVersions") - delete(additionalProperties, "allowedRequestContentTypes") - delete(additionalProperties, "mode") - delete(additionalProperties, "paranoiaLevel") - delete(additionalProperties, "type") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWafConfigPatch struct { - value *WafConfigPatch - isSet bool -} - -func (v NullableWafConfigPatch) Get() *WafConfigPatch { - return v.value -} - -func (v *NullableWafConfigPatch) Set(val *WafConfigPatch) { - v.value = val - v.isSet = true -} - -func (v NullableWafConfigPatch) IsSet() bool { - return v.isSet -} - -func (v *NullableWafConfigPatch) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafConfigPatch(val *WafConfigPatch) *NullableWafConfigPatch { - return &NullableWafConfigPatch{value: val, isSet: true} -} - -func (v NullableWafConfigPatch) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafConfigPatch) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_mode.go b/services/cdn/v1betaapi/model_waf_mode.go deleted file mode 100644 index 4d54555e4..000000000 --- a/services/cdn/v1betaapi/model_waf_mode.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// WafMode the model 'WafMode' -type WafMode string - -// List of WafMode -const ( - WAFMODE_DISABLED WafMode = "DISABLED" - WAFMODE_ENABLED WafMode = "ENABLED" - WAFMODE_LOG_ONLY WafMode = "LOG_ONLY" - WAFMODE_UNKNOWN_DEFAULT_OPEN_API WafMode = "unknown_default_open_api" -) - -// All allowed values of WafMode enum -var AllowedWafModeEnumValues = []WafMode{ - "DISABLED", - "ENABLED", - "LOG_ONLY", - "unknown_default_open_api", -} - -func (v *WafMode) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := WafMode(value) - for _, existing := range AllowedWafModeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = WAFMODE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewWafModeFromValue returns a pointer to a valid WafMode -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewWafModeFromValue(v string) (*WafMode, error) { - ev := WafMode(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for WafMode: valid values are %v", v, AllowedWafModeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v WafMode) IsValid() bool { - for _, existing := range AllowedWafModeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to WafMode value -func (v WafMode) Ptr() *WafMode { - return &v -} - -type NullableWafMode struct { - value *WafMode - isSet bool -} - -func (v NullableWafMode) Get() *WafMode { - return v.value -} - -func (v *NullableWafMode) Set(val *WafMode) { - v.value = val - v.isSet = true -} - -func (v NullableWafMode) IsSet() bool { - return v.isSet -} - -func (v *NullableWafMode) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafMode(val *WafMode) *NullableWafMode { - return &NullableWafMode{value: val, isSet: true} -} - -func (v NullableWafMode) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafMode) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_paranoia_level.go b/services/cdn/v1betaapi/model_waf_paranoia_level.go deleted file mode 100644 index 66cac18ae..000000000 --- a/services/cdn/v1betaapi/model_waf_paranoia_level.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// WafParanoiaLevel The paranoia level defines how aggressively the WAF should action on requests. It ranges from `L1` (least strict, lowest chance of false positives) to `L4` (most strict, highest chance of false positives). A higher paranoia level is more effective at catching attacks but can also block legitimate traffic. -type WafParanoiaLevel string - -// List of WafParanoiaLevel -const ( - WAFPARANOIALEVEL_L1 WafParanoiaLevel = "L1" - WAFPARANOIALEVEL_L2 WafParanoiaLevel = "L2" - WAFPARANOIALEVEL_L3 WafParanoiaLevel = "L3" - WAFPARANOIALEVEL_L4 WafParanoiaLevel = "L4" - WAFPARANOIALEVEL_UNKNOWN_DEFAULT_OPEN_API WafParanoiaLevel = "unknown_default_open_api" -) - -// All allowed values of WafParanoiaLevel enum -var AllowedWafParanoiaLevelEnumValues = []WafParanoiaLevel{ - "L1", - "L2", - "L3", - "L4", - "unknown_default_open_api", -} - -func (v *WafParanoiaLevel) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := WafParanoiaLevel(value) - for _, existing := range AllowedWafParanoiaLevelEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = WAFPARANOIALEVEL_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewWafParanoiaLevelFromValue returns a pointer to a valid WafParanoiaLevel -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewWafParanoiaLevelFromValue(v string) (*WafParanoiaLevel, error) { - ev := WafParanoiaLevel(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for WafParanoiaLevel: valid values are %v", v, AllowedWafParanoiaLevelEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v WafParanoiaLevel) IsValid() bool { - for _, existing := range AllowedWafParanoiaLevelEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to WafParanoiaLevel value -func (v WafParanoiaLevel) Ptr() *WafParanoiaLevel { - return &v -} - -type NullableWafParanoiaLevel struct { - value *WafParanoiaLevel - isSet bool -} - -func (v NullableWafParanoiaLevel) Get() *WafParanoiaLevel { - return v.value -} - -func (v *NullableWafParanoiaLevel) Set(val *WafParanoiaLevel) { - v.value = val - v.isSet = true -} - -func (v NullableWafParanoiaLevel) IsSet() bool { - return v.isSet -} - -func (v *NullableWafParanoiaLevel) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafParanoiaLevel(val *WafParanoiaLevel) *NullableWafParanoiaLevel { - return &NullableWafParanoiaLevel{value: val, isSet: true} -} - -func (v NullableWafParanoiaLevel) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafParanoiaLevel) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_rule.go b/services/cdn/v1betaapi/model_waf_rule.go deleted file mode 100644 index 9eb3582f5..000000000 --- a/services/cdn/v1betaapi/model_waf_rule.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the WAFRule type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WAFRule{} - -// WAFRule struct for WAFRule -type WAFRule struct { - // Optional CoreRuleSet rule ID in case this is a CRS rule - Code *string `json:"code,omitempty"` - // LocalizedString is a map from language to string value - Description map[string]string `json:"description"` - Id string `json:"id"` - AdditionalProperties map[string]interface{} -} - -type _WAFRule WAFRule - -// NewWAFRule instantiates a new WAFRule 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 NewWAFRule(description map[string]string, id string) *WAFRule { - this := WAFRule{} - this.Description = description - this.Id = id - return &this -} - -// NewWAFRuleWithDefaults instantiates a new WAFRule 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 NewWAFRuleWithDefaults() *WAFRule { - this := WAFRule{} - return &this -} - -// GetCode returns the Code field value if set, zero value otherwise. -func (o *WAFRule) GetCode() string { - if o == nil || IsNil(o.Code) { - var ret string - return ret - } - return *o.Code -} - -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WAFRule) GetCodeOk() (*string, bool) { - if o == nil || IsNil(o.Code) { - return nil, false - } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *WAFRule) HasCode() bool { - if o != nil && !IsNil(o.Code) { - return true - } - - return false -} - -// SetCode gets a reference to the given string and assigns it to the Code field. -func (o *WAFRule) SetCode(v string) { - o.Code = &v -} - -// GetDescription returns the Description field value -func (o *WAFRule) GetDescription() map[string]string { - if o == nil { - var ret map[string]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 *WAFRule) GetDescriptionOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.Description, true -} - -// SetDescription sets field value -func (o *WAFRule) SetDescription(v map[string]string) { - o.Description = v -} - -// GetId returns the Id field value -func (o *WAFRule) 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 *WAFRule) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *WAFRule) SetId(v string) { - o.Id = v -} - -func (o WAFRule) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WAFRule) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Code) { - toSerialize["code"] = o.Code - } - toSerialize["description"] = o.Description - toSerialize["id"] = o.Id - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WAFRule) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "description", - "id", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWAFRule := _WAFRule{} - - err = json.Unmarshal(data, &varWAFRule) - - if err != nil { - return err - } - - *o = WAFRule(varWAFRule) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "code") - delete(additionalProperties, "description") - delete(additionalProperties, "id") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWAFRule struct { - value *WAFRule - isSet bool -} - -func (v NullableWAFRule) Get() *WAFRule { - return v.value -} - -func (v *NullableWAFRule) Set(val *WAFRule) { - v.value = val - v.isSet = true -} - -func (v NullableWAFRule) IsSet() bool { - return v.isSet -} - -func (v *NullableWAFRule) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWAFRule(val *WAFRule) *NullableWAFRule { - return &NullableWAFRule{value: val, isSet: true} -} - -func (v NullableWAFRule) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWAFRule) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_rule_action.go b/services/cdn/v1betaapi/model_waf_rule_action.go deleted file mode 100644 index ee7021818..000000000 --- a/services/cdn/v1betaapi/model_waf_rule_action.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// WAFRuleAction The action a WAF rule can take based on a request -type WAFRuleAction string - -// List of WAFRuleAction -const ( - WAFRULEACTION_BLOCKED WAFRuleAction = "BLOCKED" - WAFRULEACTION_LOGGED WAFRuleAction = "LOGGED" - WAFRULEACTION_ALLOWED WAFRuleAction = "ALLOWED" - WAFRULEACTION_UNKNOWN_DEFAULT_OPEN_API WAFRuleAction = "unknown_default_open_api" -) - -// All allowed values of WAFRuleAction enum -var AllowedWAFRuleActionEnumValues = []WAFRuleAction{ - "BLOCKED", - "LOGGED", - "ALLOWED", - "unknown_default_open_api", -} - -func (v *WAFRuleAction) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := WAFRuleAction(value) - for _, existing := range AllowedWAFRuleActionEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = WAFRULEACTION_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewWAFRuleActionFromValue returns a pointer to a valid WAFRuleAction -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewWAFRuleActionFromValue(v string) (*WAFRuleAction, error) { - ev := WAFRuleAction(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for WAFRuleAction: valid values are %v", v, AllowedWAFRuleActionEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v WAFRuleAction) IsValid() bool { - for _, existing := range AllowedWAFRuleActionEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to WAFRuleAction value -func (v WAFRuleAction) Ptr() *WAFRuleAction { - return &v -} - -type NullableWAFRuleAction struct { - value *WAFRuleAction - isSet bool -} - -func (v NullableWAFRuleAction) Get() *WAFRuleAction { - return v.value -} - -func (v *NullableWAFRuleAction) Set(val *WAFRuleAction) { - v.value = val - v.isSet = true -} - -func (v NullableWAFRuleAction) IsSet() bool { - return v.isSet -} - -func (v *NullableWAFRuleAction) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWAFRuleAction(val *WAFRuleAction) *NullableWAFRuleAction { - return &NullableWAFRuleAction{value: val, isSet: true} -} - -func (v NullableWAFRuleAction) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWAFRuleAction) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_rule_collection.go b/services/cdn/v1betaapi/model_waf_rule_collection.go deleted file mode 100644 index a631a4f09..000000000 --- a/services/cdn/v1betaapi/model_waf_rule_collection.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the WAFRuleCollection type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WAFRuleCollection{} - -// WAFRuleCollection struct for WAFRuleCollection -type WAFRuleCollection struct { - Groups []WAFRuleGroup `json:"groups"` - Id string `json:"id"` - // LocalizedString is a map from language to string value - Name map[string]string `json:"name"` - AdditionalProperties map[string]interface{} -} - -type _WAFRuleCollection WAFRuleCollection - -// NewWAFRuleCollection instantiates a new WAFRuleCollection 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 NewWAFRuleCollection(groups []WAFRuleGroup, id string, name map[string]string) *WAFRuleCollection { - this := WAFRuleCollection{} - this.Groups = groups - this.Id = id - this.Name = name - return &this -} - -// NewWAFRuleCollectionWithDefaults instantiates a new WAFRuleCollection 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 NewWAFRuleCollectionWithDefaults() *WAFRuleCollection { - this := WAFRuleCollection{} - return &this -} - -// GetGroups returns the Groups field value -func (o *WAFRuleCollection) GetGroups() []WAFRuleGroup { - if o == nil { - var ret []WAFRuleGroup - return ret - } - - return o.Groups -} - -// GetGroupsOk returns a tuple with the Groups field value -// and a boolean to check if the value has been set. -func (o *WAFRuleCollection) GetGroupsOk() ([]WAFRuleGroup, bool) { - if o == nil { - return nil, false - } - return o.Groups, true -} - -// SetGroups sets field value -func (o *WAFRuleCollection) SetGroups(v []WAFRuleGroup) { - o.Groups = v -} - -// GetId returns the Id field value -func (o *WAFRuleCollection) 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 *WAFRuleCollection) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *WAFRuleCollection) SetId(v string) { - o.Id = v -} - -// GetName returns the Name field value -func (o *WAFRuleCollection) GetName() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *WAFRuleCollection) GetNameOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *WAFRuleCollection) SetName(v map[string]string) { - o.Name = v -} - -func (o WAFRuleCollection) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WAFRuleCollection) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["groups"] = o.Groups - toSerialize["id"] = o.Id - toSerialize["name"] = o.Name - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WAFRuleCollection) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "groups", - "id", - "name", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWAFRuleCollection := _WAFRuleCollection{} - - err = json.Unmarshal(data, &varWAFRuleCollection) - - if err != nil { - return err - } - - *o = WAFRuleCollection(varWAFRuleCollection) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "groups") - delete(additionalProperties, "id") - delete(additionalProperties, "name") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWAFRuleCollection struct { - value *WAFRuleCollection - isSet bool -} - -func (v NullableWAFRuleCollection) Get() *WAFRuleCollection { - return v.value -} - -func (v *NullableWAFRuleCollection) Set(val *WAFRuleCollection) { - v.value = val - v.isSet = true -} - -func (v NullableWAFRuleCollection) IsSet() bool { - return v.isSet -} - -func (v *NullableWAFRuleCollection) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWAFRuleCollection(val *WAFRuleCollection) *NullableWAFRuleCollection { - return &NullableWAFRuleCollection{value: val, isSet: true} -} - -func (v NullableWAFRuleCollection) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWAFRuleCollection) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_rule_group.go b/services/cdn/v1betaapi/model_waf_rule_group.go deleted file mode 100644 index 529ee1e51..000000000 --- a/services/cdn/v1betaapi/model_waf_rule_group.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the WAFRuleGroup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WAFRuleGroup{} - -// WAFRuleGroup struct for WAFRuleGroup -type WAFRuleGroup struct { - // LocalizedString is a map from language to string value - Description map[string]string `json:"description"` - // LocalizedString is a map from language to string value - Name map[string]string `json:"name"` - Rules []WAFRule `json:"rules"` - AdditionalProperties map[string]interface{} -} - -type _WAFRuleGroup WAFRuleGroup - -// NewWAFRuleGroup instantiates a new WAFRuleGroup 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 NewWAFRuleGroup(description map[string]string, name map[string]string, rules []WAFRule) *WAFRuleGroup { - this := WAFRuleGroup{} - this.Description = description - this.Name = name - this.Rules = rules - return &this -} - -// NewWAFRuleGroupWithDefaults instantiates a new WAFRuleGroup 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 NewWAFRuleGroupWithDefaults() *WAFRuleGroup { - this := WAFRuleGroup{} - return &this -} - -// GetDescription returns the Description field value -func (o *WAFRuleGroup) GetDescription() map[string]string { - if o == nil { - var ret map[string]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 *WAFRuleGroup) GetDescriptionOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.Description, true -} - -// SetDescription sets field value -func (o *WAFRuleGroup) SetDescription(v map[string]string) { - o.Description = v -} - -// GetName returns the Name field value -func (o *WAFRuleGroup) GetName() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *WAFRuleGroup) GetNameOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *WAFRuleGroup) SetName(v map[string]string) { - o.Name = v -} - -// GetRules returns the Rules field value -func (o *WAFRuleGroup) GetRules() []WAFRule { - if o == nil { - var ret []WAFRule - return ret - } - - return o.Rules -} - -// GetRulesOk returns a tuple with the Rules field value -// and a boolean to check if the value has been set. -func (o *WAFRuleGroup) GetRulesOk() ([]WAFRule, bool) { - if o == nil { - return nil, false - } - return o.Rules, true -} - -// SetRules sets field value -func (o *WAFRuleGroup) SetRules(v []WAFRule) { - o.Rules = v -} - -func (o WAFRuleGroup) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WAFRuleGroup) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["description"] = o.Description - toSerialize["name"] = o.Name - toSerialize["rules"] = o.Rules - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WAFRuleGroup) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "description", - "name", - "rules", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWAFRuleGroup := _WAFRuleGroup{} - - err = json.Unmarshal(data, &varWAFRuleGroup) - - if err != nil { - return err - } - - *o = WAFRuleGroup(varWAFRuleGroup) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "description") - delete(additionalProperties, "name") - delete(additionalProperties, "rules") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWAFRuleGroup struct { - value *WAFRuleGroup - isSet bool -} - -func (v NullableWAFRuleGroup) Get() *WAFRuleGroup { - return v.value -} - -func (v *NullableWAFRuleGroup) Set(val *WAFRuleGroup) { - v.value = val - v.isSet = true -} - -func (v NullableWAFRuleGroup) IsSet() bool { - return v.isSet -} - -func (v *NullableWAFRuleGroup) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWAFRuleGroup(val *WAFRuleGroup) *NullableWAFRuleGroup { - return &NullableWAFRuleGroup{value: val, isSet: true} -} - -func (v NullableWAFRuleGroup) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWAFRuleGroup) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_status_rule_block.go b/services/cdn/v1betaapi/model_waf_status_rule_block.go deleted file mode 100644 index cb04d138b..000000000 --- a/services/cdn/v1betaapi/model_waf_status_rule_block.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the WAFStatusRuleBlock type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WAFStatusRuleBlock{} - -// WAFStatusRuleBlock struct for WAFStatusRuleBlock -type WAFStatusRuleBlock struct { - // Specifies the ID of the Rule. - Id string `json:"id"` - AdditionalProperties map[string]interface{} -} - -type _WAFStatusRuleBlock WAFStatusRuleBlock - -// NewWAFStatusRuleBlock instantiates a new WAFStatusRuleBlock 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 NewWAFStatusRuleBlock(id string) *WAFStatusRuleBlock { - this := WAFStatusRuleBlock{} - this.Id = id - return &this -} - -// NewWAFStatusRuleBlockWithDefaults instantiates a new WAFStatusRuleBlock 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 NewWAFStatusRuleBlockWithDefaults() *WAFStatusRuleBlock { - this := WAFStatusRuleBlock{} - return &this -} - -// GetId returns the Id field value -func (o *WAFStatusRuleBlock) 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 *WAFStatusRuleBlock) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *WAFStatusRuleBlock) SetId(v string) { - o.Id = v -} - -func (o WAFStatusRuleBlock) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WAFStatusRuleBlock) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WAFStatusRuleBlock) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "id", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWAFStatusRuleBlock := _WAFStatusRuleBlock{} - - err = json.Unmarshal(data, &varWAFStatusRuleBlock) - - if err != nil { - return err - } - - *o = WAFStatusRuleBlock(varWAFStatusRuleBlock) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "id") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWAFStatusRuleBlock struct { - value *WAFStatusRuleBlock - isSet bool -} - -func (v NullableWAFStatusRuleBlock) Get() *WAFStatusRuleBlock { - return v.value -} - -func (v *NullableWAFStatusRuleBlock) Set(val *WAFStatusRuleBlock) { - v.value = val - v.isSet = true -} - -func (v NullableWAFStatusRuleBlock) IsSet() bool { - return v.isSet -} - -func (v *NullableWAFStatusRuleBlock) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWAFStatusRuleBlock(val *WAFStatusRuleBlock) *NullableWAFStatusRuleBlock { - return &NullableWAFStatusRuleBlock{value: val, isSet: true} -} - -func (v NullableWAFStatusRuleBlock) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWAFStatusRuleBlock) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_type.go b/services/cdn/v1betaapi/model_waf_type.go deleted file mode 100644 index af786be99..000000000 --- a/services/cdn/v1betaapi/model_waf_type.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// WafType Enable or disable the Premium WAF. Do note that enabling the Premium WAF will cause additional fees. Some features are gated behind the Premium WAF, like additional, **premium-only rules** and the ability to create **custom rules** (not yet implemented) -type WafType string - -// List of WafType -const ( - WAFTYPE_FREE WafType = "FREE" - WAFTYPE_PREMIUM WafType = "PREMIUM" - WAFTYPE_UNKNOWN_DEFAULT_OPEN_API WafType = "unknown_default_open_api" -) - -// All allowed values of WafType enum -var AllowedWafTypeEnumValues = []WafType{ - "FREE", - "PREMIUM", - "unknown_default_open_api", -} - -func (v *WafType) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := WafType(value) - for _, existing := range AllowedWafTypeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = WAFTYPE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewWafTypeFromValue returns a pointer to a valid WafType -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewWafTypeFromValue(v string) (*WafType, error) { - ev := WafType(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for WafType: valid values are %v", v, AllowedWafTypeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v WafType) IsValid() bool { - for _, existing := range AllowedWafTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to WafType value -func (v WafType) Ptr() *WafType { - return &v -} - -type NullableWafType struct { - value *WafType - isSet bool -} - -func (v NullableWafType) Get() *WafType { - return v.value -} - -func (v *NullableWafType) Set(val *WafType) { - v.value = val - v.isSet = true -} - -func (v NullableWafType) IsSet() bool { - return v.isSet -} - -func (v *NullableWafType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWafType(val *WafType) *NullableWafType { - return &NullableWafType{value: val, isSet: true} -} - -func (v NullableWafType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWafType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/model_waf_violation.go b/services/cdn/v1betaapi/model_waf_violation.go deleted file mode 100644 index b9ddaf966..000000000 --- a/services/cdn/v1betaapi/model_waf_violation.go +++ /dev/null @@ -1,315 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "encoding/json" - "fmt" -) - -// checks if the WAFViolation type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WAFViolation{} - -// WAFViolation Information about a violated WAF rule in case the WAF is enabled and a rule was triggered (either in BLOCK or LOG_ONLY mode) -type WAFViolation struct { - Action WAFRuleAction `json:"action"` - // ASN for the request - Asn string `json:"asn"` - // Rule specific message explaining the violation - Message string `json:"message"` - // HTTP Method of the request that triggered the violation - Method string `json:"method"` - RequestHeaders map[string]string `json:"requestHeaders"` - // ID of the WAF rule that was triggered - RuleId string `json:"ruleId"` - AdditionalProperties map[string]interface{} -} - -type _WAFViolation WAFViolation - -// NewWAFViolation instantiates a new WAFViolation 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 NewWAFViolation(action WAFRuleAction, asn string, message string, method string, requestHeaders map[string]string, ruleId string) *WAFViolation { - this := WAFViolation{} - this.Action = action - this.Asn = asn - this.Message = message - this.Method = method - this.RequestHeaders = requestHeaders - this.RuleId = ruleId - return &this -} - -// NewWAFViolationWithDefaults instantiates a new WAFViolation 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 NewWAFViolationWithDefaults() *WAFViolation { - this := WAFViolation{} - return &this -} - -// GetAction returns the Action field value -func (o *WAFViolation) GetAction() WAFRuleAction { - if o == nil { - var ret WAFRuleAction - return ret - } - - return o.Action -} - -// GetActionOk returns a tuple with the Action field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetActionOk() (*WAFRuleAction, bool) { - if o == nil { - return nil, false - } - return &o.Action, true -} - -// SetAction sets field value -func (o *WAFViolation) SetAction(v WAFRuleAction) { - o.Action = v -} - -// GetAsn returns the Asn field value -func (o *WAFViolation) GetAsn() string { - if o == nil { - var ret string - return ret - } - - return o.Asn -} - -// GetAsnOk returns a tuple with the Asn field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetAsnOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Asn, true -} - -// SetAsn sets field value -func (o *WAFViolation) SetAsn(v string) { - o.Asn = v -} - -// GetMessage returns the Message field value -func (o *WAFViolation) GetMessage() string { - if o == nil { - var ret string - return ret - } - - return o.Message -} - -// GetMessageOk returns a tuple with the Message field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Message, true -} - -// SetMessage sets field value -func (o *WAFViolation) SetMessage(v string) { - o.Message = v -} - -// GetMethod returns the Method field value -func (o *WAFViolation) GetMethod() string { - if o == nil { - var ret string - return ret - } - - return o.Method -} - -// GetMethodOk returns a tuple with the Method field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetMethodOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Method, true -} - -// SetMethod sets field value -func (o *WAFViolation) SetMethod(v string) { - o.Method = v -} - -// GetRequestHeaders returns the RequestHeaders field value -func (o *WAFViolation) GetRequestHeaders() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.RequestHeaders -} - -// GetRequestHeadersOk returns a tuple with the RequestHeaders field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetRequestHeadersOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.RequestHeaders, true -} - -// SetRequestHeaders sets field value -func (o *WAFViolation) SetRequestHeaders(v map[string]string) { - o.RequestHeaders = v -} - -// GetRuleId returns the RuleId field value -func (o *WAFViolation) GetRuleId() string { - if o == nil { - var ret string - return ret - } - - return o.RuleId -} - -// GetRuleIdOk returns a tuple with the RuleId field value -// and a boolean to check if the value has been set. -func (o *WAFViolation) GetRuleIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.RuleId, true -} - -// SetRuleId sets field value -func (o *WAFViolation) SetRuleId(v string) { - o.RuleId = v -} - -func (o WAFViolation) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WAFViolation) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["action"] = o.Action - toSerialize["asn"] = o.Asn - toSerialize["message"] = o.Message - toSerialize["method"] = o.Method - toSerialize["requestHeaders"] = o.RequestHeaders - toSerialize["ruleId"] = o.RuleId - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *WAFViolation) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "action", - "asn", - "message", - "method", - "requestHeaders", - "ruleId", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varWAFViolation := _WAFViolation{} - - err = json.Unmarshal(data, &varWAFViolation) - - if err != nil { - return err - } - - *o = WAFViolation(varWAFViolation) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "action") - delete(additionalProperties, "asn") - delete(additionalProperties, "message") - delete(additionalProperties, "method") - delete(additionalProperties, "requestHeaders") - delete(additionalProperties, "ruleId") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableWAFViolation struct { - value *WAFViolation - isSet bool -} - -func (v NullableWAFViolation) Get() *WAFViolation { - return v.value -} - -func (v *NullableWAFViolation) Set(val *WAFViolation) { - v.value = val - v.isSet = true -} - -func (v NullableWAFViolation) IsSet() bool { - return v.isSet -} - -func (v *NullableWAFViolation) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWAFViolation(val *WAFViolation) *NullableWAFViolation { - return &NullableWAFViolation{value: val, isSet: true} -} - -func (v NullableWAFViolation) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWAFViolation) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/cdn/v1betaapi/response.go b/services/cdn/v1betaapi/response.go deleted file mode 100644 index 231a0c587..000000000 --- a/services/cdn/v1betaapi/response.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResponse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/services/cdn/v1betaapi/utils.go b/services/cdn/v1betaapi/utils.go deleted file mode 100644 index 2bb1bbbd5..000000000 --- a/services/cdn/v1betaapi/utils.go +++ /dev/null @@ -1,361 +0,0 @@ -/* -STACKIT CDN API (DEPRECATED) - -**DEPRECATED:** This API version (1beta.0.0) is deprecated. Please migrate to the version (v1). API used to create and manage your CDN distributions. - -API version: 1beta.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1betaapi - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "time" -) - -// PtrBool is a helper routine that returns a pointer to given boolean value. -func PtrBool(v bool) *bool { return &v } - -// PtrInt is a helper routine that returns a pointer to given integer value. -func PtrInt(v int) *int { return &v } - -// PtrInt32 is a helper routine that returns a pointer to given integer value. -func PtrInt32(v int32) *int32 { return &v } - -// PtrInt64 is a helper routine that returns a pointer to given integer value. -func PtrInt64(v int64) *int64 { return &v } - -// PtrFloat32 is a helper routine that returns a pointer to given float value. -func PtrFloat32(v float32) *float32 { return &v } - -// PtrFloat64 is a helper routine that returns a pointer to given float value. -func PtrFloat64(v float64) *float64 { return &v } - -// PtrString is a helper routine that returns a pointer to given string value. -func PtrString(v string) *string { return &v } - -// PtrTime is helper routine that returns a pointer to given Time value. -func PtrTime(v time.Time) *time.Time { return &v } - -type NullableBool struct { - value *bool - isSet bool -} - -func (v NullableBool) Get() *bool { - return v.value -} - -func (v *NullableBool) Set(val *bool) { - v.value = val - v.isSet = true -} - -func (v NullableBool) IsSet() bool { - return v.isSet -} - -func (v *NullableBool) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBool(val *bool) *NullableBool { - return &NullableBool{value: val, isSet: true} -} - -func (v NullableBool) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBool) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt struct { - value *int - isSet bool -} - -func (v NullableInt) Get() *int { - return v.value -} - -func (v *NullableInt) Set(val *int) { - v.value = val - v.isSet = true -} - -func (v NullableInt) IsSet() bool { - return v.isSet -} - -func (v *NullableInt) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt(val *int) *NullableInt { - return &NullableInt{value: val, isSet: true} -} - -func (v NullableInt) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt32 struct { - value *int32 - isSet bool -} - -func (v NullableInt32) Get() *int32 { - return v.value -} - -func (v *NullableInt32) Set(val *int32) { - v.value = val - v.isSet = true -} - -func (v NullableInt32) IsSet() bool { - return v.isSet -} - -func (v *NullableInt32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt32(val *int32) *NullableInt32 { - return &NullableInt32{value: val, isSet: true} -} - -func (v NullableInt32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt64 struct { - value *int64 - isSet bool -} - -func (v NullableInt64) Get() *int64 { - return v.value -} - -func (v *NullableInt64) Set(val *int64) { - v.value = val - v.isSet = true -} - -func (v NullableInt64) IsSet() bool { - return v.isSet -} - -func (v *NullableInt64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt64(val *int64) *NullableInt64 { - return &NullableInt64{value: val, isSet: true} -} - -func (v NullableInt64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat32 struct { - value *float32 - isSet bool -} - -func (v NullableFloat32) Get() *float32 { - return v.value -} - -func (v *NullableFloat32) Set(val *float32) { - v.value = val - v.isSet = true -} - -func (v NullableFloat32) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat32(val *float32) *NullableFloat32 { - return &NullableFloat32{value: val, isSet: true} -} - -func (v NullableFloat32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat64 struct { - value *float64 - isSet bool -} - -func (v NullableFloat64) Get() *float64 { - return v.value -} - -func (v *NullableFloat64) Set(val *float64) { - v.value = val - v.isSet = true -} - -func (v NullableFloat64) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat64(val *float64) *NullableFloat64 { - return &NullableFloat64{value: val, isSet: true} -} - -func (v NullableFloat64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableString struct { - value *string - isSet bool -} - -func (v NullableString) Get() *string { - return v.value -} - -func (v *NullableString) Set(val *string) { - v.value = val - v.isSet = true -} - -func (v NullableString) IsSet() bool { - return v.isSet -} - -func (v *NullableString) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableString(val *string) *NullableString { - return &NullableString{value: val, isSet: true} -} - -func (v NullableString) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableString) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableTime struct { - value *time.Time - isSet bool -} - -func (v NullableTime) Get() *time.Time { - return v.value -} - -func (v *NullableTime) Set(val *time.Time) { - v.value = val - v.isSet = true -} - -func (v NullableTime) IsSet() bool { - return v.isSet -} - -func (v *NullableTime) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTime(val *time.Time) *NullableTime { - return &NullableTime{value: val, isSet: true} -} - -func (v NullableTime) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTime) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// IsNil checks if an input is nil -func IsNil(i interface{}) bool { - if i == nil { - return true - } - switch reflect.TypeOf(i).Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: - return reflect.ValueOf(i).IsNil() - case reflect.Array: - return reflect.ValueOf(i).IsZero() - } - return false -} - -type MappedNullable interface { - ToMap() (map[string]interface{}, error) -} - -// A wrapper for strict JSON decoding -func newStrictDecoder(data []byte) *json.Decoder { - dec := json.NewDecoder(bytes.NewBuffer(data)) - dec.DisallowUnknownFields() - return dec -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -}