/*
Edge Application API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 2.0.0
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package edgeapplications

import (
	"encoding/json"
	"bytes"
	"fmt"
)

// checks if the ApplicationCacheResponseDetails type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ApplicationCacheResponseDetails{}

// ApplicationCacheResponseDetails struct for ApplicationCacheResponseDetails
type ApplicationCacheResponseDetails struct {
	Id int64 `json:"id"`
	Name string `json:"name"`
	BrowserCacheSettings string `json:"browser_cache_settings"`
	BrowserCacheSettingsMaximumTtl int64 `json:"browser_cache_settings_maximum_ttl"`
	CdnCacheSettings string `json:"cdn_cache_settings"`
	CdnCacheSettingsMaximumTtl int64 `json:"cdn_cache_settings_maximum_ttl"`
	CacheByQueryString string `json:"cache_by_query_string"`
	QueryStringFields []string `json:"query_string_fields"`
	EnableQueryStringSort bool `json:"enable_query_string_sort"`
	CacheByCookies string `json:"cache_by_cookies"`
	CookieNames []string `json:"cookie_names"`
	AdaptiveDeliveryAction *string `json:"adaptive_delivery_action,omitempty"`
	DeviceGroup []int32 `json:"device_group,omitempty"`
	EnableCachingForPost bool `json:"enable_caching_for_post"`
	EnableCachingForOptions *bool `json:"enable_caching_for_options,omitempty"`
	L2CachingEnabled bool `json:"l2_caching_enabled"`
	IsSliceConfigurationEnabled *bool `json:"is_slice_configuration_enabled,omitempty"`
	IsSliceEdgeCachingEnabled *bool `json:"is_slice_edge_caching_enabled,omitempty"`
	IsSliceL2CachingEnabled *bool `json:"is_slice_l2_caching_enabled,omitempty"`
	SliceConfigurationRange *int64 `json:"slice_configuration_range,omitempty"`
	EnableStaleCache *bool `json:"enable_stale_cache,omitempty"`
	L2Region NullableString `json:"l2_region,omitempty"`
}

type _ApplicationCacheResponseDetails ApplicationCacheResponseDetails

// NewApplicationCacheResponseDetails instantiates a new ApplicationCacheResponseDetails 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 NewApplicationCacheResponseDetails(id int64, name string, browserCacheSettings string, browserCacheSettingsMaximumTtl int64, cdnCacheSettings string, cdnCacheSettingsMaximumTtl int64, cacheByQueryString string, queryStringFields []string, enableQueryStringSort bool, cacheByCookies string, cookieNames []string, enableCachingForPost bool, l2CachingEnabled bool) *ApplicationCacheResponseDetails {
	this := ApplicationCacheResponseDetails{}
	this.Id = id
	this.Name = name
	this.BrowserCacheSettings = browserCacheSettings
	this.BrowserCacheSettingsMaximumTtl = browserCacheSettingsMaximumTtl
	this.CdnCacheSettings = cdnCacheSettings
	this.CdnCacheSettingsMaximumTtl = cdnCacheSettingsMaximumTtl
	this.CacheByQueryString = cacheByQueryString
	this.QueryStringFields = queryStringFields
	this.EnableQueryStringSort = enableQueryStringSort
	this.CacheByCookies = cacheByCookies
	this.CookieNames = cookieNames
	this.EnableCachingForPost = enableCachingForPost
	this.L2CachingEnabled = l2CachingEnabled
	return &this
}

// NewApplicationCacheResponseDetailsWithDefaults instantiates a new ApplicationCacheResponseDetails 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 NewApplicationCacheResponseDetailsWithDefaults() *ApplicationCacheResponseDetails {
	this := ApplicationCacheResponseDetails{}
	return &this
}

// GetId returns the Id field value
func (o *ApplicationCacheResponseDetails) GetId() int64 {
	if o == nil {
		var ret int64
		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 *ApplicationCacheResponseDetails) GetIdOk() (*int64, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Id, true
}

// SetId sets field value
func (o *ApplicationCacheResponseDetails) SetId(v int64) {
	o.Id = v
}

// GetName returns the Name field value
func (o *ApplicationCacheResponseDetails) 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 *ApplicationCacheResponseDetails) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Name, true
}

// SetName sets field value
func (o *ApplicationCacheResponseDetails) SetName(v string) {
	o.Name = v
}

// GetBrowserCacheSettings returns the BrowserCacheSettings field value
func (o *ApplicationCacheResponseDetails) GetBrowserCacheSettings() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.BrowserCacheSettings
}

// GetBrowserCacheSettingsOk returns a tuple with the BrowserCacheSettings field value
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetBrowserCacheSettingsOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.BrowserCacheSettings, true
}

// SetBrowserCacheSettings sets field value
func (o *ApplicationCacheResponseDetails) SetBrowserCacheSettings(v string) {
	o.BrowserCacheSettings = v
}

// GetBrowserCacheSettingsMaximumTtl returns the BrowserCacheSettingsMaximumTtl field value
func (o *ApplicationCacheResponseDetails) GetBrowserCacheSettingsMaximumTtl() int64 {
	if o == nil {
		var ret int64
		return ret
	}

	return o.BrowserCacheSettingsMaximumTtl
}

// GetBrowserCacheSettingsMaximumTtlOk returns a tuple with the BrowserCacheSettingsMaximumTtl field value
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetBrowserCacheSettingsMaximumTtlOk() (*int64, bool) {
	if o == nil {
		return nil, false
	}
	return &o.BrowserCacheSettingsMaximumTtl, true
}

// SetBrowserCacheSettingsMaximumTtl sets field value
func (o *ApplicationCacheResponseDetails) SetBrowserCacheSettingsMaximumTtl(v int64) {
	o.BrowserCacheSettingsMaximumTtl = v
}

// GetCdnCacheSettings returns the CdnCacheSettings field value
func (o *ApplicationCacheResponseDetails) GetCdnCacheSettings() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.CdnCacheSettings
}

// GetCdnCacheSettingsOk returns a tuple with the CdnCacheSettings field value
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetCdnCacheSettingsOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.CdnCacheSettings, true
}

// SetCdnCacheSettings sets field value
func (o *ApplicationCacheResponseDetails) SetCdnCacheSettings(v string) {
	o.CdnCacheSettings = v
}

// GetCdnCacheSettingsMaximumTtl returns the CdnCacheSettingsMaximumTtl field value
func (o *ApplicationCacheResponseDetails) GetCdnCacheSettingsMaximumTtl() int64 {
	if o == nil {
		var ret int64
		return ret
	}

	return o.CdnCacheSettingsMaximumTtl
}

// GetCdnCacheSettingsMaximumTtlOk returns a tuple with the CdnCacheSettingsMaximumTtl field value
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetCdnCacheSettingsMaximumTtlOk() (*int64, bool) {
	if o == nil {
		return nil, false
	}
	return &o.CdnCacheSettingsMaximumTtl, true
}

// SetCdnCacheSettingsMaximumTtl sets field value
func (o *ApplicationCacheResponseDetails) SetCdnCacheSettingsMaximumTtl(v int64) {
	o.CdnCacheSettingsMaximumTtl = v
}

// GetCacheByQueryString returns the CacheByQueryString field value
func (o *ApplicationCacheResponseDetails) GetCacheByQueryString() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.CacheByQueryString
}

// GetCacheByQueryStringOk returns a tuple with the CacheByQueryString field value
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetCacheByQueryStringOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.CacheByQueryString, true
}

// SetCacheByQueryString sets field value
func (o *ApplicationCacheResponseDetails) SetCacheByQueryString(v string) {
	o.CacheByQueryString = v
}

// GetQueryStringFields returns the QueryStringFields field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *ApplicationCacheResponseDetails) GetQueryStringFields() []string {
	if o == nil {
		var ret []string
		return ret
	}

	return o.QueryStringFields
}

// GetQueryStringFieldsOk returns a tuple with the QueryStringFields 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 *ApplicationCacheResponseDetails) GetQueryStringFieldsOk() ([]string, bool) {
	if o == nil || IsNil(o.QueryStringFields) {
		return nil, false
	}
	return o.QueryStringFields, true
}

// SetQueryStringFields sets field value
func (o *ApplicationCacheResponseDetails) SetQueryStringFields(v []string) {
	o.QueryStringFields = v
}

// GetEnableQueryStringSort returns the EnableQueryStringSort field value
func (o *ApplicationCacheResponseDetails) GetEnableQueryStringSort() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.EnableQueryStringSort
}

// GetEnableQueryStringSortOk returns a tuple with the EnableQueryStringSort field value
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetEnableQueryStringSortOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return &o.EnableQueryStringSort, true
}

// SetEnableQueryStringSort sets field value
func (o *ApplicationCacheResponseDetails) SetEnableQueryStringSort(v bool) {
	o.EnableQueryStringSort = v
}

// GetCacheByCookies returns the CacheByCookies field value
func (o *ApplicationCacheResponseDetails) GetCacheByCookies() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.CacheByCookies
}

// GetCacheByCookiesOk returns a tuple with the CacheByCookies field value
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetCacheByCookiesOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.CacheByCookies, true
}

// SetCacheByCookies sets field value
func (o *ApplicationCacheResponseDetails) SetCacheByCookies(v string) {
	o.CacheByCookies = v
}

// GetCookieNames returns the CookieNames field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *ApplicationCacheResponseDetails) GetCookieNames() []string {
	if o == nil {
		var ret []string
		return ret
	}

	return o.CookieNames
}

// GetCookieNamesOk returns a tuple with the CookieNames 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 *ApplicationCacheResponseDetails) GetCookieNamesOk() ([]string, bool) {
	if o == nil || IsNil(o.CookieNames) {
		return nil, false
	}
	return o.CookieNames, true
}

// SetCookieNames sets field value
func (o *ApplicationCacheResponseDetails) SetCookieNames(v []string) {
	o.CookieNames = v
}

// GetAdaptiveDeliveryAction returns the AdaptiveDeliveryAction field value if set, zero value otherwise.
func (o *ApplicationCacheResponseDetails) GetAdaptiveDeliveryAction() string {
	if o == nil || IsNil(o.AdaptiveDeliveryAction) {
		var ret string
		return ret
	}
	return *o.AdaptiveDeliveryAction
}

// GetAdaptiveDeliveryActionOk returns a tuple with the AdaptiveDeliveryAction field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetAdaptiveDeliveryActionOk() (*string, bool) {
	if o == nil || IsNil(o.AdaptiveDeliveryAction) {
		return nil, false
	}
	return o.AdaptiveDeliveryAction, true
}

// HasAdaptiveDeliveryAction returns a boolean if a field has been set.
func (o *ApplicationCacheResponseDetails) HasAdaptiveDeliveryAction() bool {
	if o != nil && !IsNil(o.AdaptiveDeliveryAction) {
		return true
	}

	return false
}

// SetAdaptiveDeliveryAction gets a reference to the given string and assigns it to the AdaptiveDeliveryAction field.
func (o *ApplicationCacheResponseDetails) SetAdaptiveDeliveryAction(v string) {
	o.AdaptiveDeliveryAction = &v
}

// GetDeviceGroup returns the DeviceGroup field value if set, zero value otherwise.
func (o *ApplicationCacheResponseDetails) GetDeviceGroup() []int32 {
	if o == nil || IsNil(o.DeviceGroup) {
		var ret []int32
		return ret
	}
	return o.DeviceGroup
}

// GetDeviceGroupOk returns a tuple with the DeviceGroup field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetDeviceGroupOk() ([]int32, bool) {
	if o == nil || IsNil(o.DeviceGroup) {
		return nil, false
	}
	return o.DeviceGroup, true
}

// HasDeviceGroup returns a boolean if a field has been set.
func (o *ApplicationCacheResponseDetails) HasDeviceGroup() bool {
	if o != nil && !IsNil(o.DeviceGroup) {
		return true
	}

	return false
}

// SetDeviceGroup gets a reference to the given []int32 and assigns it to the DeviceGroup field.
func (o *ApplicationCacheResponseDetails) SetDeviceGroup(v []int32) {
	o.DeviceGroup = v
}

// GetEnableCachingForPost returns the EnableCachingForPost field value
func (o *ApplicationCacheResponseDetails) GetEnableCachingForPost() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.EnableCachingForPost
}

// GetEnableCachingForPostOk returns a tuple with the EnableCachingForPost field value
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetEnableCachingForPostOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return &o.EnableCachingForPost, true
}

// SetEnableCachingForPost sets field value
func (o *ApplicationCacheResponseDetails) SetEnableCachingForPost(v bool) {
	o.EnableCachingForPost = v
}

// GetEnableCachingForOptions returns the EnableCachingForOptions field value if set, zero value otherwise.
func (o *ApplicationCacheResponseDetails) GetEnableCachingForOptions() bool {
	if o == nil || IsNil(o.EnableCachingForOptions) {
		var ret bool
		return ret
	}
	return *o.EnableCachingForOptions
}

// GetEnableCachingForOptionsOk returns a tuple with the EnableCachingForOptions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetEnableCachingForOptionsOk() (*bool, bool) {
	if o == nil || IsNil(o.EnableCachingForOptions) {
		return nil, false
	}
	return o.EnableCachingForOptions, true
}

// HasEnableCachingForOptions returns a boolean if a field has been set.
func (o *ApplicationCacheResponseDetails) HasEnableCachingForOptions() bool {
	if o != nil && !IsNil(o.EnableCachingForOptions) {
		return true
	}

	return false
}

// SetEnableCachingForOptions gets a reference to the given bool and assigns it to the EnableCachingForOptions field.
func (o *ApplicationCacheResponseDetails) SetEnableCachingForOptions(v bool) {
	o.EnableCachingForOptions = &v
}

// GetL2CachingEnabled returns the L2CachingEnabled field value
func (o *ApplicationCacheResponseDetails) GetL2CachingEnabled() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.L2CachingEnabled
}

// GetL2CachingEnabledOk returns a tuple with the L2CachingEnabled field value
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetL2CachingEnabledOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return &o.L2CachingEnabled, true
}

// SetL2CachingEnabled sets field value
func (o *ApplicationCacheResponseDetails) SetL2CachingEnabled(v bool) {
	o.L2CachingEnabled = v
}

// GetIsSliceConfigurationEnabled returns the IsSliceConfigurationEnabled field value if set, zero value otherwise.
func (o *ApplicationCacheResponseDetails) GetIsSliceConfigurationEnabled() bool {
	if o == nil || IsNil(o.IsSliceConfigurationEnabled) {
		var ret bool
		return ret
	}
	return *o.IsSliceConfigurationEnabled
}

// GetIsSliceConfigurationEnabledOk returns a tuple with the IsSliceConfigurationEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetIsSliceConfigurationEnabledOk() (*bool, bool) {
	if o == nil || IsNil(o.IsSliceConfigurationEnabled) {
		return nil, false
	}
	return o.IsSliceConfigurationEnabled, true
}

// HasIsSliceConfigurationEnabled returns a boolean if a field has been set.
func (o *ApplicationCacheResponseDetails) HasIsSliceConfigurationEnabled() bool {
	if o != nil && !IsNil(o.IsSliceConfigurationEnabled) {
		return true
	}

	return false
}

// SetIsSliceConfigurationEnabled gets a reference to the given bool and assigns it to the IsSliceConfigurationEnabled field.
func (o *ApplicationCacheResponseDetails) SetIsSliceConfigurationEnabled(v bool) {
	o.IsSliceConfigurationEnabled = &v
}

// GetIsSliceEdgeCachingEnabled returns the IsSliceEdgeCachingEnabled field value if set, zero value otherwise.
func (o *ApplicationCacheResponseDetails) GetIsSliceEdgeCachingEnabled() bool {
	if o == nil || IsNil(o.IsSliceEdgeCachingEnabled) {
		var ret bool
		return ret
	}
	return *o.IsSliceEdgeCachingEnabled
}

// GetIsSliceEdgeCachingEnabledOk returns a tuple with the IsSliceEdgeCachingEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetIsSliceEdgeCachingEnabledOk() (*bool, bool) {
	if o == nil || IsNil(o.IsSliceEdgeCachingEnabled) {
		return nil, false
	}
	return o.IsSliceEdgeCachingEnabled, true
}

// HasIsSliceEdgeCachingEnabled returns a boolean if a field has been set.
func (o *ApplicationCacheResponseDetails) HasIsSliceEdgeCachingEnabled() bool {
	if o != nil && !IsNil(o.IsSliceEdgeCachingEnabled) {
		return true
	}

	return false
}

// SetIsSliceEdgeCachingEnabled gets a reference to the given bool and assigns it to the IsSliceEdgeCachingEnabled field.
func (o *ApplicationCacheResponseDetails) SetIsSliceEdgeCachingEnabled(v bool) {
	o.IsSliceEdgeCachingEnabled = &v
}

// GetIsSliceL2CachingEnabled returns the IsSliceL2CachingEnabled field value if set, zero value otherwise.
func (o *ApplicationCacheResponseDetails) GetIsSliceL2CachingEnabled() bool {
	if o == nil || IsNil(o.IsSliceL2CachingEnabled) {
		var ret bool
		return ret
	}
	return *o.IsSliceL2CachingEnabled
}

// GetIsSliceL2CachingEnabledOk returns a tuple with the IsSliceL2CachingEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetIsSliceL2CachingEnabledOk() (*bool, bool) {
	if o == nil || IsNil(o.IsSliceL2CachingEnabled) {
		return nil, false
	}
	return o.IsSliceL2CachingEnabled, true
}

// HasIsSliceL2CachingEnabled returns a boolean if a field has been set.
func (o *ApplicationCacheResponseDetails) HasIsSliceL2CachingEnabled() bool {
	if o != nil && !IsNil(o.IsSliceL2CachingEnabled) {
		return true
	}

	return false
}

// SetIsSliceL2CachingEnabled gets a reference to the given bool and assigns it to the IsSliceL2CachingEnabled field.
func (o *ApplicationCacheResponseDetails) SetIsSliceL2CachingEnabled(v bool) {
	o.IsSliceL2CachingEnabled = &v
}

// GetSliceConfigurationRange returns the SliceConfigurationRange field value if set, zero value otherwise.
func (o *ApplicationCacheResponseDetails) GetSliceConfigurationRange() int64 {
	if o == nil || IsNil(o.SliceConfigurationRange) {
		var ret int64
		return ret
	}
	return *o.SliceConfigurationRange
}

// GetSliceConfigurationRangeOk returns a tuple with the SliceConfigurationRange field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetSliceConfigurationRangeOk() (*int64, bool) {
	if o == nil || IsNil(o.SliceConfigurationRange) {
		return nil, false
	}
	return o.SliceConfigurationRange, true
}

// HasSliceConfigurationRange returns a boolean if a field has been set.
func (o *ApplicationCacheResponseDetails) HasSliceConfigurationRange() bool {
	if o != nil && !IsNil(o.SliceConfigurationRange) {
		return true
	}

	return false
}

// SetSliceConfigurationRange gets a reference to the given int64 and assigns it to the SliceConfigurationRange field.
func (o *ApplicationCacheResponseDetails) SetSliceConfigurationRange(v int64) {
	o.SliceConfigurationRange = &v
}

// GetEnableStaleCache returns the EnableStaleCache field value if set, zero value otherwise.
func (o *ApplicationCacheResponseDetails) GetEnableStaleCache() bool {
	if o == nil || IsNil(o.EnableStaleCache) {
		var ret bool
		return ret
	}
	return *o.EnableStaleCache
}

// GetEnableStaleCacheOk returns a tuple with the EnableStaleCache field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationCacheResponseDetails) GetEnableStaleCacheOk() (*bool, bool) {
	if o == nil || IsNil(o.EnableStaleCache) {
		return nil, false
	}
	return o.EnableStaleCache, true
}

// HasEnableStaleCache returns a boolean if a field has been set.
func (o *ApplicationCacheResponseDetails) HasEnableStaleCache() bool {
	if o != nil && !IsNil(o.EnableStaleCache) {
		return true
	}

	return false
}

// SetEnableStaleCache gets a reference to the given bool and assigns it to the EnableStaleCache field.
func (o *ApplicationCacheResponseDetails) SetEnableStaleCache(v bool) {
	o.EnableStaleCache = &v
}

// GetL2Region returns the L2Region field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ApplicationCacheResponseDetails) GetL2Region() string {
	if o == nil || IsNil(o.L2Region.Get()) {
		var ret string
		return ret
	}
	return *o.L2Region.Get()
}

// GetL2RegionOk returns a tuple with the L2Region 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 *ApplicationCacheResponseDetails) GetL2RegionOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.L2Region.Get(), o.L2Region.IsSet()
}

// HasL2Region returns a boolean if a field has been set.
func (o *ApplicationCacheResponseDetails) HasL2Region() bool {
	if o != nil && o.L2Region.IsSet() {
		return true
	}

	return false
}

// SetL2Region gets a reference to the given NullableString and assigns it to the L2Region field.
func (o *ApplicationCacheResponseDetails) SetL2Region(v string) {
	o.L2Region.Set(&v)
}
// SetL2RegionNil sets the value for L2Region to be an explicit nil
func (o *ApplicationCacheResponseDetails) SetL2RegionNil() {
	o.L2Region.Set(nil)
}

// UnsetL2Region ensures that no value is present for L2Region, not even an explicit nil
func (o *ApplicationCacheResponseDetails) UnsetL2Region() {
	o.L2Region.Unset()
}

func (o ApplicationCacheResponseDetails) MarshalJSON() ([]byte, error) {
	toSerialize,err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o ApplicationCacheResponseDetails) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	toSerialize["name"] = o.Name
	toSerialize["browser_cache_settings"] = o.BrowserCacheSettings
	toSerialize["browser_cache_settings_maximum_ttl"] = o.BrowserCacheSettingsMaximumTtl
	toSerialize["cdn_cache_settings"] = o.CdnCacheSettings
	toSerialize["cdn_cache_settings_maximum_ttl"] = o.CdnCacheSettingsMaximumTtl
	toSerialize["cache_by_query_string"] = o.CacheByQueryString
	if o.QueryStringFields != nil {
		toSerialize["query_string_fields"] = o.QueryStringFields
	}
	toSerialize["enable_query_string_sort"] = o.EnableQueryStringSort
	toSerialize["cache_by_cookies"] = o.CacheByCookies
	if o.CookieNames != nil {
		toSerialize["cookie_names"] = o.CookieNames
	}
	if !IsNil(o.AdaptiveDeliveryAction) {
		toSerialize["adaptive_delivery_action"] = o.AdaptiveDeliveryAction
	}
	if !IsNil(o.DeviceGroup) {
		toSerialize["device_group"] = o.DeviceGroup
	}
	toSerialize["enable_caching_for_post"] = o.EnableCachingForPost
	if !IsNil(o.EnableCachingForOptions) {
		toSerialize["enable_caching_for_options"] = o.EnableCachingForOptions
	}
	toSerialize["l2_caching_enabled"] = o.L2CachingEnabled
	if !IsNil(o.IsSliceConfigurationEnabled) {
		toSerialize["is_slice_configuration_enabled"] = o.IsSliceConfigurationEnabled
	}
	if !IsNil(o.IsSliceEdgeCachingEnabled) {
		toSerialize["is_slice_edge_caching_enabled"] = o.IsSliceEdgeCachingEnabled
	}
	if !IsNil(o.IsSliceL2CachingEnabled) {
		toSerialize["is_slice_l2_caching_enabled"] = o.IsSliceL2CachingEnabled
	}
	if !IsNil(o.SliceConfigurationRange) {
		toSerialize["slice_configuration_range"] = o.SliceConfigurationRange
	}
	if !IsNil(o.EnableStaleCache) {
		toSerialize["enable_stale_cache"] = o.EnableStaleCache
	}
	if o.L2Region.IsSet() {
		toSerialize["l2_region"] = o.L2Region.Get()
	}
	return toSerialize, nil
}

func (o *ApplicationCacheResponseDetails) 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",
		"name",
		"browser_cache_settings",
		"browser_cache_settings_maximum_ttl",
		"cdn_cache_settings",
		"cdn_cache_settings_maximum_ttl",
		"cache_by_query_string",
		"query_string_fields",
		"enable_query_string_sort",
		"cache_by_cookies",
		"cookie_names",
		"enable_caching_for_post",
		"l2_caching_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)
		}
	}

	varApplicationCacheResponseDetails := _ApplicationCacheResponseDetails{}

	decoder := json.NewDecoder(bytes.NewReader(data))
	decoder.DisallowUnknownFields()
	err = decoder.Decode(&varApplicationCacheResponseDetails)

	if err != nil {
		return err
	}

	*o = ApplicationCacheResponseDetails(varApplicationCacheResponseDetails)

	return err
}

type NullableApplicationCacheResponseDetails struct {
	value *ApplicationCacheResponseDetails
	isSet bool
}

func (v NullableApplicationCacheResponseDetails) Get() *ApplicationCacheResponseDetails {
	return v.value
}

func (v *NullableApplicationCacheResponseDetails) Set(val *ApplicationCacheResponseDetails) {
	v.value = val
	v.isSet = true
}

func (v NullableApplicationCacheResponseDetails) IsSet() bool {
	return v.isSet
}

func (v *NullableApplicationCacheResponseDetails) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableApplicationCacheResponseDetails(val *ApplicationCacheResponseDetails) *NullableApplicationCacheResponseDetails {
	return &NullableApplicationCacheResponseDetails{value: val, isSet: true}
}

func (v NullableApplicationCacheResponseDetails) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableApplicationCacheResponseDetails) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}


