Files
sdk/model_iam_session.go

490 lines
13 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"
"time"
)
// checks if the IamSession type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IamSession{}
// IamSession struct for IamSession
type IamSession struct {
Application *string `json:"application,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
CreatedTime *string `json:"createdTime,omitempty"`
Deleted *bool `json:"deleted,omitempty"`
// ExclusiveSignin is a transient control flag (v1 xorm:\"-\"): a caller sets it on a create to collapse SessionId down to the single incoming cookie instead of appending. It is never stored — a persisted session always carries it false, so orm:\"-\" keeps it off the column backends and omitempty keeps it out of the SQLite JSON blob.
ExclusiveSignin *bool `json:"exclusiveSignin,omitempty"`
// Persisted fields
Id *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Owner *string `json:"owner,omitempty"`
SessionId []string `json:"sessionId,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IamSession IamSession
// NewIamSession instantiates a new IamSession 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 NewIamSession() *IamSession {
this := IamSession{}
return &this
}
// NewIamSessionWithDefaults instantiates a new IamSession 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 NewIamSessionWithDefaults() *IamSession {
this := IamSession{}
return &this
}
// GetApplication returns the Application field value if set, zero value otherwise.
func (o *IamSession) GetApplication() string {
if o == nil || IsNil(o.Application) {
var ret string
return ret
}
return *o.Application
}
// GetApplicationOk returns a tuple with the Application field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamSession) GetApplicationOk() (*string, bool) {
if o == nil || IsNil(o.Application) {
return nil, false
}
return o.Application, true
}
// HasApplication returns a boolean if a field has been set.
func (o *IamSession) HasApplication() bool {
if o != nil && !IsNil(o.Application) {
return true
}
return false
}
// SetApplication gets a reference to the given string and assigns it to the Application field.
func (o *IamSession) SetApplication(v string) {
o.Application = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *IamSession) GetCreatedAt() time.Time {
if o == nil || IsNil(o.CreatedAt) {
var ret time.Time
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamSession) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *IamSession) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *IamSession) SetCreatedAt(v time.Time) {
o.CreatedAt = &v
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *IamSession) 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 *IamSession) 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 *IamSession) 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 *IamSession) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetDeleted returns the Deleted field value if set, zero value otherwise.
func (o *IamSession) GetDeleted() bool {
if o == nil || IsNil(o.Deleted) {
var ret bool
return ret
}
return *o.Deleted
}
// GetDeletedOk returns a tuple with the Deleted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamSession) GetDeletedOk() (*bool, bool) {
if o == nil || IsNil(o.Deleted) {
return nil, false
}
return o.Deleted, true
}
// HasDeleted returns a boolean if a field has been set.
func (o *IamSession) HasDeleted() bool {
if o != nil && !IsNil(o.Deleted) {
return true
}
return false
}
// SetDeleted gets a reference to the given bool and assigns it to the Deleted field.
func (o *IamSession) SetDeleted(v bool) {
o.Deleted = &v
}
// GetExclusiveSignin returns the ExclusiveSignin field value if set, zero value otherwise.
func (o *IamSession) GetExclusiveSignin() bool {
if o == nil || IsNil(o.ExclusiveSignin) {
var ret bool
return ret
}
return *o.ExclusiveSignin
}
// GetExclusiveSigninOk returns a tuple with the ExclusiveSignin field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamSession) GetExclusiveSigninOk() (*bool, bool) {
if o == nil || IsNil(o.ExclusiveSignin) {
return nil, false
}
return o.ExclusiveSignin, true
}
// HasExclusiveSignin returns a boolean if a field has been set.
func (o *IamSession) HasExclusiveSignin() bool {
if o != nil && !IsNil(o.ExclusiveSignin) {
return true
}
return false
}
// SetExclusiveSignin gets a reference to the given bool and assigns it to the ExclusiveSignin field.
func (o *IamSession) SetExclusiveSignin(v bool) {
o.ExclusiveSignin = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *IamSession) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamSession) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *IamSession) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *IamSession) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *IamSession) 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 *IamSession) 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 *IamSession) 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 *IamSession) SetName(v string) {
o.Name = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *IamSession) 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 *IamSession) 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 *IamSession) 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 *IamSession) SetOwner(v string) {
o.Owner = &v
}
// GetSessionId returns the SessionId field value if set, zero value otherwise.
func (o *IamSession) 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 *IamSession) 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 *IamSession) 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 *IamSession) SetSessionId(v []string) {
o.SessionId = v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *IamSession) GetUpdatedAt() time.Time {
if o == nil || IsNil(o.UpdatedAt) {
var ret time.Time
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamSession) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *IamSession) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
func (o *IamSession) SetUpdatedAt(v time.Time) {
o.UpdatedAt = &v
}
func (o IamSession) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IamSession) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Application) {
toSerialize["application"] = o.Application
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.Deleted) {
toSerialize["deleted"] = o.Deleted
}
if !IsNil(o.ExclusiveSignin) {
toSerialize["exclusiveSignin"] = o.ExclusiveSignin
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.SessionId) {
toSerialize["sessionId"] = o.SessionId
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IamSession) UnmarshalJSON(data []byte) (err error) {
varIamSession := _IamSession{}
err = json.Unmarshal(data, &varIamSession)
if err != nil {
return err
}
*o = IamSession(varIamSession)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "application")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "createdTime")
delete(additionalProperties, "deleted")
delete(additionalProperties, "exclusiveSignin")
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "owner")
delete(additionalProperties, "sessionId")
delete(additionalProperties, "updatedAt")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIamSession struct {
value *IamSession
isSet bool
}
func (v NullableIamSession) Get() *IamSession {
return v.value
}
func (v *NullableIamSession) Set(val *IamSession) {
v.value = val
v.isSet = true
}
func (v NullableIamSession) IsSet() bool {
return v.isSet
}
func (v *NullableIamSession) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIamSession(val *IamSession) *NullableIamSession {
return &NullableIamSession{value: val, isSet: true}
}
func (v NullableIamSession) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIamSession) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}