Files
sdk/model_session.go

265 lines
6.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 Session type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Session{}
// Session struct for Session
type Session struct {
CreatedTime *string `json:"createdTime,omitempty"`
Name *string `json:"name,omitempty"`
Owner *string `json:"owner,omitempty"`
SessionId []string `json:"sessionId,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Session Session
// NewSession instantiates a new Session 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 NewSession() *Session {
this := Session{}
return &this
}
// NewSessionWithDefaults instantiates a new Session 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 NewSessionWithDefaults() *Session {
this := Session{}
return &this
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *Session) GetCreatedTime() string {
if o == nil || IsNil(o.CreatedTime) {
var ret string
return ret
}
return *o.CreatedTime
}
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Session) GetCreatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.CreatedTime) {
return nil, false
}
return o.CreatedTime, true
}
// HasCreatedTime returns a boolean if a field has been set.
func (o *Session) HasCreatedTime() bool {
if o != nil && !IsNil(o.CreatedTime) {
return true
}
return false
}
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
func (o *Session) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Session) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Session) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *Session) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *Session) SetName(v string) {
o.Name = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *Session) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Session) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *Session) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *Session) SetOwner(v string) {
o.Owner = &v
}
// GetSessionId returns the SessionId field value if set, zero value otherwise.
func (o *Session) GetSessionId() []string {
if o == nil || IsNil(o.SessionId) {
var ret []string
return ret
}
return o.SessionId
}
// GetSessionIdOk returns a tuple with the SessionId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Session) GetSessionIdOk() ([]string, bool) {
if o == nil || IsNil(o.SessionId) {
return nil, false
}
return o.SessionId, true
}
// HasSessionId returns a boolean if a field has been set.
func (o *Session) HasSessionId() bool {
if o != nil && !IsNil(o.SessionId) {
return true
}
return false
}
// SetSessionId gets a reference to the given []string and assigns it to the SessionId field.
func (o *Session) SetSessionId(v []string) {
o.SessionId = v
}
func (o Session) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Session) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.SessionId) {
toSerialize["sessionId"] = o.SessionId
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Session) UnmarshalJSON(data []byte) (err error) {
varSession := _Session{}
err = json.Unmarshal(data, &varSession)
if err != nil {
return err
}
*o = Session(varSession)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "createdTime")
delete(additionalProperties, "name")
delete(additionalProperties, "owner")
delete(additionalProperties, "sessionId")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSession struct {
value *Session
isSet bool
}
func (v NullableSession) Get() *Session {
return v.value
}
func (v *NullableSession) Set(val *Session) {
v.value = val
v.isSet = true
}
func (v NullableSession) IsSet() bool {
return v.isSet
}
func (v *NullableSession) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSession(val *Session) *NullableSession {
return &NullableSession{value: val, isSet: true}
}
func (v NullableSession) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSession) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}