/*
1Backend

AI-native microservices platform.

API version: 0.8.2
Contact: sales@singulatron.com
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package openapi

import (
	"encoding/json"
)

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

// ContainerSvcVolume struct for ContainerSvcVolume
type ContainerSvcVolume struct {
	// Destination is the path inside the container.
	Destination *string `json:"destination,omitempty"`
	// ReadOnly indicates whether the mount is read-only.
	ReadOnly *bool `json:"readOnly,omitempty"`
	// Source is the host path or volume name.
	Source *string `json:"source,omitempty"`
}

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

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

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

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

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

	return false
}

// SetDestination gets a reference to the given string and assigns it to the Destination field.
func (o *ContainerSvcVolume) SetDestination(v string) {
	o.Destination = &v
}

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

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

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

	return false
}

// SetReadOnly gets a reference to the given bool and assigns it to the ReadOnly field.
func (o *ContainerSvcVolume) SetReadOnly(v bool) {
	o.ReadOnly = &v
}

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

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

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

	return false
}

// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *ContainerSvcVolume) SetSource(v string) {
	o.Source = &v
}

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

func (o ContainerSvcVolume) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Destination) {
		toSerialize["destination"] = o.Destination
	}
	if !IsNil(o.ReadOnly) {
		toSerialize["readOnly"] = o.ReadOnly
	}
	if !IsNil(o.Source) {
		toSerialize["source"] = o.Source
	}
	return toSerialize, nil
}

type NullableContainerSvcVolume struct {
	value *ContainerSvcVolume
	isSet bool
}

func (v NullableContainerSvcVolume) Get() *ContainerSvcVolume {
	return v.value
}

func (v *NullableContainerSvcVolume) Set(val *ContainerSvcVolume) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableContainerSvcVolume(val *ContainerSvcVolume) *NullableContainerSvcVolume {
	return &NullableContainerSvcVolume{value: val, isSet: true}
}

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

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


