Files
sdk/model_platform_image_view.go

193 lines
5.4 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 PlatformImageView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformImageView{}
// PlatformImageView struct for PlatformImageView
type PlatformImageView struct {
// Repository is the image path without a tag (ghcr.io/acme/api). Required for source `image`, which runs it as-is. A git app's built image is NOT this: the build pushes to a path derived from the org and slug, and the deployment records that full ref.
Repository *string `json:"repository,omitempty"`
// Tag is the tag to run: what the create declared, then RE-STAMPED on every transition to live with the tag that actually went live. So after a deploy it names what is running, not what was asked for.
Tag *string `json:"tag,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformImageView PlatformImageView
// NewPlatformImageView instantiates a new PlatformImageView 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 NewPlatformImageView() *PlatformImageView {
this := PlatformImageView{}
return &this
}
// NewPlatformImageViewWithDefaults instantiates a new PlatformImageView 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 NewPlatformImageViewWithDefaults() *PlatformImageView {
this := PlatformImageView{}
return &this
}
// GetRepository returns the Repository field value if set, zero value otherwise.
func (o *PlatformImageView) 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 *PlatformImageView) 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 *PlatformImageView) 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 *PlatformImageView) SetRepository(v string) {
o.Repository = &v
}
// GetTag returns the Tag field value if set, zero value otherwise.
func (o *PlatformImageView) 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 *PlatformImageView) 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 *PlatformImageView) 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 *PlatformImageView) SetTag(v string) {
o.Tag = &v
}
func (o PlatformImageView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformImageView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Repository) {
toSerialize["repository"] = o.Repository
}
if !IsNil(o.Tag) {
toSerialize["tag"] = o.Tag
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformImageView) UnmarshalJSON(data []byte) (err error) {
varPlatformImageView := _PlatformImageView{}
err = json.Unmarshal(data, &varPlatformImageView)
if err != nil {
return err
}
*o = PlatformImageView(varPlatformImageView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "repository")
delete(additionalProperties, "tag")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformImageView struct {
value *PlatformImageView
isSet bool
}
func (v NullablePlatformImageView) Get() *PlatformImageView {
return v.value
}
func (v *NullablePlatformImageView) Set(val *PlatformImageView) {
v.value = val
v.isSet = true
}
func (v NullablePlatformImageView) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformImageView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformImageView(val *PlatformImageView) *NullablePlatformImageView {
return &NullablePlatformImageView{value: val, isSet: true}
}
func (v NullablePlatformImageView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformImageView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}