diff --git a/services/cdn/oas_commit b/services/cdn/oas_commit index 71a76821d4..49c5b451cd 100644 --- a/services/cdn/oas_commit +++ b/services/cdn/oas_commit @@ -1 +1 @@ -0afa5e4924e6bf230fdade5cb294ecfd97dd63e5 +d3f51a99ec81d4226be8c6d4826ed2547014edb0 diff --git a/services/cdn/v1api/model_config.go b/services/cdn/v1api/model_config.go index c1642f1674..580edb845a 100644 --- a/services/cdn/v1api/model_config.go +++ b/services/cdn/v1api/model_config.go @@ -26,8 +26,12 @@ 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. BlockedIps []string `json:"blockedIps"` CacheConfig CacheConfig `json:"cacheConfig"` + // Configures a custom origin path to serve when the origin returns a 404 Not Found status (e.g. index.html or /404.html). Must not contain a URL scheme. + Custom404ErrorResponse NullableString `json:"custom404ErrorResponse,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"` + // Configures the default root object served when a request targets the root path '/' of the distribution (e.g. index.html or /index.html). Must not contain a URL scheme. + DefaultRootObject NullableString `json:"defaultRootObject,omitempty"` // Enabling this allows the 'Host' header to be passed through to the origin. ForwardHostHeader bool `json:"forwardHostHeader"` // Labels are key-value string pairs that can be attached to a distribution. @@ -169,6 +173,49 @@ func (o *Config) SetCacheConfig(v CacheConfig) { o.CacheConfig = v } +// GetCustom404ErrorResponse returns the Custom404ErrorResponse field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Config) GetCustom404ErrorResponse() string { + if o == nil || IsNil(o.Custom404ErrorResponse.Get()) { + var ret string + return ret + } + return *o.Custom404ErrorResponse.Get() +} + +// GetCustom404ErrorResponseOk returns a tuple with the Custom404ErrorResponse 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) GetCustom404ErrorResponseOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Custom404ErrorResponse.Get(), o.Custom404ErrorResponse.IsSet() +} + +// HasCustom404ErrorResponse returns a boolean if a field has been set. +func (o *Config) HasCustom404ErrorResponse() bool { + if o != nil && o.Custom404ErrorResponse.IsSet() { + return true + } + + return false +} + +// SetCustom404ErrorResponse gets a reference to the given NullableString and assigns it to the Custom404ErrorResponse field. +func (o *Config) SetCustom404ErrorResponse(v string) { + o.Custom404ErrorResponse.Set(&v) +} + +// SetCustom404ErrorResponseNil sets the value for Custom404ErrorResponse to be an explicit nil +func (o *Config) SetCustom404ErrorResponseNil() { + o.Custom404ErrorResponse.Set(nil) +} + +// UnsetCustom404ErrorResponse ensures that no value is present for Custom404ErrorResponse, not even an explicit nil +func (o *Config) UnsetCustom404ErrorResponse() { + o.Custom404ErrorResponse.Unset() +} + // 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()) { @@ -212,6 +259,49 @@ func (o *Config) UnsetDefaultCacheDuration() { o.DefaultCacheDuration.Unset() } +// GetDefaultRootObject returns the DefaultRootObject field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Config) GetDefaultRootObject() string { + if o == nil || IsNil(o.DefaultRootObject.Get()) { + var ret string + return ret + } + return *o.DefaultRootObject.Get() +} + +// GetDefaultRootObjectOk returns a tuple with the DefaultRootObject 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) GetDefaultRootObjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultRootObject.Get(), o.DefaultRootObject.IsSet() +} + +// HasDefaultRootObject returns a boolean if a field has been set. +func (o *Config) HasDefaultRootObject() bool { + if o != nil && o.DefaultRootObject.IsSet() { + return true + } + + return false +} + +// SetDefaultRootObject gets a reference to the given NullableString and assigns it to the DefaultRootObject field. +func (o *Config) SetDefaultRootObject(v string) { + o.DefaultRootObject.Set(&v) +} + +// SetDefaultRootObjectNil sets the value for DefaultRootObject to be an explicit nil +func (o *Config) SetDefaultRootObjectNil() { + o.DefaultRootObject.Set(nil) +} + +// UnsetDefaultRootObject ensures that no value is present for DefaultRootObject, not even an explicit nil +func (o *Config) UnsetDefaultRootObject() { + o.DefaultRootObject.Unset() +} + // GetForwardHostHeader returns the ForwardHostHeader field value func (o *Config) GetForwardHostHeader() bool { if o == nil { @@ -517,9 +607,15 @@ func (o Config) ToMap() (map[string]interface{}, error) { toSerialize["blockedCountries"] = o.BlockedCountries toSerialize["blockedIps"] = o.BlockedIps toSerialize["cacheConfig"] = o.CacheConfig + if o.Custom404ErrorResponse.IsSet() { + toSerialize["custom404ErrorResponse"] = o.Custom404ErrorResponse.Get() + } if o.DefaultCacheDuration.IsSet() { toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() } + if o.DefaultRootObject.IsSet() { + toSerialize["defaultRootObject"] = o.DefaultRootObject.Get() + } toSerialize["forwardHostHeader"] = o.ForwardHostHeader if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels @@ -595,7 +691,9 @@ func (o *Config) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "blockedCountries") delete(additionalProperties, "blockedIps") delete(additionalProperties, "cacheConfig") + delete(additionalProperties, "custom404ErrorResponse") delete(additionalProperties, "defaultCacheDuration") + delete(additionalProperties, "defaultRootObject") delete(additionalProperties, "forwardHostHeader") delete(additionalProperties, "labels") delete(additionalProperties, "logSink") diff --git a/services/cdn/v1api/model_config_patch.go b/services/cdn/v1api/model_config_patch.go index 5c3b784813..ef578b8ca5 100644 --- a/services/cdn/v1api/model_config_patch.go +++ b/services/cdn/v1api/model_config_patch.go @@ -25,8 +25,12 @@ type ConfigPatch 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. BlockedIps []string `json:"blockedIps,omitempty"` CacheConfig *CacheConfigPatch `json:"cacheConfig,omitempty"` + // Configures a custom origin path to serve when the origin returns a 404 Not Found status (e.g. index.html or /404.html). Must not contain a URL scheme. Setting to null removes the custom 404 error response. + Custom404ErrorResponse NullableString `json:"custom404ErrorResponse,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"` + // Configures the default root object served when a request targets the root path '/' of the distribution (e.g. index.html or /index.html). Must not contain a URL scheme. Setting to null removes the default root object. + DefaultRootObject NullableString `json:"defaultRootObject,omitempty"` // Enabling this allows the 'Host' header to be passed through to the origin. ForwardHostHeader *bool `json:"forwardHostHeader,omitempty"` // Labels are key-value string pairs that can be attached to a distribution. JSON Merge Patch is supported, meaning setting a key to null will remove it. @@ -191,6 +195,49 @@ func (o *ConfigPatch) SetCacheConfig(v CacheConfigPatch) { o.CacheConfig = &v } +// GetCustom404ErrorResponse returns the Custom404ErrorResponse field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetCustom404ErrorResponse() string { + if o == nil || IsNil(o.Custom404ErrorResponse.Get()) { + var ret string + return ret + } + return *o.Custom404ErrorResponse.Get() +} + +// GetCustom404ErrorResponseOk returns a tuple with the Custom404ErrorResponse 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) GetCustom404ErrorResponseOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Custom404ErrorResponse.Get(), o.Custom404ErrorResponse.IsSet() +} + +// HasCustom404ErrorResponse returns a boolean if a field has been set. +func (o *ConfigPatch) HasCustom404ErrorResponse() bool { + if o != nil && o.Custom404ErrorResponse.IsSet() { + return true + } + + return false +} + +// SetCustom404ErrorResponse gets a reference to the given NullableString and assigns it to the Custom404ErrorResponse field. +func (o *ConfigPatch) SetCustom404ErrorResponse(v string) { + o.Custom404ErrorResponse.Set(&v) +} + +// SetCustom404ErrorResponseNil sets the value for Custom404ErrorResponse to be an explicit nil +func (o *ConfigPatch) SetCustom404ErrorResponseNil() { + o.Custom404ErrorResponse.Set(nil) +} + +// UnsetCustom404ErrorResponse ensures that no value is present for Custom404ErrorResponse, not even an explicit nil +func (o *ConfigPatch) UnsetCustom404ErrorResponse() { + o.Custom404ErrorResponse.Unset() +} + // 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()) { @@ -234,6 +281,49 @@ func (o *ConfigPatch) UnsetDefaultCacheDuration() { o.DefaultCacheDuration.Unset() } +// GetDefaultRootObject returns the DefaultRootObject field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetDefaultRootObject() string { + if o == nil || IsNil(o.DefaultRootObject.Get()) { + var ret string + return ret + } + return *o.DefaultRootObject.Get() +} + +// GetDefaultRootObjectOk returns a tuple with the DefaultRootObject 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) GetDefaultRootObjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultRootObject.Get(), o.DefaultRootObject.IsSet() +} + +// HasDefaultRootObject returns a boolean if a field has been set. +func (o *ConfigPatch) HasDefaultRootObject() bool { + if o != nil && o.DefaultRootObject.IsSet() { + return true + } + + return false +} + +// SetDefaultRootObject gets a reference to the given NullableString and assigns it to the DefaultRootObject field. +func (o *ConfigPatch) SetDefaultRootObject(v string) { + o.DefaultRootObject.Set(&v) +} + +// SetDefaultRootObjectNil sets the value for DefaultRootObject to be an explicit nil +func (o *ConfigPatch) SetDefaultRootObjectNil() { + o.DefaultRootObject.Set(nil) +} + +// UnsetDefaultRootObject ensures that no value is present for DefaultRootObject, not even an explicit nil +func (o *ConfigPatch) UnsetDefaultRootObject() { + o.DefaultRootObject.Unset() +} + // GetForwardHostHeader returns the ForwardHostHeader field value if set, zero value otherwise. func (o *ConfigPatch) GetForwardHostHeader() bool { if o == nil || IsNil(o.ForwardHostHeader) { @@ -598,9 +688,15 @@ func (o ConfigPatch) ToMap() (map[string]interface{}, error) { if !IsNil(o.CacheConfig) { toSerialize["cacheConfig"] = o.CacheConfig } + if o.Custom404ErrorResponse.IsSet() { + toSerialize["custom404ErrorResponse"] = o.Custom404ErrorResponse.Get() + } if o.DefaultCacheDuration.IsSet() { toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() } + if o.DefaultRootObject.IsSet() { + toSerialize["defaultRootObject"] = o.DefaultRootObject.Get() + } if !IsNil(o.ForwardHostHeader) { toSerialize["forwardHostHeader"] = o.ForwardHostHeader } @@ -657,7 +753,9 @@ func (o *ConfigPatch) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "blockedCountries") delete(additionalProperties, "blockedIps") delete(additionalProperties, "cacheConfig") + delete(additionalProperties, "custom404ErrorResponse") delete(additionalProperties, "defaultCacheDuration") + delete(additionalProperties, "defaultRootObject") delete(additionalProperties, "forwardHostHeader") delete(additionalProperties, "labels") delete(additionalProperties, "logSink") diff --git a/services/cdn/v1api/model_create_distribution_payload.go b/services/cdn/v1api/model_create_distribution_payload.go index f2734a4d7a..29ac3953a7 100644 --- a/services/cdn/v1api/model_create_distribution_payload.go +++ b/services/cdn/v1api/model_create_distribution_payload.go @@ -26,8 +26,12 @@ type CreateDistributionPayload 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. BlockedIps []string `json:"blockedIps,omitempty"` CacheConfig *CacheConfigCreate `json:"cacheConfig,omitempty"` + // Configures a custom origin path to serve when the origin returns a 404 Not Found status (e.g. index.html or /404.html). Must not contain a URL scheme. + Custom404ErrorResponse *string `json:"custom404ErrorResponse,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"` + // Configures the default root object served when a request targets the root path '/' of the distribution (e.g. index.html or /index.html). Must not contain a URL scheme. + DefaultRootObject *string `json:"defaultRootObject,omitempty"` // Enabling this allows the 'Host' header to be passed through to the origin. ForwardHostHeader *bool `json:"forwardHostHeader,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. @@ -189,6 +193,38 @@ func (o *CreateDistributionPayload) SetCacheConfig(v CacheConfigCreate) { o.CacheConfig = &v } +// GetCustom404ErrorResponse returns the Custom404ErrorResponse field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetCustom404ErrorResponse() string { + if o == nil || IsNil(o.Custom404ErrorResponse) { + var ret string + return ret + } + return *o.Custom404ErrorResponse +} + +// GetCustom404ErrorResponseOk returns a tuple with the Custom404ErrorResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetCustom404ErrorResponseOk() (*string, bool) { + if o == nil || IsNil(o.Custom404ErrorResponse) { + return nil, false + } + return o.Custom404ErrorResponse, true +} + +// HasCustom404ErrorResponse returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasCustom404ErrorResponse() bool { + if o != nil && !IsNil(o.Custom404ErrorResponse) { + return true + } + + return false +} + +// SetCustom404ErrorResponse gets a reference to the given string and assigns it to the Custom404ErrorResponse field. +func (o *CreateDistributionPayload) SetCustom404ErrorResponse(v string) { + o.Custom404ErrorResponse = &v +} + // GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetDefaultCacheDuration() string { if o == nil || IsNil(o.DefaultCacheDuration) { @@ -221,6 +257,38 @@ func (o *CreateDistributionPayload) SetDefaultCacheDuration(v string) { o.DefaultCacheDuration = &v } +// GetDefaultRootObject returns the DefaultRootObject field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetDefaultRootObject() string { + if o == nil || IsNil(o.DefaultRootObject) { + var ret string + return ret + } + return *o.DefaultRootObject +} + +// GetDefaultRootObjectOk returns a tuple with the DefaultRootObject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetDefaultRootObjectOk() (*string, bool) { + if o == nil || IsNil(o.DefaultRootObject) { + return nil, false + } + return o.DefaultRootObject, true +} + +// HasDefaultRootObject returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasDefaultRootObject() bool { + if o != nil && !IsNil(o.DefaultRootObject) { + return true + } + + return false +} + +// SetDefaultRootObject gets a reference to the given string and assigns it to the DefaultRootObject field. +func (o *CreateDistributionPayload) SetDefaultRootObject(v string) { + o.DefaultRootObject = &v +} + // GetForwardHostHeader returns the ForwardHostHeader field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetForwardHostHeader() bool { if o == nil || IsNil(o.ForwardHostHeader) { @@ -585,9 +653,15 @@ func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.CacheConfig) { toSerialize["cacheConfig"] = o.CacheConfig } + if !IsNil(o.Custom404ErrorResponse) { + toSerialize["custom404ErrorResponse"] = o.Custom404ErrorResponse + } if !IsNil(o.DefaultCacheDuration) { toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration } + if !IsNil(o.DefaultRootObject) { + toSerialize["defaultRootObject"] = o.DefaultRootObject + } if !IsNil(o.ForwardHostHeader) { toSerialize["forwardHostHeader"] = o.ForwardHostHeader } @@ -667,7 +741,9 @@ func (o *CreateDistributionPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "blockedCountries") delete(additionalProperties, "blockedIps") delete(additionalProperties, "cacheConfig") + delete(additionalProperties, "custom404ErrorResponse") delete(additionalProperties, "defaultCacheDuration") + delete(additionalProperties, "defaultRootObject") delete(additionalProperties, "forwardHostHeader") delete(additionalProperties, "intentId") delete(additionalProperties, "labels")