Files
sdk/model_usage_report_resp.go

193 lines
5.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 UsageReportResp type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UsageReportResp{}
// UsageReportResp struct for UsageReportResp
type UsageReportResp struct {
// Accepted is how many samples passed validation. Every one of them was accepted, or the whole report was refused — there is no partial success.
Accepted *int64 `json:"accepted,omitempty"`
// Stored is whether the warehouse actually persisted them. False means the datastore was unavailable and the poll of history was lost; the request still succeeded, so a device retries without being blocked.
Stored *bool `json:"stored,omitempty"`
AdditionalProperties map[string]interface{}
}
type _UsageReportResp UsageReportResp
// NewUsageReportResp instantiates a new UsageReportResp 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 NewUsageReportResp() *UsageReportResp {
this := UsageReportResp{}
return &this
}
// NewUsageReportRespWithDefaults instantiates a new UsageReportResp 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 NewUsageReportRespWithDefaults() *UsageReportResp {
this := UsageReportResp{}
return &this
}
// GetAccepted returns the Accepted field value if set, zero value otherwise.
func (o *UsageReportResp) GetAccepted() int64 {
if o == nil || IsNil(o.Accepted) {
var ret int64
return ret
}
return *o.Accepted
}
// GetAcceptedOk returns a tuple with the Accepted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageReportResp) GetAcceptedOk() (*int64, bool) {
if o == nil || IsNil(o.Accepted) {
return nil, false
}
return o.Accepted, true
}
// HasAccepted returns a boolean if a field has been set.
func (o *UsageReportResp) HasAccepted() bool {
if o != nil && !IsNil(o.Accepted) {
return true
}
return false
}
// SetAccepted gets a reference to the given int64 and assigns it to the Accepted field.
func (o *UsageReportResp) SetAccepted(v int64) {
o.Accepted = &v
}
// GetStored returns the Stored field value if set, zero value otherwise.
func (o *UsageReportResp) GetStored() bool {
if o == nil || IsNil(o.Stored) {
var ret bool
return ret
}
return *o.Stored
}
// GetStoredOk returns a tuple with the Stored field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageReportResp) GetStoredOk() (*bool, bool) {
if o == nil || IsNil(o.Stored) {
return nil, false
}
return o.Stored, true
}
// HasStored returns a boolean if a field has been set.
func (o *UsageReportResp) HasStored() bool {
if o != nil && !IsNil(o.Stored) {
return true
}
return false
}
// SetStored gets a reference to the given bool and assigns it to the Stored field.
func (o *UsageReportResp) SetStored(v bool) {
o.Stored = &v
}
func (o UsageReportResp) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UsageReportResp) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Accepted) {
toSerialize["accepted"] = o.Accepted
}
if !IsNil(o.Stored) {
toSerialize["stored"] = o.Stored
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *UsageReportResp) UnmarshalJSON(data []byte) (err error) {
varUsageReportResp := _UsageReportResp{}
err = json.Unmarshal(data, &varUsageReportResp)
if err != nil {
return err
}
*o = UsageReportResp(varUsageReportResp)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "accepted")
delete(additionalProperties, "stored")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableUsageReportResp struct {
value *UsageReportResp
isSet bool
}
func (v NullableUsageReportResp) Get() *UsageReportResp {
return v.value
}
func (v *NullableUsageReportResp) Set(val *UsageReportResp) {
v.value = val
v.isSet = true
}
func (v NullableUsageReportResp) IsSet() bool {
return v.isSet
}
func (v *NullableUsageReportResp) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUsageReportResp(val *UsageReportResp) *NullableUsageReportResp {
return &NullableUsageReportResp{value: val, isSet: true}
}
func (v NullableUsageReportResp) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUsageReportResp) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}