Files
sdk/model_ml_ml_create.go

231 lines
6.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 MlMlCreate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MlMlCreate{}
// MlMlCreate struct for MlMlCreate
type MlMlCreate struct {
// Labels are extra labels to set on the object, merged UNDER the tenancy labels this plane derives from the validated principal — so a label naming another org's scope cannot displace the real one.
Labels map[string]string `json:"labels,omitempty"`
// Name is the resource's name: a DNS-1123 label (^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$), lowercased and trimmed. It is the name the resource answers to for the life of the caller's org.
Name *string `json:"name,omitempty"`
Spec interface{} `json:"spec,omitempty"`
AdditionalProperties map[string]interface{}
}
type _MlMlCreate MlMlCreate
// NewMlMlCreate instantiates a new MlMlCreate 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 NewMlMlCreate() *MlMlCreate {
this := MlMlCreate{}
return &this
}
// NewMlMlCreateWithDefaults instantiates a new MlMlCreate 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 NewMlMlCreateWithDefaults() *MlMlCreate {
this := MlMlCreate{}
return &this
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *MlMlCreate) GetLabels() map[string]string {
if o == nil || IsNil(o.Labels) {
var ret map[string]string
return ret
}
return o.Labels
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MlMlCreate) GetLabelsOk() (map[string]string, bool) {
if o == nil || IsNil(o.Labels) {
return map[string]string{}, false
}
return o.Labels, true
}
// HasLabels returns a boolean if a field has been set.
func (o *MlMlCreate) HasLabels() bool {
if o != nil && !IsNil(o.Labels) {
return true
}
return false
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *MlMlCreate) SetLabels(v map[string]string) {
o.Labels = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *MlMlCreate) 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 *MlMlCreate) 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 *MlMlCreate) 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 *MlMlCreate) SetName(v string) {
o.Name = &v
}
// GetSpec returns the Spec field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MlMlCreate) GetSpec() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Spec
}
// GetSpecOk returns a tuple with the Spec field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MlMlCreate) GetSpecOk() (*interface{}, bool) {
if o == nil || IsNil(o.Spec) {
return nil, false
}
return &o.Spec, true
}
// HasSpec returns a boolean if a field has been set.
func (o *MlMlCreate) HasSpec() bool {
if o != nil && !IsNil(o.Spec) {
return true
}
return false
}
// SetSpec gets a reference to the given interface{} and assigns it to the Spec field.
func (o *MlMlCreate) SetSpec(v interface{}) {
o.Spec = v
}
func (o MlMlCreate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MlMlCreate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Labels) {
toSerialize["labels"] = o.Labels
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if o.Spec != nil {
toSerialize["spec"] = o.Spec
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MlMlCreate) UnmarshalJSON(data []byte) (err error) {
varMlMlCreate := _MlMlCreate{}
err = json.Unmarshal(data, &varMlMlCreate)
if err != nil {
return err
}
*o = MlMlCreate(varMlMlCreate)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "labels")
delete(additionalProperties, "name")
delete(additionalProperties, "spec")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMlMlCreate struct {
value *MlMlCreate
isSet bool
}
func (v NullableMlMlCreate) Get() *MlMlCreate {
return v.value
}
func (v *NullableMlMlCreate) Set(val *MlMlCreate) {
v.value = val
v.isSet = true
}
func (v NullableMlMlCreate) IsSet() bool {
return v.isSet
}
func (v *NullableMlMlCreate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMlMlCreate(val *MlMlCreate) *NullableMlMlCreate {
return &NullableMlMlCreate{value: val, isSet: true}
}
func (v NullableMlMlCreate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMlMlCreate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}