mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.9 KiB
Go
269 lines
6.9 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 LinkSourceState type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &LinkSourceState{}
|
|
|
|
// LinkSourceState struct for LinkSourceState
|
|
type LinkSourceState struct {
|
|
// Available reports whether this ledger answered; false is honest \"unavailable\", never a zero that would read as no usage.
|
|
Available *bool `json:"available,omitempty"`
|
|
// Note says in prose what the ledger's numbers mean.
|
|
Note *string `json:"note,omitempty"`
|
|
// Scope is whose usage the ledger measures: user or org.
|
|
Scope *string `json:"scope,omitempty"`
|
|
// Source is the table of record behind the ledger.
|
|
Source *string `json:"source,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _LinkSourceState LinkSourceState
|
|
|
|
// NewLinkSourceState instantiates a new LinkSourceState 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 NewLinkSourceState() *LinkSourceState {
|
|
this := LinkSourceState{}
|
|
return &this
|
|
}
|
|
|
|
// NewLinkSourceStateWithDefaults instantiates a new LinkSourceState 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 NewLinkSourceStateWithDefaults() *LinkSourceState {
|
|
this := LinkSourceState{}
|
|
return &this
|
|
}
|
|
|
|
// GetAvailable returns the Available field value if set, zero value otherwise.
|
|
func (o *LinkSourceState) GetAvailable() bool {
|
|
if o == nil || IsNil(o.Available) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Available
|
|
}
|
|
|
|
// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkSourceState) GetAvailableOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Available) {
|
|
return nil, false
|
|
}
|
|
return o.Available, true
|
|
}
|
|
|
|
// HasAvailable returns a boolean if a field has been set.
|
|
func (o *LinkSourceState) HasAvailable() bool {
|
|
if o != nil && !IsNil(o.Available) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAvailable gets a reference to the given bool and assigns it to the Available field.
|
|
func (o *LinkSourceState) SetAvailable(v bool) {
|
|
o.Available = &v
|
|
}
|
|
|
|
// GetNote returns the Note field value if set, zero value otherwise.
|
|
func (o *LinkSourceState) GetNote() string {
|
|
if o == nil || IsNil(o.Note) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Note
|
|
}
|
|
|
|
// GetNoteOk returns a tuple with the Note field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkSourceState) GetNoteOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Note) {
|
|
return nil, false
|
|
}
|
|
return o.Note, true
|
|
}
|
|
|
|
// HasNote returns a boolean if a field has been set.
|
|
func (o *LinkSourceState) HasNote() bool {
|
|
if o != nil && !IsNil(o.Note) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNote gets a reference to the given string and assigns it to the Note field.
|
|
func (o *LinkSourceState) SetNote(v string) {
|
|
o.Note = &v
|
|
}
|
|
|
|
// GetScope returns the Scope field value if set, zero value otherwise.
|
|
func (o *LinkSourceState) GetScope() string {
|
|
if o == nil || IsNil(o.Scope) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Scope
|
|
}
|
|
|
|
// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkSourceState) GetScopeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Scope) {
|
|
return nil, false
|
|
}
|
|
return o.Scope, true
|
|
}
|
|
|
|
// HasScope returns a boolean if a field has been set.
|
|
func (o *LinkSourceState) HasScope() bool {
|
|
if o != nil && !IsNil(o.Scope) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetScope gets a reference to the given string and assigns it to the Scope field.
|
|
func (o *LinkSourceState) SetScope(v string) {
|
|
o.Scope = &v
|
|
}
|
|
|
|
// GetSource returns the Source field value if set, zero value otherwise.
|
|
func (o *LinkSourceState) GetSource() string {
|
|
if o == nil || IsNil(o.Source) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Source
|
|
}
|
|
|
|
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkSourceState) GetSourceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Source) {
|
|
return nil, false
|
|
}
|
|
return o.Source, true
|
|
}
|
|
|
|
// HasSource returns a boolean if a field has been set.
|
|
func (o *LinkSourceState) HasSource() bool {
|
|
if o != nil && !IsNil(o.Source) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSource gets a reference to the given string and assigns it to the Source field.
|
|
func (o *LinkSourceState) SetSource(v string) {
|
|
o.Source = &v
|
|
}
|
|
|
|
func (o LinkSourceState) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o LinkSourceState) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Available) {
|
|
toSerialize["available"] = o.Available
|
|
}
|
|
if !IsNil(o.Note) {
|
|
toSerialize["note"] = o.Note
|
|
}
|
|
if !IsNil(o.Scope) {
|
|
toSerialize["scope"] = o.Scope
|
|
}
|
|
if !IsNil(o.Source) {
|
|
toSerialize["source"] = o.Source
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *LinkSourceState) UnmarshalJSON(data []byte) (err error) {
|
|
varLinkSourceState := _LinkSourceState{}
|
|
|
|
err = json.Unmarshal(data, &varLinkSourceState)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = LinkSourceState(varLinkSourceState)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "available")
|
|
delete(additionalProperties, "note")
|
|
delete(additionalProperties, "scope")
|
|
delete(additionalProperties, "source")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableLinkSourceState struct {
|
|
value *LinkSourceState
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableLinkSourceState) Get() *LinkSourceState {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableLinkSourceState) Set(val *LinkSourceState) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableLinkSourceState) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableLinkSourceState) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableLinkSourceState(val *LinkSourceState) *NullableLinkSourceState {
|
|
return &NullableLinkSourceState{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableLinkSourceState) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableLinkSourceState) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|