mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
228 lines
5.8 KiB
Go
228 lines
5.8 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 ContainerDetail type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ContainerDetail{}
|
|
|
|
// ContainerDetail struct for ContainerDetail
|
|
type ContainerDetail struct {
|
|
Image *string `json:"image,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Resources *ResourceRequests `json:"resources,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ContainerDetail ContainerDetail
|
|
|
|
// NewContainerDetail instantiates a new ContainerDetail 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 NewContainerDetail() *ContainerDetail {
|
|
this := ContainerDetail{}
|
|
return &this
|
|
}
|
|
|
|
// NewContainerDetailWithDefaults instantiates a new ContainerDetail 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 NewContainerDetailWithDefaults() *ContainerDetail {
|
|
this := ContainerDetail{}
|
|
return &this
|
|
}
|
|
|
|
// GetImage returns the Image field value if set, zero value otherwise.
|
|
func (o *ContainerDetail) GetImage() string {
|
|
if o == nil || IsNil(o.Image) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Image
|
|
}
|
|
|
|
// GetImageOk returns a tuple with the Image field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContainerDetail) GetImageOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Image) {
|
|
return nil, false
|
|
}
|
|
return o.Image, true
|
|
}
|
|
|
|
// HasImage returns a boolean if a field has been set.
|
|
func (o *ContainerDetail) HasImage() bool {
|
|
if o != nil && !IsNil(o.Image) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetImage gets a reference to the given string and assigns it to the Image field.
|
|
func (o *ContainerDetail) SetImage(v string) {
|
|
o.Image = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *ContainerDetail) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContainerDetail) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *ContainerDetail) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *ContainerDetail) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetResources returns the Resources field value if set, zero value otherwise.
|
|
func (o *ContainerDetail) GetResources() ResourceRequests {
|
|
if o == nil || IsNil(o.Resources) {
|
|
var ret ResourceRequests
|
|
return ret
|
|
}
|
|
return *o.Resources
|
|
}
|
|
|
|
// GetResourcesOk returns a tuple with the Resources field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContainerDetail) GetResourcesOk() (*ResourceRequests, bool) {
|
|
if o == nil || IsNil(o.Resources) {
|
|
return nil, false
|
|
}
|
|
return o.Resources, true
|
|
}
|
|
|
|
// HasResources returns a boolean if a field has been set.
|
|
func (o *ContainerDetail) HasResources() bool {
|
|
if o != nil && !IsNil(o.Resources) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResources gets a reference to the given ResourceRequests and assigns it to the Resources field.
|
|
func (o *ContainerDetail) SetResources(v ResourceRequests) {
|
|
o.Resources = &v
|
|
}
|
|
|
|
func (o ContainerDetail) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ContainerDetail) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Image) {
|
|
toSerialize["image"] = o.Image
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Resources) {
|
|
toSerialize["resources"] = o.Resources
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ContainerDetail) UnmarshalJSON(data []byte) (err error) {
|
|
varContainerDetail := _ContainerDetail{}
|
|
|
|
err = json.Unmarshal(data, &varContainerDetail)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ContainerDetail(varContainerDetail)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "image")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "resources")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableContainerDetail struct {
|
|
value *ContainerDetail
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableContainerDetail) Get() *ContainerDetail {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableContainerDetail) Set(val *ContainerDetail) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableContainerDetail) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableContainerDetail) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableContainerDetail(val *ContainerDetail) *NullableContainerDetail {
|
|
return &NullableContainerDetail{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableContainerDetail) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableContainerDetail) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|