/*
 * VM Auto Scaling API
 *
 * The VM Auto Scaling Service enables IONOS clients to horizontally scale the number of VM replicas based on configured rules. You can use VM Auto Scaling to ensure that you have a sufficient number of replicas to handle your application loads at all times.  For this purpose, create a VM Auto Scaling Group that contains the server replicas. The VM Auto Scaling Service ensures that the number of replicas in the group is always within the defined limits.   When scaling policies are set, VM Auto Scaling creates or deletes replicas according to the requirements of your applications. For each policy, specified 'scale-in' and 'scale-out' actions are performed when the corresponding thresholds are reached.
 *
 * API version: 1-SDK.1
 * Contact: support@cloud.ionos.com
 */

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

package ionoscloud

import (
	"encoding/json"
)

// GroupPutProperties struct for GroupPutProperties
type GroupPutProperties struct {
	Datacenter *GroupPutPropertiesDatacenter `json:"datacenter,omitempty"`
	// The data center location.
	Location *string `json:"location"`
	// The maximum value for the number of replicas on a VM Auto Scaling Group. Must be >= 0 and <= 200. Will be enforced for both automatic and manual changes.
	MaxReplicaCount *int64 `json:"maxReplicaCount"`
	// The minimum value for the number of replicas on a VM Auto Scaling Group. Must be >= 0 and <= 200. Will be enforced for both automatic and manual changes
	MinReplicaCount *int64 `json:"minReplicaCount"`
	// The name of the VM Auto Scaling Group. This field must not be null or blank.
	Name                 *string                `json:"name"`
	Policy               *GroupPolicy           `json:"policy"`
	ReplicaConfiguration *ReplicaPropertiesPost `json:"replicaConfiguration"`
}

// NewGroupPutProperties instantiates a new GroupPutProperties 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 NewGroupPutProperties(location string, maxReplicaCount int64, minReplicaCount int64, name string, policy GroupPolicy, replicaConfiguration ReplicaPropertiesPost) *GroupPutProperties {
	this := GroupPutProperties{}

	this.Location = &location
	this.MaxReplicaCount = &maxReplicaCount
	this.MinReplicaCount = &minReplicaCount
	this.Name = &name
	this.Policy = &policy
	this.ReplicaConfiguration = &replicaConfiguration

	return &this
}

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

// GetDatacenter returns the Datacenter field value
// If the value is explicit nil, the zero value for GroupPutPropertiesDatacenter will be returned
func (o *GroupPutProperties) GetDatacenter() *GroupPutPropertiesDatacenter {
	if o == nil {
		return nil
	}

	return o.Datacenter

}

// GetDatacenterOk returns a tuple with the Datacenter 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 *GroupPutProperties) GetDatacenterOk() (*GroupPutPropertiesDatacenter, bool) {
	if o == nil {
		return nil, false
	}

	return o.Datacenter, true
}

// SetDatacenter sets field value
func (o *GroupPutProperties) SetDatacenter(v GroupPutPropertiesDatacenter) {

	o.Datacenter = &v

}

// HasDatacenter returns a boolean if a field has been set.
func (o *GroupPutProperties) HasDatacenter() bool {
	if o != nil && o.Datacenter != nil {
		return true
	}

	return false
}

// GetLocation returns the Location field value
// If the value is explicit nil, the zero value for string will be returned
func (o *GroupPutProperties) GetLocation() *string {
	if o == nil {
		return nil
	}

	return o.Location

}

// GetLocationOk returns a tuple with the Location 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 *GroupPutProperties) GetLocationOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Location, true
}

// SetLocation sets field value
func (o *GroupPutProperties) SetLocation(v string) {

	o.Location = &v

}

// HasLocation returns a boolean if a field has been set.
func (o *GroupPutProperties) HasLocation() bool {
	if o != nil && o.Location != nil {
		return true
	}

	return false
}

// GetMaxReplicaCount returns the MaxReplicaCount field value
// If the value is explicit nil, the zero value for int64 will be returned
func (o *GroupPutProperties) GetMaxReplicaCount() *int64 {
	if o == nil {
		return nil
	}

	return o.MaxReplicaCount

}

// GetMaxReplicaCountOk returns a tuple with the MaxReplicaCount 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 *GroupPutProperties) GetMaxReplicaCountOk() (*int64, bool) {
	if o == nil {
		return nil, false
	}

	return o.MaxReplicaCount, true
}

// SetMaxReplicaCount sets field value
func (o *GroupPutProperties) SetMaxReplicaCount(v int64) {

	o.MaxReplicaCount = &v

}

