/*
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"
	"time"
)

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

// Transformer struct for Transformer
type Transformer struct {
	Id              *string            `json:"id,omitempty"`
	Enabled         *bool              `json:"enabled,omitempty"`
	TransformerType *string            `json:"transformer_type,omitempty"`
	Image           *string            `json:"image,omitempty"`
	Command         *string            `json:"command,omitempty"`
	Args            *string            `json:"args,omitempty"`
	ResourceRequest *ResourceRequest   `json:"resource_request,omitempty"`
	EnvVars         []EnvVar           `json:"env_vars,omitempty"`
	Secrets         []MountedMLPSecret `json:"secrets,omitempty"`
	CreatedAt       *time.Time         `json:"created_at,omitempty"`
	UpdatedAt       *time.Time         `json:"updated_at,omitempty"`
}

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

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

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

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

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

	return false
}

// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Transformer) SetId(v string) {
	o.Id = &v
}

// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *Transformer) GetEnabled() bool {
	if o == nil || IsNil(o.Enabled) {
		var ret bool
		return ret
	}
	return *o.Enabled
}

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

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

	return false
}

// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *Transformer) SetEnabled(v bool) {
	o.Enabled = &v
}

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

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

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

	return false
}

// SetTransformerType gets a reference to the given string and assigns it to the TransformerType field.
func (o *Transformer) SetTransformerType(v string) {
	o.TransformerType = &v
}

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

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

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

	return false
}

// SetImage gets a reference to the given string and assigns it to the Image field.
func (o *Transformer) SetImage(v string) {
	o.Image = &v
}

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

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

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

	return false
}

// SetCommand gets a reference to the given string and assigns it to the Command field.
func (o *Transformer) SetCommand(v string) {
	o.Command = &v
}

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

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

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

	return false
}

// SetArgs gets a reference to the given string and assigns it to the Args field.
func (o *Transformer) SetArgs(v string) {
	o.Args = &v
}

// GetResourceRequest returns the ResourceRequest field value if set, zero value otherwise.
func (o *Transformer) GetResourceRequest() ResourceRequest {
	if o == nil || IsNil(o.ResourceRequest) {
		var ret ResourceRequest
		return ret
	}
	return *o.ResourceRequest
}

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

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

	return false
}

// SetResourceRequest gets a reference to the given ResourceRequest and assigns it to the ResourceRequest field.
func (o *Transformer) SetResourceRequest(v ResourceRequest) {
	o.ResourceRequest = &v
}

// GetEnvVars returns the EnvVars field value if set, zero value otherwise.
func (o *Transformer) GetEnvVars() []EnvVar {
	if o == nil || IsNil(o.EnvVars) {
		var ret []EnvVar
		return ret
	}
	return o.EnvVars
}

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

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

	return false
}

// SetEnvVars gets a reference to the given []EnvVar and assigns it to the EnvVars field.
func (o *Transformer) SetEnvVars(v []EnvVar) {
	o.EnvVars = v
}

// GetSecrets returns the Secrets field value if set, zero value otherwise.
func (o *Transformer) GetSecrets() []MountedMLPSecret {
	if o == nil || IsNil(o.Secrets) {
		var ret []MountedMLPSecret
		return ret
	}
	return o.Secrets
}

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

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

	return false
}

// SetSecrets gets a reference to the given []MountedMLPSecret and assigns it to the Secrets field.
func (o *Transformer) SetSecrets(v []MountedMLPSecret) {
	o.Secrets = v
}

// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *Transformer) GetCreatedAt() time.Time {
	if o == nil || IsNil(o.CreatedAt) {
		var ret time.Time
		return ret
	}
	return *o.CreatedAt
}

// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transformer) GetCreatedAtOk() (*time.Time, bool) {
	if o == nil || IsNil(o.CreatedAt) {
		return nil, false
	}
	return o.CreatedAt, true
}

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

	return false
}

// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *Transformer) SetCreatedAt(v time.Time) {
	o.CreatedAt = &v
}

// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *Transformer) GetUpdatedAt() time.Time {
	if o == nil || IsNil(o.UpdatedAt) {
		var ret time.Time
		return ret
	}
	return *o.UpdatedAt
}

// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Transformer) GetUpdatedAtOk() (*time.Time, bool) {
	if o == nil || IsNil(o.UpdatedAt) {
		return nil, false
	}
	return o.UpdatedAt, true
}

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

	return false
}

// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
func (o *Transformer) SetUpdatedAt(v time.Time) {
	o.UpdatedAt = &v
}

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

func (o Transformer) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.Enabled) {
		toSerialize["enabled"] = o.Enabled
	}
	if !IsNil(o.TransformerType) {
		toSerialize["transformer_type"] = o.TransformerType
	}
	if !IsNil(o.Image) {
		toSerialize["image"] = o.Image
	}
	if !IsNil(o.Command) {
		toSerialize["command"] = o.Command
	}
	if !IsNil(o.Args) {
		toSerialize["args"] = o.Args
	}
	if !IsNil(o.ResourceRequest) {
		toSerialize["resource_request"] = o.ResourceRequest
	}
	if !IsNil(o.EnvVars) {
		toSerialize["env_vars"] = o.EnvVars
	}
	if !IsNil(o.Secrets) {
		toSerialize["secrets"] = o.Secrets
	}
	if !IsNil(o.CreatedAt) {
		toSerialize["created_at"] = o.CreatedAt
	}
	if !IsNil(o.UpdatedAt) {
		toSerialize["updated_at"] = o.UpdatedAt
	}
	return toSerialize, nil
}

type NullableTransformer struct {
	value *Transformer
	isSet bool
}

func (v NullableTransformer) Get() *Transformer {
	return v.value
}

func (v *NullableTransformer) Set(val *Transformer) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTransformer(val *Transformer) *NullableTransformer {
	return &NullableTransformer{value: val, isSet: true}
}

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

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