/*
Daytona Toolbox API

Daytona Toolbox API

API version: v0.0.0-dev
*/

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

package toolbox

import (
	"encoding/json"
)

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

// Chart struct for Chart
type Chart struct {
	Elements []ChartElement `json:"elements,omitempty"`
	Png *string `json:"png,omitempty"`
	Title *string `json:"title,omitempty"`
	Type *string `json:"type,omitempty"`
	XLabel *string `json:"x_label,omitempty"`
	XScale *string `json:"x_scale,omitempty"`
	XTickLabels []string `json:"x_tick_labels,omitempty"`
	XTicks []float32 `json:"x_ticks,omitempty"`
	YLabel *string `json:"y_label,omitempty"`
	YScale *string `json:"y_scale,omitempty"`
	YTickLabels []string `json:"y_tick_labels,omitempty"`
	YTicks []float32 `json:"y_ticks,omitempty"`
}

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

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

// GetElements returns the Elements field value if set, zero value otherwise.
func (o *Chart) GetElements() []ChartElement {
	if o == nil || IsNil(o.Elements) {
		var ret []ChartElement
		return ret
	}
	return o.Elements
}

// GetElementsOk returns a tuple with the Elements field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Chart) GetElementsOk() ([]ChartElement, bool) {
	if o == nil || IsNil(o.Elements) {
		return nil, false
	}
	return o.Elements, true
}

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

	return false
}

// SetElements gets a reference to the given []ChartElement and assigns it to the Elements field.
func (o *Chart) SetElements(v []ChartElement) {
	o.Elements = v
}

// GetPng returns the Png field value if set, zero value otherwise.
func (o *Chart) GetPng() string {
	if o == nil || IsNil(o.Png) {
		var ret string
		return ret
	}
	return *o.Png
}

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

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

	return false
}

// SetPng gets a reference to the given string and assigns it to the Png field.
func (o *Chart) SetPng(v string) {
	o.Png = &v
}

// GetTitle returns the Title field value if set, zero value otherwise.
func (o *Chart) GetTitle() string {
	if o == nil || IsNil(o.Title) {
		var ret string
		return ret
	}
	return *o.Title
}

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

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

	return false
}

// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *Chart) SetTitle(v string) {
	o.Title = &v
}

// GetType returns the Type field value if set, zero value otherwise.
func (o *Chart) GetType() string {
	if o == nil || IsNil(o.Type) {
		var ret string
		return ret
	}
	return *o.Type
}

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

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

	return false
}

// SetType gets a reference to the given string and assigns it to the Type field.
func (o *Chart) SetType(v string) {
	o.Type = &v
}

// GetXLabel returns the XLabel field value if set, zero value otherwise.
func (o *Chart) GetXLabel() string {
	if o == nil || IsNil(o.XLabel) {
		var ret string
		return ret
	}
	return *o.XLabel
}

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

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

	return false
}

// SetXLabel gets a reference to the given string and assigns it to the XLabel field.
func (o *Chart) SetXLabel(v string) {
	o.XLabel = &v
}

// GetXScale returns the XScale field value if set, zero value otherwise.
func (o *Chart) GetXScale() string {
	if o == nil || IsNil(o.XScale) {
		var ret string
		return ret
	}
	return *o.XScale
}

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

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

	return false
}

// SetXScale gets a reference to the given string and assigns it to the XScale field.
func (o *Chart) SetXScale(v string) {
	o.XScale = &v
}

// GetXTickLabels returns the XTickLabels field value if set, zero value otherwise.
func (o *Chart) GetXTickLabels() []string {
	if o == nil || IsNil(o.XTickLabels) {
		var ret []string
		return ret
	}
	return o.XTickLabels
}

// GetXTickLabelsOk returns a tuple with the XTickLabels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Chart) GetXTickLabelsOk() ([]string, bool) {
	if o == nil || IsNil(o.XTickLabels) {
		return nil, false
	}
	return o.XTickLabels, true
}

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

	return false
}

// SetXTickLabels gets a reference to the given []string and assigns it to the XTickLabels field.
func (o *Chart) SetXTickLabels(v []string) {
	o.XTickLabels = v
}

