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

// Container struct for Container
type Container struct {
	Name              *string `json:"name,omitempty"`
	PodName           *string `json:"pod_name,omitempty"`
	ComponentType     *string `json:"component_type,omitempty"`
	Namespace         *string `json:"namespace,omitempty"`
	Cluster           *string `json:"cluster,omitempty"`
	GcpProject        *string `json:"gcp_project,omitempty"`
	VersionEndpointId *int32  `json:"version_endpoint_id,omitempty"`
}

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

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

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

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

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

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

	return false
}

// SetPodName gets a reference to the given string and assigns it to the PodName field.
func (o *Container) SetPodName(v string) {
	o.PodName = &v
}

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

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

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

	return false
}

// SetComponentType gets a reference to the given string and assigns it to the ComponentType field.
func (o *Container) SetComponentType(v string) {
	o.ComponentType = &v
}

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

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

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

	return false
}

// SetNamespace gets a reference to the given string and assigns it to the Namespace field.
func (o *Container) SetNamespace(v string) {
	o.Namespace = &v
}

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

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

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

	return false
}

// SetCluster gets a reference to the given string and assigns it to the Cluster field.
func (o *Container) SetCluster(v string) {
	o.Cluster = &v
}

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

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

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

	return false
}

// SetGcpProject gets a reference to the given string and assigns it to the GcpProject field.
func (o *Container) SetGcpProject(v string) {
	o.GcpProject = &v
}

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

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

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

	return false
}

// SetVersionEndpointId gets a reference to the given int32 and assigns it to the VersionEndpointId field.
func (o *Container) SetVersionEndpointId(v int32) {
	o.VersionEndpointId = &v
}

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

func (o Container) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	if !IsNil(o.PodName) {
		toSerialize["pod_name"] = o.PodName
	}
	if !IsNil(o.ComponentType) {
		toSerialize["component_type"] = o.ComponentType
	}
	if !IsNil(o.Namespace) {
		toSerialize["namespace"] = o.Namespace
	}
	if !IsNil(o.Cluster) {
		toSerialize["cluster"] = o.Cluster
	}
	if !IsNil(o.GcpProject) {
		toSerialize["gcp_project"] = o.GcpProject
	}
	if !IsNil(o.VersionEndpointId) {
		toSerialize["version_endpoint_id"] = o.VersionEndpointId
	}
	return toSerialize, nil
}

type NullableContainer struct {
	value *Container
	isSet bool
}

func (v NullableContainer) Get() *Container {
	return v.value
}

func (v *NullableContainer) Set(val *Container) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableContainer(val *Container) *NullableContainer {
	return &NullableContainer{value: val, isSet: true}
}

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

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