/*
 * Container Registry service
 *
 * ## Overview Container Registry service enables IONOS clients to manage docker and OCI compliant registries for use by their managed Kubernetes clusters. Use a Container Registry to ensure you have a privately accessed registry to efficiently support image pulls. ## Changelog ### 1.1.0  - Added new endpoints for Repositories  - Added new endpoints for Artifacts  - Added new endpoints for Vulnerabilities  - Added registry vulnerabilityScanning feature ### 1.2.0 - Added registry `apiSubnetAllowList`
 *
 * API version: 1.2.0
 * Contact: support@cloud.ionos.com
 */

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

package ionoscloud

import (
	"encoding/json"
	"time"
)

// ArtifactMetadataAllOf struct for ArtifactMetadataAllOf
type ArtifactMetadataAllOf struct {
	// The date and time the artifact was last pushed
	LastPushedAt *IonosTime `json:"lastPushedAt"`
	// The date and time the artifact was last pulled
	LastPulledAt *IonosTime `json:"lastPulledAt,omitempty"`
	// The date and time the artifact was last scanned
	LastScannedAt *IonosTime `json:"lastScannedAt,omitempty"`
	// The number of times the artifact was pushed
	PushCount *int64 `json:"pushCount"`
	// The number of times the artifact was pulled
	PullCount *int64 `json:"pullCount"`
	// The CVSS vulnerability severity rating
	VulnMaxSeverity *string `json:"vulnMaxSeverity,omitempty"`
	// The total CVSS score of all vulnerabilities of the artifact
	VulnTotalScore *float32 `json:"vulnTotalScore,omitempty"`
	// The total number of vulnerabilities of the artifact
	VulnTotalCount *int64 `json:"vulnTotalCount,omitempty"`
	// The number of fixable vulnerabilities of the artifact
	VulnFixableCount *int64 `json:"vulnFixableCount,omitempty"`
}

// NewArtifactMetadataAllOf instantiates a new ArtifactMetadataAllOf 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 NewArtifactMetadataAllOf(lastPushedAt time.Time, pushCount int64, pullCount int64) *ArtifactMetadataAllOf {
	this := ArtifactMetadataAllOf{}

	this.LastPushedAt = &IonosTime{lastPushedAt}
	this.PushCount = &pushCount
	this.PullCount = &pullCount

	return &this
}

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

// GetLastPushedAt returns the LastPushedAt field value
// If the value is explicit nil, the zero value for time.Time will be returned
func (o *ArtifactMetadataAllOf) GetLastPushedAt() *time.Time {
	if o == nil {
		return nil
	}

	if o.LastPushedAt == nil {
		return nil
	}
	return &o.LastPushedAt.Time

}

// GetLastPushedAtOk returns a tuple with the LastPushedAt field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ArtifactMetadataAllOf) GetLastPushedAtOk() (*time.Time, bool) {
	if o == nil {
		return nil, false
	}

	if o.LastPushedAt == nil {
		return nil, false
	}
	return &o.LastPushedAt.Time, true

}

// SetLastPushedAt sets field value
func (o *ArtifactMetadataAllOf) SetLastPushedAt(v time.Time) {

	o.LastPushedAt = &IonosTime{v}

}

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

	return false
}

// GetLastPulledAt returns the LastPulledAt field value
// If the value is explicit nil, the zero value for time.Time will be returned
func (o *ArtifactMetadataAllOf) GetLastPulledAt() *time.Time {
	if o == nil {
		return nil
	}

	if o.LastPulledAt == nil {
		return nil
	}
	return &o.LastPulledAt.Time

}

// GetLastPulledAtOk returns a tuple with the LastPulledAt field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ArtifactMetadataAllOf) GetLastPulledAtOk() (*time.Time, bool) {
	if o == nil {
		return nil, false
	}

	if o.LastPulledAt == nil {
		return nil, false
	}
	return &o.LastPulledAt.Time, true

}

// SetLastPulledAt sets field value
func (o *ArtifactMetadataAllOf) SetLastPulledAt(v time.Time) {

	o.LastPulledAt = &IonosTime{v}

}

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

	return false
}

// GetLastScannedAt returns the LastScannedAt field value
// If the value is explicit nil, the zero value for time.Time will be returned
func (o *ArtifactMetadataAllOf) GetLastScannedAt() *time.Time {
	if o == nil {
		return nil
	}

	if o.LastScannedAt == nil {
		return nil
	}
	return &o.LastScannedAt.Time

}

// GetLastScannedAtOk returns a tuple with the LastScannedAt field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ArtifactMetadataAllOf) GetLastScannedAtOk() (*time.Time, bool) {
	if o == nil {
		return nil, false
	}

	if o.LastScannedAt == nil {
		return nil, false
	}
	return &o.LastScannedAt.Time, true

}

// SetLastScannedAt sets field value
func (o *ArtifactMetadataAllOf) SetLastScannedAt(v time.Time) {

	o.LastScannedAt = &IonosTime{v}

}

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

	return false
}

// GetPushCount returns the PushCount field value
// If the value is explicit nil, the zero value for int64 will be returned
func (o *ArtifactMetadataAllOf) GetPushCount() *int64 {
	if o == nil {
		return nil
	}

	return o.PushCount

}

