Files
sdk/model_link_route_candidate.go

535 lines
14 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 LinkRouteCandidate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LinkRouteCandidate{}
// LinkRouteCandidate struct for LinkRouteCandidate
type LinkRouteCandidate struct {
// Account is the provider-side account identifier.
Account *string `json:"account,omitempty"`
// Available reports whether the candidate is routable right now.
Available *bool `json:"available,omitempty"`
// Billing is the cost consequence of dialing this candidate: plan (the user's own subscription) or commerce (the metered gateway path).
Billing *string `json:"billing,omitempty"`
// HeadroomPct is the remaining rate-limit capacity, 0..100. A link with no snapshot counts as full headroom.
HeadroomPct *float64 `json:"headroomPct,omitempty"`
// Host is that machine's hostname label.
Host *string `json:"host,omitempty"`
// Kind is how the account authenticates: subscription or apikey.
Kind *string `json:"kind,omitempty"`
// LinkID is the underlying link's opaque handle.
LinkId *string `json:"linkId,omitempty"`
// Machine is the machine the account is signed in on.
Machine *string `json:"machine,omitempty"`
// Plan is the provider plan label the account is on.
Plan *string `json:"plan,omitempty"`
// Provider is the AI provider the candidate account belongs to.
Provider *string `json:"provider,omitempty"`
// Reason says why the candidate is not routable, when Available is false.
Reason *string `json:"reason,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LinkRouteCandidate LinkRouteCandidate
// NewLinkRouteCandidate instantiates a new LinkRouteCandidate 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 NewLinkRouteCandidate() *LinkRouteCandidate {
this := LinkRouteCandidate{}
return &this
}
// NewLinkRouteCandidateWithDefaults instantiates a new LinkRouteCandidate 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 NewLinkRouteCandidateWithDefaults() *LinkRouteCandidate {
this := LinkRouteCandidate{}
return &this
}
// GetAccount returns the Account field value if set, zero value otherwise.
func (o *LinkRouteCandidate) GetAccount() string {
if o == nil || IsNil(o.Account) {
var ret string
return ret
}
return *o.Account
}
// GetAccountOk returns a tuple with the Account field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkRouteCandidate) GetAccountOk() (*string, bool) {
if o == nil || IsNil(o.Account) {
return nil, false
}
return o.Account, true
}
// HasAccount returns a boolean if a field has been set.
func (o *LinkRouteCandidate) HasAccount() bool {
if o != nil && !IsNil(o.Account) {
return true
}
return false
}
// SetAccount gets a reference to the given string and assigns it to the Account field.
func (o *LinkRouteCandidate) SetAccount(v string) {
o.Account = &v
}
// GetAvailable returns the Available field value if set, zero value otherwise.
func (o *LinkRouteCandidate) 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 *LinkRouteCandidate) 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 *LinkRouteCandidate) 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 *LinkRouteCandidate) SetAvailable(v bool) {
o.Available = &v
}
// GetBilling returns the Billing field value if set, zero value otherwise.
func (o *LinkRouteCandidate) GetBilling() string {
if o == nil || IsNil(o.Billing) {
var ret string
return ret
}
return *o.Billing
}
// GetBillingOk returns a tuple with the Billing field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkRouteCandidate) GetBillingOk() (*string, bool) {
if o == nil || IsNil(o.Billing) {
return nil, false
}
return o.Billing, true
}
// HasBilling returns a boolean if a field has been set.
func (o *LinkRouteCandidate) HasBilling() bool {
if o != nil && !IsNil(o.Billing) {
return true
}
return false
}
// SetBilling gets a reference to the given string and assigns it to the Billing field.
func (o *LinkRouteCandidate) SetBilling(v string) {
o.Billing = &v
}
// GetHeadroomPct returns the HeadroomPct field value if set, zero value otherwise.
func (o *LinkRouteCandidate) GetHeadroomPct() float64 {
if o == nil || IsNil(o.HeadroomPct) {
var ret float64
return ret
}
return *o.HeadroomPct
}
// GetHeadroomPctOk returns a tuple with the HeadroomPct field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkRouteCandidate) GetHeadroomPctOk() (*float64, bool) {
if o == nil || IsNil(o.HeadroomPct) {
return nil, false
}
return o.HeadroomPct, true
}
// HasHeadroomPct returns a boolean if a field has been set.
func (o *LinkRouteCandidate) HasHeadroomPct() bool {
if o != nil && !IsNil(o.HeadroomPct) {
return true
}
return false
}
// SetHeadroomPct gets a reference to the given float64 and assigns it to the HeadroomPct field.
func (o *LinkRouteCandidate) SetHeadroomPct(v float64) {
o.HeadroomPct = &v
}
// GetHost returns the Host field value if set, zero value otherwise.
func (o *LinkRouteCandidate) GetHost() string {
if o == nil || IsNil(o.Host) {
var ret string
return ret
}
return *o.Host
}
// GetHostOk returns a tuple with the Host field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkRouteCandidate) GetHostOk() (*string, bool) {
if o == nil || IsNil(o.Host) {
return nil, false
}
return o.Host, true
}
// HasHost returns a boolean if a field has been set.
func (o *LinkRouteCandidate) HasHost() bool {
if o != nil && !IsNil(o.Host) {
return true
}
return false
}
// SetHost gets a reference to the given string and assigns it to the Host field.
func (o *LinkRouteCandidate) SetHost(v string) {
o.Host = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *LinkRouteCandidate) GetKind() string {
if o == nil || IsNil(o.Kind) {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkRouteCandidate) GetKindOk() (*string, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *LinkRouteCandidate) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *LinkRouteCandidate) SetKind(v string) {
o.Kind = &v
}
// GetLinkId returns the LinkId field value if set, zero value otherwise.
func (o *LinkRouteCandidate) GetLinkId() string {
if o == nil || IsNil(o.LinkId) {
var ret string
return ret
}
return *o.LinkId
}
// GetLinkIdOk returns a tuple with the LinkId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkRouteCandidate) GetLinkIdOk() (*string, bool) {
if o == nil || IsNil(o.LinkId) {
return nil, false
}
return o.LinkId, true
}
// HasLinkId returns a boolean if a field has been set.
func (o *LinkRouteCandidate) HasLinkId() bool {
if o != nil && !IsNil(o.LinkId) {
return true
}
return false
}
// SetLinkId gets a reference to the given string and assigns it to the LinkId field.
func (o *LinkRouteCandidate) SetLinkId(v string) {
o.LinkId = &v
}
// GetMachine returns the Machine field value if set, zero value otherwise.
func (o *LinkRouteCandidate) GetMachine() string {
if o == nil || IsNil(o.Machine) {
var ret string
return ret
}
return *o.Machine
}
// GetMachineOk returns a tuple with the Machine field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkRouteCandidate) GetMachineOk() (*string, bool) {
if o == nil || IsNil(o.Machine) {
return nil, false
}
return o.Machine, true
}
// HasMachine returns a boolean if a field has been set.
func (o *LinkRouteCandidate) HasMachine() bool {
if o != nil && !IsNil(o.Machine) {
return true
}
return false
}
// SetMachine gets a reference to the given string and assigns it to the Machine field.
func (o *LinkRouteCandidate) SetMachine(v string) {
o.Machine = &v
}
// GetPlan returns the Plan field value if set, zero value otherwise.
func (o *LinkRouteCandidate) GetPlan() string {
if o == nil || IsNil(o.Plan) {
var ret string
return ret
}
return *o.Plan
}
// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkRouteCandidate) GetPlanOk() (*string, bool) {
if o == nil || IsNil(o.Plan) {
return nil, false
}
return o.Plan, true
}
// HasPlan returns a boolean if a field has been set.
func (o *LinkRouteCandidate) HasPlan() bool {
if o != nil && !IsNil(o.Plan) {
return true
}
return false
}
// SetPlan gets a reference to the given string and assigns it to the Plan field.
func (o *LinkRouteCandidate) SetPlan(v string) {
o.Plan = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *LinkRouteCandidate) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkRouteCandidate) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *LinkRouteCandidate) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *LinkRouteCandidate) SetProvider(v string) {
o.Provider = &v
}
// GetReason returns the Reason field value if set, zero value otherwise.
func (o *LinkRouteCandidate) GetReason() string {
if o == nil || IsNil(o.Reason) {
var ret string
return ret
}
return *o.Reason
}
// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkRouteCandidate) GetReasonOk() (*string, bool) {
if o == nil || IsNil(o.Reason) {
return nil, false
}
return o.Reason, true
}
// HasReason returns a boolean if a field has been set.
func (o *LinkRouteCandidate) HasReason() bool {
if o != nil && !IsNil(o.Reason) {
return true
}
return false
}
// SetReason gets a reference to the given string and assigns it to the Reason field.
func (o *LinkRouteCandidate) SetReason(v string) {
o.Reason = &v
}
func (o LinkRouteCandidate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LinkRouteCandidate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Account) {
toSerialize["account"] = o.Account
}
if !IsNil(o.Available) {
toSerialize["available"] = o.Available
}
if !IsNil(o.Billing) {
toSerialize["billing"] = o.Billing
}
if !IsNil(o.HeadroomPct) {
toSerialize["headroomPct"] = o.HeadroomPct
}
if !IsNil(o.Host) {
toSerialize["host"] = o.Host
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.LinkId) {
toSerialize["linkId"] = o.LinkId
}
if !IsNil(o.Machine) {
toSerialize["machine"] = o.Machine
}
if !IsNil(o.Plan) {
toSerialize["plan"] = o.Plan
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Reason) {
toSerialize["reason"] = o.Reason
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LinkRouteCandidate) UnmarshalJSON(data []byte) (err error) {
varLinkRouteCandidate := _LinkRouteCandidate{}
err = json.Unmarshal(data, &varLinkRouteCandidate)
if err != nil {
return err
}
*o = LinkRouteCandidate(varLinkRouteCandidate)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "account")
delete(additionalProperties, "available")
delete(additionalProperties, "billing")
delete(additionalProperties, "headroomPct")
delete(additionalProperties, "host")
delete(additionalProperties, "kind")
delete(additionalProperties, "linkId")
delete(additionalProperties, "machine")
delete(additionalProperties, "plan")
delete(additionalProperties, "provider")
delete(additionalProperties, "reason")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLinkRouteCandidate struct {
value *LinkRouteCandidate
isSet bool
}
func (v NullableLinkRouteCandidate) Get() *LinkRouteCandidate {
return v.value
}
func (v *NullableLinkRouteCandidate) Set(val *LinkRouteCandidate) {
v.value = val
v.isSet = true
}
func (v NullableLinkRouteCandidate) IsSet() bool {
return v.isSet
}
func (v *NullableLinkRouteCandidate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLinkRouteCandidate(val *LinkRouteCandidate) *NullableLinkRouteCandidate {
return &NullableLinkRouteCandidate{value: val, isSet: true}
}
func (v NullableLinkRouteCandidate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLinkRouteCandidate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}