diff --git a/services/cdn/api_default.go b/services/cdn/api_default.go index 8c306397..b0f0d6e4 100644 --- a/services/cdn/api_default.go +++ b/services/cdn/api_default.go @@ -390,7 +390,7 @@ type ApiListDistributionsRequest interface { PageSize(pageSize int32) ApiListDistributionsRequest // 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. PageIdentifier(pageIdentifier string) ApiListDistributionsRequest - // 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 + // 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. SortBy(sortBy string) ApiListDistributionsRequest SortOrder(sortOrder string) ApiListDistributionsRequest Execute() (*ListDistributionsResponse, error) @@ -2159,7 +2159,7 @@ func (r ListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiListD 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 +// 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 ListDistributionsRequest) SortBy(sortBy string) ApiListDistributionsRequest { r.sortBy = &sortBy diff --git a/services/cdn/model_config.go b/services/cdn/model_config.go index 59efb6eb..009dd8fc 100644 --- a/services/cdn/model_config.go +++ b/services/cdn/model_config.go @@ -77,6 +77,31 @@ func setConfigGetBlockedIPsAttributeType(arg *ConfigGetBlockedIPsAttributeType, *arg = &val } +/* + types and functions for defaultCacheDuration +*/ + +// isNullableString +type ConfigGetDefaultCacheDurationAttributeType = *NullableString + +func getConfigGetDefaultCacheDurationAttributeTypeOk(arg ConfigGetDefaultCacheDurationAttributeType) (ret ConfigGetDefaultCacheDurationRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setConfigGetDefaultCacheDurationAttributeType(arg *ConfigGetDefaultCacheDurationAttributeType, val ConfigGetDefaultCacheDurationRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ConfigGetDefaultCacheDurationArgType = *string +type ConfigGetDefaultCacheDurationRetType = *string + /* types and functions for monthlyLimitBytes */ @@ -147,6 +172,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"` + // 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"` // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. MonthlyLimitBytes ConfigGetMonthlyLimitBytesAttributeType `json:"monthlyLimitBytes,omitempty"` Optimizer ConfigGetOptimizerAttributeType `json:"optimizer,omitempty"` @@ -228,6 +255,40 @@ func (o *Config) SetBlockedIPs(v ConfigGetBlockedIPsRetType) { setConfigGetBlockedIPsAttributeType(&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() (res ConfigGetDefaultCacheDurationRetType) { + res, _ = o.GetDefaultCacheDurationOk() + return +} + +// 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() (ret ConfigGetDefaultCacheDurationRetType, ok bool) { + return getConfigGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration) +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *Config) HasDefaultCacheDuration() bool { + _, ok := o.GetDefaultCacheDurationOk() + return ok +} + +// SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. +func (o *Config) SetDefaultCacheDuration(v ConfigGetDefaultCacheDurationRetType) { + setConfigGetDefaultCacheDurationAttributeType(&o.DefaultCacheDuration, v) +} + +// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil +func (o *Config) SetDefaultCacheDurationNil() { + o.DefaultCacheDuration = nil +} + +// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil +func (o *Config) UnsetDefaultCacheDuration() { + o.DefaultCacheDuration = nil +} + // GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Config) GetMonthlyLimitBytes() (res ConfigGetMonthlyLimitBytesRetType) { res, _ = o.GetMonthlyLimitBytesOk() @@ -313,6 +374,9 @@ func (o Config) ToMap() (map[string]interface{}, error) { if val, ok := getConfigGetBlockedIPsAttributeTypeOk(o.BlockedIPs); ok { toSerialize["BlockedIPs"] = val } + if val, ok := getConfigGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration); ok { + toSerialize["DefaultCacheDuration"] = val + } if val, ok := getConfigGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes); ok { toSerialize["MonthlyLimitBytes"] = val } diff --git a/services/cdn/model_config_patch.go b/services/cdn/model_config_patch.go index 4285ac6d..4ded2f96 100644 --- a/services/cdn/model_config_patch.go +++ b/services/cdn/model_config_patch.go @@ -77,6 +77,31 @@ func setConfigPatchGetBlockedIPsAttributeType(arg *ConfigPatchGetBlockedIPsAttri *arg = &val } +/* + types and functions for defaultCacheDuration +*/ + +// isNullableString +type ConfigPatchGetDefaultCacheDurationAttributeType = *NullableString + +func getConfigPatchGetDefaultCacheDurationAttributeTypeOk(arg ConfigPatchGetDefaultCacheDurationAttributeType) (ret ConfigPatchGetDefaultCacheDurationRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setConfigPatchGetDefaultCacheDurationAttributeType(arg *ConfigPatchGetDefaultCacheDurationAttributeType, val ConfigPatchGetDefaultCacheDurationRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ConfigPatchGetDefaultCacheDurationArgType = *string +type ConfigPatchGetDefaultCacheDurationRetType = *string + /* types and functions for monthlyLimitBytes */ @@ -144,6 +169,8 @@ type ConfigPatch struct { 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"` + // 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"` // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. MonthlyLimitBytes ConfigPatchGetMonthlyLimitBytesAttributeType `json:"monthlyLimitBytes,omitempty"` Optimizer ConfigPatchGetOptimizerAttributeType `json:"optimizer,omitempty"` @@ -236,6 +263,40 @@ func (o *ConfigPatch) SetBlockedIPs(v ConfigPatchGetBlockedIPsRetType) { setConfigPatchGetBlockedIPsAttributeType(&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() (res ConfigPatchGetDefaultCacheDurationRetType) { + res, _ = o.GetDefaultCacheDurationOk() + return +} + +// 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() (ret ConfigPatchGetDefaultCacheDurationRetType, ok bool) { + return getConfigPatchGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration) +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *ConfigPatch) HasDefaultCacheDuration() bool { + _, ok := o.GetDefaultCacheDurationOk() + return ok +} + +// SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. +func (o *ConfigPatch) SetDefaultCacheDuration(v ConfigPatchGetDefaultCacheDurationRetType) { + setConfigPatchGetDefaultCacheDurationAttributeType(&o.DefaultCacheDuration, v) +} + +// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil +func (o *ConfigPatch) SetDefaultCacheDurationNil() { + o.DefaultCacheDuration = nil +} + +// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil +func (o *ConfigPatch) UnsetDefaultCacheDuration() { + o.DefaultCacheDuration = nil +} + // GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConfigPatch) GetMonthlyLimitBytes() (res ConfigPatchGetMonthlyLimitBytesRetType) { res, _ = o.GetMonthlyLimitBytesOk() @@ -327,6 +388,9 @@ func (o ConfigPatch) ToMap() (map[string]interface{}, error) { if val, ok := getConfigPatchGetBlockedIPsAttributeTypeOk(o.BlockedIPs); ok { toSerialize["BlockedIPs"] = val } + if val, ok := getConfigPatchGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration); ok { + toSerialize["DefaultCacheDuration"] = val + } if val, ok := getConfigPatchGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes); ok { toSerialize["MonthlyLimitBytes"] = val } diff --git a/services/cdn/model_create_distribution_payload.go b/services/cdn/model_create_distribution_payload.go index 29bd6a22..c9f2e229 100644 --- a/services/cdn/model_create_distribution_payload.go +++ b/services/cdn/model_create_distribution_payload.go @@ -57,6 +57,27 @@ func setCreateDistributionPayloadGetBlockedIPsAttributeType(arg *CreateDistribut *arg = &val } +/* + types and functions for defaultCacheDuration +*/ + +// isNotNullableString +type CreateDistributionPayloadGetDefaultCacheDurationAttributeType = *string + +func getCreateDistributionPayloadGetDefaultCacheDurationAttributeTypeOk(arg CreateDistributionPayloadGetDefaultCacheDurationAttributeType) (ret CreateDistributionPayloadGetDefaultCacheDurationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateDistributionPayloadGetDefaultCacheDurationAttributeType(arg *CreateDistributionPayloadGetDefaultCacheDurationAttributeType, val CreateDistributionPayloadGetDefaultCacheDurationRetType) { + *arg = &val +} + +type CreateDistributionPayloadGetDefaultCacheDurationArgType = string +type CreateDistributionPayloadGetDefaultCacheDurationRetType = string + /* types and functions for intentId */ @@ -185,6 +206,8 @@ type CreateDistributionPayload struct { 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"` + // 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"` // 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 CreateDistributionPayloadGetIntentIdAttributeType `json:"intentId,omitempty"` // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. @@ -267,6 +290,29 @@ func (o *CreateDistributionPayload) SetBlockedIPs(v CreateDistributionPayloadGet setCreateDistributionPayloadGetBlockedIPsAttributeType(&o.BlockedIPs, v) } +// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetDefaultCacheDuration() (res CreateDistributionPayloadGetDefaultCacheDurationRetType) { + res, _ = o.GetDefaultCacheDurationOk() + return +} + +// 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() (ret CreateDistributionPayloadGetDefaultCacheDurationRetType, ok bool) { + return getCreateDistributionPayloadGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration) +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasDefaultCacheDuration() bool { + _, ok := o.GetDefaultCacheDurationOk() + return ok +} + +// SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. +func (o *CreateDistributionPayload) SetDefaultCacheDuration(v CreateDistributionPayloadGetDefaultCacheDurationRetType) { + setCreateDistributionPayloadGetDefaultCacheDurationAttributeType(&o.DefaultCacheDuration, v) +} + // GetIntentId returns the IntentId field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetIntentId() (res CreateDistributionPayloadGetIntentIdRetType) { res, _ = o.GetIntentIdOk() @@ -401,6 +447,9 @@ func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { if val, ok := getCreateDistributionPayloadGetBlockedIPsAttributeTypeOk(o.BlockedIPs); ok { toSerialize["BlockedIPs"] = val } + if val, ok := getCreateDistributionPayloadGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration); ok { + toSerialize["DefaultCacheDuration"] = val + } if val, ok := getCreateDistributionPayloadGetIntentIdAttributeTypeOk(o.IntentId); ok { toSerialize["IntentId"] = val }