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

// CustomPredictor struct for CustomPredictor
type CustomPredictor struct {
	Image   *string `json:"image,omitempty"`
	Command *string `json:"command,omitempty"`
	Args    *string `json:"args,omitempty"`
}

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

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

// GetImage returns the Image field value if set, zero value otherwise.
func (o *CustomPredictor) 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 *CustomPredictor) 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 *CustomPredictor) 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 *CustomPredictor) SetImage(v string) {
	o.Image = &v
}

// GetCommand returns the Command field value if set, zero value otherwise.
func (o *CustomPredictor) 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 *CustomPredictor) 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 *CustomPredictor) 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 *CustomPredictor) SetCommand(v string) {
	o.Command = &v
}

// GetArgs returns the Args field value if set, zero value otherwise.
func (o *CustomPredictor) 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 *CustomPredictor) 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 *CustomPredictor) 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 *CustomPredictor) SetArgs(v string) {
	o.Args = &v
}

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

func (o CustomPredictor) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Image) {
		toSerialize["image"] = o.Image
	}
	if !IsNil(o.Command) {
		toSerialize["command"] = o.Command
	}
	if !IsNil(o.Args) {
		toSerialize["args"] = o.Args
	}
	return toSerialize, nil
}

type NullableCustomPredictor struct {
	value *CustomPredictor
	isSet bool
}

func (v NullableCustomPredictor) Get() *CustomPredictor {
	return v.value
}

func (v *NullableCustomPredictor) Set(val *CustomPredictor) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCustomPredictor(val *CustomPredictor) *NullableCustomPredictor {
	return &NullableCustomPredictor{value: val, isSet: true}
}

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

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