Files
sdk/model_usage_source_state.go

269 lines
7.0 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 UsageSourceState type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UsageSourceState{}
// UsageSourceState struct for UsageSourceState
type UsageSourceState struct {
// Available is whether this side's ledger answered. False means its rows are missing, not that there were none.
Available *bool `json:"available,omitempty"`
// Note is the human sentence that says what this side's numbers mean, so a board cannot present a plan percentage as a Hanzo charge.
Note *string `json:"note,omitempty"`
// Scope is whose rows this side carries: \"user\" or \"org\".
Scope *string `json:"scope,omitempty"`
// Source is the table of record the rows came from.
Source *string `json:"source,omitempty"`
AdditionalProperties map[string]interface{}
}
type _UsageSourceState UsageSourceState
// NewUsageSourceState instantiates a new UsageSourceState 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 NewUsageSourceState() *UsageSourceState {
this := UsageSourceState{}
return &this
}
// NewUsageSourceStateWithDefaults instantiates a new UsageSourceState 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 NewUsageSourceStateWithDefaults() *UsageSourceState {
this := UsageSourceState{}
return &this
}
// GetAvailable returns the Available field value if set, zero value otherwise.
func (o *UsageSourceState) 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 *UsageSourceState) 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 *UsageSourceState) 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 *UsageSourceState) SetAvailable(v bool) {
o.Available = &v
}
// GetNote returns the Note field value if set, zero value otherwise.
func (o *UsageSourceState) 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 *UsageSourceState) 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 *UsageSourceState) 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 *UsageSourceState) SetNote(v string) {
o.Note = &v
}
// GetScope returns the Scope field value if set, zero value otherwise.
func (o *UsageSourceState) 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 *UsageSourceState) 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 *UsageSourceState) 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 *UsageSourceState) SetScope(v string) {
o.Scope = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *UsageSourceState) 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 *UsageSourceState) 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 *UsageSourceState) 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 *UsageSourceState) SetSource(v string) {
o.Source = &v
}
func (o UsageSourceState) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UsageSourceState) 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 *UsageSourceState) UnmarshalJSON(data []byte) (err error) {
varUsageSourceState := _UsageSourceState{}
err = json.Unmarshal(data, &varUsageSourceState)
if err != nil {
return err
}
*o = UsageSourceState(varUsageSourceState)
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 NullableUsageSourceState struct {
value *UsageSourceState
isSet bool
}
func (v NullableUsageSourceState) Get() *UsageSourceState {
return v.value
}
func (v *NullableUsageSourceState) Set(val *UsageSourceState) {
v.value = val
v.isSet = true
}
func (v NullableUsageSourceState) IsSet() bool {
return v.isSet
}
func (v *NullableUsageSourceState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUsageSourceState(val *UsageSourceState) *NullableUsageSourceState {
return &NullableUsageSourceState{value: val, isSet: true}
}
func (v NullableUsageSourceState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUsageSourceState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}