Files
sdk/model_deploy_image.go

307 lines
7.9 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the DeployImage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DeployImage{}
// DeployImage struct for DeployImage
type DeployImage struct {
// Digest is the sha256 of the bytes, when the reference is pinned by one.
Digest *string `json:"digest,omitempty"`
// Ref is the reference exactly as the pods run it.
Ref *string `json:"ref,omitempty"`
// Repository is the reference without its tag or digest.
Repository *string `json:"repository,omitempty"`
// Revision is the commit the image was built from — its org.opencontainers.image.revision label — where the registry answers it: a digest-pinned image in one of our registries that this deployment can read. Absent means unknown, never \"built from nothing\".
Revision *string `json:"revision,omitempty"`
// Tag is the release name, when the reference carries one.
Tag *string `json:"tag,omitempty"`
AdditionalProperties map[string]interface{}
}
type _DeployImage DeployImage
// NewDeployImage instantiates a new DeployImage 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 NewDeployImage() *DeployImage {
this := DeployImage{}
return &this
}
// NewDeployImageWithDefaults instantiates a new DeployImage 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 NewDeployImageWithDefaults() *DeployImage {
this := DeployImage{}
return &this
}
// GetDigest returns the Digest field value if set, zero value otherwise.
func (o *DeployImage) GetDigest() string {
if o == nil || IsNil(o.Digest) {
var ret string
return ret
}
return *o.Digest
}
// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeployImage) GetDigestOk() (*string, bool) {
if o == nil || IsNil(o.Digest) {
return nil, false
}
return o.Digest, true
}
// HasDigest returns a boolean if a field has been set.
func (o *DeployImage) HasDigest() bool {
if o != nil && !IsNil(o.Digest) {
return true
}
return false
}
// SetDigest gets a reference to the given string and assigns it to the Digest field.
func (o *DeployImage) SetDigest(v string) {
o.Digest = &v
}
// GetRef returns the Ref field value if set, zero value otherwise.
func (o *DeployImage) GetRef() string {
if o == nil || IsNil(o.Ref) {
var ret string
return ret
}
return *o.Ref
}
// GetRefOk returns a tuple with the Ref field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeployImage) GetRefOk() (*string, bool) {
if o == nil || IsNil(o.Ref) {
return nil, false
}
return o.Ref, true
}
// HasRef returns a boolean if a field has been set.
func (o *DeployImage) HasRef() bool {
if o != nil && !IsNil(o.Ref) {
return true
}
return false
}
// SetRef gets a reference to the given string and assigns it to the Ref field.
func (o *DeployImage) SetRef(v string) {
o.Ref = &v
}
// GetRepository returns the Repository field value if set, zero value otherwise.
func (o *DeployImage) GetRepository() string {
if o == nil || IsNil(o.Repository) {
var ret string
return ret
}
return *o.Repository
}
// GetRepositoryOk returns a tuple with the Repository field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeployImage) GetRepositoryOk() (*string, bool) {
if o == nil || IsNil(o.Repository) {
return nil, false
}
return o.Repository, true
}
// HasRepository returns a boolean if a field has been set.
func (o *DeployImage) HasRepository() bool {
if o != nil && !IsNil(o.Repository) {
return true
}
return false
}
// SetRepository gets a reference to the given string and assigns it to the Repository field.
func (o *DeployImage) SetRepository(v string) {
o.Repository = &v
}
// GetRevision returns the Revision field value if set, zero value otherwise.
func (o *DeployImage) GetRevision() string {
if o == nil || IsNil(o.Revision) {
var ret string
return ret
}
return *o.Revision
}
// GetRevisionOk returns a tuple with the Revision field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeployImage) GetRevisionOk() (*string, bool) {
if o == nil || IsNil(o.Revision) {
return nil, false
}
return o.Revision, true
}
// HasRevision returns a boolean if a field has been set.
func (o *DeployImage) HasRevision() bool {
if o != nil && !IsNil(o.Revision) {
return true
}
return false
}
// SetRevision gets a reference to the given string and assigns it to the Revision field.
func (o *DeployImage) SetRevision(v string) {
o.Revision = &v
}
// GetTag returns the Tag field value if set, zero value otherwise.
func (o *DeployImage) GetTag() string {
if o == nil || IsNil(o.Tag) {
var ret string
return ret
}
return *o.Tag
}
// GetTagOk returns a tuple with the Tag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeployImage) GetTagOk() (*string, bool) {
if o == nil || IsNil(o.Tag) {
return nil, false
}
return o.Tag, true
}
// HasTag returns a boolean if a field has been set.
func (o *DeployImage) HasTag() bool {
if o != nil && !IsNil(o.Tag) {
return true
}
return false
}
// SetTag gets a reference to the given string and assigns it to the Tag field.
func (o *DeployImage) SetTag(v string) {
o.Tag = &v
}
func (o DeployImage) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DeployImage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Digest) {
toSerialize["digest"] = o.Digest
}
if !IsNil(o.Ref) {
toSerialize["ref"] = o.Ref
}
if !IsNil(o.Repository) {
toSerialize["repository"] = o.Repository
}
if !IsNil(o.Revision) {
toSerialize["revision"] = o.Revision
}
if !IsNil(o.Tag) {
toSerialize["tag"] = o.Tag
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *DeployImage) UnmarshalJSON(data []byte) (err error) {
varDeployImage := _DeployImage{}
err = json.Unmarshal(data, &varDeployImage)
if err != nil {
return err
}
*o = DeployImage(varDeployImage)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "digest")
delete(additionalProperties, "ref")
delete(additionalProperties, "repository")
delete(additionalProperties, "revision")
delete(additionalProperties, "tag")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDeployImage struct {
value *DeployImage
isSet bool
}
func (v NullableDeployImage) Get() *DeployImage {
return v.value
}
func (v *NullableDeployImage) Set(val *DeployImage) {
v.value = val
v.isSet = true
}
func (v NullableDeployImage) IsSet() bool {
return v.isSet
}
func (v *NullableDeployImage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDeployImage(val *DeployImage) *NullableDeployImage {
return &NullableDeployImage{value: val, isSet: true}
}
func (v NullableDeployImage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDeployImage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}