/*
Anchore Engine API Server

This is the Anchore Engine API. Provides the primary external API for users of the service.

API version: 0.1.20
Contact: nurmi@anchore.com
*/

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

package anchore

import (
	"encoding/json"
)

// VulnerabilityReference An external link/reference
type VulnerabilityReference struct {
	// The reference source
	Source *string `json:"source,omitempty"`
	Tags []string `json:"tags,omitempty"`
	// The reference url
	Url *string `json:"url,omitempty"`
}

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

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

// GetSource returns the Source field value if set, zero value otherwise.
func (o *VulnerabilityReference) GetSource() string {
	if o == nil || o.Source == nil {
		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 *VulnerabilityReference) GetSourceOk() (*string, bool) {
	if o == nil || o.Source == nil {
		return nil, false
	}
	return o.Source, true
}

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

	return false
}

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

// GetTags returns the Tags field value if set, zero value otherwise.
func (o *VulnerabilityReference) GetTags() []string {
	if o == nil || o.Tags == nil {
		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 *VulnerabilityReference) GetTagsOk() ([]string, bool) {
	if o == nil || o.Tags == nil {
		return nil, false
	}
	return o.Tags, true
}

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

	return false
}

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

// GetUrl returns the Url field value if set, zero value otherwise.
func (o *VulnerabilityReference) GetUrl() string {
	if o == nil || o.Url == nil {
		var ret string
		return ret
	}
	return *o.Url
}

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

// HasUrl returns a boolean if a field has been set.
func (o *VulnerabilityReference) HasUrl() bool {
	if o != nil && o.Url != nil {
		return true
	}

	return false
}

// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *VulnerabilityReference) SetUrl(v string) {
	o.Url = &v
}

func (o VulnerabilityReference) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Source != nil {
		toSerialize["source"] = o.Source
	}
	if o.Tags != nil {
		toSerialize["tags"] = o.Tags
	}
	if o.Url != nil {
		toSerialize["url"] = o.Url
	}
	return json.Marshal(toSerialize)
}

type NullableVulnerabilityReference struct {
	value *VulnerabilityReference
	isSet bool
}

func (v NullableVulnerabilityReference) Get() *VulnerabilityReference {
	return v.value
}

func (v *NullableVulnerabilityReference) Set(val *VulnerabilityReference) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableVulnerabilityReference(val *VulnerabilityReference) *NullableVulnerabilityReference {
	return &NullableVulnerabilityReference{value: val, isSet: true}
}

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

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


