/*
Edge Firewall 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 edgefirewall

import (
	"encoding/json"
)

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

// SetRateLimitDetails struct for SetRateLimitDetails
type SetRateLimitDetails struct {
	Type *string `json:"type,omitempty"`
	LimitBy *string `json:"limit_by,omitempty"`
	AverageRateLimit *int32 `json:"average_rate_limit,omitempty"`
	MaximumBurstSize *int32 `json:"maximum_burst_size,omitempty"`
}

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

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

// GetType returns the Type field value if set, zero value otherwise.
func (o *SetRateLimitDetails) GetType() string {
	if o == nil || IsNil(o.Type) {
		var ret string
		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 *SetRateLimitDetails) GetTypeOk() (*string, 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 *SetRateLimitDetails) HasType() bool {
	if o != nil && !IsNil(o.Type) {
		return true
	}

	return false
}

// SetType gets a reference to the given string and assigns it to the Type field.
func (o *SetRateLimitDetails) SetType(v string) {
	o.Type = &v
}

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

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

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

	return false
}

// SetLimitBy gets a reference to the given string and assigns it to the LimitBy field.
func (o *SetRateLimitDetails) SetLimitBy(v string) {
	o.LimitBy = &v
}

// GetAverageRateLimit returns the AverageRateLimit field value if set, zero value otherwise.
func (o *SetRateLimitDetails) GetAverageRateLimit() int32 {
	if o == nil || IsNil(o.AverageRateLimit) {
		var ret int32
		return ret
	}
	return *o.AverageRateLimit
}

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

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

	return false
}

// SetAverageRateLimit gets a reference to the given int32 and assigns it to the AverageRateLimit field.
func (o *SetRateLimitDetails) SetAverageRateLimit(v int32) {
	o.AverageRateLimit = &v
}

// GetMaximumBurstSize returns the MaximumBurstSize field value if set, zero value otherwise.
func (o *SetRateLimitDetails) GetMaximumBurstSize() int32 {
	if o == nil || IsNil(o.MaximumBurstSize) {
		var ret int32
		return ret
	}
	return *o.MaximumBurstSize
}

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

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

	return false
}

// SetMaximumBurstSize gets a reference to the given int32 and assigns it to the MaximumBurstSize field.
func (o *SetRateLimitDetails) SetMaximumBurstSize(v int32) {
	o.MaximumBurstSize = &v
}

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

func (o SetRateLimitDetails) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Type) {
		toSerialize["type"] = o.Type
	}
	if !IsNil(o.LimitBy) {
		toSerialize["limit_by"] = o.LimitBy
	}
	if !IsNil(o.AverageRateLimit) {
		toSerialize["average_rate_limit"] = o.AverageRateLimit
	}
	if !IsNil(o.MaximumBurstSize) {
		toSerialize["maximum_burst_size"] = o.MaximumBurstSize
	}
	return toSerialize, nil
}

type NullableSetRateLimitDetails struct {
	value *SetRateLimitDetails
	isSet bool
}

func (v NullableSetRateLimitDetails) Get() *SetRateLimitDetails {
	return v.value
}

func (v *NullableSetRateLimitDetails) Set(val *SetRateLimitDetails) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSetRateLimitDetails(val *SetRateLimitDetails) *NullableSetRateLimitDetails {
	return &NullableSetRateLimitDetails{value: val, isSet: true}
}

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

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


