mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.5 KiB
Go
345 lines
9.5 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 LinkSummaryResp type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &LinkSummaryResp{}
|
|
|
|
// LinkSummaryResp struct for LinkSummaryResp
|
|
type LinkSummaryResp struct {
|
|
// Account reports the linked-accounts ledger's own availability, so a partial answer never fabricates this half. It is scoped to the CALLER: the accounts they linked, metered from each provider's own login.
|
|
Account *LinkSourceState `json:"account,omitempty"`
|
|
// From is when the window opens, RFC 3339 UTC. ONE resolver fixes it for both ledgers, so the account rows and the Hanzo rows always cover the same period — two resolvers could drift and turn the union into a lie.
|
|
From *string `json:"from,omitempty"`
|
|
// Hanzo reports the same for the Hanzo-routed ledger, which is scoped to the ORG rather than the caller — a different question over the same window. The two are independent: either can be unavailable while the other answers, and Rows then carries only the half that did.
|
|
Hanzo *LinkSourceState `json:"hanzo,omitempty"`
|
|
// Range is the resolved period label.
|
|
Range *string `json:"range,omitempty"`
|
|
// Rows is the union of both ledgers, each row labelled by source and scope — concatenated, NEVER summed: a plan's percentage is not money.
|
|
Rows []LinkTotalView `json:"rows,omitempty"`
|
|
// To is where the window closes, EXCLUSIVE, RFC 3339 UTC — the instant the read was served. Shared by both ledgers, for the reason From gives.
|
|
To *string `json:"to,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _LinkSummaryResp LinkSummaryResp
|
|
|
|
// NewLinkSummaryResp instantiates a new LinkSummaryResp 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 NewLinkSummaryResp() *LinkSummaryResp {
|
|
this := LinkSummaryResp{}
|
|
return &this
|
|
}
|
|
|
|
// NewLinkSummaryRespWithDefaults instantiates a new LinkSummaryResp 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 NewLinkSummaryRespWithDefaults() *LinkSummaryResp {
|
|
this := LinkSummaryResp{}
|
|
return &this
|
|
}
|
|
|
|
// GetAccount returns the Account field value if set, zero value otherwise.
|
|
func (o *LinkSummaryResp) GetAccount() LinkSourceState {
|
|
if o == nil || IsNil(o.Account) {
|
|
var ret LinkSourceState
|
|
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 *LinkSummaryResp) GetAccountOk() (*LinkSourceState, 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 *LinkSummaryResp) HasAccount() bool {
|
|
if o != nil && !IsNil(o.Account) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAccount gets a reference to the given LinkSourceState and assigns it to the Account field.
|
|
func (o *LinkSummaryResp) SetAccount(v LinkSourceState) {
|
|
o.Account = &v
|
|
}
|
|
|
|
// GetFrom returns the From field value if set, zero value otherwise.
|
|
func (o *LinkSummaryResp) GetFrom() string {
|
|
if o == nil || IsNil(o.From) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.From
|
|
}
|
|
|
|
// GetFromOk returns a tuple with the From field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkSummaryResp) GetFromOk() (*string, bool) {
|
|
if o == nil || IsNil(o.From) {
|
|
return nil, false
|
|
}
|
|
return o.From, true
|
|
}
|
|
|
|
// HasFrom returns a boolean if a field has been set.
|
|
func (o *LinkSummaryResp) HasFrom() bool {
|
|
if o != nil && !IsNil(o.From) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFrom gets a reference to the given string and assigns it to the From field.
|
|
func (o *LinkSummaryResp) SetFrom(v string) {
|
|
o.From = &v
|
|
}
|
|
|
|
// GetHanzo returns the Hanzo field value if set, zero value otherwise.
|
|
func (o *LinkSummaryResp) GetHanzo() LinkSourceState {
|
|
if o == nil || IsNil(o.Hanzo) {
|
|
var ret LinkSourceState
|
|
return ret
|
|
}
|
|
return *o.Hanzo
|
|
}
|
|
|
|
// GetHanzoOk returns a tuple with the Hanzo field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkSummaryResp) GetHanzoOk() (*LinkSourceState, bool) {
|
|
if o == nil || IsNil(o.Hanzo) {
|
|
return nil, false
|
|
}
|
|
return o.Hanzo, true
|
|
}
|
|
|
|
// HasHanzo returns a boolean if a field has been set.
|
|
func (o *LinkSummaryResp) HasHanzo() bool {
|
|
if o != nil && !IsNil(o.Hanzo) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHanzo gets a reference to the given LinkSourceState and assigns it to the Hanzo field.
|
|
func (o *LinkSummaryResp) SetHanzo(v LinkSourceState) {
|
|
o.Hanzo = &v
|
|
}
|
|
|
|
// GetRange returns the Range field value if set, zero value otherwise.
|
|
func (o *LinkSummaryResp) GetRange() string {
|
|
if o == nil || IsNil(o.Range) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Range
|
|
}
|
|
|
|
// GetRangeOk returns a tuple with the Range field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkSummaryResp) GetRangeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Range) {
|
|
return nil, false
|
|
}
|
|
return o.Range, true
|
|
}
|
|
|
|
// HasRange returns a boolean if a field has been set.
|
|
func (o *LinkSummaryResp) HasRange() bool {
|
|
if o != nil && !IsNil(o.Range) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRange gets a reference to the given string and assigns it to the Range field.
|
|
func (o *LinkSummaryResp) SetRange(v string) {
|
|
o.Range = &v
|
|
}
|
|
|
|
// GetRows returns the Rows field value if set, zero value otherwise.
|
|
func (o *LinkSummaryResp) GetRows() []LinkTotalView {
|
|
if o == nil || IsNil(o.Rows) {
|
|
var ret []LinkTotalView
|
|
return ret
|
|
}
|
|
return o.Rows
|
|
}
|
|
|
|
// GetRowsOk returns a tuple with the Rows field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkSummaryResp) GetRowsOk() ([]LinkTotalView, bool) {
|
|
if o == nil || IsNil(o.Rows) {
|
|
return nil, false
|
|
}
|
|
return o.Rows, true
|
|
}
|
|
|
|
// HasRows returns a boolean if a field has been set.
|
|
func (o *LinkSummaryResp) HasRows() bool {
|
|
if o != nil && !IsNil(o.Rows) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRows gets a reference to the given []LinkTotalView and assigns it to the Rows field.
|
|
func (o *LinkSummaryResp) SetRows(v []LinkTotalView) {
|
|
o.Rows = v
|
|
}
|
|
|
|
// GetTo returns the To field value if set, zero value otherwise.
|
|
func (o *LinkSummaryResp) GetTo() string {
|
|
if o == nil || IsNil(o.To) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.To
|
|
}
|
|
|
|
// GetToOk returns a tuple with the To field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkSummaryResp) GetToOk() (*string, bool) {
|
|
if o == nil || IsNil(o.To) {
|
|
return nil, false
|
|
}
|
|
return o.To, true
|
|
}
|
|
|
|
// HasTo returns a boolean if a field has been set.
|
|
func (o *LinkSummaryResp) HasTo() bool {
|
|
if o != nil && !IsNil(o.To) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTo gets a reference to the given string and assigns it to the To field.
|
|
func (o *LinkSummaryResp) SetTo(v string) {
|
|
o.To = &v
|
|
}
|
|
|
|
func (o LinkSummaryResp) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o LinkSummaryResp) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Account) {
|
|
toSerialize["account"] = o.Account
|
|
}
|
|
if !IsNil(o.From) {
|
|
toSerialize["from"] = o.From
|
|
}
|
|
if !IsNil(o.Hanzo) {
|
|
toSerialize["hanzo"] = o.Hanzo
|
|
}
|
|
if !IsNil(o.Range) {
|
|
toSerialize["range"] = o.Range
|
|
}
|
|
if !IsNil(o.Rows) {
|
|
toSerialize["rows"] = o.Rows
|
|
}
|
|
if !IsNil(o.To) {
|
|
toSerialize["to"] = o.To
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *LinkSummaryResp) UnmarshalJSON(data []byte) (err error) {
|
|
varLinkSummaryResp := _LinkSummaryResp{}
|
|
|
|
err = json.Unmarshal(data, &varLinkSummaryResp)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = LinkSummaryResp(varLinkSummaryResp)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "account")
|
|
delete(additionalProperties, "from")
|
|
delete(additionalProperties, "hanzo")
|
|
delete(additionalProperties, "range")
|
|
delete(additionalProperties, "rows")
|
|
delete(additionalProperties, "to")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableLinkSummaryResp struct {
|
|
value *LinkSummaryResp
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableLinkSummaryResp) Get() *LinkSummaryResp {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableLinkSummaryResp) Set(val *LinkSummaryResp) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableLinkSummaryResp) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableLinkSummaryResp) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableLinkSummaryResp(val *LinkSummaryResp) *NullableLinkSummaryResp {
|
|
return &NullableLinkSummaryResp{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableLinkSummaryResp) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableLinkSummaryResp) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|