/*
 * Red Hat Security Data API
 *
 * Unofficial OpenAPI definitions for Red Hat Security Data API
 *
 * API version: 1.0
 * Contact: mustafa@ctrliq.com
 */

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

package rhsecurity

import (
	"encoding/json"
)

// CVEDetailed CVE model used when retrieving a specific CVE
type CVEDetailed struct {
	ThreatSeverity  string                        `json:"threat_severity"`
	PublicDate      string                        `json:"public_date"`
	Bugzilla        CVEDetailedBugzilla           `json:"bugzilla"`
	Cvss3           CVEDetailedCvss3              `json:"cvss3"`
	Cwe             string                        `json:"cwe"`
	Details         []string                      `json:"details"`
	Acknowledgement string                        `json:"acknowledgement"`
	AffectedRelease *[]CVEDetailedAffectedRelease `json:"affected_release,omitempty"`
	Name            string                        `json:"name"`
	Csaw            bool                          `json:"csaw"`
	PackageState    *[]CVEDetailedPackageState    `json:"package_state,omitempty"`
}

// NewCVEDetailed instantiates a new CVEDetailed 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 NewCVEDetailed(threatSeverity string, publicDate string, bugzilla CVEDetailedBugzilla, cvss3 CVEDetailedCvss3, cwe string, details []string, acknowledgement string, name string, csaw bool) *CVEDetailed {
	this := CVEDetailed{}
	this.ThreatSeverity = threatSeverity
	this.PublicDate = publicDate
	this.Bugzilla = bugzilla
	this.Cvss3 = cvss3
	this.Cwe = cwe
	this.Details = details
	this.Acknowledgement = acknowledgement
	this.Name = name
	this.Csaw = csaw
	return &this
}

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

// GetThreatSeverity returns the ThreatSeverity field value
func (o *CVEDetailed) GetThreatSeverity() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ThreatSeverity
}

// GetThreatSeverityOk returns a tuple with the ThreatSeverity field value
// and a boolean to check if the value has been set.
func (o *CVEDetailed) GetThreatSeverityOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.ThreatSeverity, true
}

// SetThreatSeverity sets field value
func (o *CVEDetailed) SetThreatSeverity(v string) {
	o.ThreatSeverity = v
}

// GetPublicDate returns the PublicDate field value
func (o *CVEDetailed) GetPublicDate() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.PublicDate
}

// GetPublicDateOk returns a tuple with the PublicDate field value
// and a boolean to check if the value has been set.
func (o *CVEDetailed) GetPublicDateOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.PublicDate, true
}

// SetPublicDate sets field value
func (o *CVEDetailed) SetPublicDate(v string) {
	o.PublicDate = v
}

// GetBugzilla returns the Bugzilla field value
func (o *CVEDetailed) GetBugzilla() CVEDetailedBugzilla {
	if o == nil {
		var ret CVEDetailedBugzilla
		return ret
	}

	return o.Bugzilla
}

// GetBugzillaOk returns a tuple with the Bugzilla field value
// and a boolean to check if the value has been set.
func (o *CVEDetailed) GetBugzillaOk() (*CVEDetailedBugzilla, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Bugzilla, true
}

// SetBugzilla sets field value
func (o *CVEDetailed) SetBugzilla(v CVEDetailedBugzilla) {
	o.Bugzilla = v
}

// GetCvss3 returns the Cvss3 field value
func (o *CVEDetailed) GetCvss3() CVEDetailedCvss3 {
	if o == nil {
		var ret CVEDetailedCvss3
		return ret
	}

	return o.Cvss3
}

// GetCvss3Ok returns a tuple with the Cvss3 field value
// and a boolean to check if the value has been set.
func (o *CVEDetailed) GetCvss3Ok() (*CVEDetailedCvss3, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Cvss3, true
}

// SetCvss3 sets field value
func (o *CVEDetailed) SetCvss3(v CVEDetailedCvss3) {
	o.Cvss3 = v
}

// GetCwe returns the Cwe field value
func (o *CVEDetailed) GetCwe() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Cwe
}

// GetCweOk returns a tuple with the Cwe field value
// and a boolean to check if the value has been set.
func (o *CVEDetailed) GetCweOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Cwe, true
}

