mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.0 KiB
Go
231 lines
6.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 FunctionUsage type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &FunctionUsage{}
|
|
|
|
// FunctionUsage struct for FunctionUsage
|
|
type FunctionUsage struct {
|
|
// null — no per-invocation cost source
|
|
CostCents *int64 `json:"costCents,omitempty"`
|
|
// one line per function that ran in the window
|
|
Series []FunctionCostLine `json:"series,omitempty"`
|
|
// how those invocations ended
|
|
Status *FunctionStatusBreakdown `json:"status,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _FunctionUsage FunctionUsage
|
|
|
|
// NewFunctionUsage instantiates a new FunctionUsage 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 NewFunctionUsage() *FunctionUsage {
|
|
this := FunctionUsage{}
|
|
return &this
|
|
}
|
|
|
|
// NewFunctionUsageWithDefaults instantiates a new FunctionUsage 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 NewFunctionUsageWithDefaults() *FunctionUsage {
|
|
this := FunctionUsage{}
|
|
return &this
|
|
}
|
|
|
|
// GetCostCents returns the CostCents field value if set, zero value otherwise.
|
|
func (o *FunctionUsage) GetCostCents() int64 {
|
|
if o == nil || IsNil(o.CostCents) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.CostCents
|
|
}
|
|
|
|
// GetCostCentsOk returns a tuple with the CostCents field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FunctionUsage) GetCostCentsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.CostCents) {
|
|
return nil, false
|
|
}
|
|
return o.CostCents, true
|
|
}
|
|
|
|
// HasCostCents returns a boolean if a field has been set.
|
|
func (o *FunctionUsage) HasCostCents() bool {
|
|
if o != nil && !IsNil(o.CostCents) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCostCents gets a reference to the given int64 and assigns it to the CostCents field.
|
|
func (o *FunctionUsage) SetCostCents(v int64) {
|
|
o.CostCents = &v
|
|
}
|
|
|
|
// GetSeries returns the Series field value if set, zero value otherwise.
|
|
func (o *FunctionUsage) GetSeries() []FunctionCostLine {
|
|
if o == nil || IsNil(o.Series) {
|
|
var ret []FunctionCostLine
|
|
return ret
|
|
}
|
|
return o.Series
|
|
}
|
|
|
|
// GetSeriesOk returns a tuple with the Series field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FunctionUsage) GetSeriesOk() ([]FunctionCostLine, bool) {
|
|
if o == nil || IsNil(o.Series) {
|
|
return nil, false
|
|
}
|
|
return o.Series, true
|
|
}
|
|
|
|
// HasSeries returns a boolean if a field has been set.
|
|
func (o *FunctionUsage) HasSeries() bool {
|
|
if o != nil && !IsNil(o.Series) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeries gets a reference to the given []FunctionCostLine and assigns it to the Series field.
|
|
func (o *FunctionUsage) SetSeries(v []FunctionCostLine) {
|
|
o.Series = v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *FunctionUsage) GetStatus() FunctionStatusBreakdown {
|
|
if o == nil || IsNil(o.Status) {
|
|
var ret FunctionStatusBreakdown
|
|
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 *FunctionUsage) GetStatusOk() (*FunctionStatusBreakdown, 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 *FunctionUsage) HasStatus() bool {
|
|
if o != nil && !IsNil(o.Status) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStatus gets a reference to the given FunctionStatusBreakdown and assigns it to the Status field.
|
|
func (o *FunctionUsage) SetStatus(v FunctionStatusBreakdown) {
|
|
o.Status = &v
|
|
}
|
|
|
|
func (o FunctionUsage) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o FunctionUsage) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.CostCents) {
|
|
toSerialize["costCents"] = o.CostCents
|
|
}
|
|
if !IsNil(o.Series) {
|
|
toSerialize["series"] = o.Series
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *FunctionUsage) UnmarshalJSON(data []byte) (err error) {
|
|
varFunctionUsage := _FunctionUsage{}
|
|
|
|
err = json.Unmarshal(data, &varFunctionUsage)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = FunctionUsage(varFunctionUsage)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "costCents")
|
|
delete(additionalProperties, "series")
|
|
delete(additionalProperties, "status")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableFunctionUsage struct {
|
|
value *FunctionUsage
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableFunctionUsage) Get() *FunctionUsage {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableFunctionUsage) Set(val *FunctionUsage) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableFunctionUsage) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableFunctionUsage) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableFunctionUsage(val *FunctionUsage) *NullableFunctionUsage {
|
|
return &NullableFunctionUsage{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableFunctionUsage) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableFunctionUsage) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|