/*
 * 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"
)

// ReplicaNic struct for ReplicaNic
type ReplicaNic struct {
	// The LAN ID of this replica NIC.
	Lan *int32 `json:"lan"`
	// The replica NIC name.
	Name *string `json:"name"`
	// DHCP for this replica NIC. This is an optional attribute with the default value 'TRUE' if not specified in the request payload or as null.
	Dhcp *bool `json:"dhcp,omitempty"`
	// Activate or deactivate the firewall. By default, an active firewall without any defined rules will block all incoming network traffic except for the firewall rules that explicitly allows certain protocols, IP addresses and ports.
	FirewallActive *bool `json:"firewallActive,omitempty"`
	// The type of firewall rules that will be allowed on the NIC. If not specified, the default INGRESS value is used.
	FirewallType *string `json:"firewallType,omitempty"`
	// List of all flow logs for the specified NIC.
	FlowLogs *[]NicFlowLog `json:"flowLogs,omitempty"`
	// List of all firewall rules for the specified NIC.
	FirewallRules *[]NicFirewallRule `json:"firewallRules,omitempty"`
	TargetGroup   *TargetGroup       `json:"targetGroup,omitempty"`
}

// NewReplicaNic instantiates a new ReplicaNic 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 NewReplicaNic(lan int32, name string) *ReplicaNic {
	this := ReplicaNic{}

	this.Lan = &lan
	this.Name = &name

	return &this
}

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

// GetLan returns the Lan field value
// If the value is explicit nil, the zero value for int32 will be returned
func (o *ReplicaNic) GetLan() *int32 {
	if o == nil {
		return nil
	}

	return o.Lan

}

// GetLanOk returns a tuple with the Lan 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 *ReplicaNic) GetLanOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}

	return o.Lan, true
}

// SetLan sets field value
func (o *ReplicaNic) SetLan(v int32) {

	o.Lan = &v

}

// HasLan returns a boolean if a field has been set.
func (o *ReplicaNic) HasLan() bool {
	if o != nil && o.Lan != 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 *ReplicaNic) 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 *ReplicaNic) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Name, true
}

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

	o.Name = &v

}

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

	return false
}

// GetDhcp returns the Dhcp field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *ReplicaNic) GetDhcp() *bool {
	if o == nil {
		return nil
	}

	return o.Dhcp

}

// GetDhcpOk returns a tuple with the Dhcp 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 *ReplicaNic) GetDhcpOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}

	return o.Dhcp, true
}

// SetDhcp sets field value
func (o *ReplicaNic) SetDhcp(v bool) {

	o.Dhcp = &v

}

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

	return false
}

// GetFirewallActive returns the FirewallActive field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *ReplicaNic) GetFirewallActive() *bool {
	if o == nil {
		return nil
	}

	return o.FirewallActive

}

// GetFirewallActiveOk returns a tuple with the FirewallActive 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 *ReplicaNic) GetFirewallActiveOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}

	return o.FirewallActive, true
}

// SetFirewallActive sets field value
func (o *ReplicaNic) SetFirewallActive(v bool) {

	o.FirewallActive = &v

}

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

	return false
}

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

	return o.FirewallType

}

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

	return o.FirewallType, true
}

// SetFirewallType sets field value
func (o *ReplicaNic) SetFirewallType(v string) {

	o.FirewallType = &v

}

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

	return false
}

// GetFlowLogs returns the FlowLogs field value
// If the value is explicit nil, the zero value for []NicFlowLog will be returned
func (o *ReplicaNic) GetFlowLogs() *[]NicFlowLog {
	if o == nil {
		return nil
	}

	return o.FlowLogs

}

// GetFlowLogsOk returns a tuple with the FlowLogs 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 *ReplicaNic) GetFlowLogsOk() (*[]NicFlowLog, bool) {
	if o == nil {
		return nil, false
	}

	return o.FlowLogs, true
}

// SetFlowLogs sets field value
func (o *ReplicaNic) SetFlowLogs(v []NicFlowLog) {

	o.FlowLogs = &v

}

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

	return false
}

// GetFirewallRules returns the FirewallRules field value
// If the value is explicit nil, the zero value for []NicFirewallRule will be returned
func (o *ReplicaNic) GetFirewallRules() *[]NicFirewallRule {
	if o == nil {
		return nil
	}

	return o.FirewallRules

}

// GetFirewallRulesOk returns a tuple with the FirewallRules 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 *ReplicaNic) GetFirewallRulesOk() (*[]NicFirewallRule, bool) {
	if o == nil {
		return nil, false
	}

	return o.FirewallRules, true
}

// SetFirewallRules sets field value
func (o *ReplicaNic) SetFirewallRules(v []NicFirewallRule) {

	o.FirewallRules = &v

}

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

	return false
}

// GetTargetGroup returns the TargetGroup field value
// If the value is explicit nil, the zero value for TargetGroup will be returned
func (o *ReplicaNic) GetTargetGroup() *TargetGroup {
	if o == nil {
		return nil
	}

	return o.TargetGroup

}

// GetTargetGroupOk returns a tuple with the TargetGroup 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 *ReplicaNic) GetTargetGroupOk() (*TargetGroup, bool) {
	if o == nil {
		return nil, false
	}

	return o.TargetGroup, true
}

// SetTargetGroup sets field value
func (o *ReplicaNic) SetTargetGroup(v TargetGroup) {

	o.TargetGroup = &v

}

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

	return false
}

func (o ReplicaNic) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Lan != nil {
		toSerialize["lan"] = o.Lan
	}

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

	toSerialize["dhcp"] = o.Dhcp

	toSerialize["firewallActive"] = o.FirewallActive

	toSerialize["firewallType"] = o.FirewallType

	toSerialize["flowLogs"] = o.FlowLogs

	toSerialize["firewallRules"] = o.FirewallRules

	if o.TargetGroup != nil {
		toSerialize["targetGroup"] = o.TargetGroup
	}

	return json.Marshal(toSerialize)
}

type NullableReplicaNic struct {
	value *ReplicaNic
	isSet bool
}

func (v NullableReplicaNic) Get() *ReplicaNic {
	return v.value
}

func (v *NullableReplicaNic) Set(val *ReplicaNic) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableReplicaNic(val *ReplicaNic) *NullableReplicaNic {
	return &NullableReplicaNic{value: val, isSet: true}
}

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

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