Files
sdk/model_team_stats_sessions.go

155 lines
4.4 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 TeamStatsSessions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TeamStatsSessions{}
// TeamStatsSessions struct for TeamStatsSessions
type TeamStatsSessions struct {
// ActiveSessions maps a space uuid to its connected sessions. It carries only the token's OWN space, and is empty for a token that names none.
ActiveSessions map[string][]TeamStatsUser `json:"activeSessions,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TeamStatsSessions TeamStatsSessions
// NewTeamStatsSessions instantiates a new TeamStatsSessions 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 NewTeamStatsSessions() *TeamStatsSessions {
this := TeamStatsSessions{}
return &this
}
// NewTeamStatsSessionsWithDefaults instantiates a new TeamStatsSessions 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 NewTeamStatsSessionsWithDefaults() *TeamStatsSessions {
this := TeamStatsSessions{}
return &this
}
// GetActiveSessions returns the ActiveSessions field value if set, zero value otherwise.
func (o *TeamStatsSessions) GetActiveSessions() map[string][]TeamStatsUser {
if o == nil || IsNil(o.ActiveSessions) {
var ret map[string][]TeamStatsUser
return ret
}
return o.ActiveSessions
}
// GetActiveSessionsOk returns a tuple with the ActiveSessions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamStatsSessions) GetActiveSessionsOk() (map[string][]TeamStatsUser, bool) {
if o == nil || IsNil(o.ActiveSessions) {
return map[string][]TeamStatsUser{}, false
}
return o.ActiveSessions, true
}
// HasActiveSessions returns a boolean if a field has been set.
func (o *TeamStatsSessions) HasActiveSessions() bool {
if o != nil && !IsNil(o.ActiveSessions) {
return true
}
return false
}
// SetActiveSessions gets a reference to the given map[string][]TeamStatsUser and assigns it to the ActiveSessions field.
func (o *TeamStatsSessions) SetActiveSessions(v map[string][]TeamStatsUser) {
o.ActiveSessions = v
}
func (o TeamStatsSessions) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TeamStatsSessions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ActiveSessions) {
toSerialize["activeSessions"] = o.ActiveSessions
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TeamStatsSessions) UnmarshalJSON(data []byte) (err error) {
varTeamStatsSessions := _TeamStatsSessions{}
err = json.Unmarshal(data, &varTeamStatsSessions)
if err != nil {
return err
}
*o = TeamStatsSessions(varTeamStatsSessions)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "activeSessions")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTeamStatsSessions struct {
value *TeamStatsSessions
isSet bool
}
func (v NullableTeamStatsSessions) Get() *TeamStatsSessions {
return v.value
}
func (v *NullableTeamStatsSessions) Set(val *TeamStatsSessions) {
v.value = val
v.isSet = true
}
func (v NullableTeamStatsSessions) IsSet() bool {
return v.isSet
}
func (v *NullableTeamStatsSessions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTeamStatsSessions(val *TeamStatsSessions) *NullableTeamStatsSessions {
return &NullableTeamStatsSessions{value: val, isSet: true}
}
func (v NullableTeamStatsSessions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTeamStatsSessions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}