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

// V1ChainNetworkAddress Contains information about assets' chain network addresses
type V1ChainNetworkAddress struct {
	// Gets or sets chain id
	ChainId NullableString `json:"chain_id,omitempty"`
	// Gets or sets network id
	NetworkId NullableString `json:"network_id,omitempty"`
	// Gets or sets chain address
	Address NullableString `json:"address,omitempty"`
}

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

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

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

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

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

	return false
}

// SetChainId gets a reference to the given NullableString and assigns it to the ChainId field.
func (o *V1ChainNetworkAddress) SetChainId(v string) {
	o.ChainId.Set(&v)
}
// SetChainIdNil sets the value for ChainId to be an explicit nil
func (o *V1ChainNetworkAddress) SetChainIdNil() {
	o.ChainId.Set(nil)
}

// UnsetChainId ensures that no value is present for ChainId, not even an explicit nil
func (o *V1ChainNetworkAddress) UnsetChainId() {
	o.ChainId.Unset()
}

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

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

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

	return false
}

// SetNetworkId gets a reference to the given NullableString and assigns it to the NetworkId field.
func (o *V1ChainNetworkAddress) SetNetworkId(v string) {
	o.NetworkId.Set(&v)
}
// SetNetworkIdNil sets the value for NetworkId to be an explicit nil
func (o *V1ChainNetworkAddress) SetNetworkIdNil() {
	o.NetworkId.Set(nil)
}

// UnsetNetworkId ensures that no value is present for NetworkId, not even an explicit nil
func (o *V1ChainNetworkAddress) UnsetNetworkId() {
	o.NetworkId.Unset()
}

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

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

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

	return false
}

// SetAddress gets a reference to the given NullableString and assigns it to the Address field.
func (o *V1ChainNetworkAddress) SetAddress(v string) {
	o.Address.Set(&v)
}
// SetAddressNil sets the value for Address to be an explicit nil
func (o *V1ChainNetworkAddress) SetAddressNil() {
	o.Address.Set(nil)
}

// UnsetAddress ensures that no value is present for Address, not even an explicit nil
func (o *V1ChainNetworkAddress) UnsetAddress() {
	o.Address.Unset()
}

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

func (o V1ChainNetworkAddress) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.ChainId.IsSet() {
		toSerialize["chain_id"] = o.ChainId.Get()
	}
	if o.NetworkId.IsSet() {
		toSerialize["network_id"] = o.NetworkId.Get()
	}
	if o.Address.IsSet() {
		toSerialize["address"] = o.Address.Get()
	}
	return toSerialize, nil
}

type NullableV1ChainNetworkAddress struct {
	value *V1ChainNetworkAddress
	isSet bool
}

func (v NullableV1ChainNetworkAddress) Get() *V1ChainNetworkAddress {
	return v.value
}

func (v *NullableV1ChainNetworkAddress) Set(val *V1ChainNetworkAddress) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1ChainNetworkAddress(val *V1ChainNetworkAddress) *NullableV1ChainNetworkAddress {
	return &NullableV1ChainNetworkAddress{value: val, isSet: true}
}

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

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