// GetPushCountOk returns a tuple with the PushCount field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ArtifactMetadataAllOf) GetPushCountOk() (*int64, bool) {
	if o == nil {
		return nil, false
	}

	return o.PushCount, true
}

// SetPushCount sets field value
func (o *ArtifactMetadataAllOf) SetPushCount(v int64) {

	o.PushCount = &v

}

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

	return false
}

// GetPullCount returns the PullCount field value
// If the value is explicit nil, the zero value for int64 will be returned
func (o *ArtifactMetadataAllOf) GetPullCount() *int64 {
	if o == nil {
		return nil
	}

	return o.PullCount

}

// GetPullCountOk returns a tuple with the PullCount field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ArtifactMetadataAllOf) GetPullCountOk() (*int64, bool) {
	if o == nil {
		return nil, false
	}

	return o.PullCount, true
}

// SetPullCount sets field value
func (o *ArtifactMetadataAllOf) SetPullCount(v int64) {

	o.PullCount = &v

}

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

	return false
}

// GetVulnMaxSeverity returns the VulnMaxSeverity field value
// If the value is explicit nil, the zero value for string will be returned
func (o *ArtifactMetadataAllOf) GetVulnMaxSeverity() *string {
	if o == nil {
		return nil
	}

	return o.VulnMaxSeverity

}

// GetVulnMaxSeverityOk returns a tuple with the VulnMaxSeverity field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ArtifactMetadataAllOf) GetVulnMaxSeverityOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.VulnMaxSeverity, true
}

// SetVulnMaxSeverity sets field value
func (o *ArtifactMetadataAllOf) SetVulnMaxSeverity(v string) {

	o.VulnMaxSeverity = &v

}

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

	return false
}

// GetVulnTotalScore returns the VulnTotalScore field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *ArtifactMetadataAllOf) GetVulnTotalScore() *float32 {
	if o == nil {
		return nil
	}

	return o.VulnTotalScore

}

// GetVulnTotalScoreOk returns a tuple with the VulnTotalScore field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ArtifactMetadataAllOf) GetVulnTotalScoreOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}

	return o.VulnTotalScore, true
}

// SetVulnTotalScore sets field value
func (o *ArtifactMetadataAllOf) SetVulnTotalScore(v float32) {

	o.VulnTotalScore = &v

}

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

	return false
}

// GetVulnTotalCount returns the VulnTotalCount field value
// If the value is explicit nil, the zero value for int64 will be returned
func (o *ArtifactMetadataAllOf) GetVulnTotalCount() *int64 {
	if o == nil {
		return nil
	}

	return o.VulnTotalCount

}

// GetVulnTotalCountOk returns a tuple with the VulnTotalCount field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ArtifactMetadataAllOf) GetVulnTotalCountOk() (*int64, bool) {
	if o == nil {
		return nil, false
	}

	return o.VulnTotalCount, true
}

// SetVulnTotalCount sets field value
func (o *ArtifactMetadataAllOf) SetVulnTotalCount(v int64) {

	o.VulnTotalCount = &v

}

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

	return false
}

// GetVulnFixableCount returns the VulnFixableCount field value
// If the value is explicit nil, the zero value for int64 will be returned
func (o *ArtifactMetadataAllOf) GetVulnFixableCount() *int64 {
	if o == nil {
		return nil
	}

	return o.VulnFixableCount

}

// GetVulnFixableCountOk returns a tuple with the VulnFixableCount field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ArtifactMetadataAllOf) GetVulnFixableCountOk() (*int64, bool) {
	if o == nil {
		return nil, false
	}

	return o.VulnFixableCount, true
}

// SetVulnFixableCount sets field value
func (o *ArtifactMetadataAllOf) SetVulnFixableCount(v int64) {

	o.VulnFixableCount = &v

}

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

	return false
}

func (o ArtifactMetadataAllOf) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.LastPushedAt != nil {
		toSerialize["lastPushedAt"] = o.LastPushedAt
	}

	if o.LastPulledAt != nil {
		toSerialize["lastPulledAt"] = o.LastPulledAt
	}

	if o.LastScannedAt != nil {
		toSerialize["lastScannedAt"] = o.LastScannedAt
	}

	if o.PushCount != nil {
		toSerialize["pushCount"] = o.PushCount
	}

	if o.PullCount != nil {
		toSerialize["pullCount"] = o.PullCount
	}

	if o.VulnMaxSeverity != nil {
		toSerialize["vulnMaxSeverity"] = o.VulnMaxSeverity
	}

	if o.VulnTotalScore != nil {
		toSerialize["vulnTotalScore"] = o.VulnTotalScore
	}

	if o.VulnTotalCount != nil {
		toSerialize["vulnTotalCount"] = o.VulnTotalCount
	}

	if o.VulnFixableCount != nil {
		toSerialize["vulnFixableCount"] = o.VulnFixableCount
	}

	return json.Marshal(toSerialize)
}

type NullableArtifactMetadataAllOf struct {
	value *ArtifactMetadataAllOf
	isSet bool
}

func (v NullableArtifactMetadataAllOf) Get() *ArtifactMetadataAllOf {
	return v.value
}

func (v *NullableArtifactMetadataAllOf) Set(val *ArtifactMetadataAllOf) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableArtifactMetadataAllOf(val *ArtifactMetadataAllOf) *NullableArtifactMetadataAllOf {
	return &NullableArtifactMetadataAllOf{value: val, isSet: true}
}

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

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