// SetCwe sets field value
func (o *CVEDetailed) SetCwe(v string) {
	o.Cwe = v
}

// GetDetails returns the Details field value
func (o *CVEDetailed) GetDetails() []string {
	if o == nil {
		var ret []string
		return ret
	}

	return o.Details
}

// GetDetailsOk returns a tuple with the Details field value
// and a boolean to check if the value has been set.
func (o *CVEDetailed) GetDetailsOk() (*[]string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Details, true
}

// SetDetails sets field value
func (o *CVEDetailed) SetDetails(v []string) {
	o.Details = v
}

// GetAcknowledgement returns the Acknowledgement field value
func (o *CVEDetailed) GetAcknowledgement() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Acknowledgement
}

// GetAcknowledgementOk returns a tuple with the Acknowledgement field value
// and a boolean to check if the value has been set.
func (o *CVEDetailed) GetAcknowledgementOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Acknowledgement, true
}

// SetAcknowledgement sets field value
func (o *CVEDetailed) SetAcknowledgement(v string) {
	o.Acknowledgement = v
}

// GetAffectedRelease returns the AffectedRelease field value if set, zero value otherwise.
func (o *CVEDetailed) GetAffectedRelease() []CVEDetailedAffectedRelease {
	if o == nil || o.AffectedRelease == nil {
		var ret []CVEDetailedAffectedRelease
		return ret
	}
	return *o.AffectedRelease
}

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

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

	return false
}

// SetAffectedRelease gets a reference to the given []CVEDetailedAffectedRelease and assigns it to the AffectedRelease field.
func (o *CVEDetailed) SetAffectedRelease(v []CVEDetailedAffectedRelease) {
	o.AffectedRelease = &v
}

// GetName returns the Name field value
func (o *CVEDetailed) GetName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Name
}

// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *CVEDetailed) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Name, true
}

// SetName sets field value
func (o *CVEDetailed) SetName(v string) {
	o.Name = v
}

// GetCsaw returns the Csaw field value
func (o *CVEDetailed) GetCsaw() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.Csaw
}

// GetCsawOk returns a tuple with the Csaw field value
// and a boolean to check if the value has been set.
func (o *CVEDetailed) GetCsawOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Csaw, true
}

// SetCsaw sets field value
func (o *CVEDetailed) SetCsaw(v bool) {
	o.Csaw = v
}

// GetPackageState returns the PackageState field value if set, zero value otherwise.
func (o *CVEDetailed) GetPackageState() []CVEDetailedPackageState {
	if o == nil || o.PackageState == nil {
		var ret []CVEDetailedPackageState
		return ret
	}
	return *o.PackageState
}

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

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

	return false
}

// SetPackageState gets a reference to the given []CVEDetailedPackageState and assigns it to the PackageState field.
func (o *CVEDetailed) SetPackageState(v []CVEDetailedPackageState) {
	o.PackageState = &v
}

func (o CVEDetailed) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if true {
		toSerialize["threat_severity"] = o.ThreatSeverity
	}
	if true {
		toSerialize["public_date"] = o.PublicDate
	}
	if true {
		toSerialize["bugzilla"] = o.Bugzilla
	}
	if true {
		toSerialize["cvss3"] = o.Cvss3
	}
	if true {
		toSerialize["cwe"] = o.Cwe
	}
	if true {
		toSerialize["details"] = o.Details
	}
	if true {
		toSerialize["acknowledgement"] = o.Acknowledgement
	}
	if o.AffectedRelease != nil {
		toSerialize["affected_release"] = o.AffectedRelease
	}
	if true {
		toSerialize["name"] = o.Name
	}
	if true {
		toSerialize["csaw"] = o.Csaw
	}
	if o.PackageState != nil {
		toSerialize["package_state"] = o.PackageState
	}
	return json.Marshal(toSerialize)
}

type NullableCVEDetailed struct {
	value *CVEDetailed
	isSet bool
}

func (v NullableCVEDetailed) Get() *CVEDetailed {
	return v.value
}

func (v *NullableCVEDetailed) Set(val *CVEDetailed) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCVEDetailed(val *CVEDetailed) *NullableCVEDetailed {
	return &NullableCVEDetailed{value: val, isSet: true}
}

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

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