/*
OPEN OUTCRY API

# Introduction This API is documented in **OpenAPI 3.0 format**.  This API the following operations: * Retrieve a list of available instruments * Retrieve a list of executed trades  # Basics * API calls have to be secured with HTTPS. * All data has to be submitted UTF-8 encoded. * The reply is sent JSON encoded.

API version: 1.0.0
*/

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

package api

import (
	"encoding/json"
)

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

// PaymentAccount Payment account available to user
type PaymentAccount struct {
	Id *string `json:"id,omitempty"`
	// ISO 4217 Currency symbol
	Currency        *string  `json:"currency,omitempty"`
	Amount          *float64 `json:"amount,omitempty"`
	AmountReserved  *float64 `json:"amountReserved,omitempty"`
	AmountAvailable *float64 `json:"amountAvailable,omitempty"`
}

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

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

// GetId returns the Id field value if set, zero value otherwise.
func (o *PaymentAccount) GetId() string {
	if o == nil || IsNil(o.Id) {
		var ret string
		return ret
	}
	return *o.Id
}

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

// HasId returns a boolean if a field has been set.
func (o *PaymentAccount) HasId() bool {
	if o != nil && !IsNil(o.Id) {
		return true
	}

	return false
}

// SetId gets a reference to the given string and assigns it to the Id field.
func (o *PaymentAccount) SetId(v string) {
	o.Id = &v
}

// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *PaymentAccount) GetCurrency() string {
	if o == nil || IsNil(o.Currency) {
		var ret string
		return ret
	}
	return *o.Currency
}

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

// HasCurrency returns a boolean if a field has been set.
func (o *PaymentAccount) HasCurrency() bool {
	if o != nil && !IsNil(o.Currency) {
		return true
	}

	return false
}

// SetCurrency gets a reference to the given string and assigns it to the Currency field.
func (o *PaymentAccount) SetCurrency(v string) {
	o.Currency = &v
}

// GetAmount returns the Amount field value if set, zero value otherwise.
func (o *PaymentAccount) GetAmount() float64 {
	if o == nil || IsNil(o.Amount) {
		var ret float64
		return ret
	}
	return *o.Amount
}

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

// HasAmount returns a boolean if a field has been set.
func (o *PaymentAccount) HasAmount() bool {
	if o != nil && !IsNil(o.Amount) {
		return true
	}

	return false
}

// SetAmount gets a reference to the given float64 and assigns it to the Amount field.
func (o *PaymentAccount) SetAmount(v float64) {
	o.Amount = &v
}

// GetAmountReserved returns the AmountReserved field value if set, zero value otherwise.
func (o *PaymentAccount) GetAmountReserved() float64 {
	if o == nil || IsNil(o.AmountReserved) {
		var ret float64
		return ret
	}
	return *o.AmountReserved
}

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

// HasAmountReserved returns a boolean if a field has been set.
func (o *PaymentAccount) HasAmountReserved() bool {
	if o != nil && !IsNil(o.AmountReserved) {
		return true
	}

	return false
}

// SetAmountReserved gets a reference to the given float64 and assigns it to the AmountReserved field.
func (o *PaymentAccount) SetAmountReserved(v float64) {
	o.AmountReserved = &v
}

// GetAmountAvailable returns the AmountAvailable field value if set, zero value otherwise.
func (o *PaymentAccount) GetAmountAvailable() float64 {
	if o == nil || IsNil(o.AmountAvailable) {
		var ret float64
		return ret
	}
	return *o.AmountAvailable
}

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

// HasAmountAvailable returns a boolean if a field has been set.
func (o *PaymentAccount) HasAmountAvailable() bool {
	if o != nil && !IsNil(o.AmountAvailable) {
		return true
	}

	return false
}

// SetAmountAvailable gets a reference to the given float64 and assigns it to the AmountAvailable field.
func (o *PaymentAccount) SetAmountAvailable(v float64) {
	o.AmountAvailable = &v
}

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

func (o PaymentAccount) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.Currency) {
		toSerialize["currency"] = o.Currency
	}
	if !IsNil(o.Amount) {
		toSerialize["amount"] = o.Amount
	}
	if !IsNil(o.AmountReserved) {
		toSerialize["amountReserved"] = o.AmountReserved
	}
	if !IsNil(o.AmountAvailable) {
		toSerialize["amountAvailable"] = o.AmountAvailable
	}
	return toSerialize, nil
}

type NullablePaymentAccount struct {
	value *PaymentAccount
	isSet bool
}

func (v NullablePaymentAccount) Get() *PaymentAccount {
	return v.value
}

func (v *NullablePaymentAccount) Set(val *PaymentAccount) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullablePaymentAccount(val *PaymentAccount) *NullablePaymentAccount {
	return &NullablePaymentAccount{value: val, isSet: true}
}

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

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