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

// Artifact struct for Artifact
type Artifact struct {
	RepositoryName *string `json:"repositoryName"`
	// The digest of the artifact
	Digest *string `json:"digest"`
	// The tags of an artifact
	Tags *[]string `json:"tags,omitempty"`
	// The media type of the artifact
	MediaType *string `json:"mediaType"`
}

// NewArtifact instantiates a new Artifact 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 NewArtifact(repositoryName string, digest string, mediaType string) *Artifact {
	this := Artifact{}

	this.RepositoryName = &repositoryName
	this.Digest = &digest
	this.MediaType = &mediaType

	return &this
}

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

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

	return o.RepositoryName

}

// GetRepositoryNameOk returns a tuple with the RepositoryName 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 *Artifact) GetRepositoryNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.RepositoryName, true
}

// SetRepositoryName sets field value
func (o *Artifact) SetRepositoryName(v string) {

	o.RepositoryName = &v

}

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

	return false
}

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

	return o.Digest

}

// GetDigestOk returns a tuple with the Digest 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 *Artifact) GetDigestOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Digest, true
}

// SetDigest sets field value
func (o *Artifact) SetDigest(v string) {

	o.Digest = &v

}

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

	return false
}

// GetTags returns the Tags field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *Artifact) GetTags() *[]string {
	if o == nil {
		return nil
	}

	return o.Tags

}

// GetTagsOk returns a tuple with the Tags 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 *Artifact) GetTagsOk() (*[]string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Tags, true
}

// SetTags sets field value
func (o *Artifact) SetTags(v []string) {

	o.Tags = &v

}

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

	return false
}

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

	return o.MediaType

}

// GetMediaTypeOk returns a tuple with the MediaType 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 *Artifact) GetMediaTypeOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.MediaType, true
}

// SetMediaType sets field value
func (o *Artifact) SetMediaType(v string) {

	o.MediaType = &v

}

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

	return false
}

func (o Artifact) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.RepositoryName != nil {
		toSerialize["repositoryName"] = o.RepositoryName
	}

	if o.Digest != nil {
		toSerialize["digest"] = o.Digest
	}

	if o.Tags != nil {
		toSerialize["tags"] = o.Tags
	}

	if o.MediaType != nil {
		toSerialize["mediaType"] = o.MediaType
	}

	return json.Marshal(toSerialize)
}

type NullableArtifact struct {
	value *Artifact
	isSet bool
}

func (v NullableArtifact) Get() *Artifact {
	return v.value
}

func (v *NullableArtifact) Set(val *Artifact) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableArtifact(val *Artifact) *NullableArtifact {
	return &NullableArtifact{value: val, isSet: true}
}

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

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