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

// Vulnerability struct for Vulnerability
type Vulnerability struct {
	// The vulnerability identifier, such as CVE-2017-100, or RHSA-2017123
	Vuln *string `json:"vuln,omitempty"`
	// The package containing a fix, if available
	Fix *string `json:"fix,omitempty"`
	// The severity of the vulnerability
	Severity *string `json:"severity,omitempty"`
	// The package name and version that are vulnerable in the image
	Package *string `json:"package,omitempty"`
	// The url for more information about the vulnerability
	Url *string `json:"url,omitempty"`
	// The name of the feed where vulnerability match was made
	Feed *string `json:"feed,omitempty"`
	// The name of the feed group where vulnerability match was made
	FeedGroup *string `json:"feed_group,omitempty"`
	// The name of the vulnerable package artifact
	PackageName *string `json:"package_name,omitempty"`
	// The version of the vulnerable package artifact
	PackageVersion *string `json:"package_version,omitempty"`
	// The type of vulnerable package
	PackageType *string `json:"package_type,omitempty"`
	// The CPE string (if applicable) describing the package to vulnerability match
	PackageCpe *string `json:"package_cpe,omitempty"`
	// The location (if applicable) of the vulnerable package in the container filesystem
	PackagePath *string `json:"package_path,omitempty"`
	// Whether a vendor will fix or not fix the vulnerability
	WillNotFix *bool `json:"will_not_fix,omitempty"`
	// List of Nvd Data objects
	NvdData []NvdDataObject `json:"nvd_data,omitempty"`
	// List of Vendor Data objects
	VendorData []VendorDataObject `json:"vendor_data,omitempty"`
}

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

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

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

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

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

	return false
}

// SetVuln gets a reference to the given string and assigns it to the Vuln field.
func (o *Vulnerability) SetVuln(v string) {
	o.Vuln = &v
}

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

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

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

	return false
}

// SetFix gets a reference to the given string and assigns it to the Fix field.
func (o *Vulnerability) SetFix(v string) {
	o.Fix = &v
}

// GetSeverity returns the Severity field value if set, zero value otherwise.
func (o *Vulnerability) 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 *Vulnerability) 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 *Vulnerability) 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 *Vulnerability) SetSeverity(v string) {
	o.Severity = &v
}

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

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

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

	return false
}

// SetPackage gets a reference to the given string and assigns it to the Package field.
func (o *Vulnerability) SetPackage(v string) {
	o.Package = &v
}

// GetUrl returns the Url field value if set, zero value otherwise.
func (o *Vulnerability) 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 *Vulnerability) 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 *Vulnerability) 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 *Vulnerability) SetUrl(v string) {
	o.Url = &v
}

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

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

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

	return false
}

// SetFeed gets a reference to the given string and assigns it to the Feed field.
func (o *Vulnerability) SetFeed(v string) {
	o.Feed = &v
}

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

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

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

	return false
}

// SetFeedGroup gets a reference to the given string and assigns it to the FeedGroup field.
func (o *Vulnerability) SetFeedGroup(v string) {
	o.FeedGroup = &v
}

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

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

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

	return false
}

// SetPackageName gets a reference to the given string and assigns it to the PackageName field.
func (o *Vulnerability) SetPackageName(v string) {
	o.PackageName = &v
}

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

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

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

	return false
}

// SetPackageVersion gets a reference to the given string and assigns it to the PackageVersion field.
func (o *Vulnerability) SetPackageVersion(v string) {
	o.PackageVersion = &v
}

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

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

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

	return false
}

// SetPackageType gets a reference to the given string and assigns it to the PackageType field.
func (o *Vulnerability) SetPackageType(v string) {
	o.PackageType = &v
}

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

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

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

	return false
}

// SetPackageCpe gets a reference to the given string and assigns it to the PackageCpe field.
func (o *Vulnerability) SetPackageCpe(v string) {
	o.PackageCpe = &v
}

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

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

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

	return false
}

// SetPackagePath gets a reference to the given string and assigns it to the PackagePath field.
func (o *Vulnerability) SetPackagePath(v string) {
	o.PackagePath = &v
}

// GetWillNotFix returns the WillNotFix field value if set, zero value otherwise.
func (o *Vulnerability) GetWillNotFix() bool {
	if o == nil || o.WillNotFix == nil {
		var ret bool
		return ret
	}
	return *o.WillNotFix
}

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

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

	return false
}

// SetWillNotFix gets a reference to the given bool and assigns it to the WillNotFix field.
func (o *Vulnerability) SetWillNotFix(v bool) {
	o.WillNotFix = &v
}

// GetNvdData returns the NvdData field value if set, zero value otherwise.
func (o *Vulnerability) 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 *Vulnerability) 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 *Vulnerability) 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 *Vulnerability) SetNvdData(v []NvdDataObject) {
	o.NvdData = v
}

// GetVendorData returns the VendorData field value if set, zero value otherwise.
func (o *Vulnerability) 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 *Vulnerability) 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 *Vulnerability) 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 *Vulnerability) SetVendorData(v []VendorDataObject) {
	o.VendorData = v
}

func (o Vulnerability) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Vuln != nil {
		toSerialize["vuln"] = o.Vuln
	}
	if o.Fix != nil {
		toSerialize["fix"] = o.Fix
	}
	if o.Severity != nil {
		toSerialize["severity"] = o.Severity
	}
	if o.Package != nil {
		toSerialize["package"] = o.Package
	}
	if o.Url != nil {
		toSerialize["url"] = o.Url
	}
	if o.Feed != nil {
		toSerialize["feed"] = o.Feed
	}
	if o.FeedGroup != nil {
		toSerialize["feed_group"] = o.FeedGroup
	}
	if o.PackageName != nil {
		toSerialize["package_name"] = o.PackageName
	}
	if o.PackageVersion != nil {
		toSerialize["package_version"] = o.PackageVersion
	}
	if o.PackageType != nil {
		toSerialize["package_type"] = o.PackageType
	}
	if o.PackageCpe != nil {
		toSerialize["package_cpe"] = o.PackageCpe
	}
	if o.PackagePath != nil {
		toSerialize["package_path"] = o.PackagePath
	}
	if o.WillNotFix != nil {
		toSerialize["will_not_fix"] = o.WillNotFix
	}
	if o.NvdData != nil {
		toSerialize["nvd_data"] = o.NvdData
	}
	if o.VendorData != nil {
		toSerialize["vendor_data"] = o.VendorData
	}
	return json.Marshal(toSerialize)
}

type NullableVulnerability struct {
	value *Vulnerability
	isSet bool
}

func (v NullableVulnerability) Get() *Vulnerability {
	return v.value
}

func (v *NullableVulnerability) Set(val *Vulnerability) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableVulnerability(val *Vulnerability) *NullableVulnerability {
	return &NullableVulnerability{value: val, isSet: true}
}

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

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