// GetXTicks returns the XTicks field value if set, zero value otherwise.
func (o *Chart) GetXTicks() []float32 {
	if o == nil || IsNil(o.XTicks) {
		var ret []float32
		return ret
	}
	return o.XTicks
}

// GetXTicksOk returns a tuple with the XTicks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Chart) GetXTicksOk() ([]float32, bool) {
	if o == nil || IsNil(o.XTicks) {
		return nil, false
	}
	return o.XTicks, true
}

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

	return false
}

// SetXTicks gets a reference to the given []float32 and assigns it to the XTicks field.
func (o *Chart) SetXTicks(v []float32) {
	o.XTicks = v
}

// GetYLabel returns the YLabel field value if set, zero value otherwise.
func (o *Chart) GetYLabel() string {
	if o == nil || IsNil(o.YLabel) {
		var ret string
		return ret
	}
	return *o.YLabel
}

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

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

	return false
}

// SetYLabel gets a reference to the given string and assigns it to the YLabel field.
func (o *Chart) SetYLabel(v string) {
	o.YLabel = &v
}

// GetYScale returns the YScale field value if set, zero value otherwise.
func (o *Chart) GetYScale() string {
	if o == nil || IsNil(o.YScale) {
		var ret string
		return ret
	}
	return *o.YScale
}

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

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

	return false
}

// SetYScale gets a reference to the given string and assigns it to the YScale field.
func (o *Chart) SetYScale(v string) {
	o.YScale = &v
}

// GetYTickLabels returns the YTickLabels field value if set, zero value otherwise.
func (o *Chart) GetYTickLabels() []string {
	if o == nil || IsNil(o.YTickLabels) {
		var ret []string
		return ret
	}
	return o.YTickLabels
}

// GetYTickLabelsOk returns a tuple with the YTickLabels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Chart) GetYTickLabelsOk() ([]string, bool) {
	if o == nil || IsNil(o.YTickLabels) {
		return nil, false
	}
	return o.YTickLabels, true
}

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

	return false
}

// SetYTickLabels gets a reference to the given []string and assigns it to the YTickLabels field.
func (o *Chart) SetYTickLabels(v []string) {
	o.YTickLabels = v
}

// GetYTicks returns the YTicks field value if set, zero value otherwise.
func (o *Chart) GetYTicks() []float32 {
	if o == nil || IsNil(o.YTicks) {
		var ret []float32
		return ret
	}
	return o.YTicks
}

// GetYTicksOk returns a tuple with the YTicks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Chart) GetYTicksOk() ([]float32, bool) {
	if o == nil || IsNil(o.YTicks) {
		return nil, false
	}
	return o.YTicks, true
}

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

	return false
}

// SetYTicks gets a reference to the given []float32 and assigns it to the YTicks field.
func (o *Chart) SetYTicks(v []float32) {
	o.YTicks = v
}

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

func (o Chart) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Elements) {
		toSerialize["elements"] = o.Elements
	}
	if !IsNil(o.Png) {
		toSerialize["png"] = o.Png
	}
	if !IsNil(o.Title) {
		toSerialize["title"] = o.Title
	}
	if !IsNil(o.Type) {
		toSerialize["type"] = o.Type
	}
	if !IsNil(o.XLabel) {
		toSerialize["x_label"] = o.XLabel
	}
	if !IsNil(o.XScale) {
		toSerialize["x_scale"] = o.XScale
	}
	if !IsNil(o.XTickLabels) {
		toSerialize["x_tick_labels"] = o.XTickLabels
	}
	if !IsNil(o.XTicks) {
		toSerialize["x_ticks"] = o.XTicks
	}
	if !IsNil(o.YLabel) {
		toSerialize["y_label"] = o.YLabel
	}
	if !IsNil(o.YScale) {
		toSerialize["y_scale"] = o.YScale
	}
	if !IsNil(o.YTickLabels) {
		toSerialize["y_tick_labels"] = o.YTickLabels
	}
	if !IsNil(o.YTicks) {
		toSerialize["y_ticks"] = o.YTicks
	}
	return toSerialize, nil
}

type NullableChart struct {
	value *Chart
	isSet bool
}

func (v NullableChart) Get() *Chart {
	return v.value
}

func (v *NullableChart) Set(val *Chart) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableChart(val *Chart) *NullableChart {
	return &NullableChart{value: val, isSet: true}
}

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

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


