mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
5.1 KiB
Go
193 lines
5.1 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 PlatformImageOrigin type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PlatformImageOrigin{}
|
|
|
|
// PlatformImageOrigin struct for PlatformImageOrigin
|
|
type PlatformImageOrigin struct {
|
|
// Repository is the image repository. Required for source `image`.
|
|
Repository *string `json:"repository,omitempty"`
|
|
// Tag is the image tag to deploy; `latest` when omitted.
|
|
Tag *string `json:"tag,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PlatformImageOrigin PlatformImageOrigin
|
|
|
|
// NewPlatformImageOrigin instantiates a new PlatformImageOrigin 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 NewPlatformImageOrigin() *PlatformImageOrigin {
|
|
this := PlatformImageOrigin{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlatformImageOriginWithDefaults instantiates a new PlatformImageOrigin 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 NewPlatformImageOriginWithDefaults() *PlatformImageOrigin {
|
|
this := PlatformImageOrigin{}
|
|
return &this
|
|
}
|
|
|
|
// GetRepository returns the Repository field value if set, zero value otherwise.
|
|
func (o *PlatformImageOrigin) 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 *PlatformImageOrigin) 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 *PlatformImageOrigin) 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 *PlatformImageOrigin) SetRepository(v string) {
|
|
o.Repository = &v
|
|
}
|
|
|
|
// GetTag returns the Tag field value if set, zero value otherwise.
|
|
func (o *PlatformImageOrigin) 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 *PlatformImageOrigin) 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 *PlatformImageOrigin) 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 *PlatformImageOrigin) SetTag(v string) {
|
|
o.Tag = &v
|
|
}
|
|
|
|
func (o PlatformImageOrigin) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PlatformImageOrigin) 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 *PlatformImageOrigin) UnmarshalJSON(data []byte) (err error) {
|
|
varPlatformImageOrigin := _PlatformImageOrigin{}
|
|
|
|
err = json.Unmarshal(data, &varPlatformImageOrigin)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PlatformImageOrigin(varPlatformImageOrigin)
|
|
|
|
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 NullablePlatformImageOrigin struct {
|
|
value *PlatformImageOrigin
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlatformImageOrigin) Get() *PlatformImageOrigin {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlatformImageOrigin) Set(val *PlatformImageOrigin) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlatformImageOrigin) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlatformImageOrigin) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlatformImageOrigin(val *PlatformImageOrigin) *NullablePlatformImageOrigin {
|
|
return &NullablePlatformImageOrigin{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlatformImageOrigin) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlatformImageOrigin) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|