Files
sdk/model_link_link_view.go

687 lines
18 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 LinkLinkView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LinkLinkView{}
// LinkLinkView struct for LinkLinkView
type LinkLinkView struct {
// Account is the provider-side account identifier, when the collector knows it.
Account *string `json:"account,omitempty"`
// Billing is how this account's inference bills — plan (the user's own subscription, metered here for visibility only) or commerce (the gateway path). Derived from Kind, never stored.
Billing *string `json:"billing,omitempty"`
// CreatedAt is when the link was first registered, RFC 3339 UTC.
CreatedAt *string `json:"createdAt,omitempty"`
// Host is the machine's human hostname label, from its most recent report.
Host *string `json:"host,omitempty"`
// ID is the link's opaque handle (\"link_\" + 32 hex chars).
Id *string `json:"id,omitempty"`
// Kind is how the account authenticates: subscription or apikey.
Kind *string `json:"kind,omitempty"`
// LastSeen is when the account last reported, RFC 3339 UTC.
LastSeen *string `json:"lastSeen,omitempty"`
// Machine is the stable machine identifier the collector reports.
Machine *string `json:"machine,omitempty"`
// OS is the machine's operating system label.
Os *string `json:"os,omitempty"`
// Plan is the provider plan label (e.g. \"Claude Max\").
Plan *string `json:"plan,omitempty"`
// Provider is the AI provider this account belongs to (claude, openai, hanzo…).
Provider *string `json:"provider,omitempty"`
// Status is linked or revoked. Revoked rows are retained for history.
Status *string `json:"status,omitempty"`
// UpdatedAt is when the link was last refreshed, RFC 3339 UTC.
UpdatedAt *string `json:"updatedAt,omitempty"`
Usage interface{} `json:"usage,omitempty"`
// User is the owning subject — the validated caller who registered the link.
User *string `json:"user,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LinkLinkView LinkLinkView
// NewLinkLinkView instantiates a new LinkLinkView 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 NewLinkLinkView() *LinkLinkView {
this := LinkLinkView{}
return &this
}
// NewLinkLinkViewWithDefaults instantiates a new LinkLinkView 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 NewLinkLinkViewWithDefaults() *LinkLinkView {
this := LinkLinkView{}
return &this
}
// GetAccount returns the Account field value if set, zero value otherwise.
func (o *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) SetAccount(v string) {
o.Account = &v
}
// GetBilling returns the Billing field value if set, zero value otherwise.
func (o *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) SetBilling(v string) {
o.Billing = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *LinkLinkView) GetCreatedAt() string {
if o == nil || IsNil(o.CreatedAt) {
var ret string
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkLinkView) GetCreatedAtOk() (*string, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *LinkLinkView) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
func (o *LinkLinkView) SetCreatedAt(v string) {
o.CreatedAt = &v
}
// GetHost returns the Host field value if set, zero value otherwise.
func (o *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) SetHost(v string) {
o.Host = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *LinkLinkView) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkLinkView) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *LinkLinkView) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *LinkLinkView) SetId(v string) {
o.Id = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) SetKind(v string) {
o.Kind = &v
}
// GetLastSeen returns the LastSeen field value if set, zero value otherwise.
func (o *LinkLinkView) GetLastSeen() string {
if o == nil || IsNil(o.LastSeen) {
var ret string
return ret
}
return *o.LastSeen
}
// GetLastSeenOk returns a tuple with the LastSeen field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkLinkView) GetLastSeenOk() (*string, bool) {
if o == nil || IsNil(o.LastSeen) {
return nil, false
}
return o.LastSeen, true
}
// HasLastSeen returns a boolean if a field has been set.
func (o *LinkLinkView) HasLastSeen() bool {
if o != nil && !IsNil(o.LastSeen) {
return true
}
return false
}
// SetLastSeen gets a reference to the given string and assigns it to the LastSeen field.
func (o *LinkLinkView) SetLastSeen(v string) {
o.LastSeen = &v
}
// GetMachine returns the Machine field value if set, zero value otherwise.
func (o *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) SetMachine(v string) {
o.Machine = &v
}
// GetOs returns the Os field value if set, zero value otherwise.
func (o *LinkLinkView) GetOs() string {
if o == nil || IsNil(o.Os) {
var ret string
return ret
}
return *o.Os
}
// GetOsOk returns a tuple with the Os field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkLinkView) GetOsOk() (*string, bool) {
if o == nil || IsNil(o.Os) {
return nil, false
}
return o.Os, true
}
// HasOs returns a boolean if a field has been set.
func (o *LinkLinkView) HasOs() bool {
if o != nil && !IsNil(o.Os) {
return true
}
return false
}
// SetOs gets a reference to the given string and assigns it to the Os field.
func (o *LinkLinkView) SetOs(v string) {
o.Os = &v
}
// GetPlan returns the Plan field value if set, zero value otherwise.
func (o *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) SetPlan(v string) {
o.Plan = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) 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 *LinkLinkView) SetProvider(v string) {
o.Provider = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *LinkLinkView) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkLinkView) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *LinkLinkView) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *LinkLinkView) SetStatus(v string) {
o.Status = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *LinkLinkView) GetUpdatedAt() string {
if o == nil || IsNil(o.UpdatedAt) {
var ret string
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkLinkView) GetUpdatedAtOk() (*string, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *LinkLinkView) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field.
func (o *LinkLinkView) SetUpdatedAt(v string) {
o.UpdatedAt = &v
}
// GetUsage returns the Usage field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *LinkLinkView) GetUsage() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Usage
}
// GetUsageOk returns a tuple with the Usage 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 *LinkLinkView) GetUsageOk() (*interface{}, bool) {
if o == nil || IsNil(o.Usage) {
return nil, false
}
return &o.Usage, true
}
// HasUsage returns a boolean if a field has been set.
func (o *LinkLinkView) HasUsage() bool {
if o != nil && !IsNil(o.Usage) {
return true
}
return false
}
// SetUsage gets a reference to the given interface{} and assigns it to the Usage field.
func (o *LinkLinkView) SetUsage(v interface{}) {
o.Usage = v
}
// GetUser returns the User field value if set, zero value otherwise.
func (o *LinkLinkView) GetUser() string {
if o == nil || IsNil(o.User) {
var ret string
return ret
}
return *o.User
}
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkLinkView) GetUserOk() (*string, bool) {
if o == nil || IsNil(o.User) {
return nil, false
}
return o.User, true
}
// HasUser returns a boolean if a field has been set.
func (o *LinkLinkView) HasUser() bool {
if o != nil && !IsNil(o.User) {
return true
}
return false
}
// SetUser gets a reference to the given string and assigns it to the User field.
func (o *LinkLinkView) SetUser(v string) {
o.User = &v
}
func (o LinkLinkView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LinkLinkView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Account) {
toSerialize["account"] = o.Account
}
if !IsNil(o.Billing) {
toSerialize["billing"] = o.Billing
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Host) {
toSerialize["host"] = o.Host
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.LastSeen) {
toSerialize["lastSeen"] = o.LastSeen
}
if !IsNil(o.Machine) {
toSerialize["machine"] = o.Machine
}
if !IsNil(o.Os) {
toSerialize["os"] = o.Os
}
if !IsNil(o.Plan) {
toSerialize["plan"] = o.Plan
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
if o.Usage != nil {
toSerialize["usage"] = o.Usage
}
if !IsNil(o.User) {
toSerialize["user"] = o.User
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LinkLinkView) UnmarshalJSON(data []byte) (err error) {
varLinkLinkView := _LinkLinkView{}
err = json.Unmarshal(data, &varLinkLinkView)
if err != nil {
return err
}
*o = LinkLinkView(varLinkLinkView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "account")
delete(additionalProperties, "billing")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "host")
delete(additionalProperties, "id")
delete(additionalProperties, "kind")
delete(additionalProperties, "lastSeen")
delete(additionalProperties, "machine")
delete(additionalProperties, "os")
delete(additionalProperties, "plan")
delete(additionalProperties, "provider")
delete(additionalProperties, "status")
delete(additionalProperties, "updatedAt")
delete(additionalProperties, "usage")
delete(additionalProperties, "user")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLinkLinkView struct {
value *LinkLinkView
isSet bool
}
func (v NullableLinkLinkView) Get() *LinkLinkView {
return v.value
}
func (v *NullableLinkLinkView) Set(val *LinkLinkView) {
v.value = val
v.isSet = true
}
func (v NullableLinkLinkView) IsSet() bool {
return v.isSet
}
func (v *NullableLinkLinkView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLinkLinkView(val *LinkLinkView) *NullableLinkLinkView {
return &NullableLinkLinkView{value: val, isSet: true}
}
func (v NullableLinkLinkView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLinkLinkView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}