Files
sdk/model_link_accounts_usage.go

269 lines
7.1 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 LinkAccountsUsage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LinkAccountsUsage{}
// LinkAccountsUsage struct for LinkAccountsUsage
type LinkAccountsUsage struct {
// Accounts is one row per linked account the gateway actually routed through.
Accounts []LinkRoutedUsage `json:"accounts,omitempty"`
// Scope is always \"user\": the caller's own linked accounts.
Scope *string `json:"scope,omitempty"`
// Source is always \"routed\": the gateway's own routed ledger.
Source *string `json:"source,omitempty"`
// Total is the honest sum across the rows.
Total *LinkAccountsTotal `json:"total,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LinkAccountsUsage LinkAccountsUsage
// NewLinkAccountsUsage instantiates a new LinkAccountsUsage 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 NewLinkAccountsUsage() *LinkAccountsUsage {
this := LinkAccountsUsage{}
return &this
}
// NewLinkAccountsUsageWithDefaults instantiates a new LinkAccountsUsage 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 NewLinkAccountsUsageWithDefaults() *LinkAccountsUsage {
this := LinkAccountsUsage{}
return &this
}
// GetAccounts returns the Accounts field value if set, zero value otherwise.
func (o *LinkAccountsUsage) GetAccounts() []LinkRoutedUsage {
if o == nil || IsNil(o.Accounts) {
var ret []LinkRoutedUsage
return ret
}
return o.Accounts
}
// GetAccountsOk returns a tuple with the Accounts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkAccountsUsage) GetAccountsOk() ([]LinkRoutedUsage, bool) {
if o == nil || IsNil(o.Accounts) {
return nil, false
}
return o.Accounts, true
}
// HasAccounts returns a boolean if a field has been set.
func (o *LinkAccountsUsage) HasAccounts() bool {
if o != nil && !IsNil(o.Accounts) {
return true
}
return false
}
// SetAccounts gets a reference to the given []LinkRoutedUsage and assigns it to the Accounts field.
func (o *LinkAccountsUsage) SetAccounts(v []LinkRoutedUsage) {
o.Accounts = v
}
// GetScope returns the Scope field value if set, zero value otherwise.
func (o *LinkAccountsUsage) 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 *LinkAccountsUsage) 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 *LinkAccountsUsage) 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 *LinkAccountsUsage) SetScope(v string) {
o.Scope = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *LinkAccountsUsage) 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 *LinkAccountsUsage) 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 *LinkAccountsUsage) 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 *LinkAccountsUsage) SetSource(v string) {
o.Source = &v
}
// GetTotal returns the Total field value if set, zero value otherwise.
func (o *LinkAccountsUsage) GetTotal() LinkAccountsTotal {
if o == nil || IsNil(o.Total) {
var ret LinkAccountsTotal
return ret
}
return *o.Total
}
// GetTotalOk returns a tuple with the Total field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkAccountsUsage) GetTotalOk() (*LinkAccountsTotal, bool) {
if o == nil || IsNil(o.Total) {
return nil, false
}
return o.Total, true
}
// HasTotal returns a boolean if a field has been set.
func (o *LinkAccountsUsage) HasTotal() bool {
if o != nil && !IsNil(o.Total) {
return true
}
return false
}
// SetTotal gets a reference to the given LinkAccountsTotal and assigns it to the Total field.
func (o *LinkAccountsUsage) SetTotal(v LinkAccountsTotal) {
o.Total = &v
}
func (o LinkAccountsUsage) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LinkAccountsUsage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Accounts) {
toSerialize["accounts"] = o.Accounts
}
if !IsNil(o.Scope) {
toSerialize["scope"] = o.Scope
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Total) {
toSerialize["total"] = o.Total
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LinkAccountsUsage) UnmarshalJSON(data []byte) (err error) {
varLinkAccountsUsage := _LinkAccountsUsage{}
err = json.Unmarshal(data, &varLinkAccountsUsage)
if err != nil {
return err
}
*o = LinkAccountsUsage(varLinkAccountsUsage)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "accounts")
delete(additionalProperties, "scope")
delete(additionalProperties, "source")
delete(additionalProperties, "total")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLinkAccountsUsage struct {
value *LinkAccountsUsage
isSet bool
}
func (v NullableLinkAccountsUsage) Get() *LinkAccountsUsage {
return v.value
}
func (v *NullableLinkAccountsUsage) Set(val *LinkAccountsUsage) {
v.value = val
v.isSet = true
}
func (v NullableLinkAccountsUsage) IsSet() bool {
return v.isSet
}
func (v *NullableLinkAccountsUsage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLinkAccountsUsage(val *LinkAccountsUsage) *NullableLinkAccountsUsage {
return &NullableLinkAccountsUsage{value: val, isSet: true}
}
func (v NullableLinkAccountsUsage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLinkAccountsUsage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}