/*
FinFeedAPI Stock REST API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: v1
Contact: support@apibricks.io
*/

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

package openapi

import (
	"encoding/json"
	"time"
)

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

// AdminOfficialPriceModel Represents the response DTO for official price information
type AdminOfficialPriceModel struct {
	// The stock symbol
	Symbol NullableString `json:"symbol,omitempty"`
	// Original timestamp in nanoseconds since epoch
	TimestampNanos *int64 `json:"timestamp_nanos,omitempty"`
	// Time when the official price was recorded as DateTime
	Timestamp *time.Time `json:"timestamp,omitempty"`
	// Type of price as byte value
	PriceType *int32 `json:"price_type,omitempty"`
	// Type of price as character string
	PriceTypeCode NullableString `json:"price_type_code,omitempty"`
	// Human-readable description of the price type
	PriceTypeText NullableString `json:"price_type_text,omitempty"`
	// Indicates if the price type is 'IEX Official Opening Price' ('Q'/0x51).
	IsPriceTypeOpening *bool `json:"is_price_type_opening,omitempty"`
	// Indicates if the price type is 'IEX Official Closing Price' ('M'/0x4d).
	IsPriceTypeClosing *bool `json:"is_price_type_closing,omitempty"`
	// Official price as decimal
	OfficialPrice *float64 `json:"official_price,omitempty"`
}

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

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

// GetSymbol returns the Symbol field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminOfficialPriceModel) GetSymbol() string {
	if o == nil || IsNil(o.Symbol.Get()) {
		var ret string
		return ret
	}
	return *o.Symbol.Get()
}

// GetSymbolOk returns a tuple with the Symbol field value if set, nil otherwise
// 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 *AdminOfficialPriceModel) GetSymbolOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Symbol.Get(), o.Symbol.IsSet()
}

// HasSymbol returns a boolean if a field has been set.
func (o *AdminOfficialPriceModel) HasSymbol() bool {
	if o != nil && o.Symbol.IsSet() {
		return true
	}

	return false
}

// SetSymbol gets a reference to the given NullableString and assigns it to the Symbol field.
func (o *AdminOfficialPriceModel) SetSymbol(v string) {
	o.Symbol.Set(&v)
}
// SetSymbolNil sets the value for Symbol to be an explicit nil
func (o *AdminOfficialPriceModel) SetSymbolNil() {
	o.Symbol.Set(nil)
}

// UnsetSymbol ensures that no value is present for Symbol, not even an explicit nil
func (o *AdminOfficialPriceModel) UnsetSymbol() {
	o.Symbol.Unset()
}

// GetTimestampNanos returns the TimestampNanos field value if set, zero value otherwise.
func (o *AdminOfficialPriceModel) GetTimestampNanos() int64 {
	if o == nil || IsNil(o.TimestampNanos) {
		var ret int64
		return ret
	}
	return *o.TimestampNanos
}

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

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

	return false
}

// SetTimestampNanos gets a reference to the given int64 and assigns it to the TimestampNanos field.
func (o *AdminOfficialPriceModel) SetTimestampNanos(v int64) {
	o.TimestampNanos = &v
}

// GetTimestamp returns the Timestamp field value if set, zero value otherwise.
func (o *AdminOfficialPriceModel) GetTimestamp() time.Time {
	if o == nil || IsNil(o.Timestamp) {
		var ret time.Time
		return ret
	}
	return *o.Timestamp
}

// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AdminOfficialPriceModel) GetTimestampOk() (*time.Time, bool) {
	if o == nil || IsNil(o.Timestamp) {
		return nil, false
	}
	return o.Timestamp, true
}

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

	return false
}

// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field.
func (o *AdminOfficialPriceModel) SetTimestamp(v time.Time) {
	o.Timestamp = &v
}

// GetPriceType returns the PriceType field value if set, zero value otherwise.
func (o *AdminOfficialPriceModel) GetPriceType() int32 {
	if o == nil || IsNil(o.PriceType) {
		var ret int32
		return ret
	}
	return *o.PriceType
}

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

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

	return false
}

// SetPriceType gets a reference to the given int32 and assigns it to the PriceType field.
func (o *AdminOfficialPriceModel) SetPriceType(v int32) {
	o.PriceType = &v
}

// GetPriceTypeCode returns the PriceTypeCode field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminOfficialPriceModel) GetPriceTypeCode() string {
	if o == nil || IsNil(o.PriceTypeCode.Get()) {
		var ret string
		return ret
	}
	return *o.PriceTypeCode.Get()
}

// GetPriceTypeCodeOk returns a tuple with the PriceTypeCode field value if set, nil otherwise
// 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 *AdminOfficialPriceModel) GetPriceTypeCodeOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.PriceTypeCode.Get(), o.PriceTypeCode.IsSet()
}

// HasPriceTypeCode returns a boolean if a field has been set.
func (o *AdminOfficialPriceModel) HasPriceTypeCode() bool {
	if o != nil && o.PriceTypeCode.IsSet() {
		return true
	}

	return false
}

