/*
Mender API

Combined API specification for the features of the different Mender backend services, suitable for code generation applications 

API version: 1
Contact: support@mender.io
*/

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

package client

import (
	"encoding/json"
	"time"
)

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

// ReleaseV1 Groups artifacts with the same release name into a single resource.
type ReleaseV1 struct {
	// release name. 
	Name *string `json:"Name,omitempty"`
	// Last modification time for the release. 
	Modified *time.Time `json:"modified,omitempty"`
	// List of artifacts for this release.
	Artifacts []ArtifactV1 `json:"Artifacts,omitempty"`
	// Number of artifacts.
	ArtifactsCount *int32 `json:"ArtifactsCount,omitempty"`
	// Tags assigned to the release used for filtering releases. Each tag must be valid a ASCII string and contain only lowercase and uppercase letters, digits, underscores, periods and hyphens.
	Tags []string `json:"tags,omitempty"`
	// Additional information describing a Release limited to 1024 characters. Please use the v2 API to set this field. 
	Notes *string `json:"notes,omitempty"`
}

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

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

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

// GetModified returns the Modified field value if set, zero value otherwise.
func (o *ReleaseV1) GetModified() time.Time {
	if o == nil || IsNil(o.Modified) {
		var ret time.Time
		return ret
	}
	return *o.Modified
}

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

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

	return false
}

// SetModified gets a reference to the given time.Time and assigns it to the Modified field.
func (o *ReleaseV1) SetModified(v time.Time) {
	o.Modified = &v
}

// GetArtifacts returns the Artifacts field value if set, zero value otherwise.
func (o *ReleaseV1) GetArtifacts() []ArtifactV1 {
	if o == nil || IsNil(o.Artifacts) {
		var ret []ArtifactV1
		return ret
	}
	return o.Artifacts
}

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

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

	return false
}

// SetArtifacts gets a reference to the given []ArtifactV1 and assigns it to the Artifacts field.
func (o *ReleaseV1) SetArtifacts(v []ArtifactV1) {
	o.Artifacts = v
}

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

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

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

	return false
}

// SetArtifactsCount gets a reference to the given int32 and assigns it to the ArtifactsCount field.
func (o *ReleaseV1) SetArtifactsCount(v int32) {
	o.ArtifactsCount = &v
}

// GetTags returns the Tags field value if set, zero value otherwise.
func (o *ReleaseV1) GetTags() []string {
	if o == nil || IsNil(o.Tags) {
		var ret []string
		return ret
	}
	return o.Tags
}

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

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

	return false
}

// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *ReleaseV1) SetTags(v []string) {
	o.Tags = v
}

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

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

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

	return false
}

// SetNotes gets a reference to the given string and assigns it to the Notes field.
func (o *ReleaseV1) SetNotes(v string) {
	o.Notes = &v
}

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

func (o ReleaseV1) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Name) {
		toSerialize["Name"] = o.Name
	}
	if !IsNil(o.Modified) {
		toSerialize["modified"] = o.Modified
	}
	if !IsNil(o.Artifacts) {
		toSerialize["Artifacts"] = o.Artifacts
	}
	if !IsNil(o.ArtifactsCount) {
		toSerialize["ArtifactsCount"] = o.ArtifactsCount
	}
	if !IsNil(o.Tags) {
		toSerialize["tags"] = o.Tags
	}
	if !IsNil(o.Notes) {
		toSerialize["notes"] = o.Notes
	}
	return toSerialize, nil
}

type NullableReleaseV1 struct {
	value *ReleaseV1
	isSet bool
}

func (v NullableReleaseV1) Get() *ReleaseV1 {
	return v.value
}

func (v *NullableReleaseV1) Set(val *ReleaseV1) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableReleaseV1(val *ReleaseV1) *NullableReleaseV1 {
	return &NullableReleaseV1{value: val, isSet: true}
}

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

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


