Files
sdk/model_capability.go

265 lines
6.4 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 Capability type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Capability{}
// Capability struct for Capability
type Capability struct {
Description *string `json:"description,omitempty"`
Href *string `json:"href,omitempty"`
Name *string `json:"name,omitempty"`
Stage *string `json:"stage,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Capability Capability
// NewCapability instantiates a new Capability 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 NewCapability() *Capability {
this := Capability{}
return &this
}
// NewCapabilityWithDefaults instantiates a new Capability 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 NewCapabilityWithDefaults() *Capability {
this := Capability{}
return &this
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Capability) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Capability) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *Capability) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *Capability) SetDescription(v string) {
o.Description = &v
}
// GetHref returns the Href field value if set, zero value otherwise.
func (o *Capability) GetHref() string {
if o == nil || IsNil(o.Href) {
var ret string
return ret
}
return *o.Href
}
// GetHrefOk returns a tuple with the Href field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Capability) GetHrefOk() (*string, bool) {
if o == nil || IsNil(o.Href) {
return nil, false
}
return o.Href, true
}
// HasHref returns a boolean if a field has been set.
func (o *Capability) HasHref() bool {
if o != nil && !IsNil(o.Href) {
return true
}
return false
}
// SetHref gets a reference to the given string and assigns it to the Href field.
func (o *Capability) SetHref(v string) {
o.Href = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Capability) 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 *Capability) 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 *Capability) 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 *Capability) SetName(v string) {
o.Name = &v
}
// GetStage returns the Stage field value if set, zero value otherwise.
func (o *Capability) GetStage() string {
if o == nil || IsNil(o.Stage) {
var ret string
return ret
}
return *o.Stage
}
// GetStageOk returns a tuple with the Stage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Capability) GetStageOk() (*string, bool) {
if o == nil || IsNil(o.Stage) {
return nil, false
}
return o.Stage, true
}
// HasStage returns a boolean if a field has been set.
func (o *Capability) HasStage() bool {
if o != nil && !IsNil(o.Stage) {
return true
}
return false
}
// SetStage gets a reference to the given string and assigns it to the Stage field.
func (o *Capability) SetStage(v string) {
o.Stage = &v
}
func (o Capability) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Capability) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.Href) {
toSerialize["href"] = o.Href
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Stage) {
toSerialize["stage"] = o.Stage
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Capability) UnmarshalJSON(data []byte) (err error) {
varCapability := _Capability{}
err = json.Unmarshal(data, &varCapability)
if err != nil {
return err
}
*o = Capability(varCapability)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "description")
delete(additionalProperties, "href")
delete(additionalProperties, "name")
delete(additionalProperties, "stage")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCapability struct {
value *Capability
isSet bool
}
func (v NullableCapability) Get() *Capability {
return v.value
}
func (v *NullableCapability) Set(val *Capability) {
v.value = val
v.isSet = true
}
func (v NullableCapability) IsSet() bool {
return v.isSet
}
func (v *NullableCapability) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCapability(val *Capability) *NullableCapability {
return &NullableCapability{value: val, isSet: true}
}
func (v NullableCapability) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCapability) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}