// SetPriceTypeCode gets a reference to the given NullableString and assigns it to the PriceTypeCode field.
func (o *AdminOfficialPriceModel) SetPriceTypeCode(v string) {
	o.PriceTypeCode.Set(&v)
}
// SetPriceTypeCodeNil sets the value for PriceTypeCode to be an explicit nil
func (o *AdminOfficialPriceModel) SetPriceTypeCodeNil() {
	o.PriceTypeCode.Set(nil)
}

// UnsetPriceTypeCode ensures that no value is present for PriceTypeCode, not even an explicit nil
func (o *AdminOfficialPriceModel) UnsetPriceTypeCode() {
	o.PriceTypeCode.Unset()
}

// GetPriceTypeText returns the PriceTypeText field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminOfficialPriceModel) GetPriceTypeText() string {
	if o == nil || IsNil(o.PriceTypeText.Get()) {
		var ret string
		return ret
	}
	return *o.PriceTypeText.Get()
}

// GetPriceTypeTextOk returns a tuple with the PriceTypeText field value if set, nil otherwise
// 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 *AdminOfficialPriceModel) GetPriceTypeTextOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.PriceTypeText.Get(), o.PriceTypeText.IsSet()
}

// HasPriceTypeText returns a boolean if a field has been set.
func (o *AdminOfficialPriceModel) HasPriceTypeText() bool {
	if o != nil && o.PriceTypeText.IsSet() {
		return true
	}

	return false
}

// SetPriceTypeText gets a reference to the given NullableString and assigns it to the PriceTypeText field.
func (o *AdminOfficialPriceModel) SetPriceTypeText(v string) {
	o.PriceTypeText.Set(&v)
}
// SetPriceTypeTextNil sets the value for PriceTypeText to be an explicit nil
func (o *AdminOfficialPriceModel) SetPriceTypeTextNil() {
	o.PriceTypeText.Set(nil)
}

// UnsetPriceTypeText ensures that no value is present for PriceTypeText, not even an explicit nil
func (o *AdminOfficialPriceModel) UnsetPriceTypeText() {
	o.PriceTypeText.Unset()
}

// GetIsPriceTypeOpening returns the IsPriceTypeOpening field value if set, zero value otherwise.
func (o *AdminOfficialPriceModel) GetIsPriceTypeOpening() bool {
	if o == nil || IsNil(o.IsPriceTypeOpening) {
		var ret bool
		return ret
	}
	return *o.IsPriceTypeOpening
}

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

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

	return false
}

// SetIsPriceTypeOpening gets a reference to the given bool and assigns it to the IsPriceTypeOpening field.
func (o *AdminOfficialPriceModel) SetIsPriceTypeOpening(v bool) {
	o.IsPriceTypeOpening = &v
}

// GetIsPriceTypeClosing returns the IsPriceTypeClosing field value if set, zero value otherwise.
func (o *AdminOfficialPriceModel) GetIsPriceTypeClosing() bool {
	if o == nil || IsNil(o.IsPriceTypeClosing) {
		var ret bool
		return ret
	}
	return *o.IsPriceTypeClosing
}

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

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

	return false
}

// SetIsPriceTypeClosing gets a reference to the given bool and assigns it to the IsPriceTypeClosing field.
func (o *AdminOfficialPriceModel) SetIsPriceTypeClosing(v bool) {
	o.IsPriceTypeClosing = &v
}

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

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

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

	return false
}

// SetOfficialPrice gets a reference to the given float64 and assigns it to the OfficialPrice field.
func (o *AdminOfficialPriceModel) SetOfficialPrice(v float64) {
	o.OfficialPrice = &v
}

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

func (o AdminOfficialPriceModel) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.Symbol.IsSet() {
		toSerialize["symbol"] = o.Symbol.Get()
	}
	if !IsNil(o.TimestampNanos) {
		toSerialize["timestamp_nanos"] = o.TimestampNanos
	}
	if !IsNil(o.Timestamp) {
		toSerialize["timestamp"] = o.Timestamp
	}
	if !IsNil(o.PriceType) {
		toSerialize["price_type"] = o.PriceType
	}
	if o.PriceTypeCode.IsSet() {
		toSerialize["price_type_code"] = o.PriceTypeCode.Get()
	}
	if o.PriceTypeText.IsSet() {
		toSerialize["price_type_text"] = o.PriceTypeText.Get()
	}
	if !IsNil(o.IsPriceTypeOpening) {
		toSerialize["is_price_type_opening"] = o.IsPriceTypeOpening
	}
	if !IsNil(o.IsPriceTypeClosing) {
		toSerialize["is_price_type_closing"] = o.IsPriceTypeClosing
	}
	if !IsNil(o.OfficialPrice) {
		toSerialize["official_price"] = o.OfficialPrice
	}
	return toSerialize, nil
}

type NullableAdminOfficialPriceModel struct {
	value *AdminOfficialPriceModel
	isSet bool
}

func (v NullableAdminOfficialPriceModel) Get() *AdminOfficialPriceModel {
	return v.value
}

func (v *NullableAdminOfficialPriceModel) Set(val *AdminOfficialPriceModel) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAdminOfficialPriceModel(val *AdminOfficialPriceModel) *NullableAdminOfficialPriceModel {
	return &NullableAdminOfficialPriceModel{value: val, isSet: true}
}

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

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


