/*
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"
)

// StandaloneVulnerability A single vulnerability record in a single namespace, the unique key is the combination of the id and namespace
type StandaloneVulnerability struct {
	// Vulnerability identifier. May be CVE-X, RHSA-X, etc. Not necessarily unique across namespaces
	Id *string `json:"id,omitempty"`
	// The namespace for the vulnerability record to avoid conflicts for the same id in different distros or sources (e.g. deb vs ubuntu for same CVE)
	Namespace *string `json:"namespace,omitempty"`
	// The array of packages (typically packages) that are vulnerable-to or provide fixes-for this vulnerability
	AffectedPackages []PackageReference `json:"affected_packages,omitempty"`
	// Severity label specific to the namepsace
	Severity *string `json:"severity,omitempty"`
	// URL for the upstream CVE record in the reporting source (e.g. ubuntu security tracker)
	Link *string `json:"link,omitempty"`
	// List of Nvd Data objects
	NvdData []NvdDataObject `json:"nvd_data,omitempty"`
	// List of Vendor Data objects
	VendorData []VendorDataObject `json:"vendor_data,omitempty"`
	// Description of the vulnerability if available
	Description *string `json:"description,omitempty"`
	// List of references including
	References []VulnerabilityReference `json:"references,omitempty"`
}

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

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

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

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

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

	return false
}

// SetId gets a reference to the given string and assigns it to the Id field.
func (o *StandaloneVulnerability) SetId(v string) {
	o.Id = &v
}

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

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

	return false
}

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

// GetAffectedPackages returns the AffectedPackages field value if set, zero value otherwise.
func (o *StandaloneVulnerability) GetAffectedPackages() []PackageReference {
	if o == nil || o.AffectedPackages == nil {
		var ret []PackageReference
		return ret
	}
	return o.AffectedPackages
}

// GetAffectedPackagesOk returns a tuple with the AffectedPackages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *StandaloneVulnerability) GetAffectedPackagesOk() ([]PackageReference, bool) {
	if o == nil || o.AffectedPackages == nil {
		return nil, false
	}
	return o.AffectedPackages, true
}

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

	return false
}

// SetAffectedPackages gets a reference to the given []PackageReference and assigns it to the AffectedPackages field.
func (o *StandaloneVulnerability) SetAffectedPackages(v []PackageReference) {
	o.AffectedPackages = v
}

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

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

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

	return false
}

// SetSeverity gets a reference to the given string and assigns it to the Severity field.
func (o *StandaloneVulnerability) SetSeverity(v string) {
	o.Severity = &v
}

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

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

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

	return false
}

// SetLink gets a reference to the given string and assigns it to the Link field.
func (o *StandaloneVulnerability) SetLink(v string) {
	o.Link = &v
}

// GetNvdData returns the NvdData field value if set, zero value otherwise.
func (o *StandaloneVulnerability) GetNvdData() []NvdDataObject {
	if o == nil || o.NvdData == nil {
		var ret []NvdDataObject
		return ret
	}
	return o.NvdData
}

// GetNvdDataOk returns a tuple with the NvdData field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *StandaloneVulnerability) GetNvdDataOk() ([]NvdDataObject, bool) {
	if o == nil || o.NvdData == nil {
		return nil, false
	}
	return o.NvdData, true
}

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

	return false
}

// SetNvdData gets a reference to the given []NvdDataObject and assigns it to the NvdData field.
func (o *StandaloneVulnerability) SetNvdData(v []NvdDataObject) {
	o.NvdData = v
}

// GetVendorData returns the VendorData field value if set, zero value otherwise.
func (o *StandaloneVulnerability) GetVendorData() []VendorDataObject {
	if o == nil || o.VendorData == nil {
		var ret []VendorDataObject
		return ret
	}
	return o.VendorData
}

// GetVendorDataOk returns a tuple with the VendorData field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *StandaloneVulnerability) GetVendorDataOk() ([]VendorDataObject, bool) {
	if o == nil || o.VendorData == nil {
		return nil, false
	}
	return o.VendorData, true
}

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

	return false
}

// SetVendorData gets a reference to the given []VendorDataObject and assigns it to the VendorData field.
func (o *StandaloneVulnerability) SetVendorData(v []VendorDataObject) {
	o.VendorData = v
}

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

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

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

	return false
}

// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *StandaloneVulnerability) SetDescription(v string) {
	o.Description = &v
}

// GetReferences returns the References field value if set, zero value otherwise.
func (o *StandaloneVulnerability) GetReferences() []VulnerabilityReference {
	if o == nil || o.References == nil {
		var ret []VulnerabilityReference
		return ret
	}
	return o.References
}

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

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

	return false
}

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

func (o StandaloneVulnerability) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Id != nil {
		toSerialize["id"] = o.Id
	}
	if o.Namespace != nil {
		toSerialize["namespace"] = o.Namespace
	}
	if o.AffectedPackages != nil {
		toSerialize["affected_packages"] = o.AffectedPackages
	}
	if o.Severity != nil {
		toSerialize["severity"] = o.Severity
	}
	if o.Link != nil {
		toSerialize["link"] = o.Link
	}
	if o.NvdData != nil {
		toSerialize["nvd_data"] = o.NvdData
	}
	if o.VendorData != nil {
		toSerialize["vendor_data"] = o.VendorData
	}
	if o.Description != nil {
		toSerialize["description"] = o.Description
	}
	if o.References != nil {
		toSerialize["references"] = o.References
	}
	return json.Marshal(toSerialize)
}

type NullableStandaloneVulnerability struct {
	value *StandaloneVulnerability
	isSet bool
}

func (v NullableStandaloneVulnerability) Get() *StandaloneVulnerability {
	return v.value
}

func (v *NullableStandaloneVulnerability) Set(val *StandaloneVulnerability) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableStandaloneVulnerability(val *StandaloneVulnerability) *NullableStandaloneVulnerability {
	return &NullableStandaloneVulnerability{value: val, isSet: true}
}

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

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


