mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
376 lines
9.2 KiB
Go
376 lines
9.2 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 Count type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Count{}
|
|
|
|
// Count struct for Count
|
|
type Count struct {
|
|
ChatCount *int32 `json:"chatCount,omitempty"`
|
|
Currency *string `json:"currency,omitempty"`
|
|
Date *string `json:"date,omitempty"`
|
|
MessageCount *int32 `json:"messageCount,omitempty"`
|
|
Price *float32 `json:"price,omitempty"`
|
|
TokenCount *int32 `json:"tokenCount,omitempty"`
|
|
UserCount *int32 `json:"userCount,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Count Count
|
|
|
|
// NewCount instantiates a new Count 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 NewCount() *Count {
|
|
this := Count{}
|
|
return &this
|
|
}
|
|
|
|
// NewCountWithDefaults instantiates a new Count 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 NewCountWithDefaults() *Count {
|
|
this := Count{}
|
|
return &this
|
|
}
|
|
|
|
// GetChatCount returns the ChatCount field value if set, zero value otherwise.
|
|
func (o *Count) GetChatCount() int32 {
|
|
if o == nil || IsNil(o.ChatCount) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.ChatCount
|
|
}
|
|
|
|
// GetChatCountOk returns a tuple with the ChatCount field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Count) GetChatCountOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.ChatCount) {
|
|
return nil, false
|
|
}
|
|
return o.ChatCount, true
|
|
}
|
|
|
|
// HasChatCount returns a boolean if a field has been set.
|
|
func (o *Count) HasChatCount() bool {
|
|
if o != nil && !IsNil(o.ChatCount) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetChatCount gets a reference to the given int32 and assigns it to the ChatCount field.
|
|
func (o *Count) SetChatCount(v int32) {
|
|
o.ChatCount = &v
|
|
}
|
|
|
|
// GetCurrency returns the Currency field value if set, zero value otherwise.
|
|
func (o *Count) GetCurrency() string {
|
|
if o == nil || IsNil(o.Currency) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Currency
|
|
}
|
|
|
|
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Count) GetCurrencyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Currency) {
|
|
return nil, false
|
|
}
|
|
return o.Currency, true
|
|
}
|
|
|
|
// HasCurrency returns a boolean if a field has been set.
|
|
func (o *Count) HasCurrency() bool {
|
|
if o != nil && !IsNil(o.Currency) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
|
|
func (o *Count) SetCurrency(v string) {
|
|
o.Currency = &v
|
|
}
|
|
|
|
// GetDate returns the Date field value if set, zero value otherwise.
|
|
func (o *Count) GetDate() string {
|
|
if o == nil || IsNil(o.Date) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Date
|
|
}
|
|
|
|
// GetDateOk returns a tuple with the Date field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Count) GetDateOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Date) {
|
|
return nil, false
|
|
}
|
|
return o.Date, true
|
|
}
|
|
|
|
// HasDate returns a boolean if a field has been set.
|
|
func (o *Count) HasDate() bool {
|
|
if o != nil && !IsNil(o.Date) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDate gets a reference to the given string and assigns it to the Date field.
|
|
func (o *Count) SetDate(v string) {
|
|
o.Date = &v
|
|
}
|
|
|
|
// GetMessageCount returns the MessageCount field value if set, zero value otherwise.
|
|
func (o *Count) GetMessageCount() int32 {
|
|
if o == nil || IsNil(o.MessageCount) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.MessageCount
|
|
}
|
|
|
|
// GetMessageCountOk returns a tuple with the MessageCount field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Count) GetMessageCountOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.MessageCount) {
|
|
return nil, false
|
|
}
|
|
return o.MessageCount, true
|
|
}
|
|
|
|
// HasMessageCount returns a boolean if a field has been set.
|
|
func (o *Count) HasMessageCount() bool {
|
|
if o != nil && !IsNil(o.MessageCount) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMessageCount gets a reference to the given int32 and assigns it to the MessageCount field.
|
|
func (o *Count) SetMessageCount(v int32) {
|
|
o.MessageCount = &v
|
|
}
|
|
|
|
// GetPrice returns the Price field value if set, zero value otherwise.
|
|
func (o *Count) GetPrice() float32 {
|
|
if o == nil || IsNil(o.Price) {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
return *o.Price
|
|
}
|
|
|
|
// GetPriceOk returns a tuple with the Price field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Count) GetPriceOk() (*float32, bool) {
|
|
if o == nil || IsNil(o.Price) {
|
|
return nil, false
|
|
}
|
|
return o.Price, true
|
|
}
|
|
|
|
// HasPrice returns a boolean if a field has been set.
|
|
func (o *Count) HasPrice() bool {
|
|
if o != nil && !IsNil(o.Price) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPrice gets a reference to the given float32 and assigns it to the Price field.
|
|
func (o *Count) SetPrice(v float32) {
|
|
o.Price = &v
|
|
}
|
|
|
|
// GetTokenCount returns the TokenCount field value if set, zero value otherwise.
|
|
func (o *Count) GetTokenCount() int32 {
|
|
if o == nil || IsNil(o.TokenCount) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.TokenCount
|
|
}
|
|
|
|
// GetTokenCountOk returns a tuple with the TokenCount field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Count) GetTokenCountOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.TokenCount) {
|
|
return nil, false
|
|
}
|
|
return o.TokenCount, true
|
|
}
|
|
|
|
// HasTokenCount returns a boolean if a field has been set.
|
|
func (o *Count) HasTokenCount() bool {
|
|
if o != nil && !IsNil(o.TokenCount) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTokenCount gets a reference to the given int32 and assigns it to the TokenCount field.
|
|
func (o *Count) SetTokenCount(v int32) {
|
|
o.TokenCount = &v
|
|
}
|
|
|
|
// GetUserCount returns the UserCount field value if set, zero value otherwise.
|
|
func (o *Count) GetUserCount() int32 {
|
|
if o == nil || IsNil(o.UserCount) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.UserCount
|
|
}
|
|
|
|
// GetUserCountOk returns a tuple with the UserCount field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Count) GetUserCountOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.UserCount) {
|
|
return nil, false
|
|
}
|
|
return o.UserCount, true
|
|
}
|
|
|
|
// HasUserCount returns a boolean if a field has been set.
|
|
func (o *Count) HasUserCount() bool {
|
|
if o != nil && !IsNil(o.UserCount) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUserCount gets a reference to the given int32 and assigns it to the UserCount field.
|
|
func (o *Count) SetUserCount(v int32) {
|
|
o.UserCount = &v
|
|
}
|
|
|
|
func (o Count) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Count) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.ChatCount) {
|
|
toSerialize["chatCount"] = o.ChatCount
|
|
}
|
|
if !IsNil(o.Currency) {
|
|
toSerialize["currency"] = o.Currency
|
|
}
|
|
if !IsNil(o.Date) {
|
|
toSerialize["date"] = o.Date
|
|
}
|
|
if !IsNil(o.MessageCount) {
|
|
toSerialize["messageCount"] = o.MessageCount
|
|
}
|
|
if !IsNil(o.Price) {
|
|
toSerialize["price"] = o.Price
|
|
}
|
|
if !IsNil(o.TokenCount) {
|
|
toSerialize["tokenCount"] = o.TokenCount
|
|
}
|
|
if !IsNil(o.UserCount) {
|
|
toSerialize["userCount"] = o.UserCount
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Count) UnmarshalJSON(data []byte) (err error) {
|
|
varCount := _Count{}
|
|
|
|
err = json.Unmarshal(data, &varCount)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Count(varCount)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "chatCount")
|
|
delete(additionalProperties, "currency")
|
|
delete(additionalProperties, "date")
|
|
delete(additionalProperties, "messageCount")
|
|
delete(additionalProperties, "price")
|
|
delete(additionalProperties, "tokenCount")
|
|
delete(additionalProperties, "userCount")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCount struct {
|
|
value *Count
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCount) Get() *Count {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCount) Set(val *Count) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCount) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCount) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCount(val *Count) *NullableCount {
|
|
return &NullableCount{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCount) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCount) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|