mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
265 lines
6.7 KiB
Go
265 lines
6.7 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 DestinationField type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &DestinationField{}
|
|
|
|
// DestinationField struct for DestinationField
|
|
type DestinationField struct {
|
|
Example *string `json:"example,omitempty"`
|
|
Key *string `json:"key,omitempty"`
|
|
Label *string `json:"label,omitempty"`
|
|
Required *bool `json:"required,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _DestinationField DestinationField
|
|
|
|
// NewDestinationField instantiates a new DestinationField 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 NewDestinationField() *DestinationField {
|
|
this := DestinationField{}
|
|
return &this
|
|
}
|
|
|
|
// NewDestinationFieldWithDefaults instantiates a new DestinationField 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 NewDestinationFieldWithDefaults() *DestinationField {
|
|
this := DestinationField{}
|
|
return &this
|
|
}
|
|
|
|
// GetExample returns the Example field value if set, zero value otherwise.
|
|
func (o *DestinationField) GetExample() string {
|
|
if o == nil || IsNil(o.Example) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Example
|
|
}
|
|
|
|
// GetExampleOk returns a tuple with the Example field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *DestinationField) GetExampleOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Example) {
|
|
return nil, false
|
|
}
|
|
return o.Example, true
|
|
}
|
|
|
|
// HasExample returns a boolean if a field has been set.
|
|
func (o *DestinationField) HasExample() bool {
|
|
if o != nil && !IsNil(o.Example) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExample gets a reference to the given string and assigns it to the Example field.
|
|
func (o *DestinationField) SetExample(v string) {
|
|
o.Example = &v
|
|
}
|
|
|
|
// GetKey returns the Key field value if set, zero value otherwise.
|
|
func (o *DestinationField) GetKey() string {
|
|
if o == nil || IsNil(o.Key) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Key
|
|
}
|
|
|
|
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *DestinationField) GetKeyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Key) {
|
|
return nil, false
|
|
}
|
|
return o.Key, true
|
|
}
|
|
|
|
// HasKey returns a boolean if a field has been set.
|
|
func (o *DestinationField) HasKey() bool {
|
|
if o != nil && !IsNil(o.Key) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKey gets a reference to the given string and assigns it to the Key field.
|
|
func (o *DestinationField) SetKey(v string) {
|
|
o.Key = &v
|
|
}
|
|
|
|
// GetLabel returns the Label field value if set, zero value otherwise.
|
|
func (o *DestinationField) GetLabel() string {
|
|
if o == nil || IsNil(o.Label) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Label
|
|
}
|
|
|
|
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *DestinationField) GetLabelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Label) {
|
|
return nil, false
|
|
}
|
|
return o.Label, true
|
|
}
|
|
|
|
// HasLabel returns a boolean if a field has been set.
|
|
func (o *DestinationField) HasLabel() bool {
|
|
if o != nil && !IsNil(o.Label) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLabel gets a reference to the given string and assigns it to the Label field.
|
|
func (o *DestinationField) SetLabel(v string) {
|
|
o.Label = &v
|
|
}
|
|
|
|
// GetRequired returns the Required field value if set, zero value otherwise.
|
|
func (o *DestinationField) GetRequired() bool {
|
|
if o == nil || IsNil(o.Required) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Required
|
|
}
|
|
|
|
// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *DestinationField) GetRequiredOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Required) {
|
|
return nil, false
|
|
}
|
|
return o.Required, true
|
|
}
|
|
|
|
// HasRequired returns a boolean if a field has been set.
|
|
func (o *DestinationField) HasRequired() bool {
|
|
if o != nil && !IsNil(o.Required) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRequired gets a reference to the given bool and assigns it to the Required field.
|
|
func (o *DestinationField) SetRequired(v bool) {
|
|
o.Required = &v
|
|
}
|
|
|
|
func (o DestinationField) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o DestinationField) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Example) {
|
|
toSerialize["example"] = o.Example
|
|
}
|
|
if !IsNil(o.Key) {
|
|
toSerialize["key"] = o.Key
|
|
}
|
|
if !IsNil(o.Label) {
|
|
toSerialize["label"] = o.Label
|
|
}
|
|
if !IsNil(o.Required) {
|
|
toSerialize["required"] = o.Required
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *DestinationField) UnmarshalJSON(data []byte) (err error) {
|
|
varDestinationField := _DestinationField{}
|
|
|
|
err = json.Unmarshal(data, &varDestinationField)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = DestinationField(varDestinationField)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "example")
|
|
delete(additionalProperties, "key")
|
|
delete(additionalProperties, "label")
|
|
delete(additionalProperties, "required")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableDestinationField struct {
|
|
value *DestinationField
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableDestinationField) Get() *DestinationField {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableDestinationField) Set(val *DestinationField) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableDestinationField) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableDestinationField) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableDestinationField(val *DestinationField) *NullableDestinationField {
|
|
return &NullableDestinationField{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableDestinationField) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableDestinationField) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|