/*
Merlin

API Guide for accessing Merlin's model management, deployment, and serving functionalities

API version: 0.14.0
*/

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

package client

import (
	"encoding/json"
)

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

// GPUConfig struct for GPUConfig
type GPUConfig struct {
	Name                 *string            `json:"name,omitempty"`
	Values               []string           `json:"values,omitempty"`
	ResourceType         *string            `json:"resource_type,omitempty"`
	NodeSelector         *map[string]string `json:"node_selector,omitempty"`
	Tolerations          []GPUToleration    `json:"tolerations,omitempty"`
	MinMonthlyCostPerGpu *float32           `json:"min_monthly_cost_per_gpu,omitempty"`
	MaxMonthlyCostPerGpu *float32           `json:"max_monthly_cost_per_gpu,omitempty"`
}

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

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

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

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

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

	return false
}

// SetName gets a reference to the given string and assigns it to the Name field.
func (o *GPUConfig) SetName(v string) {
	o.Name = &v
}

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

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

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

	return false
}

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

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

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

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

	return false
}

// SetResourceType gets a reference to the given string and assigns it to the ResourceType field.
func (o *GPUConfig) SetResourceType(v string) {
	o.ResourceType = &v
}

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

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

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

	return false
}

// SetNodeSelector gets a reference to the given map[string]string and assigns it to the NodeSelector field.
func (o *GPUConfig) SetNodeSelector(v map[string]string) {
	o.NodeSelector = &v
}

// GetTolerations returns the Tolerations field value if set, zero value otherwise.
func (o *GPUConfig) GetTolerations() []GPUToleration {
	if o == nil || IsNil(o.Tolerations) {
		var ret []GPUToleration
		return ret
	}
	return o.Tolerations
}

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

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

	return false
}

// SetTolerations gets a reference to the given []GPUToleration and assigns it to the Tolerations field.
func (o *GPUConfig) SetTolerations(v []GPUToleration) {
	o.Tolerations = v
}

// GetMinMonthlyCostPerGpu returns the MinMonthlyCostPerGpu field value if set, zero value otherwise.
func (o *GPUConfig) GetMinMonthlyCostPerGpu() float32 {
	if o == nil || IsNil(o.MinMonthlyCostPerGpu) {
		var ret float32
		return ret
	}
	return *o.MinMonthlyCostPerGpu
}

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

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

	return false
}

// SetMinMonthlyCostPerGpu gets a reference to the given float32 and assigns it to the MinMonthlyCostPerGpu field.
func (o *GPUConfig) SetMinMonthlyCostPerGpu(v float32) {
	o.MinMonthlyCostPerGpu = &v
}

// GetMaxMonthlyCostPerGpu returns the MaxMonthlyCostPerGpu field value if set, zero value otherwise.
func (o *GPUConfig) GetMaxMonthlyCostPerGpu() float32 {
	if o == nil || IsNil(o.MaxMonthlyCostPerGpu) {
		var ret float32
		return ret
	}
	return *o.MaxMonthlyCostPerGpu
}

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

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

	return false
}

// SetMaxMonthlyCostPerGpu gets a reference to the given float32 and assigns it to the MaxMonthlyCostPerGpu field.
func (o *GPUConfig) SetMaxMonthlyCostPerGpu(v float32) {
	o.MaxMonthlyCostPerGpu = &v
}

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

func (o GPUConfig) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	if !IsNil(o.Values) {
		toSerialize["values"] = o.Values
	}
	if !IsNil(o.ResourceType) {
		toSerialize["resource_type"] = o.ResourceType
	}
	if !IsNil(o.NodeSelector) {
		toSerialize["node_selector"] = o.NodeSelector
	}
	if !IsNil(o.Tolerations) {
		toSerialize["tolerations"] = o.Tolerations
	}
	if !IsNil(o.MinMonthlyCostPerGpu) {
		toSerialize["min_monthly_cost_per_gpu"] = o.MinMonthlyCostPerGpu
	}
	if !IsNil(o.MaxMonthlyCostPerGpu) {
		toSerialize["max_monthly_cost_per_gpu"] = o.MaxMonthlyCostPerGpu
	}
	return toSerialize, nil
}

type NullableGPUConfig struct {
	value *GPUConfig
	isSet bool
}

func (v NullableGPUConfig) Get() *GPUConfig {
	return v.value
}

func (v *NullableGPUConfig) Set(val *GPUConfig) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableGPUConfig(val *GPUConfig) *NullableGPUConfig {
	return &NullableGPUConfig{value: val, isSet: true}
}

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

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