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

// PredictionJob struct for PredictionJob
type PredictionJob struct {
	Id              *int32       `json:"id,omitempty"`
	Name            *string      `json:"name,omitempty"`
	VersionId       *int32       `json:"version_id,omitempty"`
	ModelId         *int32       `json:"model_id,omitempty"`
	ProjectId       *int32       `json:"project_id,omitempty"`
	EnvironmentName *string      `json:"environment_name,omitempty"`
	Environment     *Environment `json:"environment,omitempty"`
	Config          *Config      `json:"config,omitempty"`
	Status          *string      `json:"status,omitempty"`
	Error           *string      `json:"error,omitempty"`
	CreatedAt       *time.Time   `json:"created_at,omitempty"`
	UpdatedAt       *time.Time   `json:"updated_at,omitempty"`
}

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

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

// GetId returns the Id field value if set, zero value otherwise.
func (o *PredictionJob) GetId() int32 {
	if o == nil || IsNil(o.Id) {
		var ret int32
		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 *PredictionJob) GetIdOk() (*int32, 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 *PredictionJob) HasId() bool {
	if o != nil && !IsNil(o.Id) {
		return true
	}

	return false
}

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

// GetName returns the Name field value if set, zero value otherwise.
func (o *PredictionJob) 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 *PredictionJob) 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 *PredictionJob) 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 *PredictionJob) SetName(v string) {
	o.Name = &v
}

// GetVersionId returns the VersionId field value if set, zero value otherwise.
func (o *PredictionJob) GetVersionId() int32 {
	if o == nil || IsNil(o.VersionId) {
		var ret int32
		return ret
	}
	return *o.VersionId
}

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

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

	return false
}

// SetVersionId gets a reference to the given int32 and assigns it to the VersionId field.
func (o *PredictionJob) SetVersionId(v int32) {
	o.VersionId = &v
}

// GetModelId returns the ModelId field value if set, zero value otherwise.
func (o *PredictionJob) GetModelId() int32 {
	if o == nil || IsNil(o.ModelId) {
		var ret int32
		return ret
	}
	return *o.ModelId
}

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

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

	return false
}

// SetModelId gets a reference to the given int32 and assigns it to the ModelId field.
func (o *PredictionJob) SetModelId(v int32) {
	o.ModelId = &v
}

// GetProjectId returns the ProjectId field value if set, zero value otherwise.
func (o *PredictionJob) GetProjectId() int32 {
	if o == nil || IsNil(o.ProjectId) {
		var ret int32
		return ret
	}
	return *o.ProjectId
}

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

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

	return false
}

// SetProjectId gets a reference to the given int32 and assigns it to the ProjectId field.
func (o *PredictionJob) SetProjectId(v int32) {
	o.ProjectId = &v
}

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

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

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

	return false
}

// SetEnvironmentName gets a reference to the given string and assigns it to the EnvironmentName field.
func (o *PredictionJob) SetEnvironmentName(v string) {
	o.EnvironmentName = &v
}

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

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

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

	return false
}

// SetEnvironment gets a reference to the given Environment and assigns it to the Environment field.
func (o *PredictionJob) SetEnvironment(v Environment) {
	o.Environment = &v
}

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

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

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

	return false
}

// SetConfig gets a reference to the given Config and assigns it to the Config field.
func (o *PredictionJob) SetConfig(v Config) {
	o.Config = &v
}

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

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

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

	return false
}

// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *PredictionJob) SetStatus(v string) {
	o.Status = &v
}

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

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

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

	return false
}

// SetError gets a reference to the given string and assigns it to the Error field.
func (o *PredictionJob) SetError(v string) {
	o.Error = &v
}

// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *PredictionJob) 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 *PredictionJob) 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 *PredictionJob) 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 *PredictionJob) SetCreatedAt(v time.Time) {
	o.CreatedAt = &v
}

// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *PredictionJob) 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 *PredictionJob) 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 *PredictionJob) 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 *PredictionJob) SetUpdatedAt(v time.Time) {
	o.UpdatedAt = &v
}

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

func (o PredictionJob) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	if !IsNil(o.VersionId) {
		toSerialize["version_id"] = o.VersionId
	}
	if !IsNil(o.ModelId) {
		toSerialize["model_id"] = o.ModelId
	}
	if !IsNil(o.ProjectId) {
		toSerialize["project_id"] = o.ProjectId
	}
	if !IsNil(o.EnvironmentName) {
		toSerialize["environment_name"] = o.EnvironmentName
	}
	if !IsNil(o.Environment) {
		toSerialize["environment"] = o.Environment
	}
	if !IsNil(o.Config) {
		toSerialize["config"] = o.Config
	}
	if !IsNil(o.Status) {
		toSerialize["status"] = o.Status
	}
	if !IsNil(o.Error) {
		toSerialize["error"] = o.Error
	}
	if !IsNil(o.CreatedAt) {
		toSerialize["created_at"] = o.CreatedAt
	}
	if !IsNil(o.UpdatedAt) {
		toSerialize["updated_at"] = o.UpdatedAt
	}
	return toSerialize, nil
}

type NullablePredictionJob struct {
	value *PredictionJob
	isSet bool
}

func (v NullablePredictionJob) Get() *PredictionJob {
	return v.value
}

func (v *NullablePredictionJob) Set(val *PredictionJob) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullablePredictionJob(val *PredictionJob) *NullablePredictionJob {
	return &NullablePredictionJob{value: val, isSet: true}
}

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

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