Files
sdk/model_agent_session_budget_view.go

307 lines
8.9 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 AgentSessionBudgetView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentSessionBudgetView{}
// AgentSessionBudgetView struct for AgentSessionBudgetView
type AgentSessionBudgetView struct {
// BudgetMicroUSD is this session's own ceiling in micro-USD, beyond the agent's. A replacement must strictly exceed what the session has already consumed, and removing it is one-way.
BudgetMicroUsd *int64 `json:"budget_micro_usd,omitempty"`
// BudgetRemoved says the session's own cap was taken off. It cannot be put back.
BudgetRemoved *bool `json:"budget_removed,omitempty"`
// ConsumedMicroUSD is what has been spent in the current period, in micro-USD. It is settled from what the gateway reported, not from the quote.
ConsumedMicroUsd *int64 `json:"consumed_micro_usd,omitempty"`
// ID names the session.
Id *string `json:"id,omitempty"`
// Status is the session's state: running, paused at its cap, or done.
Status *string `json:"status,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentSessionBudgetView AgentSessionBudgetView
// NewAgentSessionBudgetView instantiates a new AgentSessionBudgetView 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 NewAgentSessionBudgetView() *AgentSessionBudgetView {
this := AgentSessionBudgetView{}
return &this
}
// NewAgentSessionBudgetViewWithDefaults instantiates a new AgentSessionBudgetView 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 NewAgentSessionBudgetViewWithDefaults() *AgentSessionBudgetView {
this := AgentSessionBudgetView{}
return &this
}
// GetBudgetMicroUsd returns the BudgetMicroUsd field value if set, zero value otherwise.
func (o *AgentSessionBudgetView) GetBudgetMicroUsd() int64 {
if o == nil || IsNil(o.BudgetMicroUsd) {
var ret int64
return ret
}
return *o.BudgetMicroUsd
}
// GetBudgetMicroUsdOk returns a tuple with the BudgetMicroUsd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentSessionBudgetView) GetBudgetMicroUsdOk() (*int64, bool) {
if o == nil || IsNil(o.BudgetMicroUsd) {
return nil, false
}
return o.BudgetMicroUsd, true
}
// HasBudgetMicroUsd returns a boolean if a field has been set.
func (o *AgentSessionBudgetView) HasBudgetMicroUsd() bool {
if o != nil && !IsNil(o.BudgetMicroUsd) {
return true
}
return false
}
// SetBudgetMicroUsd gets a reference to the given int64 and assigns it to the BudgetMicroUsd field.
func (o *AgentSessionBudgetView) SetBudgetMicroUsd(v int64) {
o.BudgetMicroUsd = &v
}
// GetBudgetRemoved returns the BudgetRemoved field value if set, zero value otherwise.
func (o *AgentSessionBudgetView) GetBudgetRemoved() bool {
if o == nil || IsNil(o.BudgetRemoved) {
var ret bool
return ret
}
return *o.BudgetRemoved
}
// GetBudgetRemovedOk returns a tuple with the BudgetRemoved field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentSessionBudgetView) GetBudgetRemovedOk() (*bool, bool) {
if o == nil || IsNil(o.BudgetRemoved) {
return nil, false
}
return o.BudgetRemoved, true
}
// HasBudgetRemoved returns a boolean if a field has been set.
func (o *AgentSessionBudgetView) HasBudgetRemoved() bool {
if o != nil && !IsNil(o.BudgetRemoved) {
return true
}
return false
}
// SetBudgetRemoved gets a reference to the given bool and assigns it to the BudgetRemoved field.
func (o *AgentSessionBudgetView) SetBudgetRemoved(v bool) {
o.BudgetRemoved = &v
}
// GetConsumedMicroUsd returns the ConsumedMicroUsd field value if set, zero value otherwise.
func (o *AgentSessionBudgetView) GetConsumedMicroUsd() int64 {
if o == nil || IsNil(o.ConsumedMicroUsd) {
var ret int64
return ret
}
return *o.ConsumedMicroUsd
}
// GetConsumedMicroUsdOk returns a tuple with the ConsumedMicroUsd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentSessionBudgetView) GetConsumedMicroUsdOk() (*int64, bool) {
if o == nil || IsNil(o.ConsumedMicroUsd) {
return nil, false
}
return o.ConsumedMicroUsd, true
}
// HasConsumedMicroUsd returns a boolean if a field has been set.
func (o *AgentSessionBudgetView) HasConsumedMicroUsd() bool {
if o != nil && !IsNil(o.ConsumedMicroUsd) {
return true
}
return false
}
// SetConsumedMicroUsd gets a reference to the given int64 and assigns it to the ConsumedMicroUsd field.
func (o *AgentSessionBudgetView) SetConsumedMicroUsd(v int64) {
o.ConsumedMicroUsd = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *AgentSessionBudgetView) 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 *AgentSessionBudgetView) 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 *AgentSessionBudgetView) 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 *AgentSessionBudgetView) SetId(v string) {
o.Id = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *AgentSessionBudgetView) 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 *AgentSessionBudgetView) 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 *AgentSessionBudgetView) 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 *AgentSessionBudgetView) SetStatus(v string) {
o.Status = &v
}
func (o AgentSessionBudgetView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentSessionBudgetView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.BudgetMicroUsd) {
toSerialize["budget_micro_usd"] = o.BudgetMicroUsd
}
if !IsNil(o.BudgetRemoved) {
toSerialize["budget_removed"] = o.BudgetRemoved
}
if !IsNil(o.ConsumedMicroUsd) {
toSerialize["consumed_micro_usd"] = o.ConsumedMicroUsd
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentSessionBudgetView) UnmarshalJSON(data []byte) (err error) {
varAgentSessionBudgetView := _AgentSessionBudgetView{}
err = json.Unmarshal(data, &varAgentSessionBudgetView)
if err != nil {
return err
}
*o = AgentSessionBudgetView(varAgentSessionBudgetView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "budget_micro_usd")
delete(additionalProperties, "budget_removed")
delete(additionalProperties, "consumed_micro_usd")
delete(additionalProperties, "id")
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentSessionBudgetView struct {
value *AgentSessionBudgetView
isSet bool
}
func (v NullableAgentSessionBudgetView) Get() *AgentSessionBudgetView {
return v.value
}
func (v *NullableAgentSessionBudgetView) Set(val *AgentSessionBudgetView) {
v.value = val
v.isSet = true
}
func (v NullableAgentSessionBudgetView) IsSet() bool {
return v.isSet
}
func (v *NullableAgentSessionBudgetView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentSessionBudgetView(val *AgentSessionBudgetView) *NullableAgentSessionBudgetView {
return &NullableAgentSessionBudgetView{value: val, isSet: true}
}
func (v NullableAgentSessionBudgetView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentSessionBudgetView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}