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

// V1MetricInfo Represents a metric information.
type V1MetricInfo struct {
	// Gets or sets the metric identifier.
	MetricId NullableString `json:"metric_id,omitempty"`
	// Gets or sets the description of the metric.
	Description NullableString `json:"description,omitempty"`
	// Gets or sets the source identifier of the metric.
	SourceId NullableString `json:"source_id,omitempty"`
}

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

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

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

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

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

	return false
}

// SetMetricId gets a reference to the given NullableString and assigns it to the MetricId field.
func (o *V1MetricInfo) SetMetricId(v string) {
	o.MetricId.Set(&v)
}
// SetMetricIdNil sets the value for MetricId to be an explicit nil
func (o *V1MetricInfo) SetMetricIdNil() {
	o.MetricId.Set(nil)
}

// UnsetMetricId ensures that no value is present for MetricId, not even an explicit nil
func (o *V1MetricInfo) UnsetMetricId() {
	o.MetricId.Unset()
}

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

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

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

	return false
}

// SetDescription gets a reference to the given NullableString and assigns it to the Description field.
func (o *V1MetricInfo) SetDescription(v string) {
	o.Description.Set(&v)
}
// SetDescriptionNil sets the value for Description to be an explicit nil
func (o *V1MetricInfo) SetDescriptionNil() {
	o.Description.Set(nil)
}

// UnsetDescription ensures that no value is present for Description, not even an explicit nil
func (o *V1MetricInfo) UnsetDescription() {
	o.Description.Unset()
}

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

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

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

	return false
}

// SetSourceId gets a reference to the given NullableString and assigns it to the SourceId field.
func (o *V1MetricInfo) SetSourceId(v string) {
	o.SourceId.Set(&v)
}
// SetSourceIdNil sets the value for SourceId to be an explicit nil
func (o *V1MetricInfo) SetSourceIdNil() {
	o.SourceId.Set(nil)
}

// UnsetSourceId ensures that no value is present for SourceId, not even an explicit nil
func (o *V1MetricInfo) UnsetSourceId() {
	o.SourceId.Unset()
}

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

func (o V1MetricInfo) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.MetricId.IsSet() {
		toSerialize["metric_id"] = o.MetricId.Get()
	}
	if o.Description.IsSet() {
		toSerialize["description"] = o.Description.Get()
	}
	if o.SourceId.IsSet() {
		toSerialize["source_id"] = o.SourceId.Get()
	}
	return toSerialize, nil
}

type NullableV1MetricInfo struct {
	value *V1MetricInfo
	isSet bool
}

func (v NullableV1MetricInfo) Get() *V1MetricInfo {
	return v.value
}

func (v *NullableV1MetricInfo) Set(val *V1MetricInfo) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1MetricInfo(val *V1MetricInfo) *NullableV1MetricInfo {
	return &NullableV1MetricInfo{value: val, isSet: true}
}

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

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