// HasMaxReplicaCount returns a boolean if a field has been set.
func (o *GroupPutProperties) HasMaxReplicaCount() bool {
	if o != nil && o.MaxReplicaCount != nil {
		return true
	}

	return false
}

// GetMinReplicaCount returns the MinReplicaCount field value
// If the value is explicit nil, the zero value for int64 will be returned
func (o *GroupPutProperties) GetMinReplicaCount() *int64 {
	if o == nil {
		return nil
	}

	return o.MinReplicaCount

}

// GetMinReplicaCountOk returns a tuple with the MinReplicaCount 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 *GroupPutProperties) GetMinReplicaCountOk() (*int64, bool) {
	if o == nil {
		return nil, false
	}

	return o.MinReplicaCount, true
}

// SetMinReplicaCount sets field value
func (o *GroupPutProperties) SetMinReplicaCount(v int64) {

	o.MinReplicaCount = &v

}

// HasMinReplicaCount returns a boolean if a field has been set.
func (o *GroupPutProperties) HasMinReplicaCount() bool {
	if o != nil && o.MinReplicaCount != nil {
		return true
	}

	return false
}

// GetName returns the Name field value
// If the value is explicit nil, the zero value for string will be returned
func (o *GroupPutProperties) GetName() *string {
	if o == nil {
		return nil
	}

	return o.Name

}

// GetNameOk returns a tuple with the Name 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 *GroupPutProperties) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Name, true
}

// SetName sets field value
func (o *GroupPutProperties) SetName(v string) {

	o.Name = &v

}

// HasName returns a boolean if a field has been set.
func (o *GroupPutProperties) HasName() bool {
	if o != nil && o.Name != nil {
		return true
	}

	return false
}

// GetPolicy returns the Policy field value
// If the value is explicit nil, the zero value for GroupPolicy will be returned
func (o *GroupPutProperties) GetPolicy() *GroupPolicy {
	if o == nil {
		return nil
	}

	return o.Policy

}

// GetPolicyOk returns a tuple with the Policy 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 *GroupPutProperties) GetPolicyOk() (*GroupPolicy, bool) {
	if o == nil {
		return nil, false
	}

	return o.Policy, true
}

// SetPolicy sets field value
func (o *GroupPutProperties) SetPolicy(v GroupPolicy) {

	o.Policy = &v

}

// HasPolicy returns a boolean if a field has been set.
func (o *GroupPutProperties) HasPolicy() bool {
	if o != nil && o.Policy != nil {
		return true
	}

	return false
}

// GetReplicaConfiguration returns the ReplicaConfiguration field value
// If the value is explicit nil, the zero value for ReplicaPropertiesPost will be returned
func (o *GroupPutProperties) GetReplicaConfiguration() *ReplicaPropertiesPost {
	if o == nil {
		return nil
	}

	return o.ReplicaConfiguration

}

// GetReplicaConfigurationOk returns a tuple with the ReplicaConfiguration 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 *GroupPutProperties) GetReplicaConfigurationOk() (*ReplicaPropertiesPost, bool) {
	if o == nil {
		return nil, false
	}

	return o.ReplicaConfiguration, true
}

// SetReplicaConfiguration sets field value
func (o *GroupPutProperties) SetReplicaConfiguration(v ReplicaPropertiesPost) {

	o.ReplicaConfiguration = &v

}

// HasReplicaConfiguration returns a boolean if a field has been set.
func (o *GroupPutProperties) HasReplicaConfiguration() bool {
	if o != nil && o.ReplicaConfiguration != nil {
		return true
	}

	return false
}

func (o GroupPutProperties) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Datacenter != nil {
		toSerialize["datacenter"] = o.Datacenter
	}

	if o.Location != nil {
		toSerialize["location"] = o.Location
	}

	if o.MaxReplicaCount != nil {
		toSerialize["maxReplicaCount"] = o.MaxReplicaCount
	}

	if o.MinReplicaCount != nil {
		toSerialize["minReplicaCount"] = o.MinReplicaCount
	}

	if o.Name != nil {
		toSerialize["name"] = o.Name
	}

	if o.Policy != nil {
		toSerialize["policy"] = o.Policy
	}

	if o.ReplicaConfiguration != nil {
		toSerialize["replicaConfiguration"] = o.ReplicaConfiguration
	}

	return json.Marshal(toSerialize)
}

type NullableGroupPutProperties struct {
	value *GroupPutProperties
	isSet bool
}

func (v NullableGroupPutProperties) Get() *GroupPutProperties {
	return v.value
}

func (v *NullableGroupPutProperties) Set(val *GroupPutProperties) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableGroupPutProperties(val *GroupPutProperties) *NullableGroupPutProperties {
	return &NullableGroupPutProperties{value: val, isSet: true}
}

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

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