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

// ModelEndpointAlert struct for ModelEndpointAlert
type ModelEndpointAlert struct {
	ModelId         *int32                        `json:"model_id,omitempty"`
	ModelEndpointId *int32                        `json:"model_endpoint_id,omitempty"`
	EnvironmentName *string                       `json:"environment_name,omitempty"`
	TeamName        *string                       `json:"team_name,omitempty"`
	AlertConditions []ModelEndpointAlertCondition `json:"alert_conditions,omitempty"`
}

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

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

// GetModelId returns the ModelId field value if set, zero value otherwise.
func (o *ModelEndpointAlert) 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 *ModelEndpointAlert) 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 *ModelEndpointAlert) 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 *ModelEndpointAlert) SetModelId(v int32) {
	o.ModelId = &v
}

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

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

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

	return false
}

// SetModelEndpointId gets a reference to the given int32 and assigns it to the ModelEndpointId field.
func (o *ModelEndpointAlert) SetModelEndpointId(v int32) {
	o.ModelEndpointId = &v
}

// GetEnvironmentName returns the EnvironmentName field value if set, zero value otherwise.
func (o *ModelEndpointAlert) 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 *ModelEndpointAlert) 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 *ModelEndpointAlert) 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 *ModelEndpointAlert) SetEnvironmentName(v string) {
	o.EnvironmentName = &v
}

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

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

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

	return false
}

// SetTeamName gets a reference to the given string and assigns it to the TeamName field.
func (o *ModelEndpointAlert) SetTeamName(v string) {
	o.TeamName = &v
}

// GetAlertConditions returns the AlertConditions field value if set, zero value otherwise.
func (o *ModelEndpointAlert) GetAlertConditions() []ModelEndpointAlertCondition {
	if o == nil || IsNil(o.AlertConditions) {
		var ret []ModelEndpointAlertCondition
		return ret
	}
	return o.AlertConditions
}

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

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

	return false
}

// SetAlertConditions gets a reference to the given []ModelEndpointAlertCondition and assigns it to the AlertConditions field.
func (o *ModelEndpointAlert) SetAlertConditions(v []ModelEndpointAlertCondition) {
	o.AlertConditions = v
}

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

func (o ModelEndpointAlert) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.ModelId) {
		toSerialize["model_id"] = o.ModelId
	}
	if !IsNil(o.ModelEndpointId) {
		toSerialize["model_endpoint_id"] = o.ModelEndpointId
	}
	if !IsNil(o.EnvironmentName) {
		toSerialize["environment_name"] = o.EnvironmentName
	}
	if !IsNil(o.TeamName) {
		toSerialize["team_name"] = o.TeamName
	}
	if !IsNil(o.AlertConditions) {
		toSerialize["alert_conditions"] = o.AlertConditions
	}
	return toSerialize, nil
}

type NullableModelEndpointAlert struct {
	value *ModelEndpointAlert
	isSet bool
}

func (v NullableModelEndpointAlert) Get() *ModelEndpointAlert {
	return v.value
}

func (v *NullableModelEndpointAlert) Set(val *ModelEndpointAlert) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableModelEndpointAlert(val *ModelEndpointAlert) *NullableModelEndpointAlert {
	return &NullableModelEndpointAlert{value: val, isSet: true}
}

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

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