/*
 * CLOUD API
 *
 *  IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool.    Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on.
 *
 * API version: 6.0
 */

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

package ionoscloud

import (
	"encoding/json"
)

// GpuTemplate struct for GpuTemplate
type GpuTemplate struct {
	// The name of the vendor
	Vendor *string `json:"vendor,omitempty"`
	// The name of the GPU card model
	Model *string `json:"model,omitempty"`
	// The way the Graphics Processing Unit (GPU) card will function. The 'passthrough' type means that the Server will be connected to the GPU directly (e.g. no virtualization involved).
	Type *string `json:"type,omitempty"`
	// The number of GPUs to be provisioned
	Count *int32 `json:"count,omitempty"`
}

// NewGpuTemplate instantiates a new GpuTemplate 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 NewGpuTemplate() *GpuTemplate {
	this := GpuTemplate{}

	return &this
}

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

// GetVendor returns the Vendor field value
// If the value is explicit nil, nil is returned
func (o *GpuTemplate) GetVendor() *string {
	if o == nil {
		return nil
	}

	return o.Vendor

}

// GetVendorOk returns a tuple with the Vendor field value
// 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 *GpuTemplate) GetVendorOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Vendor, true
}

// SetVendor sets field value
func (o *GpuTemplate) SetVendor(v string) {

	o.Vendor = &v

}

// HasVendor returns a boolean if a field has been set.
func (o *GpuTemplate) HasVendor() bool {
	if o != nil && o.Vendor != nil {
		return true
	}

	return false
}

// GetModel returns the Model field value
// If the value is explicit nil, nil is returned
func (o *GpuTemplate) GetModel() *string {
	if o == nil {
		return nil
	}

	return o.Model

}

// GetModelOk returns a tuple with the Model field value
// 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 *GpuTemplate) GetModelOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Model, true
}

// SetModel sets field value
func (o *GpuTemplate) SetModel(v string) {

	o.Model = &v

}

// HasModel returns a boolean if a field has been set.
func (o *GpuTemplate) HasModel() bool {
	if o != nil && o.Model != nil {
		return true
	}

	return false
}

// GetType returns the Type field value
// If the value is explicit nil, nil is returned
func (o *GpuTemplate) GetType() *string {
	if o == nil {
		return nil
	}

	return o.Type

}

// GetTypeOk returns a tuple with the Type field value
// 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 *GpuTemplate) GetTypeOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Type, true
}

// SetType sets field value
func (o *GpuTemplate) SetType(v string) {

	o.Type = &v

}

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

	return false
}

// GetCount returns the Count field value
// If the value is explicit nil, nil is returned
func (o *GpuTemplate) GetCount() *int32 {
	if o == nil {
		return nil
	}

	return o.Count

}

// GetCountOk returns a tuple with the Count field value
// 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 *GpuTemplate) GetCountOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}

	return o.Count, true
}

// SetCount sets field value
func (o *GpuTemplate) SetCount(v int32) {

	o.Count = &v

}

// HasCount returns a boolean if a field has been set.
func (o *GpuTemplate) HasCount() bool {
	if o != nil && o.Count != nil {
		return true
	}

	return false
}

func (o GpuTemplate) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Vendor != nil {
		toSerialize["vendor"] = o.Vendor
	}

	if o.Model != nil {
		toSerialize["model"] = o.Model
	}

	if o.Type != nil {
		toSerialize["type"] = o.Type
	}

	if o.Count != nil {
		toSerialize["count"] = o.Count
	}

	return json.Marshal(toSerialize)
}

type NullableGpuTemplate struct {
	value *GpuTemplate
	isSet bool
}

func (v NullableGpuTemplate) Get() *GpuTemplate {
	return v.value
}

func (v *NullableGpuTemplate) Set(val *GpuTemplate) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableGpuTemplate(val *GpuTemplate) *NullableGpuTemplate {
	return &NullableGpuTemplate{value: val, isSet: true}
}

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

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