mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
339 lines
8.0 KiB
Go
339 lines
8.0 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 Scale type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Scale{}
|
|
|
|
// Scale struct for Scale
|
|
type Scale struct {
|
|
CreatedTime *string `json:"createdTime,omitempty"`
|
|
DisplayName *string `json:"displayName,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Owner *string `json:"owner,omitempty"`
|
|
State *string `json:"state,omitempty"`
|
|
Text *string `json:"text,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Scale Scale
|
|
|
|
// NewScale instantiates a new Scale 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 NewScale() *Scale {
|
|
this := Scale{}
|
|
return &this
|
|
}
|
|
|
|
// NewScaleWithDefaults instantiates a new Scale 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 NewScaleWithDefaults() *Scale {
|
|
this := Scale{}
|
|
return &this
|
|
}
|
|
|
|
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
|
|
func (o *Scale) GetCreatedTime() string {
|
|
if o == nil || IsNil(o.CreatedTime) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CreatedTime
|
|
}
|
|
|
|
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Scale) GetCreatedTimeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CreatedTime) {
|
|
return nil, false
|
|
}
|
|
return o.CreatedTime, true
|
|
}
|
|
|
|
// HasCreatedTime returns a boolean if a field has been set.
|
|
func (o *Scale) HasCreatedTime() bool {
|
|
if o != nil && !IsNil(o.CreatedTime) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
|
|
func (o *Scale) SetCreatedTime(v string) {
|
|
o.CreatedTime = &v
|
|
}
|
|
|
|
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
|
|
func (o *Scale) GetDisplayName() string {
|
|
if o == nil || IsNil(o.DisplayName) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.DisplayName
|
|
}
|
|
|
|
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Scale) GetDisplayNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.DisplayName) {
|
|
return nil, false
|
|
}
|
|
return o.DisplayName, true
|
|
}
|
|
|
|
// HasDisplayName returns a boolean if a field has been set.
|
|
func (o *Scale) HasDisplayName() bool {
|
|
if o != nil && !IsNil(o.DisplayName) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
|
|
func (o *Scale) SetDisplayName(v string) {
|
|
o.DisplayName = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *Scale) 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 *Scale) 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 *Scale) 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 *Scale) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetOwner returns the Owner field value if set, zero value otherwise.
|
|
func (o *Scale) GetOwner() string {
|
|
if o == nil || IsNil(o.Owner) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Owner
|
|
}
|
|
|
|
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Scale) GetOwnerOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Owner) {
|
|
return nil, false
|
|
}
|
|
return o.Owner, true
|
|
}
|
|
|
|
// HasOwner returns a boolean if a field has been set.
|
|
func (o *Scale) HasOwner() bool {
|
|
if o != nil && !IsNil(o.Owner) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOwner gets a reference to the given string and assigns it to the Owner field.
|
|
func (o *Scale) SetOwner(v string) {
|
|
o.Owner = &v
|
|
}
|
|
|
|
// GetState returns the State field value if set, zero value otherwise.
|
|
func (o *Scale) GetState() string {
|
|
if o == nil || IsNil(o.State) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.State
|
|
}
|
|
|
|
// GetStateOk returns a tuple with the State field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Scale) GetStateOk() (*string, bool) {
|
|
if o == nil || IsNil(o.State) {
|
|
return nil, false
|
|
}
|
|
return o.State, true
|
|
}
|
|
|
|
// HasState returns a boolean if a field has been set.
|
|
func (o *Scale) HasState() bool {
|
|
if o != nil && !IsNil(o.State) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetState gets a reference to the given string and assigns it to the State field.
|
|
func (o *Scale) SetState(v string) {
|
|
o.State = &v
|
|
}
|
|
|
|
// GetText returns the Text field value if set, zero value otherwise.
|
|
func (o *Scale) GetText() string {
|
|
if o == nil || IsNil(o.Text) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Text
|
|
}
|
|
|
|
// GetTextOk returns a tuple with the Text field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Scale) GetTextOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Text) {
|
|
return nil, false
|
|
}
|
|
return o.Text, true
|
|
}
|
|
|
|
// HasText returns a boolean if a field has been set.
|
|
func (o *Scale) HasText() bool {
|
|
if o != nil && !IsNil(o.Text) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetText gets a reference to the given string and assigns it to the Text field.
|
|
func (o *Scale) SetText(v string) {
|
|
o.Text = &v
|
|
}
|
|
|
|
func (o Scale) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Scale) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.CreatedTime) {
|
|
toSerialize["createdTime"] = o.CreatedTime
|
|
}
|
|
if !IsNil(o.DisplayName) {
|
|
toSerialize["displayName"] = o.DisplayName
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Owner) {
|
|
toSerialize["owner"] = o.Owner
|
|
}
|
|
if !IsNil(o.State) {
|
|
toSerialize["state"] = o.State
|
|
}
|
|
if !IsNil(o.Text) {
|
|
toSerialize["text"] = o.Text
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Scale) UnmarshalJSON(data []byte) (err error) {
|
|
varScale := _Scale{}
|
|
|
|
err = json.Unmarshal(data, &varScale)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Scale(varScale)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "createdTime")
|
|
delete(additionalProperties, "displayName")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "owner")
|
|
delete(additionalProperties, "state")
|
|
delete(additionalProperties, "text")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableScale struct {
|
|
value *Scale
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableScale) Get() *Scale {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableScale) Set(val *Scale) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableScale) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableScale) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableScale(val *Scale) *NullableScale {
|
|
return &NullableScale{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableScale) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableScale) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|