/*
1Backend

AI-native microservices platform.

API version: 0.8.2
Contact: sales@singulatron.com
*/

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

package openapi

import (
	"encoding/json"
)

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

// PolicySvcRateLimitParameters struct for PolicySvcRateLimitParameters
type PolicySvcRateLimitParameters struct {
	Entity *PolicySvcEntity `json:"entity,omitempty"`
	MaxRequests *int32 `json:"maxRequests,omitempty"`
	Scope *PolicySvcScope `json:"scope,omitempty"`
	TimeWindow *string `json:"timeWindow,omitempty"`
}

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

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

// GetEntity returns the Entity field value if set, zero value otherwise.
func (o *PolicySvcRateLimitParameters) GetEntity() PolicySvcEntity {
	if o == nil || IsNil(o.Entity) {
		var ret PolicySvcEntity
		return ret
	}
	return *o.Entity
}

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

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

	return false
}

// SetEntity gets a reference to the given PolicySvcEntity and assigns it to the Entity field.
func (o *PolicySvcRateLimitParameters) SetEntity(v PolicySvcEntity) {
	o.Entity = &v
}

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

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

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

	return false
}

// SetMaxRequests gets a reference to the given int32 and assigns it to the MaxRequests field.
func (o *PolicySvcRateLimitParameters) SetMaxRequests(v int32) {
	o.MaxRequests = &v
}

// GetScope returns the Scope field value if set, zero value otherwise.
func (o *PolicySvcRateLimitParameters) GetScope() PolicySvcScope {
	if o == nil || IsNil(o.Scope) {
		var ret PolicySvcScope
		return ret
	}
	return *o.Scope
}

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

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

	return false
}

// SetScope gets a reference to the given PolicySvcScope and assigns it to the Scope field.
func (o *PolicySvcRateLimitParameters) SetScope(v PolicySvcScope) {
	o.Scope = &v
}

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

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

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

	return false
}

// SetTimeWindow gets a reference to the given string and assigns it to the TimeWindow field.
func (o *PolicySvcRateLimitParameters) SetTimeWindow(v string) {
	o.TimeWindow = &v
}

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

func (o PolicySvcRateLimitParameters) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Entity) {
		toSerialize["entity"] = o.Entity
	}
	if !IsNil(o.MaxRequests) {
		toSerialize["maxRequests"] = o.MaxRequests
	}
	if !IsNil(o.Scope) {
		toSerialize["scope"] = o.Scope
	}
	if !IsNil(o.TimeWindow) {
		toSerialize["timeWindow"] = o.TimeWindow
	}
	return toSerialize, nil
}

type NullablePolicySvcRateLimitParameters struct {
	value *PolicySvcRateLimitParameters
	isSet bool
}

func (v NullablePolicySvcRateLimitParameters) Get() *PolicySvcRateLimitParameters {
	return v.value
}

func (v *NullablePolicySvcRateLimitParameters) Set(val *PolicySvcRateLimitParameters) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullablePolicySvcRateLimitParameters(val *PolicySvcRateLimitParameters) *NullablePolicySvcRateLimitParameters {
	return &NullablePolicySvcRateLimitParameters{value: val, isSet: true}
}

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

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


