/*
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 TerminalReassignmentTarget type satisfies the MappedNullable interface at compile time
var _ common.MappedNullable = &TerminalReassignmentTarget{}

// TerminalReassignmentTarget struct for TerminalReassignmentTarget
type TerminalReassignmentTarget struct {
	// The unique identifier of the company account to which the terminal is reassigned.
	CompanyId *string `json:"companyId,omitempty"`
	// Indicates if the terminal is reassigned to the inventory of the merchant account. - If **true**, the terminal is in the inventory of the merchant account and cannot process transactions. - If **false**, the terminal is reassigned directly to the merchant account and can process transactions.
	Inventory bool `json:"inventory"`
	// The unique identifier of the merchant account to which the terminal is reassigned.
	MerchantId *string `json:"merchantId,omitempty"`
	// The unique identifier of the store to which the terminal is reassigned.
	StoreId *string `json:"storeId,omitempty"`
}

// NewTerminalReassignmentTarget instantiates a new TerminalReassignmentTarget 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 NewTerminalReassignmentTarget(inventory bool) *TerminalReassignmentTarget {
	this := TerminalReassignmentTarget{}
	this.Inventory = inventory
	return &this
}

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

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

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

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

	return false
}

// SetCompanyId gets a reference to the given string and assigns it to the CompanyId field.
func (o *TerminalReassignmentTarget) SetCompanyId(v string) {
	o.CompanyId = &v
}

// GetInventory returns the Inventory field value
func (o *TerminalReassignmentTarget) GetInventory() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.Inventory
}

// GetInventoryOk returns a tuple with the Inventory field value
// and a boolean to check if the value has been set.
func (o *TerminalReassignmentTarget) GetInventoryOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Inventory, true
}

// SetInventory sets field value
func (o *TerminalReassignmentTarget) SetInventory(v bool) {
	o.Inventory = v
}

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

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

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

	return false
}

// SetMerchantId gets a reference to the given string and assigns it to the MerchantId field.
func (o *TerminalReassignmentTarget) SetMerchantId(v string) {
	o.MerchantId = &v
}

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

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

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

	return false
}

// SetStoreId gets a reference to the given string and assigns it to the StoreId field.
func (o *TerminalReassignmentTarget) SetStoreId(v string) {
	o.StoreId = &v
}

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

func (o TerminalReassignmentTarget) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.CompanyId) {
		toSerialize["companyId"] = o.CompanyId
	}
	toSerialize["inventory"] = o.Inventory
	if !common.IsNil(o.MerchantId) {
		toSerialize["merchantId"] = o.MerchantId
	}
	if !common.IsNil(o.StoreId) {
		toSerialize["storeId"] = o.StoreId
	}
	return toSerialize, nil
}

type NullableTerminalReassignmentTarget struct {
	value *TerminalReassignmentTarget
	isSet bool
}

func (v NullableTerminalReassignmentTarget) Get() *TerminalReassignmentTarget {
	return v.value
}

func (v *NullableTerminalReassignmentTarget) Set(val *TerminalReassignmentTarget) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTerminalReassignmentTarget(val *TerminalReassignmentTarget) *NullableTerminalReassignmentTarget {
	return &NullableTerminalReassignmentTarget{value: val, isSet: true}
}

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

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