Files
sdk/model_activity.go

191 lines
4.6 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 Activity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Activity{}
// Activity struct for Activity
type Activity struct {
FieldCount map[string]int32 `json:"FieldCount,omitempty"`
Date *string `json:"date,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Activity Activity
// NewActivity instantiates a new Activity 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 NewActivity() *Activity {
this := Activity{}
return &this
}
// NewActivityWithDefaults instantiates a new Activity 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 NewActivityWithDefaults() *Activity {
this := Activity{}
return &this
}
// GetFieldCount returns the FieldCount field value if set, zero value otherwise.
func (o *Activity) GetFieldCount() map[string]int32 {
if o == nil || IsNil(o.FieldCount) {
var ret map[string]int32
return ret
}
return o.FieldCount
}
// GetFieldCountOk returns a tuple with the FieldCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Activity) GetFieldCountOk() (map[string]int32, bool) {
if o == nil || IsNil(o.FieldCount) {
return map[string]int32{}, false
}
return o.FieldCount, true
}
// HasFieldCount returns a boolean if a field has been set.
func (o *Activity) HasFieldCount() bool {
if o != nil && !IsNil(o.FieldCount) {
return true
}
return false
}
// SetFieldCount gets a reference to the given map[string]int32 and assigns it to the FieldCount field.
func (o *Activity) SetFieldCount(v map[string]int32) {
o.FieldCount = v
}
// GetDate returns the Date field value if set, zero value otherwise.
func (o *Activity) 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 *Activity) 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 *Activity) 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 *Activity) SetDate(v string) {
o.Date = &v
}
func (o Activity) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Activity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.FieldCount) {
toSerialize["FieldCount"] = o.FieldCount
}
if !IsNil(o.Date) {
toSerialize["date"] = o.Date
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Activity) UnmarshalJSON(data []byte) (err error) {
varActivity := _Activity{}
err = json.Unmarshal(data, &varActivity)
if err != nil {
return err
}
*o = Activity(varActivity)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "FieldCount")
delete(additionalProperties, "date")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableActivity struct {
value *Activity
isSet bool
}
func (v NullableActivity) Get() *Activity {
return v.value
}
func (v *NullableActivity) Set(val *Activity) {
v.value = val
v.isSet = true
}
func (v NullableActivity) IsSet() bool {
return v.isSet
}
func (v *NullableActivity) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableActivity(val *Activity) *NullableActivity {
return &NullableActivity{value: val, isSet: true}
}
func (v NullableActivity) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableActivity) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}