/*
Exchange Rates Historical 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"
)

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

// V1Icon Represents an icon.
type V1Icon struct {
	// Gets or sets the exchange ID associated with the icon.
	ExchangeId NullableString `json:"exchange_id,omitempty"`
	// Gets or sets the asset ID associated with the icon.
	AssetId NullableString `json:"asset_id,omitempty"`
	// Gets or sets the URL of the icon.
	Url NullableString `json:"url,omitempty"`
}

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

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

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

// GetExchangeIdOk returns a tuple with the ExchangeId 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 *V1Icon) GetExchangeIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.ExchangeId.Get(), o.ExchangeId.IsSet()
}

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

	return false
}

// SetExchangeId gets a reference to the given NullableString and assigns it to the ExchangeId field.
func (o *V1Icon) SetExchangeId(v string) {
	o.ExchangeId.Set(&v)
}
// SetExchangeIdNil sets the value for ExchangeId to be an explicit nil
func (o *V1Icon) SetExchangeIdNil() {
	o.ExchangeId.Set(nil)
}

// UnsetExchangeId ensures that no value is present for ExchangeId, not even an explicit nil
func (o *V1Icon) UnsetExchangeId() {
	o.ExchangeId.Unset()
}

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

// GetAssetIdOk returns a tuple with the AssetId 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 *V1Icon) GetAssetIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.AssetId.Get(), o.AssetId.IsSet()
}

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

	return false
}

// SetAssetId gets a reference to the given NullableString and assigns it to the AssetId field.
func (o *V1Icon) SetAssetId(v string) {
	o.AssetId.Set(&v)
}
// SetAssetIdNil sets the value for AssetId to be an explicit nil
func (o *V1Icon) SetAssetIdNil() {
	o.AssetId.Set(nil)
}

// UnsetAssetId ensures that no value is present for AssetId, not even an explicit nil
func (o *V1Icon) UnsetAssetId() {
	o.AssetId.Unset()
}

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

// GetUrlOk returns a tuple with the Url 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 *V1Icon) GetUrlOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Url.Get(), o.Url.IsSet()
}

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

	return false
}

// SetUrl gets a reference to the given NullableString and assigns it to the Url field.
func (o *V1Icon) SetUrl(v string) {
	o.Url.Set(&v)
}
// SetUrlNil sets the value for Url to be an explicit nil
func (o *V1Icon) SetUrlNil() {
	o.Url.Set(nil)
}

// UnsetUrl ensures that no value is present for Url, not even an explicit nil
func (o *V1Icon) UnsetUrl() {
	o.Url.Unset()
}

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

func (o V1Icon) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.ExchangeId.IsSet() {
		toSerialize["exchange_id"] = o.ExchangeId.Get()
	}
	if o.AssetId.IsSet() {
		toSerialize["asset_id"] = o.AssetId.Get()
	}
	if o.Url.IsSet() {
		toSerialize["url"] = o.Url.Get()
	}
	return toSerialize, nil
}

type NullableV1Icon struct {
	value *V1Icon
	isSet bool
}

func (v NullableV1Icon) Get() *V1Icon {
	return v.value
}

func (v *NullableV1Icon) Set(val *V1Icon) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1Icon(val *V1Icon) *NullableV1Icon {
	return &NullableV1Icon{value: val, isSet: true}
}

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

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


