mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
191 lines
4.5 KiB
Go
191 lines
4.5 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 CiArtifact type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CiArtifact{}
|
|
|
|
// CiArtifact struct for CiArtifact
|
|
type CiArtifact struct {
|
|
Digest *string `json:"digest,omitempty"`
|
|
Tag *string `json:"tag,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CiArtifact CiArtifact
|
|
|
|
// NewCiArtifact instantiates a new CiArtifact 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 NewCiArtifact() *CiArtifact {
|
|
this := CiArtifact{}
|
|
return &this
|
|
}
|
|
|
|
// NewCiArtifactWithDefaults instantiates a new CiArtifact 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 NewCiArtifactWithDefaults() *CiArtifact {
|
|
this := CiArtifact{}
|
|
return &this
|
|
}
|
|
|
|
// GetDigest returns the Digest field value if set, zero value otherwise.
|
|
func (o *CiArtifact) 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 *CiArtifact) 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 *CiArtifact) 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 *CiArtifact) SetDigest(v string) {
|
|
o.Digest = &v
|
|
}
|
|
|
|
// GetTag returns the Tag field value if set, zero value otherwise.
|
|
func (o *CiArtifact) 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 *CiArtifact) 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 *CiArtifact) 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 *CiArtifact) SetTag(v string) {
|
|
o.Tag = &v
|
|
}
|
|
|
|
func (o CiArtifact) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CiArtifact) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Digest) {
|
|
toSerialize["digest"] = o.Digest
|
|
}
|
|
if !IsNil(o.Tag) {
|
|
toSerialize["tag"] = o.Tag
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CiArtifact) UnmarshalJSON(data []byte) (err error) {
|
|
varCiArtifact := _CiArtifact{}
|
|
|
|
err = json.Unmarshal(data, &varCiArtifact)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CiArtifact(varCiArtifact)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "digest")
|
|
delete(additionalProperties, "tag")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCiArtifact struct {
|
|
value *CiArtifact
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCiArtifact) Get() *CiArtifact {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCiArtifact) Set(val *CiArtifact) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCiArtifact) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCiArtifact) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCiArtifact(val *CiArtifact) *NullableCiArtifact {
|
|
return &NullableCiArtifact{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCiArtifact) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCiArtifact) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|