diff --git a/services/iaasalpha/model_create_image_payload.go b/services/iaasalpha/model_create_image_payload.go index c467540d0..fdc79f52b 100644 --- a/services/iaasalpha/model_create_image_payload.go +++ b/services/iaasalpha/model_create_image_payload.go @@ -20,7 +20,8 @@ var _ MappedNullable = &CreateImagePayload{} // CreateImagePayload Object that represents an Image and its parameters. Used for Creating and returning (get/list). type CreateImagePayload struct { - Config *ImageConfig `json:"config,omitempty"` + Checksum *ImageChecksum `json:"checksum,omitempty"` + Config *ImageConfig `json:"config,omitempty"` // Date-time when resource was created. CreatedAt *time.Time `json:"createdAt,omitempty"` // Object that represents a disk format. @@ -38,6 +39,8 @@ type CreateImagePayload struct { // REQUIRED Name *string `json:"name"` Protected *bool `json:"protected,omitempty"` + // Scope of an Image. + Scope *string `json:"scope,omitempty"` // The status of an image object. Status *string `json:"status,omitempty"` // Date-time when resource was last updated. @@ -65,6 +68,38 @@ func NewCreateImagePayloadWithDefaults() *CreateImagePayload { return &this } +// GetChecksum returns the Checksum field value if set, zero value otherwise. +func (o *CreateImagePayload) GetChecksum() *ImageChecksum { + if o == nil || IsNil(o.Checksum) { + var ret *ImageChecksum + return ret + } + return o.Checksum +} + +// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetChecksumOk() (*ImageChecksum, bool) { + if o == nil || IsNil(o.Checksum) { + return nil, false + } + return o.Checksum, true +} + +// HasChecksum returns a boolean if a field has been set. +func (o *CreateImagePayload) HasChecksum() bool { + if o != nil && !IsNil(o.Checksum) { + return true + } + + return false +} + +// SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. +func (o *CreateImagePayload) SetChecksum(v *ImageChecksum) { + o.Checksum = v +} + // GetConfig returns the Config field value if set, zero value otherwise. func (o *CreateImagePayload) GetConfig() *ImageConfig { if o == nil || IsNil(o.Config) { @@ -337,6 +372,38 @@ func (o *CreateImagePayload) SetProtected(v *bool) { o.Protected = v } +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *CreateImagePayload) GetScope() *string { + if o == nil || IsNil(o.Scope) { + var ret *string + return ret + } + return o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetScopeOk() (*string, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *CreateImagePayload) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *CreateImagePayload) SetScope(v *string) { + o.Scope = v +} + // GetStatus returns the Status field value if set, zero value otherwise. func (o *CreateImagePayload) GetStatus() *string { if o == nil || IsNil(o.Status) { @@ -403,6 +470,9 @@ func (o *CreateImagePayload) SetUpdatedAt(v *time.Time) { func (o CreateImagePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.Checksum) { + toSerialize["checksum"] = o.Checksum + } if !IsNil(o.Config) { toSerialize["config"] = o.Config } @@ -426,6 +496,9 @@ func (o CreateImagePayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Protected) { toSerialize["protected"] = o.Protected } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } if !IsNil(o.Status) { toSerialize["status"] = o.Status } diff --git a/services/iaasalpha/model_image.go b/services/iaasalpha/model_image.go index 2cd4e1b99..e6e523da5 100644 --- a/services/iaasalpha/model_image.go +++ b/services/iaasalpha/model_image.go @@ -20,7 +20,8 @@ var _ MappedNullable = &Image{} // Image Object that represents an Image and its parameters. Used for Creating and returning (get/list). type Image struct { - Config *ImageConfig `json:"config,omitempty"` + Checksum *ImageChecksum `json:"checksum,omitempty"` + Config *ImageConfig `json:"config,omitempty"` // Date-time when resource was created. CreatedAt *time.Time `json:"createdAt,omitempty"` // Object that represents a disk format. @@ -38,6 +39,8 @@ type Image struct { // REQUIRED Name *string `json:"name"` Protected *bool `json:"protected,omitempty"` + // Scope of an Image. + Scope *string `json:"scope,omitempty"` // The status of an image object. Status *string `json:"status,omitempty"` // Date-time when resource was last updated. @@ -65,6 +68,38 @@ func NewImageWithDefaults() *Image { return &this } +// GetChecksum returns the Checksum field value if set, zero value otherwise. +func (o *Image) GetChecksum() *ImageChecksum { + if o == nil || IsNil(o.Checksum) { + var ret *ImageChecksum + return ret + } + return o.Checksum +} + +// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetChecksumOk() (*ImageChecksum, bool) { + if o == nil || IsNil(o.Checksum) { + return nil, false + } + return o.Checksum, true +} + +// HasChecksum returns a boolean if a field has been set. +func (o *Image) HasChecksum() bool { + if o != nil && !IsNil(o.Checksum) { + return true + } + + return false +} + +// SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. +func (o *Image) SetChecksum(v *ImageChecksum) { + o.Checksum = v +} + // GetConfig returns the Config field value if set, zero value otherwise. func (o *Image) GetConfig() *ImageConfig { if o == nil || IsNil(o.Config) { @@ -337,6 +372,38 @@ func (o *Image) SetProtected(v *bool) { o.Protected = v } +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *Image) GetScope() *string { + if o == nil || IsNil(o.Scope) { + var ret *string + return ret + } + return o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetScopeOk() (*string, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *Image) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *Image) SetScope(v *string) { + o.Scope = v +} + // GetStatus returns the Status field value if set, zero value otherwise. func (o *Image) GetStatus() *string { if o == nil || IsNil(o.Status) { @@ -403,6 +470,9 @@ func (o *Image) SetUpdatedAt(v *time.Time) { func (o Image) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.Checksum) { + toSerialize["checksum"] = o.Checksum + } if !IsNil(o.Config) { toSerialize["config"] = o.Config } @@ -426,6 +496,9 @@ func (o Image) ToMap() (map[string]interface{}, error) { if !IsNil(o.Protected) { toSerialize["protected"] = o.Protected } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } if !IsNil(o.Status) { toSerialize["status"] = o.Status } diff --git a/services/iaasalpha/model_image_checksum.go b/services/iaasalpha/model_image_checksum.go new file mode 100644 index 000000000..48df5c5b1 --- /dev/null +++ b/services/iaasalpha/model_image_checksum.go @@ -0,0 +1,140 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the ImageChecksum type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageChecksum{} + +// ImageChecksum Representation of an image checksum. +type ImageChecksum struct { + // Algorithm for the checksum of the image data. + // REQUIRED + Algorithm *string `json:"algorithm"` + // Hexdigest of the checksum of the image data. + // REQUIRED + Digest *string `json:"digest"` +} + +type _ImageChecksum ImageChecksum + +// NewImageChecksum instantiates a new ImageChecksum 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 NewImageChecksum(algorithm *string, digest *string) *ImageChecksum { + this := ImageChecksum{} + this.Algorithm = algorithm + this.Digest = digest + return &this +} + +// NewImageChecksumWithDefaults instantiates a new ImageChecksum 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 NewImageChecksumWithDefaults() *ImageChecksum { + this := ImageChecksum{} + return &this +} + +// GetAlgorithm returns the Algorithm field value +func (o *ImageChecksum) GetAlgorithm() *string { + if o == nil { + var ret *string + return ret + } + + return o.Algorithm +} + +// GetAlgorithmOk returns a tuple with the Algorithm field value +// and a boolean to check if the value has been set. +func (o *ImageChecksum) GetAlgorithmOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Algorithm, true +} + +// SetAlgorithm sets field value +func (o *ImageChecksum) SetAlgorithm(v *string) { + o.Algorithm = v +} + +// GetDigest returns the Digest field value +func (o *ImageChecksum) GetDigest() *string { + if o == nil { + var ret *string + return ret + } + + return o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value +// and a boolean to check if the value has been set. +func (o *ImageChecksum) GetDigestOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Digest, true +} + +// SetDigest sets field value +func (o *ImageChecksum) SetDigest(v *string) { + o.Digest = v +} + +func (o ImageChecksum) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["algorithm"] = o.Algorithm + toSerialize["digest"] = o.Digest + return toSerialize, nil +} + +type NullableImageChecksum struct { + value *ImageChecksum + isSet bool +} + +func (v NullableImageChecksum) Get() *ImageChecksum { + return v.value +} + +func (v *NullableImageChecksum) Set(val *ImageChecksum) { + v.value = val + v.isSet = true +} + +func (v NullableImageChecksum) IsSet() bool { + return v.isSet +} + +func (v *NullableImageChecksum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageChecksum(val *ImageChecksum) *NullableImageChecksum { + return &NullableImageChecksum{value: val, isSet: true} +} + +func (v NullableImageChecksum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageChecksum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}