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

// MetadataExchange Represents an exchange.
type MetadataExchange struct {
	// Gets or sets the exchange ID.
	ExchangeId NullableString `json:"exchange_id,omitempty"`
	// Gets or sets the website URL of the exchange.
	Website NullableString `json:"website,omitempty"`
	// Gets or sets the name of the exchange.
	Name NullableString `json:"name,omitempty"`
}

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

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

// GetExchangeId returns the ExchangeId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MetadataExchange) 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 *MetadataExchange) 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 *MetadataExchange) 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 *MetadataExchange) SetExchangeId(v string) {
	o.ExchangeId.Set(&v)
}
// SetExchangeIdNil sets the value for ExchangeId to be an explicit nil
func (o *MetadataExchange) SetExchangeIdNil() {
	o.ExchangeId.Set(nil)
}

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

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

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

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

	return false
}

// SetWebsite gets a reference to the given NullableString and assigns it to the Website field.
func (o *MetadataExchange) SetWebsite(v string) {
	o.Website.Set(&v)
}
// SetWebsiteNil sets the value for Website to be an explicit nil
func (o *MetadataExchange) SetWebsiteNil() {
	o.Website.Set(nil)
}

// UnsetWebsite ensures that no value is present for Website, not even an explicit nil
func (o *MetadataExchange) UnsetWebsite() {
	o.Website.Unset()
}

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

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

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

	return false
}

// SetName gets a reference to the given NullableString and assigns it to the Name field.
func (o *MetadataExchange) SetName(v string) {
	o.Name.Set(&v)
}
// SetNameNil sets the value for Name to be an explicit nil
func (o *MetadataExchange) SetNameNil() {
	o.Name.Set(nil)
}

// UnsetName ensures that no value is present for Name, not even an explicit nil
func (o *MetadataExchange) UnsetName() {
	o.Name.Unset()
}

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

func (o MetadataExchange) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.ExchangeId.IsSet() {
		toSerialize["exchange_id"] = o.ExchangeId.Get()
	}
	if o.Website.IsSet() {
		toSerialize["website"] = o.Website.Get()
	}
	if o.Name.IsSet() {
		toSerialize["name"] = o.Name.Get()
	}
	return toSerialize, nil
}

type NullableMetadataExchange struct {
	value *MetadataExchange
	isSet bool
}

func (v NullableMetadataExchange) Get() *MetadataExchange {
	return v.value
}

func (v *NullableMetadataExchange) Set(val *MetadataExchange) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableMetadataExchange(val *MetadataExchange) *NullableMetadataExchange {
	return &NullableMetadataExchange{value: val, isSet: true}
}

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

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


