/*
Management API

API version: 3
*/

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

package management

import (
	"encoding/json"

	"github.com/adyen/adyen-go-api-library/v21/src/common"
)

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

// TerminalConnectivityCellular struct for TerminalConnectivityCellular
type TerminalConnectivityCellular struct {
	// The integrated circuit card identifier (ICCID) of the primary SIM card in the terminal.
	Iccid *string `json:"iccid,omitempty"`
	// The integrated circuit card identifier (ICCID) of the secondary SIM card in the terminal, typically used for a [third-party SIM card](https://docs.adyen.com/point-of-sale/design-your-integration/network-and-connectivity/cellular-failover/#using-a-third-party-sim-card).
	Iccid2 *string `json:"iccid2,omitempty"`
	// On a terminal that supports 3G or 4G connectivity, indicates the status of the primary SIM card in the terminal.
	Status *string `json:"status,omitempty"`
}

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

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

// GetIccid returns the Iccid field value if set, zero value otherwise.
func (o *TerminalConnectivityCellular) GetIccid() string {
	if o == nil || common.IsNil(o.Iccid) {
		var ret string
		return ret
	}
	return *o.Iccid
}

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

// HasIccid returns a boolean if a field has been set.
func (o *TerminalConnectivityCellular) HasIccid() bool {
	if o != nil && !common.IsNil(o.Iccid) {
		return true
	}

	return false
}

// SetIccid gets a reference to the given string and assigns it to the Iccid field.
func (o *TerminalConnectivityCellular) SetIccid(v string) {
	o.Iccid = &v
}

// GetIccid2 returns the Iccid2 field value if set, zero value otherwise.
func (o *TerminalConnectivityCellular) GetIccid2() string {
	if o == nil || common.IsNil(o.Iccid2) {
		var ret string
		return ret
	}
	return *o.Iccid2
}

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

// HasIccid2 returns a boolean if a field has been set.
func (o *TerminalConnectivityCellular) HasIccid2() bool {
	if o != nil && !common.IsNil(o.Iccid2) {
		return true
	}

	return false
}

// SetIccid2 gets a reference to the given string and assigns it to the Iccid2 field.
func (o *TerminalConnectivityCellular) SetIccid2(v string) {
	o.Iccid2 = &v
}

// GetStatus returns the Status field value if set, zero value otherwise.
func (o *TerminalConnectivityCellular) GetStatus() string {
	if o == nil || common.IsNil(o.Status) {
		var ret string
		return ret
	}
	return *o.Status
}

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

// HasStatus returns a boolean if a field has been set.
func (o *TerminalConnectivityCellular) HasStatus() bool {
	if o != nil && !common.IsNil(o.Status) {
		return true
	}

	return false
}

// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *TerminalConnectivityCellular) SetStatus(v string) {
	o.Status = &v
}

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

func (o TerminalConnectivityCellular) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.Iccid) {
		toSerialize["iccid"] = o.Iccid
	}
	if !common.IsNil(o.Iccid2) {
		toSerialize["iccid2"] = o.Iccid2
	}
	if !common.IsNil(o.Status) {
		toSerialize["status"] = o.Status
	}
	return toSerialize, nil
}

type NullableTerminalConnectivityCellular struct {
	value *TerminalConnectivityCellular
	isSet bool
}

func (v NullableTerminalConnectivityCellular) Get() *TerminalConnectivityCellular {
	return v.value
}

func (v *NullableTerminalConnectivityCellular) Set(val *TerminalConnectivityCellular) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTerminalConnectivityCellular(val *TerminalConnectivityCellular) *NullableTerminalConnectivityCellular {
	return &NullableTerminalConnectivityCellular{value: val, isSet: true}
}

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

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

func (o *TerminalConnectivityCellular) isValidStatus() bool {
	var allowedEnumValues = []string{"activated", "deactivated", "deprecated", "inventory", "readyForActivation"}
	for _, allowed := range allowedEnumValues {
		if o.GetStatus() == allowed {
			return true
		}
	}
	return false
}
