/* CDN API 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 cdnbeta import ( "encoding/json" ) // checks if the CreateDistributionPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateDistributionPayload{} /* types and functions for backend */ // isModel type CreateDistributionPayloadGetBackendAttributeType = *CreateDistributionPayloadBackend type CreateDistributionPayloadGetBackendArgType = CreateDistributionPayloadBackend type CreateDistributionPayloadGetBackendRetType = CreateDistributionPayloadBackend func getCreateDistributionPayloadGetBackendAttributeTypeOk(arg CreateDistributionPayloadGetBackendAttributeType) (ret CreateDistributionPayloadGetBackendRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateDistributionPayloadGetBackendAttributeType(arg *CreateDistributionPayloadGetBackendAttributeType, val CreateDistributionPayloadGetBackendRetType) { *arg = &val } /* types and functions for blockedCountries */ // isArray type CreateDistributionPayloadGetBlockedCountriesAttributeType = *[]string type CreateDistributionPayloadGetBlockedCountriesArgType = []string type CreateDistributionPayloadGetBlockedCountriesRetType = []string func getCreateDistributionPayloadGetBlockedCountriesAttributeTypeOk(arg CreateDistributionPayloadGetBlockedCountriesAttributeType) (ret CreateDistributionPayloadGetBlockedCountriesRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateDistributionPayloadGetBlockedCountriesAttributeType(arg *CreateDistributionPayloadGetBlockedCountriesAttributeType, val CreateDistributionPayloadGetBlockedCountriesRetType) { *arg = &val } /* types and functions for blockedIps */ // isArray type CreateDistributionPayloadGetBlockedIpsAttributeType = *[]string type CreateDistributionPayloadGetBlockedIpsArgType = []string type CreateDistributionPayloadGetBlockedIpsRetType = []string func getCreateDistributionPayloadGetBlockedIpsAttributeTypeOk(arg CreateDistributionPayloadGetBlockedIpsAttributeType) (ret CreateDistributionPayloadGetBlockedIpsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateDistributionPayloadGetBlockedIpsAttributeType(arg *CreateDistributionPayloadGetBlockedIpsAttributeType, val CreateDistributionPayloadGetBlockedIpsRetType) { *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 */ // isNotNullableString type CreateDistributionPayloadGetIntentIdAttributeType = *string func getCreateDistributionPayloadGetIntentIdAttributeTypeOk(arg CreateDistributionPayloadGetIntentIdAttributeType) (ret CreateDistributionPayloadGetIntentIdRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateDistributionPayloadGetIntentIdAttributeType(arg *CreateDistributionPayloadGetIntentIdAttributeType, val CreateDistributionPayloadGetIntentIdRetType) { *arg = &val } type CreateDistributionPayloadGetIntentIdArgType = string type CreateDistributionPayloadGetIntentIdRetType = string /* types and functions for logSink */ // isModel type CreateDistributionPayloadGetLogSinkAttributeType = *CreateDistributionPayloadLogSink type CreateDistributionPayloadGetLogSinkArgType = CreateDistributionPayloadLogSink type CreateDistributionPayloadGetLogSinkRetType = CreateDistributionPayloadLogSink func getCreateDistributionPayloadGetLogSinkAttributeTypeOk(arg CreateDistributionPayloadGetLogSinkAttributeType) (ret CreateDistributionPayloadGetLogSinkRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateDistributionPayloadGetLogSinkAttributeType(arg *CreateDistributionPayloadGetLogSinkAttributeType, val CreateDistributionPayloadGetLogSinkRetType) { *arg = &val } /* types and functions for monthlyLimitBytes */ // isLong type CreateDistributionPayloadGetMonthlyLimitBytesAttributeType = *int64 type CreateDistributionPayloadGetMonthlyLimitBytesArgType = int64 type CreateDistributionPayloadGetMonthlyLimitBytesRetType = int64 func getCreateDistributionPayloadGetMonthlyLimitBytesAttributeTypeOk(arg CreateDistributionPayloadGetMonthlyLimitBytesAttributeType) (ret CreateDistributionPayloadGetMonthlyLimitBytesRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateDistributionPayloadGetMonthlyLimitBytesAttributeType(arg *CreateDistributionPayloadGetMonthlyLimitBytesAttributeType, val CreateDistributionPayloadGetMonthlyLimitBytesRetType) { *arg = &val } /* types and functions for optimizer */ // isModel type CreateDistributionPayloadGetOptimizerAttributeType = *Optimizer type CreateDistributionPayloadGetOptimizerArgType = Optimizer type CreateDistributionPayloadGetOptimizerRetType = Optimizer func getCreateDistributionPayloadGetOptimizerAttributeTypeOk(arg CreateDistributionPayloadGetOptimizerAttributeType) (ret CreateDistributionPayloadGetOptimizerRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateDistributionPayloadGetOptimizerAttributeType(arg *CreateDistributionPayloadGetOptimizerAttributeType, val CreateDistributionPayloadGetOptimizerRetType) { *arg = &val } /* types and functions for regions */ // isArray type CreateDistributionPayloadGetRegionsAttributeType = *[]Region type CreateDistributionPayloadGetRegionsArgType = []Region type CreateDistributionPayloadGetRegionsRetType = []Region func getCreateDistributionPayloadGetRegionsAttributeTypeOk(arg CreateDistributionPayloadGetRegionsAttributeType) (ret CreateDistributionPayloadGetRegionsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateDistributionPayloadGetRegionsAttributeType(arg *CreateDistributionPayloadGetRegionsAttributeType, val CreateDistributionPayloadGetRegionsRetType) { *arg = &val } /* types and functions for waf */ // isModel type CreateDistributionPayloadGetWafAttributeType = *WafConfig type CreateDistributionPayloadGetWafArgType = WafConfig type CreateDistributionPayloadGetWafRetType = WafConfig func getCreateDistributionPayloadGetWafAttributeTypeOk(arg CreateDistributionPayloadGetWafAttributeType) (ret CreateDistributionPayloadGetWafRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setCreateDistributionPayloadGetWafAttributeType(arg *CreateDistributionPayloadGetWafAttributeType, val CreateDistributionPayloadGetWafRetType) { *arg = &val } // CreateDistributionPayload struct for CreateDistributionPayload type CreateDistributionPayload struct { // REQUIRED Backend CreateDistributionPayloadGetBackendAttributeType `json:"backend" required:"true"` // 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"` // 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"` LogSink CreateDistributionPayloadGetLogSinkAttributeType `json:"logSink,omitempty"` // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. MonthlyLimitBytes CreateDistributionPayloadGetMonthlyLimitBytesAttributeType `json:"monthlyLimitBytes,omitempty"` Optimizer CreateDistributionPayloadGetOptimizerAttributeType `json:"optimizer,omitempty"` // Define in which regions you would like your content to be cached. // REQUIRED Regions CreateDistributionPayloadGetRegionsAttributeType `json:"regions" required:"true"` Waf CreateDistributionPayloadGetWafAttributeType `json:"waf,omitempty"` } 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 CreateDistributionPayloadGetBackendArgType, regions CreateDistributionPayloadGetRegionsArgType) *CreateDistributionPayload { this := CreateDistributionPayload{} setCreateDistributionPayloadGetBackendAttributeType(&this.Backend, backend) setCreateDistributionPayloadGetRegionsAttributeType(&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() (ret CreateDistributionPayloadGetBackendRetType) { ret, _ = o.GetBackendOk() return ret } // GetBackendOk returns a tuple with the Backend field value // and a boolean to check if the value has been set. func (o *CreateDistributionPayload) GetBackendOk() (ret CreateDistributionPayloadGetBackendRetType, ok bool) { return getCreateDistributionPayloadGetBackendAttributeTypeOk(o.Backend) } // SetBackend sets field value func (o *CreateDistributionPayload) SetBackend(v CreateDistributionPayloadGetBackendRetType) { setCreateDistributionPayloadGetBackendAttributeType(&o.Backend, v) } // GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetBlockedCountries() (res CreateDistributionPayloadGetBlockedCountriesRetType) { res, _ = o.GetBlockedCountriesOk() return } // 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() (ret CreateDistributionPayloadGetBlockedCountriesRetType, ok bool) { return getCreateDistributionPayloadGetBlockedCountriesAttributeTypeOk(o.BlockedCountries) } // HasBlockedCountries returns a boolean if a field has been set. func (o *CreateDistributionPayload) HasBlockedCountries() bool { _, ok := o.GetBlockedCountriesOk() return ok } // SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. func (o *CreateDistributionPayload) SetBlockedCountries(v CreateDistributionPayloadGetBlockedCountriesRetType) { setCreateDistributionPayloadGetBlockedCountriesAttributeType(&o.BlockedCountries, v) } // GetBlockedIps returns the BlockedIps field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetBlockedIps() (res CreateDistributionPayloadGetBlockedIpsRetType) { res, _ = o.GetBlockedIpsOk() return } // 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() (ret CreateDistributionPayloadGetBlockedIpsRetType, ok bool) { return getCreateDistributionPayloadGetBlockedIpsAttributeTypeOk(o.BlockedIps) } // HasBlockedIps returns a boolean if a field has been set. func (o *CreateDistributionPayload) HasBlockedIps() bool { _, ok := o.GetBlockedIpsOk() return ok } // SetBlockedIps gets a reference to the given []string and assigns it to the BlockedIps field. func (o *CreateDistributionPayload) SetBlockedIps(v CreateDistributionPayloadGetBlockedIpsRetType) { 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() return } // 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() (ret CreateDistributionPayloadGetIntentIdRetType, ok bool) { return getCreateDistributionPayloadGetIntentIdAttributeTypeOk(o.IntentId) } // HasIntentId returns a boolean if a field has been set. func (o *CreateDistributionPayload) HasIntentId() bool { _, ok := o.GetIntentIdOk() return ok } // SetIntentId gets a reference to the given string and assigns it to the IntentId field. func (o *CreateDistributionPayload) SetIntentId(v CreateDistributionPayloadGetIntentIdRetType) { setCreateDistributionPayloadGetIntentIdAttributeType(&o.IntentId, v) } // GetLogSink returns the LogSink field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetLogSink() (res CreateDistributionPayloadGetLogSinkRetType) { res, _ = o.GetLogSinkOk() return } // 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() (ret CreateDistributionPayloadGetLogSinkRetType, ok bool) { return getCreateDistributionPayloadGetLogSinkAttributeTypeOk(o.LogSink) } // HasLogSink returns a boolean if a field has been set. func (o *CreateDistributionPayload) HasLogSink() bool { _, ok := o.GetLogSinkOk() return ok } // SetLogSink gets a reference to the given CreateDistributionPayloadLogSink and assigns it to the LogSink field. func (o *CreateDistributionPayload) SetLogSink(v CreateDistributionPayloadGetLogSinkRetType) { setCreateDistributionPayloadGetLogSinkAttributeType(&o.LogSink, v) } // GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetMonthlyLimitBytes() (res CreateDistributionPayloadGetMonthlyLimitBytesRetType) { res, _ = o.GetMonthlyLimitBytesOk() return } // 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() (ret CreateDistributionPayloadGetMonthlyLimitBytesRetType, ok bool) { return getCreateDistributionPayloadGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes) } // HasMonthlyLimitBytes returns a boolean if a field has been set. func (o *CreateDistributionPayload) HasMonthlyLimitBytes() bool { _, ok := o.GetMonthlyLimitBytesOk() return ok } // SetMonthlyLimitBytes gets a reference to the given int64 and assigns it to the MonthlyLimitBytes field. func (o *CreateDistributionPayload) SetMonthlyLimitBytes(v CreateDistributionPayloadGetMonthlyLimitBytesRetType) { setCreateDistributionPayloadGetMonthlyLimitBytesAttributeType(&o.MonthlyLimitBytes, v) } // GetOptimizer returns the Optimizer field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetOptimizer() (res CreateDistributionPayloadGetOptimizerRetType) { res, _ = o.GetOptimizerOk() return } // 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() (ret CreateDistributionPayloadGetOptimizerRetType, ok bool) { return getCreateDistributionPayloadGetOptimizerAttributeTypeOk(o.Optimizer) } // HasOptimizer returns a boolean if a field has been set. func (o *CreateDistributionPayload) HasOptimizer() bool { _, ok := o.GetOptimizerOk() return ok } // SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. func (o *CreateDistributionPayload) SetOptimizer(v CreateDistributionPayloadGetOptimizerRetType) { setCreateDistributionPayloadGetOptimizerAttributeType(&o.Optimizer, v) } // GetRegions returns the Regions field value func (o *CreateDistributionPayload) GetRegions() (ret CreateDistributionPayloadGetRegionsRetType) { ret, _ = o.GetRegionsOk() return ret } // GetRegionsOk returns a tuple with the Regions field value // and a boolean to check if the value has been set. func (o *CreateDistributionPayload) GetRegionsOk() (ret CreateDistributionPayloadGetRegionsRetType, ok bool) { return getCreateDistributionPayloadGetRegionsAttributeTypeOk(o.Regions) } // SetRegions sets field value func (o *CreateDistributionPayload) SetRegions(v CreateDistributionPayloadGetRegionsRetType) { setCreateDistributionPayloadGetRegionsAttributeType(&o.Regions, v) } // GetWaf returns the Waf field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetWaf() (res CreateDistributionPayloadGetWafRetType) { res, _ = o.GetWafOk() return } // 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() (ret CreateDistributionPayloadGetWafRetType, ok bool) { return getCreateDistributionPayloadGetWafAttributeTypeOk(o.Waf) } // HasWaf returns a boolean if a field has been set. func (o *CreateDistributionPayload) HasWaf() bool { _, ok := o.GetWafOk() return ok } // SetWaf gets a reference to the given WafConfig and assigns it to the Waf field. func (o *CreateDistributionPayload) SetWaf(v CreateDistributionPayloadGetWafRetType) { setCreateDistributionPayloadGetWafAttributeType(&o.Waf, v) } func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateDistributionPayloadGetBackendAttributeTypeOk(o.Backend); ok { toSerialize["Backend"] = val } if val, ok := getCreateDistributionPayloadGetBlockedCountriesAttributeTypeOk(o.BlockedCountries); ok { toSerialize["BlockedCountries"] = val } 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 } if val, ok := getCreateDistributionPayloadGetLogSinkAttributeTypeOk(o.LogSink); ok { toSerialize["LogSink"] = val } if val, ok := getCreateDistributionPayloadGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes); ok { toSerialize["MonthlyLimitBytes"] = val } if val, ok := getCreateDistributionPayloadGetOptimizerAttributeTypeOk(o.Optimizer); ok { toSerialize["Optimizer"] = val } if val, ok := getCreateDistributionPayloadGetRegionsAttributeTypeOk(o.Regions); ok { toSerialize["Regions"] = val } if val, ok := getCreateDistributionPayloadGetWafAttributeTypeOk(o.Waf); ok { toSerialize["Waf"] = val } return toSerialize, nil } 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) }