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

// TerminalReassignmentRequest struct for TerminalReassignmentRequest
type TerminalReassignmentRequest struct {
	// The unique identifier of the company account to which the terminal is reassigned.
	CompanyId *string `json:"companyId,omitempty"`
	// Must be specified when reassigning terminals to a merchant account:  - If set to **true**, reassigns terminals to the inventory of the merchant account and the terminals cannot process transactions.  - If set to **false**, reassigns terminals directly to the merchant account and the terminals can process transactions.
	Inventory *bool `json:"inventory,omitempty"`
	// The unique identifier of the merchant account to which the terminal is reassigned. When reassigning terminals to a merchant account, you must specify the `inventory` field.
	MerchantId *string `json:"merchantId,omitempty"`
	// The unique identifier of the store to which the terminal is reassigned.
	StoreId *string `json:"storeId,omitempty"`
}

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

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

// GetCompanyId returns the CompanyId field value if set, zero value otherwise.
func (o *TerminalReassignmentRequest) 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 *TerminalReassignmentRequest) 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 *TerminalReassignmentRequest) 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 *TerminalReassignmentRequest) SetCompanyId(v string) {
	o.CompanyId = &v
}

// GetInventory returns the Inventory field value if set, zero value otherwise.
func (o *TerminalReassignmentRequest) GetInventory() bool {
	if o == nil || common.IsNil(o.Inventory) {
		var ret bool
		return ret
	}
	return *o.Inventory
}

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

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

	return false
}

// SetInventory gets a reference to the given bool and assigns it to the Inventory field.
func (o *TerminalReassignmentRequest) SetInventory(v bool) {
	o.Inventory = &v
}

// GetMerchantId returns the MerchantId field value if set, zero value otherwise.
func (o *TerminalReassignmentRequest) 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 *TerminalReassignmentRequest) 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 *TerminalReassignmentRequest) 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 *TerminalReassignmentRequest) SetMerchantId(v string) {
	o.MerchantId = &v
}

// GetStoreId returns the StoreId field value if set, zero value otherwise.
func (o *TerminalReassignmentRequest) 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 *TerminalReassignmentRequest) 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 *TerminalReassignmentRequest) 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 *TerminalReassignmentRequest) SetStoreId(v string) {
	o.StoreId = &v
}

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

func (o TerminalReassignmentRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.CompanyId) {
		toSerialize["companyId"] = o.CompanyId
	}
	if !common.IsNil(o.Inventory) {
		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 NullableTerminalReassignmentRequest struct {
	value *TerminalReassignmentRequest
	isSet bool
}

func (v NullableTerminalReassignmentRequest) Get() *TerminalReassignmentRequest {
	return v.value
}

func (v *NullableTerminalReassignmentRequest) Set(val *TerminalReassignmentRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTerminalReassignmentRequest(val *TerminalReassignmentRequest) *NullableTerminalReassignmentRequest {
	return &NullableTerminalReassignmentRequest{value: val, isSet: true}
}

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

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